1// included by gtk2.pas
2
3{$IFDEF read_forward_definitions}
4{$ENDIF read_forward_definitions}
5
6//------------------------------------------------------------------------------
7
8{$IFDEF read_interface_types}
9{ GTK_DISABLE_DEPRECATED  }
10   TGtkModuleInitFunc = procedure (argc:Pgint; argv:PPPgchar); cdecl;
11
12   TGtkModuleDisplayInitFunc = procedure (display: PGdkDisplay); cdecl;
13
14   TGtkKeySnoopFunc = function (grab_widget:PGtkWidget; event:PGdkEventKey; func_data:gpointer):gint; cdecl;
15{$ENDIF read_interface_types}
16
17//------------------------------------------------------------------------------
18
19{$IFDEF read_interface_rest}
20{ Priorities for redrawing and resizing }
21
22const
23   GTK_PRIORITY_RESIZE = G_PRIORITY_HIGH_IDLE + 10;
24
25{$ifndef GTK_DISABLE_DEPRECATED}
26{ Use GDK_PRIORITY_REDRAW  }
27const
28   GTK_PRIORITY_REDRAW = G_PRIORITY_HIGH_IDLE + 20;
29{ Deprecated. Use G_PRIORITY #define's instead
30  }
31   GTK_PRIORITY_HIGH = G_PRIORITY_HIGH;
32   GTK_PRIORITY_INTERNAL = GTK_PRIORITY_REDRAW;
33   GTK_PRIORITY_DEFAULT = G_PRIORITY_DEFAULT_IDLE;
34   GTK_PRIORITY_LOW = G_PRIORITY_LOW;
35{$endif}
36
37{$IFNDEF KYLIX}
38{ Gtk version.  }
39var
40  {$IFDEF WINDOWS}
41   gtk_major_version : guint;external gtklib name 'gtk_major_version';
42   gtk_minor_version : guint;external gtklib name 'gtk_minor_version';
43   gtk_micro_version : guint;external gtklib name 'gtk_micro_version';
44   gtk_binary_age    : guint;external gtklib name 'gtk_binary_age';
45   gtk_interface_age : guint;external gtklib name 'gtk_interface_type';
46  {$ELSE}
47   gtk_major_version : guint;cvar;external;
48   gtk_minor_version : guint;cvar;external;
49   gtk_micro_version : guint;cvar;external;
50   gtk_binary_age    : guint;cvar;external;
51   gtk_interface_age : guint;cvar;external;
52  {$ENDIF}
53{$ENDIF}
54
55function gtk_check_version(required_major:guint; required_minor:guint; required_micro:guint):Pgchar; cdecl; external gtklib;
56
57{$ifndef G_PLATFORM_WIN32}
58{ Initialization, exit, mainloop and miscellaneous routines }
59procedure gtk_init(argc:Plongint; argv:PPPchar); cdecl; external gtklib;
60function gtk_init_check(argc:Plongint; argv:PPPchar):gboolean; cdecl; external gtklib;
61{$else}
62{ Variants that are used to check for correct struct packing
63   when building GTK+-using code. }
64procedure gtk_init_abi_check(argc:Plongint; argv:PPPchar; num_checks:longint; sizeof_GtkWindow:Tsize_t; sizeof_GtkBox:Tsize_t); cdecl; external gtklib;
65function gtk_init_check_abi_check(argc:Plongint; argv:PPPchar; num_checks:longint; sizeof_GtkWindow:Tsize_t; sizeof_GtkBox:Tsize_t):gboolean; cdecl; external gtklib;
66procedure gtk_init(argc: Plongint; argv : PPPchar);
67function gtk_init_check(argc: Plongint; argv : PPPchar) : gboolean;
68{$endif G_PLATFORM_WIN32}
69
70
71{$ifndef GTK_DISABLE_DEPRECATED}
72procedure gtk_exit(error_code:gint); cdecl; external gtklib;
73{$endif}
74{ GTK_DISABLE_DEPRECATED  }
75
76procedure gtk_disable_setlocale; cdecl; external gtklib;
77function gtk_set_locale:Pgchar; cdecl; external gtklib;
78function gtk_get_default_language:PPangoLanguage; cdecl; external gtklib;
79function gtk_events_pending:gint; cdecl; external gtklib;
80{ The following is the event func GTK+ registers with GDK
81   we expose it mainly to allow filtering of events between
82   GDK and GTK+.
83  }
84procedure gtk_main_do_event(event:PGdkEvent); cdecl; external gtklib;
85procedure gtk_main; cdecl; external gtklib;
86function gtk_main_level:guint; cdecl; external gtklib;
87procedure gtk_main_quit; cdecl; external gtklib;
88function gtk_main_iteration:gboolean; cdecl; external gtklib;
89{ gtk_main_iteration() calls gtk_main_iteration_do(TRUE)  }
90function gtk_main_iteration_do(blocking:gboolean):gboolean; cdecl; external gtklib;
91function gtk_true:gboolean; cdecl; external gtklib;
92function gtk_false:gboolean; cdecl; external gtklib;
93procedure gtk_grab_add(widget:PGtkWidget); cdecl; external gtklib;
94function gtk_grab_get_current:PGtkWidget; cdecl; external gtklib;
95procedure gtk_grab_remove(widget:PGtkWidget); cdecl; external gtklib;
96procedure gtk_init_add(_function:TGtkFunction; data:gpointer); cdecl; external gtklib;
97procedure gtk_quit_add_destroy(main_level:guint; anObject:PGtkObject); cdecl; external gtklib;
98function gtk_quit_add(main_level:guint; _function:TGtkFunction; data:gpointer):guint; cdecl; external gtklib;
99function gtk_quit_add_full(main_level:guint; _function:TGtkFunction; marshal:TGtkCallbackMarshal; data:gpointer; destroy:TGtkDestroyNotify):guint; cdecl; external gtklib;
100procedure gtk_quit_remove(quit_handler_id:guint); cdecl; external gtklib;
101procedure gtk_quit_remove_by_data(data:gpointer); cdecl; external gtklib;
102function gtk_timeout_add(interval:guint32; _function:TGtkFunction; data:gpointer):guint; cdecl; external gtklib;
103function gtk_timeout_add_full(interval:guint32; _function:TGtkFunction; marshal:TGtkCallbackMarshal; data:gpointer; destroy:TGtkDestroyNotify):guint; cdecl; external gtklib;
104procedure gtk_timeout_remove(timeout_handler_id:guint); cdecl; external gtklib;
105function gtk_idle_add(_function:TGtkFunction; data:gpointer):guint; cdecl; external gtklib;
106function gtk_idle_add_priority(priority:gint; _function:TGtkFunction; data:gpointer):guint; cdecl; external gtklib;
107function gtk_idle_add_full(priority:gint; _function:TGtkFunction; marshal:TGtkCallbackMarshal; data:gpointer; destroy:TGtkDestroyNotify):guint; cdecl; external gtklib;
108procedure gtk_idle_remove(idle_handler_id:guint); cdecl; external gtklib;
109procedure gtk_idle_remove_by_data(data:gpointer); cdecl; external gtklib;
110function gtk_input_add_full(source:gint; condition:TGdkInputCondition; _function:TGdkInputFunction; marshal:TGtkCallbackMarshal; data:gpointer;
111           destroy:TGtkDestroyNotify):guint; cdecl; external gtklib;
112procedure gtk_input_remove(input_handler_id:guint); cdecl; external gtklib;
113function gtk_key_snooper_install(snooper:TGtkKeySnoopFunc; func_data:gpointer):guint; cdecl; external gtklib;
114procedure gtk_key_snooper_remove(snooper_handler_id:guint); cdecl; external gtklib;
115function gtk_get_current_event:PGdkEvent; cdecl; external gtklib;
116function gtk_get_current_event_time:guint32; cdecl; external gtklib;
117function gtk_get_current_event_state(state:PGdkModifierType):gboolean; cdecl; external gtklib;
118function gtk_get_event_widget(event:PGdkEvent):PGtkWidget; cdecl; external gtklib;
119
120{ Private routines internal to GTK+ }
121procedure gtk_propagate_event(widget:PGtkWidget; event:PGdkEvent); cdecl; external gtklib;
122function _gtk_boolean_handled_accumulator(ihint:PGSignalInvocationHint; return_accu:PGValue; handler_return:PGValue; dummy:gpointer):gboolean; cdecl; external gtklib;
123function _gtk_find_module(name:Pgchar; _type:Pgchar):Pgchar; cdecl; external gtklib;
124function _gtk_get_module_path(_type:Pgchar):PPgchar; cdecl; external gtklib;
125
126{$ifdef HasGTK2_6}
127function gtk_get_option_group(open_default_display:gboolean):PGOptionGroup; cdecl; external gtklib;
128function gtk_init_with_args(argc:PLongint; argv:PPPchar; parameter_string:Pchar;
129  entries:PGOptionEntry; translation_domain:Pchar; error:PPGError):gboolean; cdecl; external gtklib;
130{$endif}
131
132{$ENDIF read_interface_rest}
133
134//------------------------------------------------------------------------------
135
136{$IFDEF read_implementation}
137{$ifdef G_PLATFORM_WIN32}
138procedure gtk_init(argc: Plongint; argv : PPPchar);
139begin
140   gtk_init_abi_check(argc,argv,2,sizeof(TGtkWindow),sizeof(TGtkBox));
141end;
142
143function gtk_init_check(argc: Plongint; argv : PPPchar) : gboolean;
144begin
145   gtk_init_check:=gtk_init_check_abi_check(argc,argv,2,sizeof(TGtkWindow),sizeof(TGtkBox));
146end;
147{$endif  G_PLATFORM_WIN32}
148
149{$ENDIF read_implementation}
150// included by gtk2.pas
151
152