From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_FILL_THIS_FORM_SHORT autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.13.214.202 with SMTP id y193mr6819126ywd.19.1472315489228; Sat, 27 Aug 2016 09:31:29 -0700 (PDT) X-Received: by 10.157.13.19 with SMTP id 19mr687753oti.15.1472315489191; Sat, 27 Aug 2016 09:31:29 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!j37no11030418qta.0!news-out.google.com!d68ni40792ith.0!nntp.google.com!j128no443700ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 27 Aug 2016 09:31:29 -0700 (PDT) In-Reply-To: <5d747db1-ad5d-4de6-8c99-e520a6b39a08@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.64.154.82; posting-account=gOYTTAoAAADrNEg_oe5Etelo-0qd7UeW NNTP-Posting-Host: 76.64.154.82 References: <5d516246-3a7c-4be5-abef-c34fb0f5c753@googlegroups.com> <21dcddb3-1e20-4e54-afc7-fb66b1b6021e@googlegroups.com> <5477ca75-bdc1-4464-9fda-35a4a4b9b181@googlegroups.com> <8fdbb4cb-f250-4844-9a7e-8a4ff5b68554@googlegroups.com> <9ae16f03-6bb2-45b3-a166-50ee8a022f22@googlegroups.com> <4b233268-a28a-4f3d-a735-9a7097d12e03@googlegroups.com> <2e60067a-2169-4ef2-a619-d23f6dfc1ea1@googlegroups.com> <7f1ca2e7-b2dc-4158-a7ab-4447f6fa98f9@googlegroups.com> <0c2d98bf-6bb9-44b6-b0a0-d097dc4acfa9@googlegroups.com> <1127af10-cf37-4092-b006-84b67424c85d@googlegroups.com> <5d747db1-ad5d-4de6-8c99-e520a6b39a08@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5d5c2b37-148a-46e5-9b12-479253704595@googlegroups.com> Subject: Re: zLibAda vs ZipAda (which should I use, if any)? From: Aurele Injection-Date: Sat, 27 Aug 2016 16:31:29 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 5547 X-Received-Body-CRC: 3023302188 Xref: news.eternal-september.org comp.lang.ada:31602 Date: 2016-08-27T09:31:29-07:00 List-Id: Hi Gautier, I think your GID packages will provide the services I need. Ver= y well done by the way. =20 Maybe you can save me some time and guide me on its use for my needs. I've= inserted some code below that show how I'll load the images from the zip f= ile using Zip-Ada, I arrange the data (not shown), and then I need to call = GID procedure to load as Handle. Any comments or ideas?=20 declare package ASU renames Ada.Strings.Unbounded; type Entry_ID is new Integer range -1..Integer'Last; type iEntry is record Texture_ID : ZipFile.Entry_ID; FullName : Ada.Strings.Unbounded.Unbounded_String; Directory : Ada.Strings.Unbounded.Unbounded_String; EntryName : Ada.Strings.Unbounded.Unbounded_String; Extension : Ada.Strings.Unbounded.Unbounded_String; end record; type iEntryEntry_Ptr is access all ZipFile.iEntry; subtype iEntry_Array_Size is Entry_ID; type iEntry_Array is array ( iEntry_Array_Size range <> ) of aliased ZipF= ile.iEntry; type iEntry_Array_Ptr is access all ZipFile.iEntry_Array; type Information is record File_Location : Ada.Strings.Unbounded.Unbounded_String; File_Name : Ada.Strings.Unbounded.Unbounded_String; Total_Entries : Natural; Texture_Entries : Natural; Data_Ptr : ZipFile.iEntry_Array_Ptr; end record; type Information_Ptr is access all ZipFile.Information; Zip_File_Name : constant String :=3D "Textures.zip"; Zip_File_Entries : iEntry_Array_Size; lpTexture_Array : aliased iEntry_Array_Ptr; lpTexture_Info : aliased Information_Ptr Local_Index : Entry_ID; ZipFileInfo : Zip.Zip_Info; FileType : UnZip.Streams.Zipped_File_Type; ----------------------------------------------------------------- begin Zip.Load( ZipFileInfo, Zip_File_Name ); Zip_File_Entries :=3D iEntry_Array_Size( Zip.Entries( ZipFileInfo ) ); lpTexture_Array :=3D new ZipFile.iEntry_Array( 1..Zip_File_Entries ); lpTexture_Info :=3D new ZipFile.Information; -- Scan procedure not shown here but is straight forward... Scan( ZipFileInfo, FileName, Info_Ptr ); -- FILL INFO_PTR -- Simple test.... try to retrieve an image at index =3D 10 Local_Index :=3D 10; -- TEST: image at index =3D 10 UnZip.Streams.Open ( File =3D> FileType, Archive_Info =3D> ZipFileInfo, Name =3D> ASU.To_String( Info_Ptr.Data_Ptr( Local_Index ).FullName )= =20 ); -- ??????????????????????????????????????????????????????? -- LoadImage is below, no idea yet what has to be done LoadImage( FileNeme =3D> Info_Ptr.Data_Ptr( Local_Index ).EntryName, FileExt =3D> Info_Ptr.Data_Ptr( Local_Index ).Extension, FullName =3D> Ada.Streams.Stream_IO.Stream_Access( UnZip.Strea= ms.Stream( FileType ) ) ); UnZip.Streams.Close( FileType ); end; ----------------------------------------------------------------- - TBD: Call "GID" procedure to load image (DIB or BMP (bitmap)) type Hande is access all System.Address; =20 hBitmap : Hande :=3D NULL; procedure LoadImage ( FileName : Ada.Strings.Unbounded.Unbounded_String; FileExt : Ada.Strings.Unbounded.Unbounded_String; FullName : Ada.Strings.Unbounded.Unbounded_String ) i= s begin -- -------------------------- hBitmap :=3D ?; -- Call GID directly here ??? Steps ???? ----------------------------- end LoadImage; ----------------------------------------------------------------- Cheers and thanks Aurele