PageRenderTime 56ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/src/wrappers/gtk/library/gtk_window.e

http://github.com/tybor/Liberty
Specman e | 1677 lines | 242 code | 410 blank | 1025 comment | 4 complexity | eedc264f14419f76251dcc950a8ed4a7 MD5 | raw file
Possible License(s): GPL-3.0, LGPL-2.1, GPL-2.0
  1. indexing
  2. copyright: "[
  3. Copyright (C) 2006 eiffel-libraries team, GTK+ team
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public License
  6. as published by the Free Software Foundation; either version 2.1 of
  7. the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with this library; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. 02110-1301 USA
  16. ]"
  17. license: "LGPL v2 or later"
  18. date: "$Date:$"
  19. revision "$REvision:$"
  20. class GTK_WINDOW
  21. inherit
  22. GTK_BIN
  23. insert
  24. GTK
  25. GTK_WINDOW_EXTERNALS
  26. GTK_WINDOW_TYPE
  27. creation
  28. make, make_toplevel, from_external_pointer
  29. feature {} -- Creation
  30. make, make_toplevel is
  31. -- Create a new window managed by the window manager, having
  32. -- a frame by default
  33. require
  34. gtk_initialized: gtk.is_initialized
  35. do
  36. from_external_pointer (gtk_window_new (gtk_window_toplevel))
  37. end
  38. feature
  39. set_title (a_title: STRING) is
  40. require
  41. a_title_not_void: a_title/=Void
  42. do
  43. gtk_window_set_title (handle, a_title.to_external)
  44. end
  45. -- TODO: wrap gtk_window_set_wmclass ()
  46. feature -- Resizability
  47. set_resizable is
  48. -- Makes current window resizable by the user.
  49. do
  50. gtk_window_set_resizable (handle, 1)
  51. end
  52. unset_resizable is
  53. -- Makes current window not resizable by the user.
  54. do
  55. gtk_window_set_resizable (handle, 0)
  56. end
  57. is_resizable: BOOLEAN is
  58. -- Is Current window resizable by the user?
  59. do
  60. Result:=gtk_window_get_resizable (handle).to_boolean
  61. end
  62. -- TODO: wrap gtk_window_add_accel_group (window,accel_group: POINTER)
  63. -- TODO: wrap gtk_window_remove_accel_group (window,accel_group: POINTER)
  64. is_focus_activated: BOOLEAN
  65. -- Has the current focused widget been activated by `activate_focus'?
  66. activate_focus is
  67. -- Try to activate the current focused widget within the
  68. -- window. `is_focus_activated' will be true if a widget got
  69. -- activated.
  70. do
  71. is_focus_activated:=gtk_window_activate_focus (handle).to_boolean
  72. end
  73. is_default_activated: BOOLEAN
  74. -- Has the default widget been activated by `activate_default'?
  75. activate_default: INTEGER is
  76. -- Activates the default widget for the window, unless the
  77. -- current focused widget has been configured to receive the
  78. -- default action (see GTK_RECEIVES_DEFAULT in
  79. -- GtkWidgetFlags), in which case the focused widget is
  80. -- activated.
  81. do
  82. is_default_activated := gtk_window_activate_default (handle).to_boolean
  83. end
  84. feature -- Window modal mode
  85. set_modal is
  86. -- Sets a window modal. Modal windows prevent interaction
  87. -- with other windows in the same application. To keep modal
  88. -- dialogs on top of main application windows, use
  89. -- `set_transient_for' to make the dialog transient for the
  90. -- parent; most window managers will then disallow lowering
  91. -- the dialog below the parent.
  92. do
  93. gtk_window_set_modal (handle,1)
  94. end
  95. unset_modal is
  96. -- Sets a window non-modal.
  97. do
  98. gtk_window_set_modal (handle,0)
  99. end
  100. is_modal: BOOLEAN is
  101. -- Is Current window modal? See `set_modal'
  102. do
  103. Result:=gtk_window_get_modal (handle).to_boolean
  104. end
  105. feature -- Window size
  106. set_default_size (a_width, an_height: INTEGER) is
  107. -- Sets the default size of a window. If the window's
  108. -- "natural" size (its size request) is larger than the
  109. -- default, the default will be ignored. More generally, if
  110. -- the default size does not obey the geometry hints for the
  111. -- window (`set_geometry_hints' can be used to set these
  112. -- explicitly), the default size will be clamped to the
  113. -- nearest permitted size.
  114. -- Unlike `set_size_request', which sets a size request for a
  115. -- widget and thus would keep users from shrinking the
  116. -- window, this function only sets the initial size, just as
  117. -- if the user had resized the window themselves. Users can
  118. -- still shrink the window again as they normally
  119. -- would. Setting a default size of -1 means to use the
  120. -- "natural" default size (the size request of the window).
  121. -- For more control over a window's initial size and how
  122. -- resizing works, investigate `set_geometry_hints'.
  123. -- For some uses, `resize' is a more appropriate
  124. -- function. `resize' changes the current size of the window,
  125. -- rather than the size to be used on initial
  126. -- display. `resize' always affects the window itself, not
  127. -- the geometry widget.
  128. -- The default size of a window only affects the first time a
  129. -- window is shown; if a window is hidden and re-shown, it
  130. -- will remember the size it had prior to hiding, rather than
  131. -- using the default size.
  132. -- Windows can't actually be 0x0 in size, they must be at
  133. -- least 1x1, but passing 0 for width and height is OK,
  134. -- resulting in a 1x1 default size.
  135. -- `a_width': width in pixels, or -1 to unset the default width
  136. -- `an_height': height in pixels, or -1 to unset the default height
  137. do
  138. gtk_window_set_default_size (handle,a_width,an_height)
  139. end
  140. -- TODO: wrap gtk_window_set_geometry_hints (window,
  141. -- geometry_widget, geometry: POINTER; gdkwindowhints_geom_mask:
  142. -- INTEGER) which require wrapping of GdkGeometry
  143. feature -- Window "gravity"
  144. -- TODO implement set_gravity_[north/south/east/west] etc
  145. set_gravity (a_gravity: INTEGER) is
  146. -- Window gravity defines the meaning of coordinates passed
  147. -- to `move'. See GDK_GRAVITY for more details. The default
  148. -- window gravity is `gdk_gravity_north_west' which will
  149. -- typically "do what you mean."
  150. -- `a_gravity': window gravity
  151. require valid_gravity: is_valid_gravity (a_gravity)
  152. do
  153. gtk_window_set_gravity (handle, a_gravity)
  154. end
  155. gravity: INTEGER is
  156. -- Window gravity; it defines the meaning of coordinates
  157. -- passed to `move'. See GDK_GRAVITY for more details.
  158. do
  159. Result := gtk_window_get_gravity (handle)
  160. ensure valid_gravity: is_valid_gravity (Result)
  161. end
  162. feature -- Window position
  163. no_position is
  164. -- No influence is made on placement.
  165. do
  166. gtk_window_set_position (handle,gtk_win_pos_none)
  167. end
  168. midscreen is
  169. -- Window should be placed in the center of the screen.
  170. do
  171. gtk_window_set_position (handle, gtk_win_pos_center)
  172. end
  173. at_mouse is
  174. -- Window should be placed at the current mouse position.
  175. do
  176. gtk_window_set_position (handle, gtk_win_pos_mouse)
  177. end
  178. always_centered is
  179. -- Keep window centered as it changes size, etc.
  180. do
  181. gtk_window_set_position (handle, gtk_win_pos_center_always)
  182. end
  183. center_on_parent is
  184. -- Center the window on its transient parent (see `set_transient_for').
  185. do
  186. gtk_window_set_position (handle, gtk_win_pos_center_on_parent)
  187. end
  188. set_position (a_position: INTEGER) is
  189. -- Sets position constraint for this window to
  190. -- `a_position'. If the old or new constraint is
  191. -- `gtk_win_pos_center_always', this will also cause the
  192. -- window to be repositioned to satisfy the new constraint.
  193. -- `a_position': a position constraint.
  194. require valid_position: is_valid_gtk_window_position (a_position)
  195. do
  196. gtk_window_set_position (handle,a_position)
  197. end
  198. feature -- Transiency
  199. set_transient_for (a_parent: GTK_WINDOW) is
  200. -- Dialog windows should be set transient for the main
  201. -- application window they were spawned from. This allows
  202. -- window managers to e.g. keep the dialog on top of the main
  203. -- window, or center the dialog over the main
  204. -- window. `GTK_DIALOG.make_with_buttons' and other convenience
  205. -- functions in GTK+ will sometimes call `set_transient_for' on
  206. -- your behalf.
  207. -- On Windows, this function will and put the child window on
  208. -- top of the parent, much as the window manager would have
  209. -- done on X.
  210. -- parent : parent window
  211. require valid_parent: a_parent/=Void
  212. do
  213. gtk_window_set_transient_for (handle,a_parent.handle)
  214. end
  215. feature -- window lifecycle
  216. set_destroy_with_parent is
  217. -- destroying the transient parent of Current window will
  218. -- also destroy window itself. This is useful for dialogs
  219. -- that shouldn't persist beyond the lifetime of the main
  220. -- window they're associated with, for example.
  221. do
  222. gtk_window_set_destroy_with_parent (handle, 1)
  223. end
  224. unset_destroy_with_parent is
  225. -- opposite of `set_destroy_with_parent'
  226. do
  227. gtk_window_set_destroy_with_parent (handle, 0)
  228. end
  229. -- TODO: wrap void gtk_window_set_screen (GtkWindow *window,
  230. -- GdkScreen *screen);
  231. -- TODO: wrap GdkScreen* gtk_window_get_screen (GtkWindow *window);
  232. feature -- various queries
  233. is_active: BOOLEAN is
  234. -- Is current window part of the current active toplevel?
  235. -- (That is, the toplevel window receiving keystrokes.) The
  236. -- return value is TRUE if the window is active toplevel
  237. -- itself, but also if it is, say, a GTK_PLUG embedded in the
  238. -- active toplevel. You might use this function if you wanted
  239. -- to draw a widget differently in an active window from a
  240. -- widget in an inactive window. See `has_toplevel_focus'
  241. do
  242. Result:=(gtk_window_is_active (handle)).to_boolean
  243. end
  244. has_toplevel_focus: BOOLEAN is
  245. -- Is the input focus within Current GTK_WINDOW? For real
  246. -- toplevel windows, this is identical to `is_active', but
  247. -- for embedded windows, like GTK_PLUG, the results will
  248. -- differ.
  249. do
  250. Result:=gtk_window_has_toplevel_focus (handle).to_boolean
  251. end
  252. -- TODO: wrap gtk_window_list_toplevels: POINTER (GList *) needs
  253. -- G_LIST[WRAPPED]. Returns a list of all existing toplevel
  254. -- windows. The widgets in the list are not individually
  255. -- referenced. If you want to iterate through the list and perform
  256. -- actions involving callbacks that might destroy the widgets, you
  257. -- must call g_list_foreach (result, (GFunc)g_object_ref, NULL)
  258. -- first, and then unref all the widgets afterwards.
  259. -- TODO: wrap void gtk_window_add_mnemonic (GtkWindow *window, guint keyval,
  260. -- GtkWidget *target);
  261. -- TODO: wrap void gtk_window_remove_mnemonic (GtkWindow *window,
  262. -- guint keyval, GtkWidget *target);
  263. -- TODO: wrap gboolean gtk_window_mnemonic_activate (GtkWindow
  264. -- *window, guint keyval, GdkModifierType modifier);
  265. -- TODO: wrap gboolean gtk_window_activate_key (GtkWindow *window,
  266. -- GdkEventKey *event);
  267. -- TODO: wrap gboolean gtk_window_propagate_key_event (GtkWindow
  268. -- *window, GdkEventKey *event);
  269. focus: GTK_WIDGET is
  270. -- the current focused widget within the window. Note that
  271. -- this is the widget that would have the focus if the
  272. -- toplevel window focused; if the toplevel window is not
  273. -- focused then `has_focus' will be False.
  274. local ptr: POINTER
  275. do
  276. ptr:=gtk_window_get_focus (handle)
  277. if ptr.is_not_null then
  278. -- TODO: black magic to retrieve the Eiffel wrapper object
  279. -- if it exists or to create the correct Eiffel object
  280. -- from it! If it has already been wrapped it can be
  281. -- stored as a property. If it hasn't been already wrapped
  282. -- things get misty; a possible implementation of it is to
  283. -- link each GtkClass to its Eiffel counterpart.
  284. not_yet_implemented
  285. else
  286. Result := Void
  287. end
  288. end
  289. feature -- Focusing
  290. unset_focus is
  291. -- Unsets the focus widget for this window.
  292. do
  293. gtk_window_set_focus (handle, default_pointer)
  294. ensure focus_unset: -- TODO
  295. end
  296. set_focus (a_widget: GTK_WIDGET) is
  297. -- If `a_widget' is not the current focus widget, and is focusable,
  298. -- sets it as the focus widget for the window. To set the focus to
  299. -- a particular widget in the toplevel, it is usually more
  300. -- convenient to use `GTK_WIDGET.grab_focus' instead of this
  301. -- function.
  302. require
  303. widget_not_void: a_widget /= Void
  304. widget_is_contained_in_window: -- TODO
  305. do
  306. gtk_window_set_focus (handle, a_widget.handle)
  307. end
  308. set_default (a_default: GTK_WIDGET) is
  309. -- Sets the default widget for Current GtkWindow. The
  310. -- default widget is the widget that's activated when the
  311. -- user presses Enter in a dialog (for example). When setting
  312. -- the default widget it's generally easier to call
  313. -- `GTK_WIDGET.grab_focus' on the widget. Before making a
  314. -- widget the default widget, you must set the
  315. -- `gtk_can_default' flag on the widget you'd like to make
  316. -- the default using `set_flags' (TODO?).
  317. require
  318. default_not_void: a_default /= Void
  319. do
  320. gtk_window_set_default (handle,a_default.handle)
  321. end
  322. unset_default is
  323. -- Unsets the default widget. See also `set_default'
  324. do
  325. gtk_window_set_default (handle, default_pointer)
  326. end
  327. present is
  328. -- Presents a window to the user. This may mean raising the
  329. -- window in the stacking order, deiconifying it, moving it
  330. -- to the current desktop, and/or giving it the keyboard
  331. -- focus, possibly dependent on the user's platform, window
  332. -- manager, and preferences.
  333. -- If window is hidden, this function calls `show' as well.
  334. -- This feature should be used when the user tries to open a
  335. -- window that's already open. Say for example the
  336. -- preferences dialog is currently open, and the user chooses
  337. -- Preferences from the menu a second time; use `present' to
  338. -- move the already-open dialog where the user can see it.
  339. -- If you are calling this feature in response to a user
  340. -- interaction, it is preferable to use `present_with_time'.
  341. do
  342. gtk_window_present (handle)
  343. end
  344. present_with_time (a_timestamp: INTEGER_32) is
  345. -- Presents a window to the user in response to a user
  346. -- interaction. If you need to present a window without a
  347. -- timestamp, use `present'; see `present' for details.
  348. -- `a_timestamp' is usually derived from the user interaction
  349. -- (typically a button or key press event) which triggered
  350. -- this call.
  351. -- TODO: a_timestamp shall be NATURAL_32
  352. require positive_stamp: a_timestamp >= 0
  353. do
  354. gtk_window_present_with_time(handle,a_timestamp)
  355. end
  356. iconify is
  357. -- Asks to iconify (i.e. minimize) the specified window. Note
  358. -- that you shouldn't assume the window is definitely
  359. -- iconified afterward, because other entities (e.g. the user
  360. -- or window manager) could deiconify it again, or there may
  361. -- not be a window manager in which case iconification isn't
  362. -- possible, etc. But normally the window will end up
  363. -- iconified. Just don't write code that crashes if not.
  364. -- It's permitted to call this function before showing a
  365. -- window, in which case the window will be iconified before
  366. -- it ever appears onscreen.
  367. -- You can track iconification via the "window_state_event"
  368. -- signal on GtkWidget.
  369. do
  370. gtk_window_iconify (handle)
  371. end
  372. deiconify is
  373. -- Asks to deiconify (i.e. unminimize) the specified
  374. -- window. Note that you shouldn't assume the window is
  375. -- definitely deiconified afterward, because other entities
  376. -- (e.g. the user or window manager) could iconify it again
  377. -- before your code which assumes deiconification gets to
  378. -- run.
  379. -- You can track iconification via the "window_state_event"
  380. -- signal on GtkWidget.
  381. do
  382. gtk_window_deiconify (handle)
  383. end
  384. stick is
  385. -- Asks to stick the window, which means that it will appear
  386. -- on all user desktops. Note that you shouldn't assume the
  387. -- window is definitely stuck afterward, because other
  388. -- entities (e.g. the user or window manager) could unstick
  389. -- it again, and some window managers do not support sticking
  390. -- windows. But normally the window will end up stuck. Just
  391. -- don't write code that crashes if not.
  392. -- It's permitted to call this function before showing a
  393. -- window.
  394. -- You can track stickiness via the "window_state_event"
  395. -- signal on GtkWidget.
  396. do
  397. gtk_window_stick (handle)
  398. end
  399. unstick is
  400. -- Asks to unstick window, which means that it will appear on
  401. -- only one of the user's desktops. Note that you shouldn't
  402. -- assume the window is definitely unstuck afterward, because
  403. -- other entities (e.g. the user or window manager) could
  404. -- stick it again. But normally the window will end up
  405. -- stuck. Just don't write code that crashes if not.
  406. -- You can track stickiness via the "window_state_event" signal on GtkWidget.
  407. do
  408. gtk_window_unstick (handle)
  409. end
  410. maximize is
  411. -- Asks to maximize window, so that it becomes
  412. -- full-screen. Note that you shouldn't assume the window is
  413. -- definitely maximized afterward, because other entities
  414. -- (e.g. the user or window manager) could unmaximize it
  415. -- again, and not all window managers support
  416. -- maximization. But normally the window will end up
  417. -- maximized. Just don't write code that crashes if not.
  418. -- It's permitted to call this function before showing a
  419. -- window, in which case the window will be maximized when it
  420. -- appears onscreen initially.
  421. -- You can track maximization via the "window_state_event"
  422. -- signal on GtkWidget.
  423. do
  424. gtk_window_maximize (handle)
  425. end
  426. unmaximize is
  427. -- Asks to unmaximize window. Note that you shouldn't assume
  428. -- the window is definitely unmaximized afterward, because
  429. -- other entities (e.g. the user or window manager) could
  430. -- maximize it again, and not all window managers honor
  431. -- requests to unmaximize. But normally the window will end
  432. -- up unmaximized. Just don't write code that crashes if not.
  433. -- You can track maximization via the "window_state_event"
  434. -- signal on GtkWidget.
  435. do
  436. gtk_window_unmaximize (handle)
  437. end
  438. fullscreen is
  439. -- Asks to place window in the fullscreen state. Note that
  440. -- you shouldn't assume the window is definitely full screen
  441. -- afterward, because other entities (e.g. the user or window
  442. -- manager) could unfullscreen it again, and not all window
  443. -- managers honor requests to fullscreen windows. But
  444. -- normally the window will end up fullscreen. Just don't
  445. -- write code that crashes if not.
  446. -- You can track the fullscreen state via the
  447. -- "window_state_event" signal on GtkWidget.
  448. do
  449. gtk_window_fullscreen (handle)
  450. end
  451. unfullscreen is
  452. -- Asks to toggle off the fullscreen state for window. Note
  453. -- that you shouldn't assume the window is definitely not
  454. -- full screen afterward, because other entities (e.g. the
  455. -- user or window manager) could fullscreen it again, and not
  456. -- all window managers honor requests to unfullscreen
  457. -- windows. But normally the window will end up restored to
  458. -- its normal state. Just don't write code that crashes if
  459. -- not.
  460. -- You can track the fullscreen state via the
  461. -- "window_state_event" signal on GtkWidget.
  462. do
  463. gtk_window_unfullscreen (handle)
  464. end
  465. -- gtk_window_set_keep_above (window: POINTER; setting: INTEGER) is
  466. -- -- Asks to keep window above, so that it stays on top. Note
  467. -- -- that you shouldn't assume the window is definitely above
  468. -- -- afterward, because other entities (e.g. the user or window
  469. -- -- manager) could not keep it above, and not all window
  470. -- -- managers support keeping windows above. But normally the
  471. -- -- window will end kept above. Just don't write code that
  472. -- -- crashes if not.
  473. -- -- It's permitted to call this function before showing a
  474. -- -- window, in which case the window will be kept above when
  475. -- -- it appears onscreen initially.
  476. -- -- You can track the above state via the "window_state_event"
  477. -- -- signal on GtkWidget.
  478. -- -- Note that, according to the Extended Window Manager Hints
  479. -- -- specification, the above state is mainly meant for user
  480. -- -- preferences and should not be used by applications
  481. -- -- e.g. for drawing attention to their dialogs.
  482. -- -- window : a GtkWindow
  483. -- -- setting : whether to keep window above other windows
  484. -- external "C use <gtk/gtk.h>"
  485. -- end
  486. -- TODO: gtk_window_set_keep_below (window:POINTER; setting: INTEGER) is
  487. -- -- Asks to keep window below, so that it stays in
  488. -- -- bottom. Note that you shouldn't assume the window is
  489. -- -- definitely below afterward, because other entities
  490. -- -- (e.g. the user or window manager) could not keep it below,
  491. -- -- and not all window managers support putting windows
  492. -- -- below. But normally the window will be kept below. Just
  493. -- -- don't write code that crashes if not.
  494. -- -- It's permitted to call this function before showing a
  495. -- -- window, in which case the window will be kept below when
  496. -- -- it appears onscreen initially.
  497. -- -- You can track the below state via the "window_state_event"
  498. -- -- signal on GtkWidget.
  499. -- -- Note that, according to the Extended Window Manager Hints
  500. -- -- specification, the above state is mainly meant for user
  501. -- -- preferences and should not be used by applications
  502. -- -- e.g. for drawing attention to their dialogs.
  503. -- -- window : a GtkWindow
  504. -- -- setting : whether to keep window below other windows
  505. -- external "C use <gtk/gtk.h>"
  506. -- end
  507. -- TODO: gtk_window_begin_resize_drag (window: POINTER;
  508. -- edge, button, root_x, root_y: INTEGER;
  509. -- guint32_timestamp: INTEGER) is
  510. -- -- Starts resizing a window. This function is used if an
  511. -- -- application has window resizing controls. When GDK can
  512. -- -- support it, the resize will be done using the standard
  513. -- -- mechanism for the window manager or windowing
  514. -- -- system. Otherwise, GDK will try to emulate window
  515. -- -- resizing, potentially not all that well, depending on the
  516. -- -- windowing system.
  517. -- -- window : a GtkWindow
  518. -- -- edge : (GdkWindowEdge) position of the resize control
  519. -- -- button : mouse button that initiated the drag
  520. -- -- root_x : X position where the user clicked to initiate the drag, in root window coordinates
  521. -- -- root_y : Y position where the user clicked to initiate the drag
  522. -- -- timestamp : timestamp from the click event that initiated the drag
  523. -- external "C use <gtk/gtk.h>"
  524. -- end
  525. -- TODO: gtk_window_begin_move_drag (GtkWindow *window,
  526. -- button, root_x, root_y: INTEGER;
  527. -- guint32_timestamp: INTEGER_32) is
  528. -- -- Starts moving a window. This function is used if an
  529. -- -- application has window movement grips. When GDK can support
  530. -- -- it, the window movement will be done using the standard
  531. -- -- mechanism for the window manager or windowing
  532. -- -- system. Otherwise, GDK will try to emulate window movement,
  533. -- -- potentially not all that well, depending on the windowing
  534. -- -- system.
  535. -- -- window : a GtkWindow
  536. -- -- button : mouse button that initiated the drag
  537. -- -- root_x : X position where the user clicked to initiate the
  538. -- -- drag, in root window coordinates
  539. -- -- root_y : Y position where the user clicked to initiate the drag
  540. -- -- timestamp : timestamp from the click event that initiated the drag
  541. -- external "C use <gtk/gtk.h>"
  542. -- end
  543. -- TODO: gtk_window_set_decorated (window: POINTER; setting: INTEGER) is
  544. -- -- By default, windows are decorated with a title bar, resize
  545. -- -- controls, etc. Some window managers allow GTK+ to disable
  546. -- -- these decorations, creating a borderless window. If you
  547. -- -- set the decorated property to FALSE using this function,
  548. -- -- GTK+ will do its best to convince the window manager not
  549. -- -- to decorate the window. Depending on the system, this
  550. -- -- function may not have any effect when called on a window
  551. -- -- that is already visible, so you should call it before
  552. -- -- calling gtk_window_show().
  553. -- -- On Windows, this function always works, since there's no
  554. -- -- window manager policy involved.
  555. -- -- window : a GtkWindow
  556. -- -- setting : TRUE to decorate the window
  557. -- external "C use <gtk/gtk.h>"
  558. -- end
  559. -- TODO: gtk_window_set_frame_dimensions (window: POINTER; left,top,right,bottom: INTEGER) is
  560. -- -- (Note: this is a special-purpose function intended for the
  561. -- -- framebuffer port; see gtk_window_set_has_frame(). It will
  562. -- -- have no effect on the window border drawn by the window
  563. -- -- manager, which is the normal case when using the X Window
  564. -- -- system.)
  565. -- -- For windows with frames (see gtk_window_set_has_frame()) this function can be used to change the size of the frame border.
  566. -- -- window : a GtkWindow that has a frame
  567. -- -- left : The width of the left border
  568. -- -- top : The height of the top border
  569. -- -- right : The width of the right border
  570. -- -- bottom : The height of the bottom border
  571. -- external "C use <gtk/gtk.h>"
  572. -- end
  573. -- gtk_window_set_has_frame (window: POINTER; setting: INTEGER) is
  574. -- -- (Note: this is a special-purpose function for the
  575. -- -- framebuffer port, that causes GTK+ to draw its own window
  576. -- -- border. For most applications, you want
  577. -- -- gtk_window_set_decorated() instead, which tells the window
  578. -- -- manager whether to draw the window border.)
  579. -- -- If this function is called on a window with setting of
  580. -- -- TRUE, before it is realized or showed, it will have a
  581. -- -- "frame" window around window->window, accessible in
  582. -- -- window->frame. Using the signal frame_event you can
  583. -- -- receive all events targeted at the frame.
  584. -- -- This function is used by the linux-fb port to implement
  585. -- -- managed windows, but it could concievably be used by
  586. -- -- X-programs that want to do their own window decorations.
  587. -- -- window : a GtkWindow
  588. -- -- setting : a boolean
  589. -- external "C use <gtk/gtk.h>"
  590. -- end
  591. -- -- void gtk_window_set_mnemonic_modifier
  592. -- -- (GtkWindow *window,
  593. -- -- GdkModifierType modifier);
  594. -- -- Sets the mnemonic modifier for this window.
  595. -- -- window : a GtkWindow
  596. -- -- modifier : the modifier mask used to activate mnemonics on this window.
  597. -- -- external "C use <gtk/gtk.h>"
  598. -- -- end
  599. -- -- void gtk_window_set_role (GtkWindow *window,
  600. -- -- const gchar *role);
  601. -- -- This function is only useful on X11, not with other GTK+ targets.
  602. -- -- In combination with the window title, the window role allows a window manager to identify "the same" window when an application is restarted. So for example you might set the "toolbox" role on your app's toolbox window, so that when the user restarts their session, the window manager can put the toolbox back in the same place.
  603. -- -- If a window already has a unique title, you don't need to set the role, since the WM can use the title to identify the window when restoring the session.
  604. -- -- window : a GtkWindow
  605. -- -- role : unique identifier for the window to be used when restoring a session
  606. -- -- external "C use <gtk/gtk.h>"
  607. -- -- end
  608. -- gtk_window_set_type_hint (window: POINTER; a_hint: INTEGER) is
  609. -- -- By setting the type hint for the window, you allow the window
  610. -- -- manager to decorate and handle the window in a way which is
  611. -- -- suitable to the function of the window in your application.
  612. -- -- This function should be called before the window becomes visible.
  613. -- -- gtk_dialog_new_with_buttons() and other convenience functions in GTK+ will sometimes call gtk_window_set_type_hint() on your behalf.
  614. -- -- window : a GtkWindow
  615. -- -- hint : (GDKWINDOWTYPEHINT) the window type
  616. -- require valid_hint: is_valid_window_type_hint (a_hint)
  617. -- external "C use <gtk/gtk.h>"
  618. -- end
  619. -- gtk_window_set_skip_taskbar_hint (window: POINTER; setting: INTEGER) is
  620. -- -- Windows may set a hint asking the desktop environment not
  621. -- -- to display the window in the task bar. This function sets
  622. -- -- this hint.
  623. -- -- window : a GtkWindow
  624. -- -- setting : TRUE to keep this window from appearing in the task bar
  625. -- external "C use <gtk/gtk.h>"
  626. -- end
  627. -- gtk_window_set_skip_pager_hint (window: POINTER; setting: INTEGER) is
  628. -- -- Windows may set a hint asking the desktop environment not to display the window in the pager. This function sets this hint. (A "pager" is any desktop navigation tool such as a workspace switcher that displays a thumbnail representation of the windows on the screen.)
  629. -- -- window : a GtkWindow
  630. -- -- setting : TRUE to keep this window from appearing in the pager
  631. -- external "C use <gtk/gtk.h>"
  632. -- end
  633. -- gtk_window_set_urgency_hint (window: POINTER; setting: INTEGER) is
  634. -- -- Windows may set a hint asking the desktop environment to
  635. -- -- draw the users attention to the window. This function sets
  636. -- -- this hint.
  637. -- -- window : a GtkWindow
  638. -- -- setting : TRUE to mark this window as urgent
  639. -- external "C use <gtk/gtk.h>"
  640. -- end
  641. -- gtk_window_set_accept_focus (window: POINTER; setting: INTEGER) is
  642. -- -- Windows may set a hint asking the desktop environment not
  643. -- -- to receive the input focus. This function sets this hint.
  644. -- -- window : a GtkWindow
  645. -- -- setting : TRUE to let this window receive input focus
  646. -- external "C use <gtk/gtk.h>"
  647. -- end
  648. -- gtk_window_set_focus_on_map (window: POINTER; setting: INTEGER) is
  649. -- -- Windows may set a hint asking the desktop environment not
  650. -- -- to receive the input focus when the window is mapped. This
  651. -- -- function sets this hint.
  652. -- -- window : a GtkWindow
  653. -- -- setting : TRUE to let this window receive input focus on map
  654. -- external "C use <gtk/gtk.h>"
  655. -- end
  656. -- gtk_window_get_decorated (window: POINTER): INTEGER is
  657. -- -- Returns whether the window has been set to have
  658. -- -- decorations such as a title bar via
  659. -- -- gtk_window_set_decorated().
  660. -- -- window : a GtkWindow
  661. -- -- Returns : TRUE if the window has been set to have decorations
  662. -- external "C use <gtk/gtk.h>"
  663. -- end
  664. -- -- GList* gtk_window_get_default_icon_list
  665. -- -- (void);
  666. -- -- Gets the value set by gtk_window_set_default_icon_list(). The list is a copy and should be freed with g_list_free(), but the pixbufs in the list have not had their reference count incremented.
  667. -- -- Returns : copy of default icon list
  668. -- --external "C use <gtk/gtk.h>"
  669. -- --end
  670. -- gtk_window_get_default_size (window, gint_width, gint_height: POINTER) is
  671. -- -- Gets the default size of the window. A value of -1 for the
  672. -- -- width or height indicates that a default size has not been
  673. -- -- explicitly set for that dimension, so the "natural" size
  674. -- -- of the window will be used.
  675. -- -- window : a GtkWindow
  676. -- -- width : (gint *) location to store the default width, or NULL
  677. -- -- height : (gint *) location to store the default height, or NULL
  678. -- external "C use <gtk/gtk.h>"
  679. -- end
  680. -- gtk_window_get_destroy_with_parent (window: POINTER): INTEGER is
  681. -- -- Returns whether the window will be destroyed with its
  682. -- -- transient parent. See
  683. -- -- gtk_window_set_destroy_with_parent().
  684. -- -- window : a GtkWindow
  685. -- -- Returns : TRUE if the window will be destroyed with its transient parent.
  686. -- external "C use <gtk/gtk.h>"
  687. -- end
  688. -- gtk_window_get_frame_dimensions (window,left,top,right,bottom: POINTER) is
  689. -- -- (Note: this is a special-purpose function intended for the
  690. -- -- framebuffer port; see gtk_window_set_has_frame(). It will
  691. -- -- not return the size of the window border drawn by the
  692. -- -- window manager, which is the normal case when using a
  693. -- -- windowing system. See gdk_window_get_frame_extents() to
  694. -- -- get the standard window border extents.)
  695. -- -- Retrieves the dimensions of the frame window for this
  696. -- -- toplevel. See gtk_window_set_has_frame(),
  697. -- -- gtk_window_set_frame_dimensions().
  698. -- -- window : a GtkWindow
  699. -- -- left: (gint*) location to store the width of the frame at the left, or NULL
  700. -- -- top : (gint*) location to store the height of the frame at the top, or NULL
  701. -- -- right :(gint*) location to store the width of the frame at the returns, or NULL
  702. -- -- bottom :(gint*) location to store the height of the frame at the bottom, or NULL
  703. -- external "C use <gtk/gtk.h>"
  704. -- end
  705. -- gtk_window_get_has_frame (window: POINTER): INTEGER is
  706. -- -- Accessor for whether the window has a frame window
  707. -- -- exterior to window->window. Gets the value set by
  708. -- -- gtk_window_set_has_frame().
  709. -- -- window : a GtkWindow
  710. -- -- Returns : TRUE if a frame has been added to the window via gtk_window_set_has_frame().
  711. -- external "C use <gtk/gtk.h>"
  712. -- end
  713. -- gtk_window_get_icon (window: POINTER): POINTER is
  714. -- -- Gets the value set by gtk_window_set_icon() (or if you've
  715. -- -- called gtk_window_set_icon_list(), gets the first icon in the
  716. -- -- icon list).
  717. -- -- window : a GtkWindow
  718. -- -- Returns : icon for window (GdkPixbuf*)
  719. -- external "C use <gtk/gtk.h>"
  720. -- end
  721. -- gtk_window_get_icon_list (window: POINTER): POINTER is
  722. -- -- Retrieves the list of icons set by
  723. -- -- gtk_window_set_icon_list(). The list is copied, but the
  724. -- -- reference count on each member won't be incremented.
  725. -- -- window : a GtkWindow
  726. -- -- Returns : copy of window's icon list (GList*)
  727. -- external "C use <gtk/gtk.h>"
  728. -- end
  729. -- gtk_window_get_icon_name (window: POINTER): POINTER is
  730. -- -- Returns the name of the themed icon for the window, see
  731. -- -- gtk_window_set_icon_name().
  732. -- -- window : a GtkWindow
  733. -- -- Returns : the icon name or NULL if the window has no
  734. -- -- themed icon (gchar *)
  735. -- external "C use <gtk/gtk.h>"
  736. -- end
  737. -- -- GdkModifierType gtk_window_get_mnemonic_modifier
  738. -- -- (GtkWindow *window);
  739. -- -- Returns the mnemonic modifier for this window. See gtk_window_set_mnemonic_modifier().
  740. -- -- window : a GtkWindow
  741. -- -- Returns : the modifier mask used to activate mnemonics on this window.
  742. -- -- external "C use <gtk/gtk.h>"
  743. -- -- end
  744. -- gtk_window_get_position (window, root_x, root_y: POINTER) is
  745. -- -- This function returns the position you need to pass to
  746. -- -- gtk_window_move() to keep window in its current
  747. -- -- position. This means that the meaning of the returned
  748. -- -- value varies with window gravity. See gtk_window_move()
  749. -- -- for more details.
  750. -- -- If you haven't changed the window gravity, its gravity
  751. -- -- will be GDK_GRAVITY_NORTH_WEST. This means that
  752. -- -- gtk_window_get_position() gets the position of the
  753. -- -- top-left corner of the window manager frame for the
  754. -- -- window. gtk_window_move() sets the position of this same
  755. -- -- top-left corner.
  756. -- -- gtk_window_get_position() is not 100% reliable because the
  757. -- -- X Window System does not specify a way to obtain the
  758. -- -- geometry of the decorations placed on a window by the
  759. -- -- window manager. Thus GTK+ is using a "best guess" that
  760. -- -- works with most window managers.
  761. -- -- Moreover, nearly all window managers are historically
  762. -- -- broken with respect to their handling of window
  763. -- -- gravity. So moving a window to its current position as
  764. -- -- returned by gtk_window_get_position() tends to result in
  765. -- -- moving the window slightly. Window managers are slowly
  766. -- -- getting better over time.
  767. -- -- If a window has gravity GDK_GRAVITY_STATIC the window
  768. -- -- manager frame is not relevant, and thus
  769. -- -- gtk_window_get_position() will always produce accurate
  770. -- -- results. However you can't use static gravity to do things
  771. -- -- like place a window in a corner of the screen, because
  772. -- -- static gravity ignores the window manager decorations.
  773. -- -- If you are saving and restoring your application's window
  774. -- -- positions, you should know that it's impossible for
  775. -- -- applications to do this without getting it somewhat wrong
  776. -- -- because applications do not have sufficient knowledge of
  777. -- -- window manager state. The Correct Mechanism is to support
  778. -- -- the session management protocol (see the "GnomeClient"
  779. -- -- object in the GNOME libraries for example) and allow the
  780. -- -- window manager to save your window sizes and positions.
  781. -- -- window : a GtkWindow
  782. -- -- root_x : (gint*) return location for X coordinate of
  783. -- -- gravity-determined reference p\oint
  784. -- -- root_y : (gint*) return location for Y coordinate of
  785. -- -- gravity-determined reference p\oint
  786. -- external "C use <gtk/gtk.h>"
  787. -- end
  788. -- -- const gchar* gtk_window_get_role (GtkWindow *window);
  789. -- -- Returns the role of the window. See gtk_window_set_role() for further explanation.
  790. -- -- window : a GtkWindow
  791. -- -- Returns : the role of the window if set, or NULL. The returned is owned by the widget and must not be modified or freed.
  792. -- --external "C use <gtk/gtk.h>"
  793. -- --end
  794. -- gtk_window_get_size (window, width, height: POINTER) is
  795. -- -- Obtains the current size of window. If window is not
  796. -- -- onscreen, it returns the size GTK+ will suggest to the
  797. -- -- window manager for the initial window size (but this is
  798. -- -- not reliably the same as the size the window manager will
  799. -- -- actually select). The size obtained by
  800. -- -- gtk_window_get_size() is the last size received in a
  801. -- -- GdkEventConfigure, that is, GTK+ uses its locally-stored
  802. -- -- size, rather than querying the X server for the size. As a
  803. -- -- result, if you call gtk_window_resize() then immediately
  804. -- -- call gtk_window_get_size(), the size won't have taken
  805. -- -- effect yet. After the window manager processes the resize
  806. -- -- request, GTK+ receives notification that the size has
  807. -- -- changed via a configure event, and the size of the window
  808. -- -- gets updated.
  809. -- -- Note 1: Nearly any use of this function creates a race
  810. -- -- condition, because the size of the window may change
  811. -- -- between the time that you get the size and the time that
  812. -- -- you perform some action assuming that size is the current
  813. -- -- size. To avoid race conditions, connect to
  814. -- -- "configure_event" on the window and adjust your
  815. -- -- size-dependent state to match the size delivered in the
  816. -- -- GdkEventConfigure.
  817. -- -- Note 2: The returned size does not include the size of the
  818. -- -- window manager decorations (aka the window frame or
  819. -- -- border). Those are not drawn by GTK+ and GTK+ has no
  820. -- -- reliable method of determining their size.
  821. -- -- Note 3: If you are getting a window size in order to
  822. -- -- position the window onscreen, there may be a better
  823. -- -- way. The preferred way is to simply set the window's
  824. -- -- semantic type with gtk_window_set_type_hint(), which
  825. -- -- allows the window manager to e.g. center dialogs. Also, if
  826. -- -- you set the transient parent of dialogs with
  827. -- -- gtk_window_set_transient_for() window managers will often
  828. -- -- center the dialog over its parent window. It's much
  829. -- -- preferred to let the window manager handle these things
  830. -- -- rather than doing it yourself, because all apps will
  831. -- -- behave consistently and according to user prefs if the
  832. -- -- window manager handles it. Also, the window manager can
  833. -- -- take the size of the window decorations/border into
  834. -- -- account, while your application cannot.
  835. -- -- In any case, if you insist on application-specified window
  836. -- -- positioning, there's still a better way than doing it
  837. -- -- yourself - gtk_window_set_position() will frequently
  838. -- -- handle the details for you.
  839. -- -- window : a GtkWindow
  840. -- -- width : (gint*) return location for width, or NULL
  841. -- -- height : (gint *) return location for height, or NULL
  842. -- external "C use <gtk/gtk.h>"
  843. -- end
  844. title: CONST_STRING is
  845. -- The title of the window, or Void if none has been set explicitely.
  846. local p: POINTER
  847. do
  848. p:=gtk_window_get_title (handle)
  849. if p.is_not_null then
  850. create Result.from_external(p)
  851. end
  852. end
  853. -- gtk_window_get_transient_for (window: POINTER): POINTER is
  854. -- -- Fetches the transient parent for this window. See
  855. -- -- gtk_window_set_transient_for().
  856. -- -- window : a GtkWindow; Returns: (GtkWindow*) the transient
  857. -- -- parent for this window, or NULL if no transient parent has
  858. -- -- been set.
  859. -- external "C use <gtk/gtk.h>"
  860. -- end
  861. -- gtk_window_get_type_hint (window: POINTER): INTEGER is
  862. -- -- Gets the type hint for this window. See gtk_window_set_type_hint().
  863. -- -- window : a GtkWindow
  864. -- -- Returns : the type hint for window. GdkWindowTypeHint
  865. -- external "C use <gtk/gtk.h>"
  866. -- ensure valid_type_hint: is_valid_window_type_hint (Result)
  867. -- end
  868. -- gtk_window_get_skip_taskbar_hint (window: POINTER): INTEGER is
  869. -- -- Gets the value set by gtk_window_set_skip_taskbar_hint()
  870. -- -- window : a GtkWindow Returns : TRUE if window shouldn't be
  871. -- -- in taskbar
  872. -- external "C use <gtk/gtk.h>"
  873. -- end
  874. -- gtk_window_get_skip_pager_hint (window: POINTER): INTEGER is
  875. -- -- Gets the value set by gtk_window_set_skip_pager_hint().
  876. -- -- window : a GtkWindow
  877. -- -- Returns : TRUE if window shouldn't be in pager
  878. -- external "C use <gtk/gtk.h>"
  879. -- end
  880. -- gtk_window_get_urgency_hint (window: POINTER): INTEGER is
  881. -- -- Gets the value set by gtk_window_set_urgency_hint()
  882. -- -- window : a GtkWindow
  883. -- -- Returns : TRUE if window is urgent
  884. -- external "C use <gtk/gtk.h>"
  885. -- end
  886. -- gtk_window_get_accept_focus (window: POINTER): INTEGER
  887. -- -- Gets the value set by gtk_window_set_accept_focus(). window
  888. -- -- : a GtkWindow Returns : TRUE if window should receive the
  889. -- -- input focus
  890. -- external "C use <gtk/gtk.h>"
  891. -- end
  892. -- -- gboolean gtk_window_get_focus_on_map (GtkWindow *window);
  893. -- -- Gets the value set by gtk_window_set_focus_on_map().
  894. -- -- window : a GtkWindow
  895. -- -- Returns : TRUE if window should receive the input focus when mapped.
  896. -- -- Since 2.6
  897. -- --external "C use <gtk/gtk.h>"
  898. -- --end
  899. move (an_x, an_y: INTEGER) is
  900. -- Asks the window manager to move window to the given position.
  901. -- Window managers are free to ignore this; most window managers
  902. -- ignore requests for initial window positions (instead using a
  903. -- user-defined placement algorithm) and honor requests after the
  904. -- window has already been shown.
  905. --
  906. -- Note: the position is the position of the gravity-determined
  907. -- reference point for the window. The gravity determines two
  908. -- things: first, the location of the reference point in root
  909. -- window coordinates; and second, which point on the window is
  910. -- positioned at the reference point.
  911. --
  912. -- By default the gravity is GDK_GRAVITY_NORTH_WEST, so the
  913. -- reference point is simply the x, y supplied to `move'.
  914. -- The top-left corner of the window decorations (aka window
  915. -- frame or border) will be placed at x, y. Therefore, to
  916. -- position a window at the top left of the screen, you want to
  917. -- use the default gravity (which is GDK_GRAVITY_NORTH_WEST)
  918. -- and move the window to 0,0.
  919. --
  920. -- To position a window at the bottom right corner of the screen,
  921. -- you would set GDK_GRAVITY_SOUTH_EAST, which means that the
  922. -- reference point is at x + the window width and y + the window
  923. -- height, and the bottom-right corner of the window border will
  924. -- be placed at that reference point. So, to place a window in
  925. -- the bottom right corner you would first set gravity to south
  926. -- east, then write:
  927. -- gtk_window_move (window, gdk_screen_width() - window_width, gdk_screen_height() - window_height).
  928. --
  929. -- The Extended Window Manager Hints specification at
  930. -- http://www.freedesktop.org/Standards/wm-spec has a nice table
  931. -- of gravities in the "implementation notes" section.
  932. --
  933. -- The gtk_window_get_position() documentation may also be relevant.
  934. --
  935. -- an_x : X coordinate to move window to
  936. -- an_y : Y coordinate to move window to
  937. do
  938. gtk_window_move (handle, an_x, an_y)
  939. end
  940. -- -- gboolean gtk_window_parse_geometry (GtkWindow *window,
  941. -- -- const gchar *geometry);
  942. -- -- Parses a standard X Window System geometry string - see the manual page for X (type 'man X') for details on this. gtk_window_parse_geometry() does work on all GTK+ ports including Win32 but is primarily intended for an X environment.
  943. -- -- If either a size or a position can be extracted from the geometry string, gtk_window_parse_geometry() returns TRUE and calls gtk_window_set_default_size() and/or gtk_window_move() to resize/move the window.
  944. -- -- If gtk_window_parse_geometry() returns TRUE, it will also set the GDK_HINT_USER_POS and/or GDK_HINT_USER_SIZE hints indicating to the window manager that the size/position of the window was user-specified. This causes most window managers to honor the geometry.
  945. -- -- Note that for gtk_window_parse_geometry() to work as expected, it has to be called when the window has its "final" size, i.e. after calling gtk_widget_show_all() on the contents and gtk_window_set_geometry_hints() on the window.
  946. -- -- include <gtk/gtk.h>
  947. -- -- static void
  948. -- -- fill_with_content (GtkWidget *vbox)
  949. -- -- {
  950. -- -- /* fill with content... */
  951. -- -- }
  952. -- -- int
  953. -- -- main (int argc, char *argv[])
  954. -- -- {
  955. -- -- GtkWidget *window, *vbox;
  956. -- -- GdkGeometry size_hints = {
  957. -- -- 100, 50, 0, 0, 100, 50, 10, 10, 0.0, 0.0, GDK_GRAVITY_NORTH_WEST
  958. -- -- };
  959. -- -- gtk_init (&argc, &argv);
  960. -- -- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  961. -- -- vbox = gtk_vbox_new (FALSE, 0);
  962. -- -- gtk_container_add (GTK_CONTAINER (window), vbox);
  963. -- -- fill_with_content (vbox);
  964. -- -- gtk_widget_show_all (vbox);
  965. -- -- gtk_window_set_geometry_hints (GTK_WINDOW (window),
  966. -- -- window,
  967. -- -- &size_hints,
  968. -- -- GDK_HINT_MIN_SIZE |
  969. -- -- GDK_HINT_BASE_SIZE |
  970. -- -- GDK_HINT_RESIZE_INC);
  971. -- -- if (argc > 1)
  972. -- -- {
  973. -- -- if (!gtk_window_parse_geometry (GTK_WINDOW (window), argv[1]))
  974. -- -- fprintf (stderr, "Failed to parse '%s'\n", argv[1]);
  975. -- -- }
  976. -- -- gtk_widget_show_all (window);
  977. -- -- gtk_main();
  978. -- -- return 0;
  979. -- -- }
  980. -- -- window : a GtkWindow
  981. -- -- geometry : geometry string
  982. -- -- Returns : TRUE if string was parsed successfully
  983. -- --external "C use <gtk/gtk.h>"
  984. -- --end
  985. -- -- void gtk_window_reshow_with_initial_size
  986. -- -- (GtkWindow *window);
  987. -- -- Hides window, then reshows it, resetting the default size and position of the window. Used by GUI builders only.
  988. -- -- window : a GtkWindow
  989. -- --external "C use <gtk/gtk.h>"
  990. -- --end
  991. -- -- void gtk_window_resize (GtkWindow *window,
  992. -- -- gint width,
  993. -- -- gint height);
  994. -- -- Resizes the window as if the user had done so, obeying geometry constraints. The default geometry constraint is that windows may not be smaller than their size request; to override this constraint, call gtk_widget_set_size_request() to set the window's request to a smaller value.
  995. -- -- If gtk_window_resize() is called before showing a window for the first time, it overrides any default size set with gtk_window_set_default_size().
  996. -- -- Windows may not be resized smaller than 1 by 1 pixels.
  997. -- -- window : a GtkWindow
  998. -- -- width : width in pixels to resize the window to
  999. -- -- height : height in pixels to resize the window to
  1000. -- --external "C use <gtk/gtk.h>"
  1001. -- --end
  1002. -- -- void gtk_window_set_default_icon_list
  1003. -- -- (GList *list);
  1004. -- -- Sets an icon list to be used as fallback for windows that haven't had gtk_window_set_icon_list() called on them to set up a window-specific icon list. This function allows you to set up the icon for all windows in your app at once.
  1005. -- -- See gtk_window_set_icon_list() for more details.
  1006. -- -- list : a list of GdkPixbuf
  1007. -- --external "C use <gtk/gtk.h>"
  1008. -- --end
  1009. -- -- void gtk_window_set_default_icon (GdkPixbuf *icon);
  1010. -- -- Sets an icon to be used as fallback for windows that haven't had gtk_window_set_icon() called on them from a pixbuf.
  1011. -- -- icon : the icon
  1012. -- -- Since 2.4
  1013. -- --external "C use <gtk/gtk.h>"
  1014. -- --end
  1015. -- -- gboolean gtk_window_set_default_icon_from_file
  1016. -- -- (const gchar *filename,
  1017. -- -- GError **err);
  1018. -- -- Sets an icon to be used as fallback for windows that haven't had gtk_window_set_icon_list() called on them from a file on disk. Warns on failure if err is NULL.
  1019. -- -- filename : location of icon file
  1020. -- -- err : location to store error, or NULL.
  1021. -- -- Returns : TRUE if setting the icon succeeded.
  1022. -- -- Since 2.2
  1023. -- --external "C use <gtk/gtk.h>"
  1024. -- --end
  1025. -- -- void gtk_window_set_default_icon_name
  1026. -- -- (const gchar *name);
  1027. -- -- Sets an icon to be used as fallback for windows that haven't had gtk_window_set_icon_list() called on them from a named themed icon, see gtk_window_set_icon_name().
  1028. -- -- name : the name of the themed icon
  1029. -- -- Since 2.6
  1030. -- --external "C use <gtk/gtk.h>"
  1031. -- --end
  1032. set_icon (icon: GDK_PIXBUF) is
  1033. -- Sets up the icon representing Current. This icon is
  1034. -- used when the window is minimized (also known as iconified).
  1035. -- Some window managers or desktop environments may also place
  1036. -- it in the window frame, or display it in other contexts.
  1037. -- The icon should be provided in whatever size it was
  1038. -- naturally drawn; that is, don't scale the image before
  1039. -- passing it to GTK+. Scaling is postponed until the last
  1040. -- minute, when the desired final size is known, to allow best
  1041. -- quality.
  1042. -- If you have your icon hand-drawn in multiple sizes, use
  1043. -- `set_icon_list'. Then the best size will be used.
  1044. -- This function is equivalent to calling `set_icon_list'
  1045. -- with a 1-element list. See also `set_default_icon_list' to
  1046. -- set the icon for all windows in your application in one go.
  1047. require
  1048. icon /= Void
  1049. do
  1050. gtk_window_set_icon (handle, icon.handle)
  1051. end
  1052. -- -- window : a GtkWindow
  1053. -- -- icon : icon image, or NULL
  1054. -- --external "C use <gtk/gtk.h>"
  1055. -- --end
  1056. -- -- void gtk_window_set_icon_list (GtkWindow *window,
  1057. -- -- GList *list);
  1058. -- -- Sets up the icon representing a GtkWindow. The icon is used when the window is minimized (also known as iconified). Some window managers or desktop environments may also place it in the window frame, or display it in other contexts.
  1059. -- -- gtk_window_set_icon_list() allows you to pass in the same icon in several hand-drawn sizes. The list should contain the natural sizes your icon is available in; that is, don't scale the image before passing it to GTK+. Scaling is postponed until the last minute, when the desired final size is known, to allow best quality.
  1060. -- -- By passing several sizes, you may improve the final image quality of the icon, by reducing or eliminating automatic image scaling.
  1061. -- -- Recommended sizes to provide: 16x16, 32x32, 48x48 at minimum, and larger images (64x64, 128x128) if you have them.
  1062. -- -- See also gtk_window_set_default_icon_list() to set the icon for all windows in your application in one go.
  1063. -- -- Note that transient windows (those who have been set transient for another window using gtk_window_set_transient_for()) will inherit their icon from their transient parent. So there's no need to explicitly set the icon on transient windows.
  1064. -- -- window : a GtkWindow
  1065. -- -- list : list of GdkPixbuf
  1066. -- --external "C use <gtk/gtk.h>"
  1067. -- --end
  1068. -- -- gboolean gtk_window_set_icon_from_file (GtkWindow *window,
  1069. -- -- const gchar *filename,
  1070. -- -- GError **err);
  1071. -- -- Sets the icon for window. Warns on failure if err is NULL.
  1072. -- -- This function is equivalent to calling gtk_window_set_icon() with a pixbuf created by loading the image from filename.
  1073. -- -- window : a GtkWindow
  1074. -- -- filename : location of icon file
  1075. -- -- err : location to store error, or NULL.
  1076. -- -- Returns : TRUE if setting the icon succeeded.
  1077. -- -- Since 2.2
  1078. -- --external "C use <gtk/gtk.h>"
  1079. -- --end
  1080. -- -- void gtk_window_set_icon_name (GtkWindow *window,
  1081. -- -- const gchar *name);
  1082. -- -- Sets the icon for the window from a named themed icon. See the docs for GtkIconTheme for more details.
  1083. -- -- Note that this has nothing to do with the WM_ICON_NAME property which is mentioned in the ICCCM.
  1084. -- -- window : a GtkWindow
  1085. -- -- name : the name of the themed icon
  1086. -- -- Since 2.6
  1087. -- --external "C use <gtk/gtk.h>"
  1088. -- --end
  1089. -- -- void gtk_window_set_auto_startup_notification
  1090. -- -- (gboolean setting);
  1091. -- -- By default, after showing the first GtkWindow for each GdkScreen, GTK+ calls gdk_screen_notify_startup_complete(). Call this function to disable the automatic startup notification. You might do this if your first window is a splash screen, and you want to delay notification until after your real main window has been shown, for example.
  1092. -- -- In that example, you would disable startup notification temporarily, show your splash screen, then re-enable it so that showing the main window would automatically result in notification.
  1093. -- -- setting : TRUE to automatically do startup notification
  1094. -- -- Since 2.2
  1095. -- --external "C use <gtk/gtk.h>"
  1096. -- --end
  1097. -- -- void gtk_decorated_window_init (GtkWindow *window);
  1098. -- -- window :
  1099. -- --external "C use <gtk/gtk.h>"
  1100. -- --end
  1101. -- -- void gtk_decorated_window_calculate_frame_size
  1102. -- -- (GtkWindow *window);
  1103. -- -- window :
  1104. -- --external "C use <gtk/gtk.h>"
  1105. -- --end
  1106. -- -- void gtk_decorated_window_set_title (GtkWindow *window,
  1107. -- -- const gchar *title);
  1108. -- -- window :
  1109. -- -- title :
  1110. -- --external "C use <gtk/gtk.h>"
  1111. -- --end
  1112. -- -- void gtk_decorated_window_move_resize_window
  1113. -- -- (GtkWindow *window,
  1114. -- -- gint x,
  1115. -- -- gint y,
  1116. -- -- gint width,
  1117. -- -- gint height);
  1118. -- -- window :
  1119. -- -- x :
  1120. -- -- y :
  1121. -- -- width :
  1122. -- -- height :
  1123. -- -- Properties
  1124. -- -- The "accept-focus" property
  1125. -- -- "accept-focus" gboolean : Read / Write
  1126. -- -- TRUE if the window should receive the input focus.
  1127. -- -- Default value: TRUE
  1128. -- -- The "allow-grow" property
  1129. -- -- "allow-grow" gboolean : Read / Write
  1130. -- -- If TRUE, users can expand the window beyond its minimum size.
  1131. -- -- Default value: TRUE
  1132. -- -- The "allow-shrink" property
  1133. -- -- "allow-shrink" gboolean : Read / Write
  1134. -- -- If TRUE, the window has no mimimum size. Setting this to TRUE is 99% of the time a bad idea.
  1135. -- -- Default value: FALSE
  1136. -- -- The "decorated" property
  1137. -- -- "decorated" gboolean : Read / Write
  1138. -- -- Whether the window should be decorated by the window manager.
  1139. -- -- Default value: TRUE
  1140. -- -- Since 2.4
  1141. -- -- The "default-height" property
  1142. -- -- "default-height" gint : Read / Write
  1143. -- -- The default height of the window, used when initially showing the window.
  1144. -- -- Allowed values: >= -1
  1145. -- -- Default value: -1
  1146. -- -- The "default-width" property
  1147. -- -- "default-width" gint : Read / Write
  1148. -- -- The default width of the window, used when initially showing the window.
  1149. -- -- Allowed values: >= -1
  1150. -- -- Default value: -1
  1151. -- -- The "destroy-with-parent" property
  1152. -- -- "destroy-with-parent" gboolean : Read / Write
  1153. -- -- If this window should be destroyed when the parent is destroyed.
  1154. -- -- Default value: FALSE
  1155. -- -- The "focus-on-map" property
  1156. -- -- "focus-on-map" gboolean : Read / Write
  1157. -- -- TRUE if the window should receive the input focus when mapped.
  1158. -- -- Default value: TRUE
  1159. -- -- The "gravity" property
  1160. -- -- "gravity" GdkGravity : Read / Write
  1161. -- -- The window gravity of the window. See gtk_window_move() and GdkGravity for more details about window gravity.
  1162. -- -- Default value: GDK_GRAVITY_NORTH_WEST
  1163. -- -- Since 2.4
  1164. -- -- The "has-toplevel-focus" property
  1165. -- -- "has-toplevel-focus" gboolean : Read
  1166. -- -- Whether the input focus is within this GtkWindow.
  1167. -- -- Default value: FALSE
  1168. -- -- The "icon" property
  1169. -- -- "icon" GdkPixbuf : Read / Write
  1170. -- -- Icon for this window.
  1171. -- -- The "icon-name" property
  1172. -- -- "icon-name" gchararray : Read / Write
  1173. -- -- The :icon-name property specifies the name of the themed icon to use as the window icon. See GtkIconTheme for more details.
  1174. -- -- Default value: NULL
  1175. -- -- Since 2.6
  1176. -- -- The "is-active" property
  1177. -- -- "is-active" gboolean : Read
  1178. -- -- Whether the toplevel is the current active window.
  1179. -- -- Default value: FALSE
  1180. -- -- The "modal" property
  1181. -- -- "modal" gboolean : Read / Write
  1182. -- -- If TRUE, the window is modal (other windows are not usable while this one is up).
  1183. -- -- Default value: FALSE
  1184. -- -- The "resizable" property
  1185. -- -- "resizable" gboolean : Read / Write
  1186. -- -- If TRUE, users can resize the window.
  1187. -- -- Default value: TRUE
  1188. -- -- The "role" property
  1189. -- -- "role" gchararray : Read / Write
  1190. -- -- Unique identifier for the window to be used when restoring a session.
  1191. -- -- Default value: NULL
  1192. -- -- The "screen" property
  1193. -- -- "screen" GdkScreen : Read / Write
  1194. -- -- The screen where this window will be displayed.
  1195. -- -- The "skip-pager-hint" property
  1196. -- -- "skip-pager-hint" gboolean : Read / Write
  1197. -- -- TRUE if the window should not be in the pager.
  1198. -- -- Default value: FALSE
  1199. -- -- The "skip-taskbar-hint" property
  1200. -- -- "skip-taskbar-hint" gboolean : Read / Write
  1201. -- -- TRUE if the window should not be in the task bar.
  1202. -- -- Default value: FALSE
  1203. -- -- The "title" property
  1204. -- -- "title" gchararray : Read / Write
  1205. -- -- The title of the window.
  1206. -- -- Default value: NULL
  1207. -- -- The "type" property
  1208. -- -- "type" GtkWindowType : Read / Write / Construct Only
  1209. -- -- The type of the window.
  1210. -- -- Default value: GTK_WINDOW_TOPLEVEL
  1211. -- -- The "type-hint" property
  1212. -- -- "type-hint" GdkWindowTypeHint : Read / Write
  1213. -- -- Hint to help the desktop environment understand what kind of window this is and how to treat it.
  1214. -- -- Default value: GDK_WINDOW_TYPE_HINT_NORMAL
  1215. -- -- The "urgency-hint" property
  1216. -- -- "urgency-hint" gboolean : Read / Write
  1217. -- -- TRUE if the window should be brought to the user's attention.
  1218. -- -- Default value: FALSE
  1219. -- -- The "window-position" property
  1220. -- -- "window-position" GtkWindowPosition : Read / Write
  1221. -- -- The initial position of the window.
  1222. -- -- Default value: GTK_WIN_POS_NONE
  1223. -- -- Signals
  1224. -- -- The "activate-default" signal
  1225. -- -- void user_function (GtkWindow *window,
  1226. -- -- gpointer user_data);
  1227. -- -- window : the object which received the signal.
  1228. -- -- user_data : user data set when the signal handler was connected.
  1229. -- -- The "activate-focus" signal
  1230. -- -- void user_function (GtkWindow *window,
  1231. -- -- gpointer user_data);
  1232. -- -- window : the object which received the signal.
  1233. -- -- user_data : user data set when the signal handler was connected.
  1234. -- -- The "frame-event" signal
  1235. -- -- gboolean user_function (GtkWindow *window,
  1236. -- -- GdkEvent *event,
  1237. -- -- gpointer user_data);
  1238. -- -- window : the object which received the signal.
  1239. -- -- event :
  1240. -- -- user_data : user data set when the signal handler was connected.
  1241. -- -- Returns :
  1242. -- -- The "keys-changed" signal
  1243. -- -- void user_function (GtkWindow *window,
  1244. -- -- gpointer user_data);
  1245. -- -- window : the object which received the signal.
  1246. -- -- user_data : user data set when the signal handler was connected.
  1247. -- -- The "move-focus" signal
  1248. -- -- void user_function (GtkWindow *window,
  1249. -- -- GtkDirectionType arg1,
  1250. -- -- gpointer user_data);
  1251. -- -- window : the object which received the signal.
  1252. -- -- arg1 :
  1253. -- -- user_data : user data set when the signal handler was connected.
  1254. -- -- The "set-focus" signal
  1255. -- -- void user_function (GtkWindow *window,
  1256. -- -- GtkWidget *widget,
  1257. -- -- gpointer user_data);
  1258. -- -- window : the object which received the signal.
  1259. -- -- widget :
  1260. -- -- user_data : user data set when the signal handler was connected.
  1261. -- -- << GtkMessageDialog GtkWindowGroup >>
  1262. feature -- struct size
  1263. struct_size: INTEGER is
  1264. external "C inline use <gtk/gtk.h>"
  1265. alias "sizeof(GtkWindow)"
  1266. end
  1267. end