gdkinputprivate.inc 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. {%MainUnit ../gdk2x.pas}
  2. {$IFDEF read_forward_definitions}
  3. PPPGdkTimeCoord = ^PPGdkTimeCoord;
  4. {$ENDIF read_forward_definitions}
  5. {$IFDEF read_interface_rest}
  6. type
  7. { information about a device axis }
  8. { reported x resolution }
  9. { reported x minimum/maximum values }
  10. { calibrated resolution (for aspect ration) - only relative values
  11. between axes used }
  12. { calibrated minimum/maximum values }
  13. PGdkAxisInfo = ^TGdkAxisInfo;
  14. TGdkAxisInfo = record
  15. xresolution : gint;
  16. xmin_value : gint;
  17. xmax_value : gint;
  18. resolution : gint;
  19. min_value : gint;
  20. max_value : gint;
  21. end;
  22. const
  23. GDK_INPUT_NUM_EVENTC = 6;
  24. {$ifndef XINPUT_NONE}
  25. { information about the axes }
  26. { Information about XInput device }
  27. { minimum key code for device }
  28. { true if we need to select a different set of events, but
  29. can't because this is the core pointer }
  30. { Mask of buttons (used for button grabs) }
  31. { true if we've claimed the device as active. (used only for XINPUT_GXI) }
  32. {$endif}
  33. { !XINPUT_NONE }
  34. type
  35. PGdkDevicePrivate = ^TGdkDevicePrivate;
  36. TGdkDevicePrivate = record
  37. info : TGdkDevice;
  38. deviceid : guint32;
  39. display : PGdkDisplay;
  40. axes : PGdkAxisInfo;
  41. xdevice : Pointer; // PXDevice;
  42. min_keycode : gint;
  43. buttonpress_type : longint;
  44. buttonrelease_type : longint;
  45. keypress_type : longint;
  46. keyrelease_type : longint;
  47. motionnotify_type : longint;
  48. proximityin_type : longint;
  49. proximityout_type : longint;
  50. changenotify_type : longint;
  51. needs_update : gint;
  52. button_state : gint;
  53. claimed : gint;
  54. end;
  55. P_GdkDeviceClass = ^T_GdkDeviceClass;
  56. T_GdkDeviceClass = record
  57. parent_class : TGObjectClass;
  58. end;
  59. { gdk window }
  60. { Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) }
  61. { position relative to root window }
  62. { rectangles relative to window of windows obscuring this one }
  63. { Is there a pointer grab for this window ? }
  64. PGdkInputWindow = ^TGdkInputWindow;
  65. TGdkInputWindow = record
  66. window : PGdkWindow;
  67. mode : TGdkExtensionMode;
  68. root_x : gint;
  69. root_y : gint;
  70. obscuring : PGdkRectangle;
  71. num_obscuring : gint;
  72. grabbed : gint;
  73. end;
  74. { Global data }
  75. // Private function GDK_IS_CORE(d : pointer) : boolean;
  76. { Function declarations }
  77. function gdk_input_window_find(window:PGdkWindow):PGdkInputWindow;cdecl;external;
  78. procedure gdk_input_window_destroy(window:PGdkWindow);cdecl;external;
  79. function _gdk_device_allocate_history(device:PGdkDevice; n_events:gint):PPGdkTimeCoord;cdecl;external;
  80. procedure _gdk_init_input_core;cdecl;external;
  81. { The following functions are provided by each implementation
  82. (xfree, gxi, and none)
  83. }
  84. function _gdk_input_enable_window(window:PGdkWindow; gdkdev:PGdkDevicePrivate):gint;cdecl;external;
  85. function _gdk_input_disable_window(window:PGdkWindow; gdkdev:PGdkDevicePrivate):gint;cdecl;external;
  86. function _gdk_input_window_none_event(event:PGdkEvent; xevent:PXEvent):gint;cdecl;external;
  87. procedure _gdk_input_configure_event(xevent:PXConfigureEvent; window:PGdkWindow);cdecl;external;
  88. procedure _gdk_input_enter_event(xevent:PXCrossingEvent; window:PGdkWindow);cdecl;external;
  89. function _gdk_input_other_event(event:PGdkEvent; xevent:PXEvent; window:PGdkWindow):gint;cdecl;external;
  90. function _gdk_input_grab_pointer(window:PGdkWindow; owner_events:gint; event_mask:TGdkEventMask; confine_to:PGdkWindow; time:guint32):gint;cdecl;external;
  91. procedure _gdk_input_ungrab_pointer(display:PGdkDisplay; time:guint32);cdecl;external;
  92. function _gdk_device_get_history(device:PGdkDevice; window:PGdkWindow; start:guint32; stop:guint32; events:PPPGdkTimeCoord;
  93. n_events:Pgint):gboolean;cdecl;external;
  94. {$ifndef XINPUT_NONE}
  95. const
  96. GDK_MAX_DEVICE_CLASSES = 13;
  97. function gdk_input_common_init(display:PGdkDisplay; include_core:gint):gint;cdecl;external;
  98. function gdk_input_find_device(display:PGdkDisplay; id:guint32):PGdkDevicePrivate;cdecl;external;
  99. procedure gdk_input_get_root_relative_geometry(display:PDisplay; w:TWindow; x_ret:Plongint; y_ret:Plongint; width_ret:Plongint;
  100. height_ret:Plongint);cdecl;external;
  101. procedure gdk_input_common_find_events(window:PGdkWindow; gdkdev:PGdkDevicePrivate; mask:gint; classes:Pointer {PXEventClass}; num_classes:Plongint);cdecl;external;
  102. procedure gdk_input_common_select_events(window:PGdkWindow; gdkdev:PGdkDevicePrivate);cdecl;external;
  103. function gdk_input_common_other_event(event:PGdkEvent; xevent:PXEvent; input_window:PGdkInputWindow; gdkdev:PGdkDevicePrivate):gint;cdecl;external;
  104. {$endif}
  105. {$ENDIF read_interface_rest}
  106. //------------------------------------------------------------------------------
  107. {$IFDEF read_implementation}
  108. { Private
  109. function GDK_IS_CORE(d : pointer) : boolean;
  110. begin
  111. GDK_IS_CORE:= (PGdkDevice(d)) = _gdk_core_pointer;
  112. end;}
  113. {$ENDIF read_implementation}