PageRenderTime 26ms CodeModel.GetById 16ms app.highlight 8ms RepoModel.GetById 0ms app.codeStats 0ms

/packages/gtk1/src/gtk/gtkbox.pp

https://github.com/slibre/freepascal
Puppet | 133 lines | 105 code | 28 blank | 0 comment | 0 complexity | 2fc6b2cd3b0e07ed77f463a3642e1aec MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
  1{
  2}
  3
  4{****************************************************************************
  5                                 Interface
  6****************************************************************************}
  7
  8{$ifdef read_interface}
  9
 10    type
 11       PGtkBox = ^TGtkBox;
 12       TGtkBox = record
 13            container : TGtkContainer;
 14            children : PGList;
 15            spacing : gint16;
 16            flag0 : {$ifdef win32}longint{$else}word{$endif};
 17         end;
 18
 19    const
 20       bm_box_homogeneous = 1;
 21       bp_box_homogeneous = 0;
 22function  homogeneous(var a : TGtkBox) : guint;
 23procedure set_homogeneous(var a : TGtkBox; __homogeneous : guint);
 24
 25    type
 26       PGtkBoxClass = ^TGtkBoxClass;
 27       TGtkBoxClass = record
 28            parent_class : TGtkContainerClass;
 29         end;
 30
 31       PGtkBoxChild = ^TGtkBoxChild;
 32       TGtkBoxChild = record
 33            widget : PGtkWidget;
 34            padding : guint16;
 35            flag0 : {$ifdef win32}longint{$else}word{$endif};
 36         end;
 37
 38    const
 39       bm_box_expand = 1;
 40       bp_box_expand = 0;
 41       bm_box_fill = 2;
 42       bp_box_fill = 1;
 43       bm_box_pack = 4;
 44       bp_box_pack = 2;
 45
 46function  expand(var a : TGtkBoxChild) : guint;
 47procedure set_expand(var a : TGtkBoxChild; __expand : guint);
 48function  fill(var a : TGtkBoxChild) : guint;
 49procedure set_fill(var a : TGtkBoxChild; __fill : guint);
 50function  pack(var a : TGtkBoxChild) : guint;
 51procedure set_pack(var a : TGtkBoxChild; __pack : guint);
 52
 53Type
 54  GTK_BOX=PGtkBox;
 55  GTK_BOX_CLASS=PGtkBoxClass;
 56
 57function  GTK_BOX_TYPE:TGtkType;cdecl;external gtkdll name 'gtk_box_get_type';
 58function  GTK_IS_BOX(obj:pointer):boolean;
 59function  GTK_IS_BOX_CLASS(klass:pointer):boolean;
 60
 61function  gtk_box_get_type:TGtkType;cdecl;external gtkdll name 'gtk_box_get_type';
 62procedure gtk_box_pack_start(box:PGtkBox; child:PGtkWidget; expand:gboolean; fill:gboolean; padding:guint);cdecl;external gtkdll name 'gtk_box_pack_start';
 63procedure gtk_box_pack_end(box:PGtkBox; child:PGtkWidget; expand:gboolean; fill:gboolean; padding:guint);cdecl;external gtkdll name 'gtk_box_pack_end';
 64procedure gtk_box_pack_start_defaults(box:PGtkBox; widget:PGtkWidget);cdecl;external gtkdll name 'gtk_box_pack_start_defaults';
 65procedure gtk_box_pack_end_defaults(box:PGtkBox; widget:PGtkWidget);cdecl;external gtkdll name 'gtk_box_pack_end_defaults';
 66procedure gtk_box_set_homogeneous(box:PGtkBox; homogeneous:gboolean);cdecl;external gtkdll name 'gtk_box_set_homogeneous';
 67procedure gtk_box_set_spacing(box:PGtkBox; spacing:gint);cdecl;external gtkdll name 'gtk_box_set_spacing';
 68procedure gtk_box_reorder_child(box:PGtkBox; child:PGtkWidget; position:gint);cdecl;external gtkdll name 'gtk_box_reorder_child';
 69procedure gtk_box_query_child_packing(box:PGtkBox; child:PGtkWidget; expand:Pgboolean; fill:Pgboolean; padding:Pguint;pack_type:PGtkPackType);cdecl;external gtkdll name 'gtk_box_query_child_packing';
 70procedure gtk_box_set_child_packing(box:PGtkBox; child:PGtkWidget; expand:gboolean; fill:gboolean; padding:guint; pack_type:TGtkPackType);cdecl;external gtkdll name 'gtk_box_set_child_packing';
 71
 72{$endif read_interface}
 73
 74
 75{****************************************************************************
 76                              Implementation
 77****************************************************************************}
 78
 79{$ifdef read_implementation}
 80
 81function  homogeneous(var a : TGtkBox) : guint;
 82      begin
 83         homogeneous:=(a.flag0 and bm_box_homogeneous) shr bp_box_homogeneous;
 84      end;
 85
 86procedure set_homogeneous(var a : TGtkBox; __homogeneous : guint);
 87      begin
 88         a.flag0:=a.flag0 or ((__homogeneous shl bp_box_homogeneous) and bm_box_homogeneous);
 89      end;
 90
 91function  expand(var a : TGtkBoxChild) : guint;
 92      begin
 93         expand:=(a.flag0 and bm_box_expand) shr bp_box_expand;
 94      end;
 95
 96procedure set_expand(var a : TGtkBoxChild; __expand : guint);
 97      begin
 98         a.flag0:=a.flag0 or ((__expand shl bp_box_expand) and bm_box_expand);
 99      end;
100
101function  fill(var a : TGtkBoxChild) : guint;
102      begin
103         fill:=(a.flag0 and bm_box_fill) shr bp_box_fill;
104      end;
105
106procedure set_fill(var a : TGtkBoxChild; __fill : guint);
107      begin
108         a.flag0:=a.flag0 or ((__fill shl bp_box_fill) and bm_box_fill);
109      end;
110
111function  pack(var a : TGtkBoxChild) : guint;
112      begin
113         pack:=(a.flag0 and bm_box_pack) shr bp_box_pack;
114      end;
115
116procedure set_pack(var a : TGtkBoxChild; __pack : guint);
117      begin
118         a.flag0:=a.flag0 or ((__pack shl bp_box_pack) and bm_box_pack);
119      end;
120
121function  GTK_IS_BOX(obj:pointer):boolean;
122begin
123  GTK_IS_BOX:=(obj<>nil) and GTK_IS_BOX_CLASS(PGtkTypeObject(obj)^.klass);
124end;
125
126function  GTK_IS_BOX_CLASS(klass:pointer):boolean;
127begin
128  GTK_IS_BOX_CLASS:=(klass<>nil) and (PGtkTypeClass(klass)^.thetype=GTK_BOX_TYPE);
129end;
130
131{$endif read_implementation}
132
133