gtkbindings.pp 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. {
  2. $Id$
  3. }
  4. {****************************************************************************
  5. Interface
  6. ****************************************************************************}
  7. {$ifdef read_interface}
  8. type
  9. PGtkPatternSpec = ^TGtkPatternSpec;
  10. TGtkPatternSpec = record
  11. match_type : TGtkMatchType;
  12. pattern_length : guint;
  13. pattern : Pgchar;
  14. pattern_reversed : Pgchar;
  15. user_data : gpointer;
  16. seq_id : guint;
  17. end;
  18. procedure gtk_pattern_spec_init(pspec:PGtkPatternSpec; pattern:Pgchar);cdecl;external gtkdll name 'gtk_pattern_spec_init';
  19. procedure gtk_pattern_spec_free_segs(pspec:PGtkPatternSpec);cdecl;external gtkdll name 'gtk_pattern_spec_free_segs';
  20. function gtk_pattern_match(pspec:PGtkPatternSpec; string_length:guint; thestring:Pgchar; string_reversed:Pgchar):gboolean;cdecl;external gtkdll name 'gtk_pattern_match';
  21. function gtk_pattern_match_string(pspec:PGtkPatternSpec; thestring:Pgchar):gboolean;cdecl;external gtkdll name 'gtk_pattern_match_string';
  22. function gtk_pattern_match_simple(pattern:Pgchar; thestring:Pgchar):gboolean;cdecl;external gtkdll name 'gtk_pattern_match_simple';
  23. type
  24. PGtkBindingSet = ^TGtkBindingSet;
  25. PGtkBindingEntry = ^TGtkBindingEntry;
  26. PGtkBindingSignal = ^TGtkBindingSignal;
  27. PGtkBindingArg = ^TGtkBindingArg;
  28. TGtkBindingSet = record
  29. set_name : Pgchar;
  30. priority : gint;
  31. widget_path_pspecs : PGSList;
  32. widget_class_pspecs : PGSList;
  33. class_branch_pspecs : PGSList;
  34. entries : PGtkBindingEntry;
  35. current : PGtkBindingEntry;
  36. end;
  37. TGtkBindingEntry = record
  38. keyval : guint;
  39. modifiers : guint;
  40. binding_set : PGtkBindingSet;
  41. flag0 : word;
  42. set_next : PGtkBindingEntry;
  43. hash_next : PGtkBindingEntry;
  44. signals : PGtkBindingSignal;
  45. end;
  46. TGtkBindingSignal = record
  47. next : PGtkBindingSignal;
  48. signal_name : Pgchar;
  49. n_args : guint;
  50. args : PGtkBindingArg;
  51. end;
  52. TGtkBindingArg = record
  53. arg_type : TGtkType;
  54. d : record
  55. case longint of
  56. 0 : ( long_data : glong );
  57. 1 : ( double_data : gdouble );
  58. 2 : ( string_data : Pgchar );
  59. end;
  60. end;
  61. const
  62. bm_TGtkBindingEntry_destroyed = $1;
  63. bp_TGtkBindingEntry_destroyed = 0;
  64. bm_TGtkBindingEntry_in_emission = $2;
  65. bp_TGtkBindingEntry_in_emission = 1;
  66. function destroyed(var a : TGtkBindingEntry) : guint;
  67. procedure set_destroyed(var a : TGtkBindingEntry; __destroyed : guint);
  68. function in_emission(var a : TGtkBindingEntry) : guint;
  69. procedure set_in_emission(var a : TGtkBindingEntry; __in_emission : guint);
  70. function gtk_binding_set_new(set_name:Pgchar):PGtkBindingSet;cdecl;external gtkdll name 'gtk_binding_set_new';
  71. function gtk_binding_set_by_class(object_class:gpointer):PGtkBindingSet;cdecl;external gtkdll name 'gtk_binding_set_by_class';
  72. function gtk_binding_set_find(set_name:Pgchar):PGtkBindingSet;cdecl;external gtkdll name 'gtk_binding_set_find';
  73. function gtk_bindings_activate(theobject:PGtkObject; keyval:guint; modifiers:guint):gboolean;cdecl;external gtkdll name 'gtk_bindings_activate';
  74. function gtk_binding_set_activate(binding_set:PGtkBindingSet; keyval:guint; modifiers:guint; theobject:PGtkObject):gboolean;cdecl;external gtkdll name 'gtk_binding_set_activate';
  75. procedure gtk_binding_entry_add(binding_set:PGtkBindingSet; keyval:guint; modifiers:guint);cdecl;external gtkdll name 'gtk_binding_entry_clear';
  76. procedure gtk_binding_entry_clear(binding_set:PGtkBindingSet; keyval:guint; modifiers:guint);cdecl;external gtkdll name 'gtk_binding_entry_clear';
  77. procedure gtk_binding_entry_add_signal(binding_set:PGtkBindingSet; keyval:guint; modifiers:guint; signal_name:Pgchar; n_args:guint; args:array of const);cdecl;external gtkdll name 'gtk_binding_entry_add_signal';
  78. procedure gtk_binding_set_add_path(binding_set:PGtkBindingSet; path_type:TGtkPathType; path_pattern:Pgchar; priority:TGtkPathPriorityType);cdecl;external gtkdll name 'gtk_binding_set_add_path';
  79. {$ifndef gtkwin}
  80. procedure gtk_binding_entry_remove(binding_set:PGtkBindingSet; keyval:guint; modifiers:guint);cdecl;external gtkdll name 'gtk_binding_entry_remove';
  81. procedure gtk_binding_entry_add_signall(binding_set:PGtkBindingSet; keyval:guint; modifiers:guint; signal_name:Pgchar; binding_args:PGSList);cdecl;external gtkdll name 'gtk_binding_entry_add_signall';
  82. function gtk_binding_parse_binding(scanner:PGScanner):guint;cdecl;external gtkdll name 'gtk_binding_parse_binding';
  83. {$endif}
  84. {$endif read_interface}
  85. {****************************************************************************
  86. Implementation
  87. ****************************************************************************}
  88. {$ifdef read_implementation}
  89. function destroyed(var a : TGtkBindingEntry) : guint;
  90. begin
  91. destroyed:=(a.flag0 and bm_TGtkBindingEntry_destroyed) shr bp_TGtkBindingEntry_destroyed;
  92. end;
  93. procedure set_destroyed(var a : TGtkBindingEntry; __destroyed : guint);
  94. begin
  95. a.flag0:=a.flag0 or ((__destroyed shl bp_TGtkBindingEntry_destroyed) and bm_TGtkBindingEntry_destroyed);
  96. end;
  97. function in_emission(var a : TGtkBindingEntry) : guint;
  98. begin
  99. in_emission:=(a.flag0 and bm_TGtkBindingEntry_in_emission) shr bp_TGtkBindingEntry_in_emission;
  100. end;
  101. procedure set_in_emission(var a : TGtkBindingEntry; __in_emission : guint);
  102. begin
  103. a.flag0:=a.flag0 or ((__in_emission shl bp_TGtkBindingEntry_in_emission) and bm_TGtkBindingEntry_in_emission);
  104. end;
  105. {$endif read_implementation}
  106. {
  107. $Log$
  108. Revision 1.1 1999-11-24 23:36:35 peter
  109. * moved to packages dir
  110. Revision 1.7 1999/10/21 08:42:01 florian
  111. * some changes to get it work with gtk 1.3 under Windows 98:
  112. - removed some trailing space after the import name
  113. - In gtkbindings.h is
  114. #define gtk_binding_entry_add gtk_binding_entry_clear
  115. so in the pascal headers the import name of gtk_bindings_entry_add should be
  116. gtk_binding_entry_clear!
  117. - removed the declaration of
  118. gtk_drag_source_unset in gtkdnd.pp it isn't in gtk-1.3.dll!
  119. - in gdk.pp glibdll must be set to gdk-1.3:
  120. const
  121. gdkdll='gdk-1.3';
  122. glibdll='gdk-1.3';
  123. else the whole gdk_* calls are imported from glib-1.3.dll which is wrong!
  124. Revision 1.6 1999/10/06 17:42:48 peter
  125. * external is now only in the interface
  126. * removed gtk 1.0 support
  127. Revision 1.5 1999/07/23 16:11:59 peter
  128. * use packrecords C
  129. Revision 1.4 1999/05/11 00:38:11 peter
  130. * win32 fixes
  131. Revision 1.3 1999/05/10 15:18:58 peter
  132. * cdecl fixes
  133. Revision 1.2 1999/05/10 09:02:56 peter
  134. * gtk 1.2 port working
  135. Revision 1.1 1999/05/07 10:40:30 peter
  136. * first things for 1.2
  137. }