[fpc-devel] types in xlib unit

ik idokan at gmail.com
Wed Oct 3 12:27:13 CEST 2007


On C some records are "magically" created, and you do not know their content.
So you can use either a pointer, or an empty record, and use a pointer
to that empty pointer.

Ido

On 10/3/07, Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
> Hi,
>
> In the xlib.pp unit the following types are defined.  How are you
> supposed to work with a record structure that contains nothing?  Does
> it the act like a Pointer type?
>
> ---------------  [xlib.pp]  ------------------
>
>    PXIM = ^TXIM;
>    TXIM = record
>      end;
>
>    PXIC = ^TXIC;
>    TXIC = record
>      end;
>
> -----------------  END ------------------
>
>
> I've got them redefined a bit, including a few X<whatever> methods so
> I could use them more easily.
>
>
> --------------  [as in fpGUI]  -------------
>
>   TXIC = record
>     dummy: Pointer;
>   end;
>   PXIC = ^TXIC;
>
>   TXIM = record
>     dummy: Pointer;
>   end;
>   PXIM = ^TXIM;
>
> -------------------   END   ------------------
>
>
> // redefines of Xlib functions
> function XmbLookupString(p1: PXIC; ev: PXKeyPressedEvent; str: PChar;
>     len: longword; ks: PKeySym; stat: PStatus): longint; cdecl; external;
> function Xutf8LookupString(p1: PXIC; ev: PXKeyPressedEvent; str: PChar;
>     len: longword; ks: PKeySym; stat: PStatus): longint; cdecl; external;
>
>
>
> Regards,
>   - Graeme -
>
>
> _______________________________________________
> fpGUI - a cross-platform Free Pascal GUI toolkit
> http://opensoft.homeip.net/fpgui/
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>


-- 
http://ik.homelinux.org/



More information about the fpc-devel mailing list