2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_WINDOW_H
4 #define _GTKMM_WINDOW_H
13 * Copyright (C) 1998-2002 The gtkmm Development Team
15 * This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Library General Public
17 * License as published by the Free Software Foundation; either
18 * version 2 of the License, or (at your option) any later version.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Library General Public License for more details.
25 * You should have received a copy of the GNU Library General Public
26 * License along with this library; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #include <glibmm/object.h>
31 #include <glibmm/listhandle.h>
32 #include <gtkmm/bin.h>
35 #ifndef DOXYGEN_SHOULD_SKIP_THIS
36 typedef struct _GtkWindowGroup GtkWindowGroup;
37 typedef struct _GtkWindowGroupClass GtkWindowGroupClass;
38 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
42 { class WindowGroup_Class; } // namespace Gtk
43 #ifndef DOXYGEN_SHOULD_SKIP_THIS
44 typedef struct _GtkWindow GtkWindow;
45 typedef struct _GtkWindowClass GtkWindowClass;
46 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
50 { class Window_Class; } // namespace Gtk
57 /** Limit the effect of grabs
60 class WindowGroup : public Glib::Object
63 #ifndef DOXYGEN_SHOULD_SKIP_THIS
66 typedef WindowGroup CppObjectType;
67 typedef WindowGroup_Class CppClassType;
68 typedef GtkWindowGroup BaseObjectType;
69 typedef GtkWindowGroupClass BaseClassType;
71 private: friend class WindowGroup_Class;
72 static CppClassType windowgroup_class_;
76 WindowGroup(const WindowGroup&);
77 WindowGroup& operator=(const WindowGroup&);
80 explicit WindowGroup(const Glib::ConstructParams& construct_params);
81 explicit WindowGroup(GtkWindowGroup* castitem);
83 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
86 virtual ~WindowGroup();
88 #ifndef DOXYGEN_SHOULD_SKIP_THIS
89 static GType get_type() G_GNUC_CONST;
90 static GType get_base_type() G_GNUC_CONST;
93 ///Provides access to the underlying C GObject.
94 GtkWindowGroup* gobj() { return reinterpret_cast<GtkWindowGroup*>(gobject_); }
96 ///Provides access to the underlying C GObject.
97 const GtkWindowGroup* gobj() const { return reinterpret_cast<GtkWindowGroup*>(gobject_); }
99 ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
100 GtkWindowGroup* gobj_copy();
110 static Glib::RefPtr<WindowGroup> create();
113 /** Adds a window to a Gtk::WindowGroup.
114 * @param window The Gtk::Window to add.
116 void add_window(Window& window);
118 /** Removes a window from a Gtk::WindowGroup.
119 * @param window The Gtk::Window to remove.
121 void remove_window(Window& window);
127 //C++ methods used to invoke GTK+ virtual functions:
128 #ifdef GLIBMM_VFUNCS_ENABLED
129 #endif //GLIBMM_VFUNCS_ENABLED
132 //GTK+ Virtual Functions (override these to change behaviour):
133 #ifdef GLIBMM_VFUNCS_ENABLED
134 #endif //GLIBMM_VFUNCS_ENABLED
136 //Default Signal Handlers::
137 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
138 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
144 * This represents all widgets which are physical windows controlled
145 * by the window manager.
147 * The window will be hidden when the window manager's close button is clicked. Override on_delete_event() to stop this.
149 * Gtk::manage() has no effect on Windows because they have no parent Containers.
153 class Window : public Bin
156 #ifndef DOXYGEN_SHOULD_SKIP_THIS
157 typedef Window CppObjectType;
158 typedef Window_Class CppClassType;
159 typedef GtkWindow BaseObjectType;
160 typedef GtkWindowClass BaseClassType;
161 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
165 #ifndef DOXYGEN_SHOULD_SKIP_THIS
168 friend class Window_Class;
169 static CppClassType window_class_;
172 Window(const Window&);
173 Window& operator=(const Window&);
176 explicit Window(const Glib::ConstructParams& construct_params);
177 explicit Window(GtkWindow* castitem);
179 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
182 #ifndef DOXYGEN_SHOULD_SKIP_THIS
183 static GType get_type() G_GNUC_CONST;
184 static GType get_base_type() G_GNUC_CONST;
187 ///Provides access to the underlying C GtkObject.
188 GtkWindow* gobj() { return reinterpret_cast<GtkWindow*>(gobject_); }
190 ///Provides access to the underlying C GtkObject.
191 const GtkWindow* gobj() const { return reinterpret_cast<GtkWindow*>(gobject_); }
195 //C++ methods used to invoke GTK+ virtual functions:
196 #ifdef GLIBMM_VFUNCS_ENABLED
197 #endif //GLIBMM_VFUNCS_ENABLED
200 //GTK+ Virtual Functions (override these to change behaviour):
201 #ifdef GLIBMM_VFUNCS_ENABLED
202 #endif //GLIBMM_VFUNCS_ENABLED
204 //Default Signal Handlers::
205 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
206 virtual void on_set_focus(Widget* focus);
207 virtual bool on_frame_event(GdkEvent* event);
208 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
215 explicit Window(WindowType type = WINDOW_TOPLEVEL);
217 #ifdef GLIBMM_PROPERTIES_ENABLED
218 /** The title of the window.
220 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
221 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
222 * the value of the property changes.
224 Glib::PropertyProxy<Glib::ustring> property_title() ;
225 #endif //#GLIBMM_PROPERTIES_ENABLED
227 #ifdef GLIBMM_PROPERTIES_ENABLED
228 /** The title of the window.
230 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
231 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
232 * the value of the property changes.
234 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_title() const;
235 #endif //#GLIBMM_PROPERTIES_ENABLED
237 #ifdef GLIBMM_PROPERTIES_ENABLED
240 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
241 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
242 * the value of the property changes.
244 Glib::PropertyProxy<bool> property_allow_shrink() ;
245 #endif //#GLIBMM_PROPERTIES_ENABLED
247 #ifdef GLIBMM_PROPERTIES_ENABLED
250 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
251 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
252 * the value of the property changes.
254 Glib::PropertyProxy_ReadOnly<bool> property_allow_shrink() const;
255 #endif //#GLIBMM_PROPERTIES_ENABLED
257 #ifdef GLIBMM_PROPERTIES_ENABLED
260 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
261 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
262 * the value of the property changes.
264 Glib::PropertyProxy<bool> property_allow_grow() ;
265 #endif //#GLIBMM_PROPERTIES_ENABLED
267 #ifdef GLIBMM_PROPERTIES_ENABLED
270 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
271 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
272 * the value of the property changes.
274 Glib::PropertyProxy_ReadOnly<bool> property_allow_grow() const;
275 #endif //#GLIBMM_PROPERTIES_ENABLED
277 #ifdef GLIBMM_PROPERTIES_ENABLED
280 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
281 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
282 * the value of the property changes.
284 Glib::PropertyProxy<bool> property_resizable() ;
285 #endif //#GLIBMM_PROPERTIES_ENABLED
287 #ifdef GLIBMM_PROPERTIES_ENABLED
290 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
291 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
292 * the value of the property changes.
294 Glib::PropertyProxy_ReadOnly<bool> property_resizable() const;
295 #endif //#GLIBMM_PROPERTIES_ENABLED
297 #ifdef GLIBMM_PROPERTIES_ENABLED
300 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
301 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
302 * the value of the property changes.
304 Glib::PropertyProxy<bool> property_modal() ;
305 #endif //#GLIBMM_PROPERTIES_ENABLED
307 #ifdef GLIBMM_PROPERTIES_ENABLED
310 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
311 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
312 * the value of the property changes.
314 Glib::PropertyProxy_ReadOnly<bool> property_modal() const;
315 #endif //#GLIBMM_PROPERTIES_ENABLED
317 #ifdef GLIBMM_PROPERTIES_ENABLED
318 /** The initial position of the window.
320 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
321 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
322 * the value of the property changes.
324 Glib::PropertyProxy<WindowPosition> property_window_position() ;
325 #endif //#GLIBMM_PROPERTIES_ENABLED
327 #ifdef GLIBMM_PROPERTIES_ENABLED
328 /** The initial position of the window.
330 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
331 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
332 * the value of the property changes.
334 Glib::PropertyProxy_ReadOnly<WindowPosition> property_window_position() const;
335 #endif //#GLIBMM_PROPERTIES_ENABLED
337 #ifdef GLIBMM_PROPERTIES_ENABLED
338 /** The default width of the window
340 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
341 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
342 * the value of the property changes.
344 Glib::PropertyProxy<int> property_default_width() ;
345 #endif //#GLIBMM_PROPERTIES_ENABLED
347 #ifdef GLIBMM_PROPERTIES_ENABLED
348 /** The default width of the window
350 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
351 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
352 * the value of the property changes.
354 Glib::PropertyProxy_ReadOnly<int> property_default_width() const;
355 #endif //#GLIBMM_PROPERTIES_ENABLED
357 #ifdef GLIBMM_PROPERTIES_ENABLED
358 /** The default height of the window
360 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
361 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
362 * the value of the property changes.
364 Glib::PropertyProxy<int> property_default_height() ;
365 #endif //#GLIBMM_PROPERTIES_ENABLED
367 #ifdef GLIBMM_PROPERTIES_ENABLED
368 /** The default height of the window
370 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
371 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
372 * the value of the property changes.
374 Glib::PropertyProxy_ReadOnly<int> property_default_height() const;
375 #endif //#GLIBMM_PROPERTIES_ENABLED
377 #ifdef GLIBMM_PROPERTIES_ENABLED
378 /** If this window should be destroyed when the parent is destroyed.
380 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
381 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
382 * the value of the property changes.
384 Glib::PropertyProxy<bool> property_destroy_with_parent() ;
385 #endif //#GLIBMM_PROPERTIES_ENABLED
387 #ifdef GLIBMM_PROPERTIES_ENABLED
388 /** If this window should be destroyed when the parent is destroyed.
390 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
391 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
392 * the value of the property changes.
394 Glib::PropertyProxy_ReadOnly<bool> property_destroy_with_parent() const;
395 #endif //#GLIBMM_PROPERTIES_ENABLED
397 #ifdef GLIBMM_PROPERTIES_ENABLED
398 /** Icon for this window.
400 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
401 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
402 * the value of the property changes.
404 Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixbuf> > property_icon() ;
405 #endif //#GLIBMM_PROPERTIES_ENABLED
407 #ifdef GLIBMM_PROPERTIES_ENABLED
408 /** Icon for this window.
410 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
411 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
412 * the value of the property changes.
414 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixbuf> > property_icon() const;
415 #endif //#GLIBMM_PROPERTIES_ENABLED
418 #ifdef GLIBMM_PROPERTIES_ENABLED
419 /** The screen where this window will be displayed.
421 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
422 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
423 * the value of the property changes.
425 Glib::PropertyProxy< Glib::RefPtr<Gdk::Screen> > property_screen() ;
426 #endif //#GLIBMM_PROPERTIES_ENABLED
428 #ifdef GLIBMM_PROPERTIES_ENABLED
429 /** The screen where this window will be displayed.
431 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
432 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
433 * the value of the property changes.
435 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Screen> > property_screen() const;
436 #endif //#GLIBMM_PROPERTIES_ENABLED
438 #ifdef GLIBMM_PROPERTIES_ENABLED
439 /** Whether the toplevel is the current active window.
441 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
442 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
443 * the value of the property changes.
445 Glib::PropertyProxy_ReadOnly<bool> property_is_active() const;
446 #endif //#GLIBMM_PROPERTIES_ENABLED
449 #ifdef GLIBMM_PROPERTIES_ENABLED
450 /** Whether the input focus is within this GtkWindow.
452 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
453 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
454 * the value of the property changes.
456 Glib::PropertyProxy_ReadOnly<bool> property_has_toplevel_focus() const;
457 #endif //#GLIBMM_PROPERTIES_ENABLED
460 #ifdef GLIBMM_PROPERTIES_ENABLED
461 /** Hint to help the desktop environment understand what kind of window this is and how to treat it.
463 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
464 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
465 * the value of the property changes.
467 Glib::PropertyProxy<GdkWindowTypeHint> property_type_hint() ;
468 #endif //#GLIBMM_PROPERTIES_ENABLED
470 #ifdef GLIBMM_PROPERTIES_ENABLED
471 /** Hint to help the desktop environment understand what kind of window this is and how to treat it.
473 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
474 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
475 * the value of the property changes.
477 Glib::PropertyProxy_ReadOnly<GdkWindowTypeHint> property_type_hint() const;
478 #endif //#GLIBMM_PROPERTIES_ENABLED
480 #ifdef GLIBMM_PROPERTIES_ENABLED
481 /** TRUE if the window should not be in the task bar.
483 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
484 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
485 * the value of the property changes.
487 Glib::PropertyProxy<bool> property_skip_taskbar_hint() ;
488 #endif //#GLIBMM_PROPERTIES_ENABLED
490 #ifdef GLIBMM_PROPERTIES_ENABLED
491 /** TRUE if the window should not be in the task bar.
493 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
494 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
495 * the value of the property changes.
497 Glib::PropertyProxy_ReadOnly<bool> property_skip_taskbar_hint() const;
498 #endif //#GLIBMM_PROPERTIES_ENABLED
500 #ifdef GLIBMM_PROPERTIES_ENABLED
501 /** TRUE if the window should not be in the pager.
503 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
504 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
505 * the value of the property changes.
507 Glib::PropertyProxy<bool> property_skip_pager_hint() ;
508 #endif //#GLIBMM_PROPERTIES_ENABLED
510 #ifdef GLIBMM_PROPERTIES_ENABLED
511 /** TRUE if the window should not be in the pager.
513 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
514 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
515 * the value of the property changes.
517 Glib::PropertyProxy_ReadOnly<bool> property_skip_pager_hint() const;
518 #endif //#GLIBMM_PROPERTIES_ENABLED
520 #ifdef GLIBMM_PROPERTIES_ENABLED
521 /** Unique identifier for the window to be used when restoring a session.
523 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
524 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
525 * the value of the property changes.
527 Glib::PropertyProxy<Glib::ustring> property_role() ;
528 #endif //#GLIBMM_PROPERTIES_ENABLED
530 #ifdef GLIBMM_PROPERTIES_ENABLED
531 /** Unique identifier for the window to be used when restoring a session.
533 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
534 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
535 * the value of the property changes.
537 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_role() const;
538 #endif //#GLIBMM_PROPERTIES_ENABLED
540 #ifdef GLIBMM_PROPERTIES_ENABLED
541 /** Whether the window should be decorated by the window manager.
543 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
544 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
545 * the value of the property changes.
547 Glib::PropertyProxy<bool> property_decorated() ;
548 #endif //#GLIBMM_PROPERTIES_ENABLED
550 #ifdef GLIBMM_PROPERTIES_ENABLED
551 /** Whether the window should be decorated by the window manager.
553 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
554 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
555 * the value of the property changes.
557 Glib::PropertyProxy_ReadOnly<bool> property_decorated() const;
558 #endif //#GLIBMM_PROPERTIES_ENABLED
560 #ifdef GLIBMM_PROPERTIES_ENABLED
561 /** The window gravity of the window.
563 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
564 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
565 * the value of the property changes.
567 Glib::PropertyProxy<Gdk::Gravity> property_gravity() ;
568 #endif //#GLIBMM_PROPERTIES_ENABLED
570 #ifdef GLIBMM_PROPERTIES_ENABLED
571 /** The window gravity of the window.
573 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
574 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
575 * the value of the property changes.
577 Glib::PropertyProxy_ReadOnly<Gdk::Gravity> property_gravity() const;
578 #endif //#GLIBMM_PROPERTIES_ENABLED
580 #ifdef GLIBMM_PROPERTIES_ENABLED
581 /** The transient parent of the dialog.
583 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
584 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
585 * the value of the property changes.
587 Glib::PropertyProxy<Window*> property_transient_for() ;
588 #endif //#GLIBMM_PROPERTIES_ENABLED
590 #ifdef GLIBMM_PROPERTIES_ENABLED
591 /** The transient parent of the dialog.
593 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
594 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
595 * the value of the property changes.
597 Glib::PropertyProxy_ReadOnly<Window*> property_transient_for() const;
598 #endif //#GLIBMM_PROPERTIES_ENABLED
600 #ifdef GLIBMM_PROPERTIES_ENABLED
601 /** TRUE if the window should be brought to the user's attention.
603 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
604 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
605 * the value of the property changes.
607 Glib::PropertyProxy<bool> property_urgency_hint() ;
608 #endif //#GLIBMM_PROPERTIES_ENABLED
610 #ifdef GLIBMM_PROPERTIES_ENABLED
611 /** TRUE if the window should be brought to the user's attention.
613 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
614 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
615 * the value of the property changes.
617 Glib::PropertyProxy_ReadOnly<bool> property_urgency_hint() const;
618 #endif //#GLIBMM_PROPERTIES_ENABLED
620 #ifdef GLIBMM_PROPERTIES_ENABLED
621 /** Whether the window frame should have a close button.
623 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
624 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
625 * the value of the property changes.
627 Glib::PropertyProxy<bool> property_deletable() ;
628 #endif //#GLIBMM_PROPERTIES_ENABLED
630 #ifdef GLIBMM_PROPERTIES_ENABLED
631 /** Whether the window frame should have a close button.
633 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
634 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
635 * the value of the property changes.
637 Glib::PropertyProxy_ReadOnly<bool> property_deletable() const;
638 #endif //#GLIBMM_PROPERTIES_ENABLED
640 #ifdef GLIBMM_PROPERTIES_ENABLED
641 /** The opacity of the window
643 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
644 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
645 * the value of the property changes.
647 Glib::PropertyProxy<double> property_opacity() ;
648 #endif //#GLIBMM_PROPERTIES_ENABLED
650 #ifdef GLIBMM_PROPERTIES_ENABLED
651 /** The opacity of the window
653 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
654 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
655 * the value of the property changes.
657 Glib::PropertyProxy_ReadOnly<double> property_opacity() const;
658 #endif //#GLIBMM_PROPERTIES_ENABLED
661 bool is_toplevel() const;
662 bool is_dialog() const;
663 bool is_popup() const;
665 WindowType get_window_type() const;
667 //: This is special to the GTK+ linux-fb port.
668 Glib::RefPtr<Gdk::Window> get_frame();
669 Glib::RefPtr<const Gdk::Window> get_frame() const;
674 * <tt>void on_my_%set_focus(Widget* focus)</tt>
677 Glib::SignalProxy1< void,Widget* > signal_set_focus();
682 * <tt>bool on_my_%frame_event(GdkEvent* event)</tt>
685 Glib::SignalProxy1< bool,GdkEvent* > signal_frame_event();
688 //Keybinding signals:
691 /** Sets the title of the Gtk::Window. The title of a window will be
692 * displayed in its title bar; on the X %Window System, the title bar
693 * is rendered by the window
694 * manager, so exactly how the title appears to users may vary
695 * according to a user's exact configuration. The title should help a
696 * user distinguish this window from other windows they may have
697 * open. A good title might include the application name and current
698 * document filename, for example.
699 * @param title Title of the window.
701 void set_title(const Glib::ustring& title);
704 /** Retrieves the title of the window. See set_title().
705 * @return The title of the window, or <tt>0</tt> if none has
706 * been set explicitely. The returned string is owned by the widget
707 * and must not be modified or freed.
709 Glib::ustring get_title() const;
712 /** Don't use this function. It sets the X %Window System "class" and
713 * "name" hints for a window. According to the ICCCM, you should
714 * always set these to the same value for all windows in an
715 * application, and GTK+ sets them to that value by default, so calling
716 * this function is sort of pointless. However, you may want to call
717 * set_role() on each window in your application, for the
718 * benefit of the session manager. Setting the role allows the window
719 * manager to restore window positions when loading a saved session.
720 * @param wmclass_name Window name hint.
721 * @param wmclass_class Window class hint.
723 void set_wmclass(const Glib::ustring& wmclass_name,
724 const Glib::ustring& wmclass_class);
727 /** This function is only useful on X11, not with other GTK+ targets.
729 * In combination with the window title, the window role allows a
730 * window manager to identify "the
731 * same" window when an application is restarted. So for example you
732 * might set the "toolbox" role on your app's toolbox window, so that
733 * when the user restarts their session, the window manager can put
734 * the toolbox back in the same place.
736 * If a window already has a unique title, you don't need to set the
737 * role, since the WM can use the title to identify the window when
738 * restoring the session.
739 * @param role Unique identifier for the window to be used when restoring a session.
741 void set_role(const Glib::ustring& role);
743 //: Returns the role of the window.
744 //- See {set_role()} for further explanation.
746 /** Return value: the role of the window if set, or <tt>0</tt>. The
747 * @return The role of the window if set, or <tt>0</tt>. The
748 * returned is owned by the widget and must not be modified
751 Glib::ustring get_role() const;
754 /** Associate @a accel_group with @a window , such that calling
755 * gtk_accel_groups_activate() on @a window will activate accelerators
756 * in @a accel_group .
757 * @param accel_group A Gtk::AccelGroup.
759 void add_accel_group(const Glib::RefPtr<AccelGroup>& accel_group);
762 /** Reverses the effects of add_accel_group().
763 * @param accel_group A Gtk::AccelGroup.
765 void remove_accel_group(const Glib::RefPtr<AccelGroup>& accel_group);
768 /** Sets a position constraint for this window. If the old or new
769 * constraint is Gtk::WIN_POS_CENTER_ALWAYS, this will also cause
770 * the window to be repositioned to satisfy the new constraint.
771 * @param position A position constraint.
773 void set_position(WindowPosition position);
776 /** Activates the current focused widget within the window.
777 * @return <tt>true</tt> if a widget got activated.
779 bool activate_focus();
782 /** If @a focus is not the current focus widget, and is focusable, sets
783 * it as the focus widget for the window. To set the focus to a particular
784 * widget in the toplevel, it is usually more convenient to use
785 * Gtk::Widget::grab_focus() instead of this function.
786 * @param focus Widget to be the new focus widget.
788 void set_focus(Gtk::Widget& focus);
792 /** Retrieves the current focused widget within the window.
793 * Note that this is the widget that would have the focus
794 * if the toplevel window focused; if the toplevel window
795 * is not focused then <tt>GTK_WIDGET_HAS_FOCUS (widget)</tt> will
796 * not be <tt>true</tt> for the widget.
797 * @return The currently focused widget, or <tt>0</tt> if there is none.
801 /** Retrieves the current focused widget within the window.
802 * Note that this is the widget that would have the focus
803 * if the toplevel window focused; if the toplevel window
804 * is not focused then <tt>GTK_WIDGET_HAS_FOCUS (widget)</tt> will
805 * not be <tt>true</tt> for the widget.
806 * @return The currently focused widget, or <tt>0</tt> if there is none.
808 const Widget* get_focus() const;
810 /** The default widget is the widget that's activated when the user
811 * presses Enter in a dialog (for example). This function sets the default widget for a Gtk::Window. When setting
812 * (rather than unsetting) the default widget it's generally easier to
813 * call Gtk::Widget::grab_focus() on the widget. Before making a widget
814 * the default widget, you must set the Gtk::CAN_DEFAULT flag on the
815 * widget you'd like to make the default using GTK_WIDGET_SET_FLAGS().
816 * @param default_widget Widget to be the default.
818 void set_default(Gtk::Widget& default_widget);
819 void unset_default();
822 /** Activates the default widget for the window, unless the current
823 * focused widget has been configured to receive the default action
824 * (see Gtk::RECEIVES_DEFAULT in Gtk::WidgetFlags), in which case the
825 * focused widget is activated.
826 * @return <tt>true</tt> if a widget got activated.
828 bool activate_default();
831 /** Dialog windows should be set transient for the main application
832 * window they were spawned from. This allows window managers to e.g. keep the
833 * dialog on top of the main window, or center the dialog over the
834 * main window. Gtk::Dialog::new_with_buttons() and other convenience
835 * functions in GTK+ will sometimes call
836 * set_transient_for() on your behalf.
838 * On Windows, this function puts the child window on top of the parent,
839 * much as the window manager would have done on X.
840 * @param parent Parent window.
842 void set_transient_for(Window& parent);
845 /** Fetches the transient parent for this window. See
846 * set_transient_for().
847 * @return The transient parent for this window, or <tt>0</tt>
848 * if no transient parent has been set.
850 Window* get_transient_for();
852 /** Fetches the transient parent for this window. See
853 * set_transient_for().
854 * @return The transient parent for this window, or <tt>0</tt>
855 * if no transient parent has been set.
857 const Window* get_transient_for() const;
860 /** Request the windowing system to make @a window partially transparent,
861 * with opacity 0 being fully transparent and 1 fully opaque. (Values
862 * of the opacity parameter are clamped to the [0,1] range.) On X11
863 * this has any effect only on X screens with a compositing manager
864 * running. See Gtk::Widget::is_composited(). On Windows it should work
867 * Note that setting a window's opacity after the window has been
868 * shown causes it to flicker once on Windows.
871 * @param opacity Desired opacity, between 0 and 1.
873 void set_opacity(double opacity);
875 /** Fetches the requested opacity for this window. See
877 * @return The requested opacity for this window.
881 double get_opacity() const;
884 /** By setting the type hint for the window, you allow the window
885 * manager to decorate and handle the window in a way which is
886 * suitable to the function of the window in your application.
888 * This function should be called before the window becomes visible.
890 * Gtk::Dialog::new_with_buttons() and other convenience functions in GTK+
891 * will sometimes call set_type_hint() on your behalf.
892 * @param hint The window type.
894 void set_type_hint(Gdk::WindowTypeHint hint);
896 /** Gets the type hint for this window. See set_type_hint().
897 * @return The type hint for @a window .
899 Gdk::WindowTypeHint get_type_hint() const;
902 /** Windows may set a hint asking the desktop environment not to display
903 * the window in the task bar. This function sets this hint.
906 * @param setting <tt>true</tt> to keep this window from appearing in the task bar.
908 void set_skip_taskbar_hint(bool setting = true);
910 /** Gets the value set by set_skip_taskbar_hint()
911 * @return <tt>true</tt> if window shouldn't be in taskbar
915 bool get_skip_taskbar_hint() const;
918 /** Windows may set a hint asking the desktop environment not to display
919 * the window in the pager. This function sets this hint.
920 * (A "pager" is any desktop navigation tool such as a workspace
921 * switcher that displays a thumbnail representation of the windows
925 * @param setting <tt>true</tt> to keep this window from appearing in the pager.
927 void set_skip_pager_hint(bool setting = true);
929 /** Gets the value set by set_skip_pager_hint().
930 * @return <tt>true</tt> if window shouldn't be in pager
934 bool get_skip_pager_hint() const;
937 /** Windows may set a hint asking the desktop environment to draw
938 * the users attention to the window. This function sets this hint.
941 * @param setting <tt>true</tt> to mark this window as urgent.
943 void set_urgency_hint(bool setting = true);
945 /** Gets the value set by set_urgency_hint()
946 * @return <tt>true</tt> if window is urgent
950 bool get_urgency_hint() const;
953 /** Windows may set a hint asking the desktop environment not to receive
954 * the input focus. This function sets this hint.
957 * @param setting <tt>true</tt> to let this window receive input focus.
959 void set_accept_focus(bool setting = true);
961 /** Gets the value set by set_accept_focus().
962 * @return <tt>true</tt> if window should receive the input focus
966 bool get_accept_focus() const;
968 /** Windows may set a hint asking the desktop environment not to receive
969 * the input focus when the window is mapped. This function sets this
973 * @param setting <tt>true</tt> to let this window receive input focus on map.
975 void set_focus_on_map(bool setting = true);
977 /** Gets the value set by set_focus_on_map().
978 * @return <tt>true</tt> if window should receive the input focus when
983 bool get_focus_on_map() const;
985 //_WRAP_METHOD(void set_destroy_with_parent(bool setting = true), gtk_window_set_destroy_with_parent)
986 // I don't that that this is ever a good thing for C++.murrayc.
989 /** Return value: <tt>true</tt> if the window will be destroyed with its transient parent.
990 * @return <tt>true</tt> if the window will be destroyed with its transient parent.
992 bool get_destroy_with_parent() const;
993 // I don't that that this is ever a good thing for C++.murrayc.
996 /** Sets whether the user can resize a window. Windows are user resizable
998 * @param resizable <tt>true</tt> if the user can resize this window.
1000 void set_resizable(bool resizable = true);
1003 /** Gets the value set by set_resizable().
1004 * @return <tt>true</tt> if the user can resize the window.
1006 bool get_resizable() const;
1009 /** Window gravity defines the meaning of coordinates passed to
1010 * move(). See move() and Gdk::Gravity for
1013 * The default window gravity is Gdk::GRAVITY_NORTH_WEST which will
1014 * typically "do what you mean."
1015 * @param gravity Window gravity.
1017 void set_gravity(Gdk::Gravity gravity);
1020 /** Gets the value set by set_gravity().
1021 * @return Window gravity.
1023 Gdk::Gravity get_gravity() const;
1026 /** This function sets up hints about how a window can be resized by
1027 * the user. You can set a minimum and maximum size; allowed resize
1028 * increments (e.g. for xterm, you can only resize by the size of a
1029 * character); aspect ratios; and more. See the Gdk::Geometry struct.
1030 * @param geometry_widget Widget the geometry hints will be applied to.
1031 * @param geometry Struct containing geometry information.
1032 * @param geom_mask Mask indicating which struct fields should be paid attention to.
1034 void set_geometry_hints(Widget& geometry_widget,
1035 const Gdk::Geometry& geometry,
1036 Gdk::WindowHints geom_mask);
1039 /** Sets the Gdk::Screen where the @a window is displayed; if
1040 * the window is already mapped, it will be unmapped, and
1041 * then remapped on the new screen.
1044 * @param screen A Gdk::Screen.
1046 void set_screen(const Glib::RefPtr<Gdk::Screen>& screen);
1049 /** Return value: a Gdk::Screen.
1050 * @return A Gdk::Screen.
1054 Glib::RefPtr<Gdk::Screen> get_screen();
1056 /** Return value: a Gdk::Screen.
1057 * @return A Gdk::Screen.
1061 Glib::RefPtr<const Gdk::Screen> get_screen() const;
1064 /** (Note: this is a special-purpose function for the framebuffer port,
1065 * that causes GTK+ to draw its own window border. For most applications,
1066 * you want set_decorated() instead, which tells the window
1067 * manager whether to draw the window border.)
1069 * If this function is called on a window with setting of <tt>true</tt>, before
1070 * it is realized or showed, it will have a "frame" window around
1071 * @a window ->window, accessible in @a window ->frame. Using the signal
1072 * frame_event you can receive all events targeted at the frame.
1074 * This function is used by the linux-fb port to implement managed
1075 * windows, but it could conceivably be used by X-programs that
1076 * want to do their own window decorations.
1077 * @param setting A boolean.
1079 void set_has_frame(bool setting = true);
1082 /** Accessor for whether the window has a frame window exterior to
1083 * @a window ->window. Gets the value set by set_has_frame().
1084 * @return <tt>true</tt> if a frame has been added to the window
1085 * via set_has_frame().
1087 bool get_has_frame() const;
1090 /** (Note: this is a special-purpose function intended for the framebuffer
1091 * port; see set_has_frame(). It will have no effect on the
1092 * window border drawn by the window manager, which is the normal
1093 * case when using the X %Window system.)
1095 * For windows with frames (see set_has_frame()) this function
1096 * can be used to change the size of the frame border.
1097 * @param left The width of the left border.
1098 * @param top The height of the top border.
1099 * @param right The width of the right border.
1100 * @param bottom The height of the bottom border.
1102 void set_frame_dimensions(int left, int top,
1103 int right, int bottom);
1106 /** (Note: this is a special-purpose function intended for the
1107 * framebuffer port; see set_has_frame(). It will not
1108 * return the size of the window border drawn by the window manager, which is the normal
1109 * case when using a windowing system. See
1110 * gdk_window_get_frame_extents() to get the standard window border
1113 * Retrieves the dimensions of the frame window for this toplevel.
1114 * See set_has_frame(), set_frame_dimensions().
1115 * @param left Location to store the width of the frame at the left.
1116 * @param top Location to store the height of the frame at the top.
1117 * @param right Location to store the width of the frame at the returns.
1118 * @param bottom Location to store the height of the frame at the bottom.
1120 void get_frame_dimensions(int& left, int& top,
1121 int& right, int& bottom) const;
1124 /** By default, windows are decorated with a title bar, resize
1125 * controls, etc. Some window
1126 * managers allow GTK+ to disable these decorations, creating a
1127 * borderless window. If you set the decorated property to <tt>false</tt>
1128 * using this function, GTK+ will do its best to convince the window
1129 * manager not to decorate the window. Depending on the system, this
1130 * function may not have any effect when called on a window that is
1131 * already visible, so you should call it before calling gtk_window_show().
1133 * On Windows, this function always works, since there's no window manager
1135 * @param setting <tt>true</tt> to decorate the window.
1137 void set_decorated(bool setting = true);
1139 /** Return value: <tt>true</tt> if the window has been set to have decorations
1140 * @return <tt>true</tt> if the window has been set to have decorations.
1142 bool get_decorated() const;
1145 /** By default, windows have a close button in the window frame. Some
1146 * window managers allow GTK+ to
1147 * disable this button. If you set the deletable property to <tt>false</tt>
1148 * using this function, GTK+ will do its best to convince the window
1149 * manager not to show a close button. Depending on the system, this
1150 * function may not have any effect when called on a window that is
1151 * already visible, so you should call it before calling gtk_window_show().
1153 * On Windows, this function always works, since there's no window manager
1157 * @param setting <tt>true</tt> to decorate the window as deletable.
1159 void set_deletable(bool setting = true);
1161 /** Return value: <tt>true</tt> if the window has been set to have a close button
1162 * @return <tt>true</tt> if the window has been set to have a close button
1166 bool get_deletable() const;
1169 /** Retrieves the list of icons set by set_icon_list().
1170 * The list is copied, but the reference count on each
1171 * member won't be incremented.
1172 * @return Copy of window's icon list.
1174 Glib::ListHandle< Glib::RefPtr<Gdk::Pixbuf> > get_icon_list();
1176 /** Retrieves the list of icons set by set_icon_list().
1177 * The list is copied, but the reference count on each
1178 * member won't be incremented.
1179 * @return Copy of window's icon list.
1181 Glib::ListHandle< Glib::RefPtr<const Gdk::Pixbuf> > get_icon_list() const;
1184 /** Sets up the icon representing a Gtk::Window. The icon is used when
1185 * the window is minimized (also known as iconified). Some window
1186 * managers or desktop environments may also place it in the window
1187 * frame, or display it in other contexts.
1189 * set_icon_list() allows you to pass in the same icon in
1190 * several hand-drawn sizes. The list should contain the natural sizes
1191 * your icon is available in; that is, don't scale the image before
1192 * passing it to GTK+. Scaling is postponed until the last minute,
1193 * when the desired final size is known, to allow best quality.
1195 * By passing several sizes, you may improve the final image quality
1196 * of the icon, by reducing or eliminating automatic image scaling.
1198 * Recommended sizes to provide: 16x16, 32x32, 48x48 at minimum, and
1199 * larger images (64x64, 128x128) if you have them.
1201 * See also set_default_icon_list() to set the icon
1202 * for all windows in your application in one go.
1204 * Note that transient windows (those who have been set transient for another
1205 * window using set_transient_for()) will inherit their
1206 * icon from their transient parent. So there's no need to explicitly
1207 * set the icon on transient windows.
1208 * @param list List of Gdk::Pixbuf.
1210 void set_icon_list(const Glib::ListHandle< Glib::RefPtr<Gdk::Pixbuf> >& list);
1213 /** Sets up the icon representing a Gtk::Window. This icon is used when
1214 * the window is minimized (also known as iconified). Some window
1215 * managers or desktop environments may also place it in the window
1216 * frame, or display it in other contexts.
1218 * The icon should be provided in whatever size it was naturally
1219 * drawn; that is, don't scale the image before passing it to
1220 * GTK+. Scaling is postponed until the last minute, when the desired
1221 * final size is known, to allow best quality.
1223 * If you have your icon hand-drawn in multiple sizes, use
1224 * set_icon_list(). Then the best size will be used.
1226 * This function is equivalent to calling set_icon_list()
1227 * with a 1-element list.
1229 * See also set_default_icon_list() to set the icon
1230 * for all windows in your application in one go.
1231 * @param icon Icon image, or <tt>0</tt>.
1233 void set_icon(const Glib::RefPtr<Gdk::Pixbuf>& icon);
1236 /** Sets the icon for the window.
1238 * This function is equivalent to calling set_icon()
1239 * with a pixbuf created by loading the image from @a filename .
1240 * @param filename Location of icon file.
1241 * @return <tt>true</tt> if setting the icon succeeded.
1245 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1246 bool set_icon_from_file(const std::string& filename);
1248 bool set_icon_from_file(const std::string& filename, std::auto_ptr<Glib::Error>& error);
1249 #endif //GLIBMM_EXCEPTIONS_ENABLED
1252 /** Gets the value set by set_icon() (or if you've
1253 * called set_icon_list(), gets the first icon in
1255 * @return Icon for window.
1257 Glib::RefPtr<Gdk::Pixbuf> get_icon();
1259 /** Gets the value set by set_icon() (or if you've
1260 * called set_icon_list(), gets the first icon in
1262 * @return Icon for window.
1264 Glib::RefPtr<const Gdk::Pixbuf> get_icon() const;
1267 /** Sets an icon list to be used as fallback for windows that haven't
1268 * had set_icon_list() called on them to set up a
1269 * window-specific icon list. This function allows you to set up the
1270 * icon for all windows in your app at once.
1272 * See set_icon_list() for more details.
1273 * @param list A list of Gdk::Pixbuf.
1275 static void set_default_icon_list(
1276 const Glib::ListHandle< Glib::RefPtr<Gdk::Pixbuf> >& list);
1279 /** Gets the value set by Gtk::Window::set_default_icon_list().
1280 * @return Copy of default icon list.
1282 static Glib::ListHandle< Glib::RefPtr<Gdk::Pixbuf> > get_default_icon_list();
1285 /** Sets an icon to be used as fallback for windows that haven't
1286 * had set_icon() called on them from a pixbuf.
1289 * @param icon The icon.
1291 static void set_default_icon(const Glib::RefPtr<Gdk::Pixbuf>& icon);
1293 /** Sets an icon to be used as fallback for windows that haven't
1294 * had set_icon_list() called on them from a named
1295 * themed icon, see set_icon_name().
1298 * @param name The name of the themed icon.
1300 static void set_default_icon_name(const Glib::ustring& name);
1302 /** Sets an icon to be used as fallback for windows that haven't
1303 * had set_icon_list() called on them from a file
1304 * on disk. Warns on failure if @a err is <tt>0</tt>.
1305 * @param filename Location of icon file.
1306 * @return <tt>true</tt> if setting the icon succeeded.
1310 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1311 static bool set_default_icon_from_file(const std::string& filename);
1313 static bool set_default_icon_from_file(const std::string& filename, std::auto_ptr<Glib::Error>& error);
1314 #endif //GLIBMM_EXCEPTIONS_ENABLED
1317 /** By default, after showing the first Gtk::Window, GTK+ calls
1318 * gdk_notify_startup_complete(). Call this function to disable
1319 * the automatic startup notification. You might do this if your
1320 * first window is a splash screen, and you want to delay notification
1321 * until after your real main window has been shown, for example.
1323 * In that example, you would disable startup notification
1324 * temporarily, show your splash screen, then re-enable it so that
1325 * showing the main window would automatically result in notification.
1328 * @param setting <tt>true</tt> to automatically do startup notification.
1330 static void set_auto_startup_notification(bool setting = true);
1333 /** Sets a window modal or non-modal. Modal windows prevent interaction
1334 * with other windows in the same application. To keep modal dialogs
1335 * on top of main application windows, use
1336 * set_transient_for() to make the dialog transient for the
1337 * parent; most window managers
1338 * will then disallow lowering the dialog below the parent.
1339 * @param modal Whether the window is modal.
1341 void set_modal(bool modal = true);
1344 /** Return value: <tt>true</tt> if the window is set to be modal and
1345 * @return <tt>true</tt> if the window is set to be modal and
1346 * establishes a grab when shown.
1348 bool get_modal() const;
1351 /** Return value: list of toplevel widgets
1352 * @return List of toplevel widgets.
1354 static Glib::ListHandle<Window*> list_toplevels();
1357 /** Adds a mnemonic to this window.
1358 * @param keyval The mnemonic.
1359 * @param target The widget that gets activated by the mnemonic.
1361 void add_mnemonic(guint keyval, Widget& target);
1364 /** Removes a mnemonic from this window.
1365 * @param keyval The mnemonic.
1366 * @param target The widget that gets activated by the mnemonic.
1368 void remove_mnemonic(guint keyval, Widget& target);
1371 /** Activates the targets associated with the mnemonic.
1372 * @param keyval The mnemonic.
1373 * @param modifier The modifiers.
1374 * @return <tt>true</tt> if the activation is done.
1376 bool mnemonic_activate(guint keyval, Gdk::ModifierType modifier);
1379 /** Sets the mnemonic modifier for this window.
1380 * @param modifier The modifier mask used to activate
1381 * mnemonics on this window.
1383 void set_mnemonic_modifier(Gdk::ModifierType modifier);
1386 /** Return value: the modifier mask used to activate
1387 * @return The modifier mask used to activate
1388 * mnemonics on this window.
1390 Gdk::ModifierType get_mnemonic_modifier();
1393 /** Presents a window to the user. This may mean raising the window
1394 * in the stacking order, deiconifying it, moving it to the current
1395 * desktop, and/or giving it the keyboard focus, possibly dependent
1396 * on the user's platform, window manager, and preferences.
1398 * If @a window is hidden, this function calls Gtk::Widget::show()
1401 * This function should be used when the user tries to open a window
1402 * that's already open. Say for example the preferences dialog is
1403 * currently open, and the user chooses Preferences from the menu
1404 * a second time; use present() to move the already-open dialog
1405 * where the user can see it.
1407 * If you are calling this function in response to a user interaction,
1408 * it is preferable to use present_with_time().
1412 /** Presents a window to the user in response to a user interaction.
1413 * If you need to present a window without a timestamp, use
1414 * present(). See present() for details.
1417 * @param timestamp The timestamp of the user interaction (typically a
1418 * button or key press event) which triggered this call.
1420 void present(guint32 timestamp);
1423 /** Asks to iconify (i.e.\ minimize) the specified @a window . Note that
1424 * you shouldn't assume the window is definitely iconified afterward,
1425 * because other entities (e.g. the user or window manager) could deiconify it
1426 * again, or there may not be a window manager in which case
1427 * iconification isn't possible, etc. But normally the window will end
1428 * up iconified. Just don't write code that crashes if not.
1430 * It's permitted to call this function before showing a window,
1431 * in which case the window will be iconified before it ever appears
1434 * You can track iconification via the "window_state_event" signal
1439 /** Asks to deiconify (i.e.\ unminimize) the specified @a window . Note
1440 * that you shouldn't assume the window is definitely deiconified
1441 * afterward, because other entities (e.g. the user or window manager) could iconify it
1442 * again before your code which assumes deiconification gets to run.
1444 * You can track iconification via the "window_state_event" signal
1450 /** Asks to stick @a window , which means that it will appear on all user
1451 * desktops. Note that you shouldn't assume the window is definitely
1452 * stuck afterward, because other entities (e.g. the user or window manager) could unstick it
1453 * again, and some window managers do not support sticking
1454 * windows. But normally the window will end up stuck. Just don't
1455 * write code that crashes if not.
1457 * It's permitted to call this function before showing a window.
1459 * You can track stickiness via the "window_state_event" signal
1464 /** Asks to unstick @a window , which means that it will appear on only
1465 * one of the user's desktops. Note that you shouldn't assume the
1466 * window is definitely unstuck afterward, because other entities
1467 * (e.g. the user or window
1468 * manager) could stick it again. But normally the window will
1469 * end up stuck. Just don't write code that crashes if not.
1471 * You can track stickiness via the "window_state_event" signal
1477 /** Asks to maximize @a window , so that it becomes full-screen. Note that
1478 * you shouldn't assume the window is definitely maximized afterward,
1479 * because other entities (e.g. the user or window manager) could unmaximize it
1480 * again, and not all window managers support maximization. But
1481 * normally the window will end up maximized. Just don't write code
1482 * that crashes if not.
1484 * It's permitted to call this function before showing a window,
1485 * in which case the window will be maximized when it appears onscreen
1488 * You can track maximization via the "window_state_event" signal
1493 /** Asks to unmaximize @a window . Note that you shouldn't assume the
1494 * window is definitely unmaximized afterward, because other entities
1495 * (e.g. the user or window
1496 * manager) could maximize it again, and not all window
1497 * managers honor requests to unmaximize. But normally the window will
1498 * end up unmaximized. Just don't write code that crashes if not.
1500 * You can track maximization via the "window_state_event" signal
1506 /** Asks to place @a window in the fullscreen state. Note that you
1507 * shouldn't assume the window is definitely full screen afterward,
1508 * because other entities (e.g. the user or window manager) could unfullscreen it
1509 * again, and not all window managers honor requests to fullscreen
1510 * windows. But normally the window will end up fullscreen. Just
1511 * don't write code that crashes if not.
1513 * You can track the fullscreen state via the "window_state_event" signal
1520 /** Asks to toggle off the fullscreen state for @a window . Note that you
1521 * shouldn't assume the window is definitely not full screen
1522 * afterward, because other entities (e.g. the user or window manager) could fullscreen it
1523 * again, and not all window managers honor requests to unfullscreen
1524 * windows. But normally the window will end up restored to its normal
1525 * state. Just don't write code that crashes if not.
1527 * You can track the fullscreen state via the "window_state_event" signal
1532 void unfullscreen();
1535 /** Starts resizing a window. This function is used if an application
1536 * has window resizing controls. When GDK can support it, the resize
1537 * will be done using the standard mechanism for the window manager or windowing
1538 * system. Otherwise, GDK will try to emulate window resizing,
1539 * potentially not all that well, depending on the windowing system.
1540 * @param button Mouse button that initiated the drag.
1541 * @param edge Position of the resize control.
1542 * @param root_x X position where the user clicked to initiate the drag, in root window coordinates.
1543 * @param root_y Y position where the user clicked to initiate the drag.
1544 * @param timestamp Timestamp from the click event that initiated the drag.
1546 void begin_resize_drag(Gdk::WindowEdge edge,
1547 int button, int root_x, int root_y, guint32 timestamp);
1550 /** Starts moving a window. This function is used if an application has
1551 * window movement grips. When GDK can support it, the window movement
1552 * will be done using the standard mechanism for the window manager or windowing
1553 * system. Otherwise, GDK will try to emulate window movement,
1554 * potentially not all that well, depending on the windowing system.
1555 * @param button Mouse button that initiated the drag.
1556 * @param root_x X position where the user clicked to initiate the drag, in root window coordinates.
1557 * @param root_y Y position where the user clicked to initiate the drag.
1558 * @param timestamp Timestamp from the click event that initiated the drag.
1560 void begin_move_drag(
1561 int button, int root_x, int root_y, guint32 timestamp);
1564 /** Sets the default size of a window. If the window's "natural" size
1565 * (its size request) is larger than the default, the default will be
1566 * ignored. More generally, if the default size does not obey the
1567 * geometry hints for the window (set_geometry_hints() can
1568 * be used to set these explicitly), the default size will be clamped
1569 * to the nearest permitted size.
1571 * Unlike Gtk::Widget::set_size_request(), which sets a size request for
1572 * a widget and thus would keep users from shrinking the window, this
1573 * function only sets the initial size, just as if the user had
1574 * resized the window themselves. Users can still shrink the window
1575 * again as they normally would. Setting a default size of -1 means to
1576 * use the "natural" default size (the size request of the window).
1578 * For more control over a window's initial size and how resizing works,
1579 * investigate set_geometry_hints().
1581 * For some uses, resize() is a more appropriate function.
1582 * resize() changes the current size of the window, rather
1583 * than the size to be used on initial display. resize() always
1584 * affects the window itself, not the geometry widget.
1586 * The default size of a window only affects the first time a window is
1587 * shown; if a window is hidden and re-shown, it will remember the size
1588 * it had prior to hiding, rather than using the default size.
1590 * Windows can't actually be 0x0 in size, they must be at least 1x1, but
1591 * passing 0 for @a width and @a height is OK, resulting in a 1x1 default size.
1592 * @param width Width in pixels, or -1 to unset the default width.
1593 * @param height Height in pixels, or -1 to unset the default height.
1595 void set_default_size(int width, int height);
1598 /** Gets the default size of the window. A value of -1 for the width or
1599 * height indicates that a default size has not been explicitly set
1600 * for that dimension, so the "natural" size of the window will be
1602 * @param width Location to store the default width.
1603 * @param height Location to store the default height.
1605 void get_default_size(int& width, int& height) const;
1608 /** Resizes the window as if the user had done so, obeying geometry
1609 * constraints. The default geometry constraint is that windows may
1610 * not be smaller than their size request; to override this
1611 * constraint, call Gtk::Widget::set_size_request() to set the window's
1612 * request to a smaller value.
1614 * If resize() is called before showing a window for the
1615 * first time, it overrides any default size set with
1616 * set_default_size().
1618 * Windows may not be resized smaller than 1 by 1 pixels.
1619 * @param width Width in pixels to resize the window to.
1620 * @param height Height in pixels to resize the window to.
1622 void resize(int width, int height);
1625 /** Obtains the current size of @a window . If @a window is not onscreen,
1626 * it returns the size GTK+ will suggest to the window manager for the initial window
1627 * size (but this is not reliably the same as the size the window
1628 * manager will actually select). The size obtained by
1629 * get_size() is the last size received in a
1630 * Gdk::EventConfigure, that is, GTK+ uses its locally-stored size,
1631 * rather than querying the X server for the size. As a result, if you
1632 * call resize() then immediately call
1633 * get_size(), the size won't have taken effect yet. After
1634 * the window manager processes the resize request, GTK+ receives
1635 * notification that the size has changed via a configure event, and
1636 * the size of the window gets updated.
1638 * @note Nearly any use of this function creates a race condition,
1639 * because the size of the window may change between the time that you
1640 * get the size and the time that you perform some action assuming
1641 * that size is the current size. To avoid race conditions, connect to
1642 * "configure_event" on the window and adjust your size-dependent
1643 * state to match the size delivered in the Gdk::EventConfigure.
1645 * @note The returned size does <em>not</em> include the
1646 * size of the window manager decorations (aka the window frame or
1647 * border). Those are not drawn by GTK+ and GTK+ has no reliable
1648 * method of determining their size.
1650 * @note If you are getting a window size in order to position
1651 * the window onscreen, there may be a better way. The preferred
1652 * way is to simply set the window's semantic type with
1653 * set_type_hint(), which allows the window manager to
1654 * e.g. center dialogs. Also, if you set the transient parent of
1655 * dialogs with set_transient_for() window managers
1656 * will often center the dialog over its parent window. It's
1657 * much preferred to let the window manager handle these
1658 * things rather than doing it yourself, because all apps will
1659 * behave consistently and according to user prefs if the window
1660 * manager handles it. Also, the window manager can take the size
1661 * of the window decorations/border into account, while your
1662 * application cannot.
1664 * In any case, if you insist on application-specified window
1665 * positioning, there's <em>still</em> a better way than
1666 * doing it yourself - set_position() will frequently
1667 * handle the details for you.
1668 * @param width Return location for width.
1669 * @param height Return location for height.
1671 void get_size(int& width, int& height) const;
1674 /** Asks the window manager to move
1675 * @a window to the given position. %Window managers are free to ignore
1676 * this; most window managers ignore requests for initial window
1677 * positions (instead using a user-defined placement algorithm) and
1678 * honor requests after the window has already been shown.
1680 * @note the position is the position of the gravity-determined
1681 * reference point for the window. The gravity determines two things:
1682 * first, the location of the reference point in root window
1683 * coordinates; and second, which point on the window is positioned at
1684 * the reference point.
1686 * By default the gravity is Gdk::GRAVITY_NORTH_WEST, so the reference
1687 * point is simply the @a x , @a y supplied to move(). The
1688 * top-left corner of the window decorations (aka window frame or
1689 * border) will be placed at @a x , @a y . Therefore, to position a window
1690 * at the top left of the screen, you want to use the default gravity
1691 * (which is Gdk::GRAVITY_NORTH_WEST) and move the window to 0,0.
1693 * To position a window at the bottom right corner of the screen, you
1694 * would set Gdk::GRAVITY_SOUTH_EAST, which means that the reference
1695 * point is at @a x + the window width and @a y + the window height, and
1696 * the bottom-right corner of the window border will be placed at that
1697 * reference point. So, to place a window in the bottom right corner
1698 * you would first set gravity to south east, then write:
1699 * <tt>gtk_window_move (window, gdk_screen_width() - window_width,
1700 * gdk_screen_height() - window_height)</tt> (note that this
1701 * example does not take multi-head scenarios into account).
1703 * The Extended Window Manager Hints specification at
1704 * http://www.freedesktop.org/Standards/wm-spec has a
1705 * nice table of gravities in the "implementation notes" section.
1707 * The get_position() documentation may also be relevant.
1708 * @param x X coordinate to move window to.
1709 * @param y Y coordinate to move window to.
1711 void move(int x, int y);
1714 /** This function returns the position you need to pass to
1715 * move() to keep @a window in its current position. This
1716 * means that the meaning of the returned value varies with window
1717 * gravity. See move() for more details.
1719 * If you haven't changed the window gravity, its gravity will be
1720 * Gdk::GRAVITY_NORTH_WEST. This means that get_position()
1721 * gets the position of the top-left corner of the window manager
1722 * frame for the window. move() sets the position of this
1723 * same top-left corner.
1725 * get_position() is not 100% reliable because the X %Window System
1726 * does not specify a way to obtain the geometry of the
1727 * decorations placed on a window by the window manager.
1728 * Thus GTK+ is using a "best guess" that works with most
1731 * Moreover, nearly all window managers are historically broken with
1732 * respect to their handling of window gravity. So moving a window to
1733 * its current position as returned by get_position() tends
1734 * to result in moving the window slightly. %Window managers are
1735 * slowly getting better over time.
1737 * If a window has gravity Gdk::GRAVITY_STATIC the window manager
1738 * frame is not relevant, and thus get_position() will
1739 * always produce accurate results. However you can't use static
1740 * gravity to do things like place a window in a corner of the screen,
1741 * because static gravity ignores the window manager decorations.
1743 * If you are saving and restoring your application's window
1744 * positions, you should know that it's impossible for applications to
1745 * do this without getting it somewhat wrong because applications do
1746 * not have sufficient knowledge of window manager state. The Correct
1747 * Mechanism is to support the session management protocol (see the
1748 * "GnomeClient" object in the GNOME libraries for example) and allow
1749 * the window manager to save your window sizes and positions.
1750 * @param root_x Return location for X coordinate of gravity-determined reference point.
1751 * @param root_y Return location for Y coordinate of gravity-determined reference point.
1753 void get_position(int& root_x, int& root_y) const;
1756 /** Parses a standard X %Window System geometry string - see the
1757 * manual page for X (type 'man X') for details on this.
1758 * parse_geometry() does work on all GTK+ ports
1759 * including Win32 but is primarily intended for an X environment.
1761 * If either a size or a position can be extracted from the
1762 * geometry string, parse_geometry() returns <tt>true</tt>
1763 * and calls set_default_size() and/or move()
1764 * to resize/move the window.
1766 * If parse_geometry() returns <tt>true</tt>, it will also
1767 * set the Gdk::HINT_USER_POS and/or Gdk::HINT_USER_SIZE hints
1768 * indicating to the window manager that the size/position of
1769 * the window was user-specified. This causes most window
1770 * managers to honor the geometry.
1772 * Note that for parse_geometry() to work as expected, it has
1773 * to be called when the window has its "final" size, i.e. after calling
1774 * Gtk::Widget::show_all() on the contents and set_geometry_hints()
1778 * #include <gtk/gtk.h>
1781 * fill_with_content (GtkWidget *vbox)
1783 * /<!-- -->* fill with content... *<!-- -->/
1787 * main (int argc, char *argv[])
1789 * GtkWidget *window, *vbox;
1790 * GdkGeometry size_hints = {
1791 * 100, 50, 0, 0, 100, 50, 10, 10, 0.0, 0.0, GDK_GRAVITY_NORTH_WEST
1794 * gtk_init (&argc, &argv);
1796 * window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
1797 * vbox = gtk_vbox_new (<tt>false</tt>, 0);
1799 * gtk_container_add (GTK_CONTAINER (window), vbox);
1800 * fill_with_content (vbox);
1801 * gtk_widget_show_all (vbox);
1803 * gtk_window_set_geometry_hints (GTK_WINDOW (window),
1806 * GDK_HINT_MIN_SIZE |
1807 * GDK_HINT_BASE_SIZE |
1808 * GDK_HINT_RESIZE_INC);
1812 * if (!gtk_window_parse_geometry (GTK_WINDOW (window), argv[1]))
1813 * fprintf (stderr, "Failed to parse '%s'<tt>\\n</tt>", argv[1]);
1816 * gtk_widget_show_all (window);
1822 * @param geometry Geometry string.
1823 * @return <tt>true</tt> if string was parsed successfully.
1825 bool parse_geometry(const Glib::ustring& geometry);
1828 /** Returns: the Gtk::WindowGroup for a window or the default group
1829 * @return The Gtk::WindowGroup for a window or the default group
1833 Glib::RefPtr<WindowGroup> get_group();
1835 /** Returns: the Gtk::WindowGroup for a window or the default group
1836 * @return The Gtk::WindowGroup for a window or the default group
1840 Glib::RefPtr<const WindowGroup> get_group() const;
1843 /** Hides @a window , then reshows it, resetting the
1844 * default size and position of the window. Used
1845 * by GUI builders only.
1847 void reshow_with_initial_size();
1850 /** Asks to keep @a window above, so that it stays on top. Note that
1851 * you shouldn't assume the window is definitely above afterward,
1852 * because other entities (e.g. the user or window manager) could not keep it above,
1853 * and not all window managers support keeping windows above. But
1854 * normally the window will end kept above. Just don't write code
1855 * that crashes if not.
1857 * It's permitted to call this function before showing a window,
1858 * in which case the window will be kept above when it appears onscreen
1861 * You can track the above state via the "window_state_event" signal
1864 * Note that, according to the Extended Window
1865 * Manager Hints specification, the above state is mainly meant
1866 * for user preferences and should not be used by applications e.g. for
1867 * drawing attention to their dialogs.
1870 * @param setting Whether to keep @a window above other windows.
1872 void set_keep_above(bool setting = true);
1874 /** Asks to keep @a window below, so that it stays in bottom. Note that
1875 * you shouldn't assume the window is definitely below afterward,
1876 * because other entities (e.g. the user or window manager) could not keep it below,
1877 * and not all window managers support putting windows below. But
1878 * normally the window will be kept below. Just don't write code
1879 * that crashes if not.
1881 * It's permitted to call this function before showing a window,
1882 * in which case the window will be kept below when it appears onscreen
1885 * You can track the below state via the "window_state_event" signal
1888 * Note that, according to the Extended Window
1889 * Manager Hints specification, the above state is mainly meant
1890 * for user preferences and should not be used by applications e.g. for
1891 * drawing attention to their dialogs.
1894 * @param setting Whether to keep @a window below other windows.
1896 void set_keep_below(bool setting = true);
1899 /** Returns a default accel group for this window
1900 * This is a gtkmm-specific function. This accel group can not
1903 Glib::RefPtr<AccelGroup> get_accel_group();
1905 /** Brings the window to the front.
1906 * This is just a more obvious convenience wrapper for get_window()->raise().
1908 virtual void raise();
1910 ///Overriden to warn that it doesn't make sense to use Gtk::manage() on this class because it has no parent container.
1911 virtual void set_manage();
1915 //See comments in the implementations:
1917 void _destroy_c_instance();
1921 //We'll create an accel_group if it's requested, and remember it.
1922 //Otherwise, you'd have to create it, add it to the window, then remember it somewhere else while you add it to other widgets.
1923 Glib::RefPtr<AccelGroup> accel_group_;
1934 /** A Glib::wrap() method for this object.
1936 * @param object The C instance.
1937 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
1938 * @result A C++ instance that wraps this C instance.
1940 * @relates Gtk::WindowGroup
1942 Glib::RefPtr<Gtk::WindowGroup> wrap(GtkWindowGroup* object, bool take_copy = false);
1948 /** A Glib::wrap() method for this object.
1950 * @param object The C instance.
1951 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
1952 * @result A C++ instance that wraps this C instance.
1954 * @relates Gtk::Window
1956 Gtk::Window* wrap(GtkWindow* object, bool take_copy = false);
1960 #endif /* _GTKMM_WINDOW_H */