gtkmain.inc 7.0 KB

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