Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# window.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002-2003 The Inti Development Team.
    00003  *  Copyright (C) 2000 Red Hat, Inc.
    00004  *
    00005  *  This program is free software; you can redistribute it and/or modify
    00006  *  it under the terms of the GNU General Public License as published by
    00007  *  the Free Software Foundation; either version 2 of the License, or
    00008  *  (at your option) any later version.
    00009  *
    00010  *  This program is distributed in the hope that it will be useful,
    00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00013  *  GNU Library General Public License for more details.
    00014  *
    00015  *  You should have received a copy of the GNU Library General Public License
    00016  *  along with this program; if not, write to the Free Software
    00017  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00018  */
    00019
    00025
    00026 #ifndef INTI_GTK_WINDOW_H
    00027 #define INTI_GTK_WINDOW_H
    00028
    00029 #ifndef INTI_GTK_BIN_H
    00030 #include <inti/gtk/bin.h>
    00031 #endif
    00032
    00033 #ifndef __GTK_WINDOW_H__
    00034 #include <gtk/gtkwindow.h>
    00035 #endif
    00036
    00037 namespace Inti {
    00038
    00039 namespace G {
    00040 class Error;
    00041 }
    00042
    00043 namespace Gdk {
    00044 class Geometry;
    00045 class Pixbuf;
    00046 class Screen;
    00047 }
    00048
    00049 namespace Gtk {
    00050
    00051 class WindowClass;
    00052 class WindowGroup;
    00053
    00063
    00064 class Window : public Bin
    00065 {
    00066         friend class G::Object;
    00067         friend class WindowClass;
    00068
    00069         Window(const Window&);
    00070         Window& operator=(const Window&);
    00071
    00072 protected:
    00075
    00076         explicit Window(GtkWindow *window, bool reference = false);
    00083
    00087
    00088         virtual void on_set_focus(Widget *focus);
    00091
    00092         virtual bool on_frame_event(const Gdk::Event& event);
    00102
    00103         virtual void on_keys_changed();
    00105
    00106         virtual bool on_delete_event(const Gdk::EventAny& event);
    00119
    00121 //  Properties
    00122
    00123         typedef G::Property<WindowType, int> TypePropertyType;
    00124         typedef G::PropertyProxy<G::Object, TypePropertyType> TypePropertyProxy;
    00125         static const TypePropertyType type_property;
    00126
    00127         typedef G::Property<String> TitlePropertyType;
    00128         typedef G::PropertyProxy<G::Object, TitlePropertyType> TitlePropertyProxy;
    00129         static const TitlePropertyType title_property;
    00130
    00131         typedef G::Property<bool> AllowShrinkPropertyType;
    00132         typedef G::PropertyProxy<G::Object, AllowShrinkPropertyType> AllowShrinkPropertyProxy;
    00133         static const AllowShrinkPropertyType allow_shrink_property;
    00134
    00135         typedef G::Property<bool> AllowGrowPropertyType;
    00136         typedef G::PropertyProxy<G::Object, AllowGrowPropertyType> AllowGrowPropertyProxy;
    00137         static const AllowGrowPropertyType allow_grow_property;
    00138
    00139         typedef G::Property<bool> ResizablePropertyType;
    00140         typedef G::PropertyProxy<G::Object, ResizablePropertyType> ResizablePropertyProxy;
    00141         static const ResizablePropertyType resizable_property;
    00142
    00143         typedef G::Property<bool> ModalPropertyType;
    00144         typedef G::PropertyProxy<G::Object, ModalPropertyType> ModalPropertyProxy;
    00145         static const ModalPropertyType modal_property;
    00146
    00147         typedef G::Property<WindowPosition, int> WindowPositionPropertyType;
    00148         typedef G::PropertyProxy<G::Object, WindowPositionPropertyType> WindowPositionPropertyProxy;
    00149         static const WindowPositionPropertyType window_position_property;
    00150
    00151         typedef G::Property<int> DefaultWidthPropertyType;
    00152         typedef G::PropertyProxy<G::Object, DefaultWidthPropertyType> DefaultWidthPropertyProxy;
    00153         static const DefaultWidthPropertyType default_width_property;
    00154
    00155         typedef G::Property<int> DefaultHeightPropertyType;
    00156         typedef G::PropertyProxy<G::Object, DefaultHeightPropertyType> DefaultHeightPropertyProxy;
    00157         static const DefaultHeightPropertyType default_height_property;
    00158
    00159         typedef G::Property<bool> DestroyWithParentPropertyType;
    00160         typedef G::PropertyProxy<G::Object, DestroyWithParentPropertyType> DestroyWithParentPropertyProxy;
    00161         static const DestroyWithParentPropertyType destroy_with_parent_property;
    00162
    00163         typedef G::Property<Gdk::Pixbuf*, G::Object*> IconPropertyType;
    00164         typedef G::PropertyProxy<G::Object, IconPropertyType> IconPropertyProxy;
    00165         static const IconPropertyType icon_property;
    00166
    00167         typedef G::Property<Gdk::Screen*, G::Object*> ScreenPropertyType;
    00168         typedef G::PropertyProxy<G::Object, ScreenPropertyType> ScreenPropertyProxy;
    00169         static const ScreenPropertyType screen_property;
    00170
    00171         typedef G::Property<bool> IsActivePropertyType;
    00172         typedef G::PropertyProxy<G::Object, IsActivePropertyType> IsActivePropertyProxy;
    00173         static const IsActivePropertyType is_active_property;
    00174
    00175         typedef G::Property<bool> HasToplevelFocusPropertyType;
    00176         typedef G::PropertyProxy<G::Object, HasToplevelFocusPropertyType> HasToplevelFocusPropertyProxy;
    00177         static const HasToplevelFocusPropertyType has_toplevel_focus_property;
    00178
    00179         typedef G::Property<Gdk::WindowTypeHint, int> TypeHintPropertyType;
    00180         typedef G::PropertyProxy<G::Object, TypeHintPropertyType> TypeHintPropertyProxy;
    00181         static const TypeHintPropertyType type_hint_property;
    00182
    00183         typedef G::Property<bool> SkipTaskbarHintPropertyType;
    00184         typedef G::PropertyProxy<G::Object, SkipTaskbarHintPropertyType> SkipTaskbarHintPropertyProxy;
    00185         static const SkipTaskbarHintPropertyType skip_taskbar_hint_property;
    00186
    00187         typedef G::Property<bool> SkipPagerHintPropertyType;
    00188         typedef G::PropertyProxy<G::Object, SkipPagerHintPropertyType> SkipPagerHintPropertyProxy;
    00189         static const SkipPagerHintPropertyType skip_pager_hint_property;
    00190
    00191 //  Signals
    00192
    00193         typedef G::Signal1<void, GtkWidget*> SetFocusSignalType;
    00194         typedef G::SignalProxy<TypeInstance, SetFocusSignalType> SetFocusSignalProxy;
    00195         static const SetFocusSignalType set_focus_signal;
    00196
    00197         typedef G::Signal1<bool, GdkEvent*> FrameEventSignalType;
    00198         typedef G::SignalProxy<TypeInstance, FrameEventSignalType> FrameEventSignalProxy;
    00199         static const FrameEventSignalType frame_event_signal;
    00200
    00201         typedef G::Signal0<void> KeysChangedSignalType;
    00202         typedef G::SignalProxy<TypeInstance, KeysChangedSignalType> KeysChangedSignalProxy;
    00203         static const KeysChangedSignalType keys_changed_signal;
    00204
    00205         typedef G::Signal1<bool, GdkEventAny*> DeleteEventSignalType;
    00206         typedef G::SignalProxy<TypeInstance, DeleteEventSignalType> DeleteEventSignalProxy;
    00207         static const DeleteEventSignalType delete_event_signal;
    00208
    00209 public:
    00212
    00213         explicit Window(WindowType type = WINDOW_TOPLEVEL);
    00224
    00225         virtual ~Window();
    00227
    00231
    00232         GtkWindow* gtk_window() const { return (GtkWindow*)instance; }
    00234
    00235         GtkWindowClass* gtk_window_class() const;
    00237
    00238         operator GtkWindow* () const;
    00240
    00241         bool is_toplevel() const;
    00243
    00244         bool is_popup() const;
    00246
    00247         String get_title() const;
    00250
    00251         String get_role() const;
    00254
    00255         Widget* get_focus() const;
    00262
    00263         Window* get_transient_for() const;
    00266
    00267         Gdk::WindowTypeHint get_type_hint() const;
    00270
    00271         bool get_skip_taskbar_hint() const;
    00274
    00275         bool get_skip_pager_hint() const;
    00278
    00279         bool get_destroy_with_parent() const;
    00282
    00283         bool get_resizable() const;
    00286
    00287         Gdk::Gravity get_gravity() const;
    00290
    00291         Gdk::Screen* get_screen() const;
    00293
    00294         bool get_has_frame() const;
    00298
    00299         void get_frame_dimensions(int *left, int *top, int *right, int *bottom) const;
    00311
    00312         bool get_decorated() const;
    00315
    00316         bool get_icon_list(std::vector<Gdk::Pixbuf*>& icons) const;
    00322
    00323         Gdk::Pixbuf* get_icon() const;
    00327
    00328         bool get_modal() const;
    00330
    00331         Gdk::ModifierTypeField get_mnemonic_modifier() const;
    00334
    00335         void get_default_size(int *width, int *height) const;
    00342
    00343         void get_size(int *width, int *height) const;
    00381
    00382         void get_position(int *root_x, int *root_y) const;
    00407
    00408         Gdk::Point get_position() const;
    00411
    00412         WindowGroup* get_group() const;
    00414
    00418
    00419         void set_title(const String& title);
    00428
    00429         void set_wmclass(const String& wmclass_name, const String& wmclass_class);
    00440
    00441         void set_role(const String& role);
    00452
    00453         AccelGroup* add_accel_group(AccelGroup *accel_group = 0);
    00460
    00461         void remove_accel_group(AccelGroup& accel_group);
    00464
    00465         void set_position(WindowPosition position);
    00471
    00472         bool activate_focus();
    00479
    00480         void set_focus(Widget *focus);
    00488
    00489         void set_default(Widget *default_widget);
    00499
    00500         bool activate_default();
    00508
    00509         void set_transient_for(Window *parent);
    00516
    00517         void set_type_hint(Gdk::WindowTypeHint hint);
    00525
    00526         void set_skip_taskbar_hint(bool setting);
    00530
    00531         void set_skip_pager_hint(bool setting);
    00538
    00539         void set_destroy_with_parent(bool setting);
    00546
    00547         void set_resizable(bool resizable);
    00552
    00553         void set_gravity(Gdk::Gravity gravity);
    00560
    00561         void set_geometry_hints(Widget *geometry_widget, const Gdk::Geometry& geometry);
    00570
    00571         void set_screen(const Gdk::Screen& screen);
    00575
    00576         void set_has_frame(bool setting);
    00590
    00591         void set_frame_dimensions(int left, int top, int right, int bottom);
    00601
    00602         void set_decorated(bool setting);
    00613
    00614         void set_icon_list(std::vector<Gdk::Pixbuf*>& icons);
    00634
    00635         void set_icon(Gdk::Pixbuf& icon);
    00649
    00650         bool set_icon_from_file(const String& filename, G::Error *error = 0);
    00661
    00662         void set_modal(bool modal);
    00670
    00671         void add_mnemonic(unsigned int keyval, Widget& target);
    00675
    00676         void remove_mnemonic(unsigned int keyval, Widget& target);
    00680
    00681         bool mnemonic_activate(unsigned int keyval, Gdk::ModifierTypeField modifier);
    00686
    00687         void set_mnemonic_modifier(Gdk::ModifierTypeField modifier);
    00690
    00691         void present();
    00699
    00700         void iconify();
    00709
    00710         void deiconify();
    00716
    00717         void stick();
    00725
    00726         void unstick();
    00732
    00733         void maximize();
    00741
    00742         void unmaximize();
    00749
    00750         void fullscreen();
    00757
    00758         void unfullscreen();
    00765
    00766         void begin_resize_drag(Gdk::WindowEdge edge, int button, int root_x, int root_y, unsigned int timestamp);
    00780
    00781         void begin_move_drag(int button, int root_x, int root_y, unsigned int timestamp);
    00794
    00795         void set_default_size(int width, int height);
    00819
    00820         void resize(int width, int height);
    00830
    00831         void move(int x, int y);
    00856
    00857         void move(const Gdk::Point& point);
    00860
    00861         bool parse_geometry(const char *geometry);
    00874
    00875         void reshow_with_initial_size();
    00878
    00880
    00881         static bool get_default_icon_list(std::vector<Gdk::Pixbuf*>& icons);
    00888
    00889         static bool list_toplevels(std::vector<Widget*>& toplevels);
    00897
    00898         static void set_default_icon_list(std::vector<Gdk::Pixbuf*>& icons);
    00905
    00906         static bool set_default_icon_from_file(const String& filename, G::Error *error = 0);
    00914
    00915         static void set_auto_startup_notification(bool setting);
    00926
    00929
    00930         const TypePropertyProxy prop_type()
    00931         {
    00932                 return TypePropertyProxy(this, &type_property);
    00933         }
    00935
    00936         const TitlePropertyProxy prop_title()
    00937         {
    00938                 return TitlePropertyProxy(this, &title_property);
    00939         }
    00941
    00942         const AllowShrinkPropertyProxy prop_allow_shrink()
    00943         {
    00944                 return AllowShrinkPropertyProxy(this, &allow_shrink_property);
    00945         }
    00948
    00949         const AllowGrowPropertyProxy prop_allow_grow()
    00950         {
    00951                 return AllowGrowPropertyProxy(this, &allow_grow_property);
    00952         }
    00954
    00955         const ResizablePropertyProxy prop_resizable()
    00956         {
    00957                 return ResizablePropertyProxy(this, &resizable_property);
    00958         }
    00960
    00961         const ModalPropertyProxy prop_modal()
    00962         {
    00963                 return ModalPropertyProxy(this, &modal_property);
    00964         }
    00967
    00968         const WindowPositionPropertyProxy prop_window_position()
    00969         {
    00970                 return WindowPositionPropertyProxy(this, &window_position_property);
    00971         }
    00973
    00974         const DefaultWidthPropertyProxy prop_default_width()
    00975         {
    00976                 return DefaultWidthPropertyProxy(this, &default_width_property);
    00977         }
    00979
    00980         const DefaultHeightPropertyProxy prop_default_height()
    00981         {
    00982                 return DefaultHeightPropertyProxy(this, &default_height_property);
    00983         }
    00985
    00986         const DestroyWithParentPropertyProxy prop_destroy_with_parent()
    00987         {
    00988                 return DestroyWithParentPropertyProxy(this, &destroy_with_parent_property);
    00989         }
    00991
    00992         const IconPropertyProxy prop_icon()
    00993         {
    00994                 return IconPropertyProxy(this, &icon_property);
    00995         }
    00997
    00998         const ScreenPropertyProxy prop_screen()
    00999         {
    01000                 return ScreenPropertyProxy(this, &screen_property);
    01001         }
    01003
    01004         const IsActivePropertyProxy prop_is_active()
    01005         {
    01006                 return IsActivePropertyProxy(this, &is_active_property);
    01007         }
    01009
    01010         const HasToplevelFocusPropertyProxy prop_has_toplevel_focus()
    01011         {
    01012                 return HasToplevelFocusPropertyProxy(this, &has_toplevel_focus_property);
    01013         }
    01015
    01016         const TypeHintPropertyProxy prop_type_hint()
    01017         {
    01018                 return TypeHintPropertyProxy(this, &type_hint_property);
    01019         }
    01022
    01023         const SkipTaskbarHintPropertyProxy prop_skip_taskbar_hint()
    01024         {
    01025                 return SkipTaskbarHintPropertyProxy(this, &skip_taskbar_hint_property);
    01026         }
    01028
    01029         const SkipPagerHintPropertyProxy prop_skip_pager_hint()
    01030         {
    01031                 return SkipPagerHintPropertyProxy(this, &skip_pager_hint_property);
    01032         }
    01034
    01038
    01039         const SetFocusSignalProxy sig_set_focus()
    01040         {
    01041                 return SetFocusSignalProxy(this, &set_focus_signal);
    01042         }
    01044
    01045         const FrameEventSignalProxy sig_frame_event()
    01046         {
    01047                 return FrameEventSignalProxy(this, &frame_event_signal);
    01048         }
    01051
    01052         const KeysChangedSignalProxy sig_keys_changed()
    01053         {
    01054                 return KeysChangedSignalProxy(this, &keys_changed_signal);
    01055         }
    01058
    01059         const DeleteEventSignalProxy sig_delete_event()
    01060         {
    01061                 return DeleteEventSignalProxy(this, &delete_event_signal);
    01062         }
    01065
    01067 };
    01068
    01071
    01072 class WindowGroup : public G::Object
    01073 {
    01074         friend class G::Object;
    01075         friend class WindowGroupClass;
    01076
    01077         WindowGroup(const WindowGroup&);
    01078         WindowGroup& operator=(const WindowGroup&);
    01079
    01080 protected:
    01083
    01084         explicit WindowGroup(GtkWindowGroup *group, bool reference = false);
    01091
    01093
    01094 public:
    01097
    01098         WindowGroup();
    01101
    01102         virtual ~WindowGroup();
    01104
    01108
    01109         GtkWindowGroup* gtk_window_group() const { return (GtkWindowGroup*)instance; }
    01111
    01112         GtkWindowGroupClass* gtk_window_group_class() const;
    01114
    01115         operator GtkWindowGroup* () const;
    01117
    01121
    01122         void add_window(Window& window);
    01125
    01126         void remove_window(Window& window);
    01129
    01131 };
    01132
    01133 } // namespace Gtk
    01134
    01135 } // namespace Inti
    01136
    01137 #endif // INTI_GTK_CONTAINER_H
    01138

Main Page - Footer