GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

window.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00024 00025 #ifndef GFC_GTK_WINDOW_HH 00026 #define GFC_GTK_WINDOW_HH 00027 00028 #ifndef GFC_GTK_BIN_HH 00029 #include <gfc/gtk/bin.hh> 00030 #endif 00031 00032 #ifndef __GTK_WINDOW_H__ 00033 #include <gtk/gtkwindow.h> 00034 #endif 00035 00036 namespace GFC { 00037 00038 namespace G { 00039 class Error; 00040 } 00041 00042 namespace Gdk { 00043 class Geometry; 00044 class Pixbuf; 00045 class Screen; 00046 } 00047 00048 namespace Gtk { 00049 00050 class WindowGroup; 00051 00061 00062 class Window : public Bin 00063 { 00064 friend class G::Object; 00065 00066 Window(const Window&); 00067 Window& operator=(const Window&); 00068 00069 protected: 00072 00073 explicit Window(GtkWindow *window, bool owns_reference = false); 00080 00084 00085 typedef G::Signal<void, Widget*> SetFocusSignalType; 00086 typedef G::SignalProxy<TypeInstance, SetFocusSignalType> SetFocusSignalProxy; 00087 static const SetFocusSignalType set_focus_signal; 00093 00094 typedef G::Signal<bool, const Gdk::Event&> FrameEventSignalType; 00095 typedef G::SignalProxy<TypeInstance, FrameEventSignalType> FrameEventSignalProxy; 00096 static const FrameEventSignalType frame_event_signal; 00103 00104 typedef G::Signal<void> KeysChangedSignalType; 00105 typedef G::SignalProxy<TypeInstance, KeysChangedSignalType> KeysChangedSignalProxy; 00106 static const KeysChangedSignalType keys_changed_signal; 00111 00113 00114 public: 00117 00118 explicit Window(WindowType type = WINDOW_TOPLEVEL); 00129 00130 virtual ~Window(); 00132 00136 00137 GtkWindow* gtk_window() const; 00139 00140 operator GtkWindow* () const; 00142 00143 bool is_toplevel() const; 00145 00146 bool is_popup() const; 00148 00149 bool is_active() const; 00158 00159 bool has_toplevel_focus() const; 00165 00166 String get_title() const; 00169 00170 String get_role() const; 00173 00174 Widget* get_focus() const; 00181 00182 Window* get_transient_for() const; 00185 00186 Gdk::WindowTypeHint get_type_hint() const; 00189 00190 bool get_skip_taskbar_hint() const; 00193 00194 bool get_accept_focus() const; 00197 00198 bool get_skip_pager_hint() const; 00201 00202 bool get_destroy_with_parent() const; 00205 00206 bool get_resizable() const; 00209 00210 Gdk::Gravity get_gravity() const; 00213 00214 Gdk::Screen* get_screen() const; 00216 00217 bool get_has_frame() const; 00221 00222 void get_frame_dimensions(int *left, int *top, int *right, int *bottom) const; 00234 00235 bool get_decorated() const; 00238 00239 bool get_icon_list(std::vector<Gdk::Pixbuf*>& icons) const; 00245 00246 Gdk::Pixbuf* get_icon() const; 00250 00251 bool get_modal() const; 00253 00254 Gdk::ModifierTypeField get_mnemonic_modifier() const; 00257 00258 void get_default_size(int *width, int *height) const; 00265 00266 void get_size(int *width, int *height) const; 00304 00305 void get_position(int *root_x, int *root_y) const; 00330 00331 Gdk::Point get_position() const; 00334 00338 00339 void set_title(const char *title); 00340 void set_title(const String& title); 00349 00350 void set_wmclass(const String& wmclass_name, const String& wmclass_class); 00361 00362 void set_role(const char *role); 00363 void set_role(const String& role); 00374 00375 AccelGroup* add_accel_group(AccelGroup *accel_group = 0); 00382 00383 void remove_accel_group(AccelGroup& accel_group); 00386 00387 void set_position(WindowPosition position); 00393 00394 bool activate_focus(); 00401 00402 void set_focus(Widget *focus); 00410 00411 void set_default(Widget *default_widget); 00421 00422 bool activate_default(); 00430 00431 void set_transient_for(Window *parent); 00438 00439 void set_type_hint(Gdk::WindowTypeHint hint); 00447 00448 void set_skip_taskbar_hint(bool setting); 00452 00453 void set_skip_pager_hint(bool setting); 00460 00461 void set_accept_focus(bool setting); 00465 00466 void set_destroy_with_parent(bool setting); 00473 00474 void set_resizable(bool resizable); 00479 00480 void set_gravity(Gdk::Gravity gravity); 00487 00488 void set_geometry_hints(Widget *geometry_widget, const Gdk::Geometry& geometry); 00497 00498 void set_screen(const Gdk::Screen& screen); 00502 00503 void set_has_frame(bool setting); 00517 00518 void set_frame_dimensions(int left, int top, int right, int bottom); 00528 00529 void set_decorated(bool setting); 00540 00541 void set_icon_list(std::vector<Gdk::Pixbuf*>& icons); 00561 00562 void set_icon(Gdk::Pixbuf& icon); 00576 00577 bool set_icon_from_file(const char *filename, G::Error *error = 0); 00578 bool set_icon_from_file(const String& filename, G::Error *error = 0); 00589 00590 void set_modal(bool modal); 00598 00599 void add_mnemonic(unsigned int keyval, Widget& target); 00603 00604 void remove_mnemonic(unsigned int keyval, Widget& target); 00608 00609 bool mnemonic_activate(unsigned int keyval, Gdk::ModifierTypeField modifier); 00614 00615 void set_mnemonic_modifier(Gdk::ModifierTypeField modifier); 00618 00619 bool activate_key(const Gdk::EventKey& event); 00627 00628 bool propagate_key_event(const Gdk::EventKey& event); 00638 00639 void present(); 00647 00648 void iconify(); 00657 00658 void deiconify(); 00664 00665 void stick(); 00673 00674 void unstick(); 00680 00681 void maximize(); 00689 00690 void unmaximize(); 00697 00698 void fullscreen(); 00705 00706 void unfullscreen(); 00713 00714 void set_keep_above(bool setting); 00730 00731 void set_keep_below(bool setting); 00747 00748 void begin_resize_drag(Gdk::WindowEdge edge, int button, int root_x, int root_y, unsigned int timestamp); 00762 00763 void begin_move_drag(int button, int root_x, int root_y, unsigned int timestamp); 00776 00777 void set_default_size(int width, int height); 00801 00802 void resize(int width, int height); 00812 00813 void move(int x, int y); 00838 00839 void move(const Gdk::Point& point); 00842 00843 bool parse_geometry(const char *geometry); 00844 bool parse_geometry(const String& geometry); 00857 00858 void reshow_with_initial_size(); 00861 00863 00864 static bool get_default_icon_list(std::vector<Gdk::Pixbuf*>& icons); 00871 00872 static bool list_toplevels(std::vector<Widget*>& toplevels); 00880 00881 static void set_default_icon_list(std::vector<Gdk::Pixbuf*>& icons); 00888 00889 static void set_default_icon(Gdk::Pixbuf& icon); 00893 00894 static bool set_default_icon_from_file(const String& filename, G::Error *error = 0); 00902 00903 static void set_auto_startup_notification(bool setting); 00914 00917 00918 const SetFocusSignalProxy sig_set_focus(); 00920 00921 const FrameEventSignalProxy sig_frame_event(); 00924 00925 const KeysChangedSignalProxy sig_keys_changed(); 00928 00930 }; 00931 00934 00935 class WindowGroup : public G::Object 00936 { 00937 friend class G::Object; 00938 00939 WindowGroup(const WindowGroup&); 00940 WindowGroup& operator=(const WindowGroup&); 00941 00942 protected: 00945 00946 explicit WindowGroup(GtkWindowGroup *group, bool owns_reference = false); 00953 00955 00956 public: 00959 00960 WindowGroup(); 00963 00964 virtual ~WindowGroup(); 00966 00970 00971 GtkWindowGroup* gtk_window_group() const; 00973 00974 operator GtkWindowGroup* () const; 00976 00980 00981 void add_window(Window& window); 00984 00985 void remove_window(Window& window); 00988 00990 }; 00991 00992 } // namespace Gtk 00993 00994 } // namespace GFC 00995 00996 #include <gfc/gtk/inline/window.inl> 00997 00998 #endif // GFC_GTK_CONTAINER_HH 00999

Generated on Tue Aug 24 00:34:33 2004 for GFC-UI by doxygen 1.3.8