gdkinput.inc 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. // included by gdk2.pp
  2. {$IFDEF read_forward_definitions}
  3. PGdkDevice = ^TGdkDevice;
  4. PGdkTimeCoord = ^TGdkTimeCoord;
  5. PPGdkTimeCoord = ^PGdkTimeCoord;
  6. {$ENDIF read_forward_definitions}
  7. //------------------------------------------------------------------------------
  8. {$IFDEF read_interface_types}
  9. PGdkExtensionMode = ^TGdkExtensionMode;
  10. TGdkExtensionMode = (
  11. GDK_EXTENSION_EVENTS_NONE,
  12. GDK_EXTENSION_EVENTS_ALL,
  13. GDK_EXTENSION_EVENTS_CURSOR
  14. );
  15. PGdkInputSource = ^TGdkInputSource;
  16. TGdkInputSource = (
  17. GDK_SOURCE_MOUSE,
  18. GDK_SOURCE_PEN,
  19. GDK_SOURCE_ERASER,
  20. GDK_SOURCE_CURSOR
  21. );
  22. PGdkInputMode = ^TGdkInputMode;
  23. TGdkInputMode = (
  24. GDK_MODE_DISABLED,
  25. GDK_MODE_SCREEN,
  26. GDK_MODE_WINDOW
  27. );
  28. PGdkAxisUse = ^TGdkAxisUse;
  29. TGdkAxisUse = longint;
  30. PGdkDeviceKey = ^TGdkDeviceKey;
  31. TGdkDeviceKey = record
  32. keyval : guint;
  33. modifiers : TGdkModifierType;
  34. end;
  35. PGdkDeviceAxis = ^TGdkDeviceAxis;
  36. TGdkDeviceAxis = record
  37. use : TGdkAxisUse;
  38. min : gdouble;
  39. max : gdouble;
  40. end;
  41. { All fields are read-only }
  42. { TRUE if the X pointer follows device motion }
  43. TGdkDevice = record
  44. parent_instance : TGObject;
  45. name : Pgchar;
  46. source : TGdkInputSource;
  47. mode : TGdkInputMode;
  48. has_cursor : gboolean;
  49. num_axes : gint;
  50. axes : PGdkDeviceAxis;
  51. num_keys : gint;
  52. keys : PGdkDeviceKey;
  53. end;
  54. { We don't allocate each coordinate this big, but we use it to
  55. be ANSI compliant and avoid accessing past the defined limits.
  56. }
  57. TGdkTimeCoord = record
  58. time : guint32;
  59. axes : array[0..(GDK_MAX_TIMECOORD_AXES)-1] of gdouble;
  60. end;
  61. {$ENDIF read_interface_types}
  62. //------------------------------------------------------------------------------
  63. {$IFDEF read_interface_rest}
  64. const
  65. GDK_AXIS_IGNORE = 0;
  66. GDK_AXIS_X = 1;
  67. GDK_AXIS_Y = 2;
  68. GDK_AXIS_PRESSURE = 3;
  69. GDK_AXIS_XTILT = 4;
  70. GDK_AXIS_YTILT = 5;
  71. GDK_AXIS_WHEEL = 6;
  72. GDK_AXIS_LAST = 7;
  73. function GDK_TYPE_DEVICE : GType;
  74. function GDK_DEVICE(anObject : Pointer) : PGdkDevice;
  75. function GDK_DEVICE_CLASS(klass : Pointer) : PGdkDeviceClass;
  76. function GDK_IS_DEVICE(anObject : Pointer) : boolean;
  77. function GDK_IS_DEVICE_CLASS(klass : Pointer) : boolean;
  78. function GDK_DEVICE_GET_CLASS(obj : Pointer) : PGdkDeviceClass;
  79. function gdk_device_get_type:GType; cdecl; external gdklib;
  80. {$ifndef GDK_MULTIHEAD_SAFE}
  81. { Returns a list of GdkDevice }
  82. function gdk_devices_list:PGList; cdecl; external gdklib;
  83. {$endif}
  84. { GDK_MULTIHEAD_SAFE }
  85. { Functions to configure a device }
  86. procedure gdk_device_set_source(device:PGdkDevice; source:TGdkInputSource); cdecl; external gdklib;
  87. function gdk_device_set_mode(device:PGdkDevice; mode:TGdkInputMode):gboolean; cdecl; external gdklib;
  88. procedure gdk_device_set_key(device:PGdkDevice; index:guint; keyval:guint; modifiers:TGdkModifierType); cdecl; external gdklib;
  89. procedure gdk_device_set_axis_use(device:PGdkDevice; index:guint; use:TGdkAxisUse); cdecl; external gdklib;
  90. procedure gdk_device_get_state(device:PGdkDevice; window:PGdkWindow; axes:Pgdouble; mask:PGdkModifierType); cdecl; external gdklib;
  91. function gdk_device_get_history(device:PGdkDevice; window:PGdkWindow; start:guint32; stop:guint32; var events:PPGdkTimeCoord;
  92. n_events:Pgint):gboolean; cdecl; external gdklib;
  93. procedure gdk_device_free_history(events:PPGdkTimeCoord; n_events:gint); cdecl; external gdklib;
  94. function gdk_device_get_axis(device:PGdkDevice; axes:Pgdouble; use:TGdkAxisUse; value:Pgdouble):gboolean; cdecl; external gdklib;
  95. procedure gdk_input_set_extension_events(window:PGdkWindow; mask:gint; mode:TGdkExtensionMode); cdecl; external gdklib;
  96. function gdk_device_get_core_pointer:PGdkDevice; cdecl; external gdklib;
  97. {$endif read_interface_rest}
  98. //------------------------------------------------------------------------------
  99. {$IFDEF read_implementation}
  100. function GDK_TYPE_DEVICE : GType;
  101. begin
  102. GDK_TYPE_DEVICE:=gdk_device_get_type;
  103. end;
  104. function GDK_DEVICE(anObject : Pointer) : PGdkDevice;
  105. begin
  106. GDK_DEVICE:=PGdkDevice(G_TYPE_CHECK_INSTANCE_CAST(anObject,GDK_TYPE_DEVICE));
  107. end;
  108. function GDK_DEVICE_CLASS(klass : Pointer) : PGdkDeviceClass;
  109. begin
  110. GDK_DEVICE_CLASS:=PGdkDeviceClass(G_TYPE_CHECK_CLASS_CAST(klass,GDK_TYPE_DEVICE));
  111. end;
  112. function GDK_IS_DEVICE(anObject : Pointer) : boolean;
  113. begin
  114. GDK_IS_DEVICE:=G_TYPE_CHECK_INSTANCE_TYPE(anObject,GDK_TYPE_DEVICE);
  115. end;
  116. function GDK_IS_DEVICE_CLASS(klass : Pointer) : boolean;
  117. begin
  118. GDK_IS_DEVICE_CLASS:=G_TYPE_CHECK_CLASS_TYPE(klass,GDK_TYPE_DEVICE);
  119. end;
  120. function GDK_DEVICE_GET_CLASS(obj : Pointer) : PGdkDeviceClass;
  121. begin
  122. GDK_DEVICE_GET_CLASS:=PGdkDeviceClass(G_TYPE_INSTANCE_GET_CLASS(obj,GDK_TYPE_DEVICE));
  123. end;
  124. {$ENDIF}