summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/gtk2/src/gtk+/gtk/gtksizegroup.inc
blob: 73d2afdcc0a727e804e0d6bfc984b1e5c2be3d6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// included by gtk2.pas

{$IFDEF read_forward_definitions}
{$ENDIF read_forward_definitions}

//------------------------------------------------------------------------------

{$IFDEF read_interface_types}
   PGtkSizeGroup = ^TGtkSizeGroup;
   TGtkSizeGroup = record
        parent_instance : TGObject;
        widgets : PGSList;
        mode : guint8;
        flag0 : word;
        requisition : TGtkRequisition;
     end;

{ Padding for future expansion  }
   PGtkSizeGroupClass = ^TGtkSizeGroupClass;
   TGtkSizeGroupClass = record
        parent_class : TGObjectClass;
        _gtk_reserved1 : procedure ; cdecl;
        _gtk_reserved2 : procedure ; cdecl;
        _gtk_reserved3 : procedure ; cdecl;
        _gtk_reserved4 : procedure ; cdecl;
     end;

{
   GtkSizeGroupMode:
   @GTK_SIZE_GROUP_NONE: group has no effect
   @GTK_SIZE_GROUP_HORIZONTAL: group effects horizontal requisition
   @GTK_SIZE_GROUP_VERTICAL: group effects vertical requisition
   @GTK_SIZE_GROUP_BOTH: group effects both horizontal and vertical requisition

   The mode of the size group determines the directions in which the size
   group effects the requested sizes of its component widgets.
   }

   PGtkSizeGroupMode = ^TGtkSizeGroupMode;
   TGtkSizeGroupMode = (
     GTK_SIZE_GROUP_NONE,
     GTK_SIZE_GROUP_HORIZONTAL,
     GTK_SIZE_GROUP_VERTICAL,
     GTK_SIZE_GROUP_BOTH
   );

{$ENDIF read_interface_types}

//------------------------------------------------------------------------------

{$IFDEF read_interface_rest}
const
   bm_TGtkSizeGroup_have_width = $1;
   bp_TGtkSizeGroup_have_width = 0;
   bm_TGtkSizeGroup_have_height = $2;
   bp_TGtkSizeGroup_have_height = 1;


function GTK_TYPE_SIZE_GROUP : GType;
function GTK_SIZE_GROUP(obj: pointer) : PGtkSizeGroup;
function GTK_SIZE_GROUP_CLASS(klass: pointer) : PGtkSizeGroupClass;
function GTK_IS_SIZE_GROUP(obj: pointer) : boolean;
function GTK_IS_SIZE_GROUP_CLASS(klass: pointer) : boolean;
function GTK_SIZE_GROUP_GET_CLASS(obj: pointer) : PGtkSizeGroupClass;

function have_width(var a : TGtkSizeGroup) : guint;
procedure set_have_width(var a : TGtkSizeGroup; __have_width : guint);
function have_height(var a : TGtkSizeGroup) : guint;
procedure set_have_height(var a : TGtkSizeGroup; __have_height : guint);

function gtk_size_group_get_type:GType; cdecl; external gtklib;
function gtk_size_group_new(mode:TGtkSizeGroupMode):PGtkSizeGroup; cdecl; external gtklib;
procedure gtk_size_group_set_mode(size_group:PGtkSizeGroup; mode:TGtkSizeGroupMode); cdecl; external gtklib;
function gtk_size_group_get_mode(size_group:PGtkSizeGroup):TGtkSizeGroupMode; cdecl; external gtklib;
procedure gtk_size_group_add_widget(size_group:PGtkSizeGroup; widget:PGtkWidget); cdecl; external gtklib;
procedure gtk_size_group_remove_widget(size_group:PGtkSizeGroup; widget:PGtkWidget); cdecl; external gtklib;
procedure _gtk_size_group_get_child_requisition(widget:PGtkWidget; requisition:PGtkRequisition); cdecl; external gtklib;
procedure _gtk_size_group_compute_requisition(widget:PGtkWidget; requisition:PGtkRequisition); cdecl; external gtklib;
procedure _gtk_size_group_queue_resize(widget:PGtkWidget); cdecl; external gtklib;
{$ENDIF read_interface_rest}

//------------------------------------------------------------------------------

{$IFDEF read_implementation}
function GTK_TYPE_SIZE_GROUP : GType;
begin
   GTK_TYPE_SIZE_GROUP:=gtk_size_group_get_type;
end;

function GTK_SIZE_GROUP(obj: pointer) : PGtkSizeGroup;
begin
   GTK_SIZE_GROUP:=PGtkSizeGroup(GTK_CHECK_CAST(obj,GTK_TYPE_SIZE_GROUP));
end;

function GTK_SIZE_GROUP_CLASS(klass: pointer) : PGtkSizeGroupClass;
begin
   GTK_SIZE_GROUP_CLASS:=PGtkSizeGroupClass(GTK_CHECK_CLASS_CAST(klass,GTK_TYPE_SIZE_GROUP));
end;

function GTK_IS_SIZE_GROUP(obj: pointer) : boolean;
begin
   GTK_IS_SIZE_GROUP:=GTK_CHECK_TYPE(obj,GTK_TYPE_SIZE_GROUP);
end;

function GTK_IS_SIZE_GROUP_CLASS(klass: pointer) : boolean;
begin
   GTK_IS_SIZE_GROUP_CLASS:=GTK_CHECK_CLASS_TYPE(klass,GTK_TYPE_SIZE_GROUP);
end;

function GTK_SIZE_GROUP_GET_CLASS(obj: pointer) : PGtkSizeGroupClass;
begin
   GTK_SIZE_GROUP_GET_CLASS:=PGtkSizeGroupClass(GTK_CHECK_GET_CLASS(obj,GTK_TYPE_SIZE_GROUP));
end;

function have_width(var a : TGtkSizeGroup) : guint;
begin
   have_width:=(a.flag0 and bm_TGtkSizeGroup_have_width) shr bp_TGtkSizeGroup_have_width;
end;

procedure set_have_width(var a : TGtkSizeGroup; __have_width : guint);
begin
   a.flag0:=a.flag0 or ((__have_width shl bp_TGtkSizeGroup_have_width) and bm_TGtkSizeGroup_have_width);
end;

function have_height(var a : TGtkSizeGroup) : guint;
begin
   have_height:=(a.flag0 and bm_TGtkSizeGroup_have_height) shr bp_TGtkSizeGroup_have_height;
end;

procedure set_have_height(var a : TGtkSizeGroup; __have_height : guint);
begin
   a.flag0:=a.flag0 or ((__have_height shl bp_TGtkSizeGroup_have_height) and bm_TGtkSizeGroup_have_height);
end;

{$ENDIF read_implementation}
// included by gtk2.pas