gdkwindow-x11.inc 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. {%MainUnit ../gdk2x.pas}
  2. {$IFDEF read_interface_rest}
  3. type
  4. { Offsets to add to X coordinates within window }
  5. { to get GDK coodinates within window }
  6. { Set when the window background is temporarily
  7. unset during resizing and scaling }
  8. { visible rectangle of window }
  9. PGdkXPositionInfo = ^TGdkXPositionInfo;
  10. TGdkXPositionInfo = record
  11. x : gint;
  12. y : gint;
  13. width : gint;
  14. height : gint;
  15. x_offset : gint;
  16. y_offset : gint;
  17. flag0 : word;
  18. clip_rect : TGdkRectangle;
  19. end;
  20. const
  21. bm_TGdkXPositionInfo_big = $1;
  22. bp_TGdkXPositionInfo_big = 0;
  23. bm_TGdkXPositionInfo_mapped = $2;
  24. bp_TGdkXPositionInfo_mapped = 1;
  25. bm_TGdkXPositionInfo_no_bg = $4;
  26. bp_TGdkXPositionInfo_no_bg = 2;
  27. function big(var a : TGdkXPositionInfo) : guint;
  28. procedure set_big(var a : TGdkXPositionInfo; __big : guint);
  29. function mapped(var a : TGdkXPositionInfo) : guint;
  30. procedure set_mapped(var a : TGdkXPositionInfo; __mapped : guint);
  31. function no_bg(var a : TGdkXPositionInfo) : guint;
  32. procedure set_no_bg(var a : TGdkXPositionInfo; __no_bg : guint);
  33. { Window implementation for X11 }
  34. type
  35. PGdkWindowImplX11 = ^TGdkWindowImplX11;
  36. TGdkWindowImplX11 = record
  37. parent_instance : TGdkDrawableImplX11;
  38. width : gint;
  39. height : gint;
  40. position_info : TGdkXPositionInfo;
  41. flag0 : word;
  42. focus_window : TWindow;
  43. end;
  44. type
  45. PGdkWindowImplX11Class = ^TGdkWindowImplX11Class;
  46. TGdkWindowImplX11Class = record
  47. parent_class : TGdkDrawableImplX11Class;
  48. end;
  49. function GDK_TYPE_WINDOW_IMPL_X11 : GType;
  50. function GDK_WINDOW_IMPL_X11(obj : pointer) : PGdkWindowImplX11;
  51. function GDK_WINDOW_IMPL_X11_CLASS(klass : pointer) : PGdkWindowImplX11Class;
  52. function GDK_IS_WINDOW_IMPL_X11(obj : pointer) : boolean;
  53. function GDK_IS_WINDOW_IMPL_X11_CLASS(klass : pointer) : boolean;
  54. function GDK_WINDOW_IMPL_X11_GET_CLASS(obj : pointer) : PGdkWindowImplX11Class;
  55. { Set if the window, or any descendent of it, has the focus }
  56. { Set if !window_has_focus, but events are being sent to the
  57. window because the pointer is in it. (Typically, no window
  58. manager is running. }
  59. { We use an extra X window for toplevel windows that we XSetInputFocus()
  60. to in order to avoid getting keyboard events redirected to subwindows
  61. that might not even be part of this app }
  62. const
  63. bm_TGdkWindowImplX11_has_focus = $1;
  64. bp_TGdkWindowImplX11_has_focus = 0;
  65. bm_TGdkWindowImplX11_has_pointer_focus = $2;
  66. bp_TGdkWindowImplX11_has_pointer_focus = 1;
  67. function has_focus(var a : TGdkWindowImplX11) : guint;
  68. procedure set_has_focus(var a : TGdkWindowImplX11; __has_focus : guint);
  69. function has_pointer_focus(var a : TGdkWindowImplX11) : guint;
  70. procedure set_has_pointer_focus(var a : TGdkWindowImplX11; __has_pointer_focus : guint);
  71. function gdk_window_impl_x11_get_type:GType;cdecl;external;
  72. {$ENDIF read_interface_rest}
  73. //------------------------------------------------------------------------------
  74. {$IFDEF read_implementation}
  75. function big(var a : TGdkXPositionInfo) : guint;
  76. begin
  77. big:=(a.flag0 and bm_TGdkXPositionInfo_big) shr bp_TGdkXPositionInfo_big;
  78. end;
  79. procedure set_big(var a : TGdkXPositionInfo; __big : guint);
  80. begin
  81. a.flag0:=a.flag0 or ((__big shl bp_TGdkXPositionInfo_big) and bm_TGdkXPositionInfo_big);
  82. end;
  83. function mapped(var a : TGdkXPositionInfo) : guint;
  84. begin
  85. mapped:=(a.flag0 and bm_TGdkXPositionInfo_mapped) shr bp_TGdkXPositionInfo_mapped;
  86. end;
  87. procedure set_mapped(var a : TGdkXPositionInfo; __mapped : guint);
  88. begin
  89. a.flag0:=a.flag0 or ((__mapped shl bp_TGdkXPositionInfo_mapped) and bm_TGdkXPositionInfo_mapped);
  90. end;
  91. function no_bg(var a : TGdkXPositionInfo) : guint;
  92. begin
  93. no_bg:=(a.flag0 and bm_TGdkXPositionInfo_no_bg) shr bp_TGdkXPositionInfo_no_bg;
  94. end;
  95. procedure set_no_bg(var a : TGdkXPositionInfo; __no_bg : guint);
  96. begin
  97. a.flag0:=a.flag0 or ((__no_bg shl bp_TGdkXPositionInfo_no_bg) and bm_TGdkXPositionInfo_no_bg);
  98. end;
  99. function GDK_TYPE_WINDOW_IMPL_X11 : GType;
  100. begin
  101. GDK_TYPE_WINDOW_IMPL_X11:=gdk_window_impl_x11_get_type;
  102. end;
  103. function GDK_WINDOW_IMPL_X11(obj : pointer) : PGdkWindowImplX11;
  104. begin
  105. GDK_WINDOW_IMPL_X11:=PGdkWindowImplX11(G_TYPE_CHECK_INSTANCE_CAST(obj,GDK_TYPE_WINDOW_IMPL_X11));
  106. end;
  107. function GDK_WINDOW_IMPL_X11_CLASS(klass : pointer) : PGdkWindowImplX11Class;
  108. begin
  109. GDK_WINDOW_IMPL_X11_CLASS:=PGdkWindowImplX11Class(G_TYPE_CHECK_CLASS_CAST(klass,GDK_TYPE_WINDOW_IMPL_X11));
  110. end;
  111. function GDK_IS_WINDOW_IMPL_X11(obj : pointer) : boolean;
  112. begin
  113. GDK_IS_WINDOW_IMPL_X11:=G_TYPE_CHECK_INSTANCE_TYPE(obj,GDK_TYPE_WINDOW_IMPL_X11);
  114. end;
  115. function GDK_IS_WINDOW_IMPL_X11_CLASS(klass : pointer) : boolean;
  116. begin
  117. GDK_IS_WINDOW_IMPL_X11_CLASS:=G_TYPE_CHECK_CLASS_TYPE(klass,GDK_TYPE_WINDOW_IMPL_X11);
  118. end;
  119. function GDK_WINDOW_IMPL_X11_GET_CLASS(obj : pointer) : PGdkWindowImplX11Class;
  120. begin
  121. GDK_WINDOW_IMPL_X11_GET_CLASS:=PGdkWindowImplX11Class(G_TYPE_INSTANCE_GET_CLASS(obj,GDK_TYPE_WINDOW_IMPL_X11));
  122. end;
  123. function has_focus(var a : TGdkWindowImplX11) : guint;
  124. begin
  125. has_focus:=(a.flag0 and bm_TGdkWindowImplX11_has_focus) shr bp_TGdkWindowImplX11_has_focus;
  126. end;
  127. procedure set_has_focus(var a : TGdkWindowImplX11; __has_focus : guint);
  128. begin
  129. a.flag0:=a.flag0 or ((__has_focus shl bp_TGdkWindowImplX11_has_focus) and bm_TGdkWindowImplX11_has_focus);
  130. end;
  131. function has_pointer_focus(var a : TGdkWindowImplX11) : guint;
  132. begin
  133. has_pointer_focus:=(a.flag0 and bm_TGdkWindowImplX11_has_pointer_focus) shr bp_TGdkWindowImplX11_has_pointer_focus;
  134. end;
  135. procedure set_has_pointer_focus(var a : TGdkWindowImplX11; __has_pointer_focus : guint);
  136. begin
  137. a.flag0:=a.flag0 or ((__has_pointer_focus shl bp_TGdkWindowImplX11_has_pointer_focus) and bm_TGdkWindowImplX11_has_pointer_focus);
  138. end;
  139. {$ENDIF read_implementation}