X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkwindow.h;h=7b0c0dc5e5f08dbb198e021bff8da635d48aeaf7;hb=3b2182e711ace4a2d6843848208224cd7525d530;hp=22753fcd0ed70745f609d92210140c0bf0d5f737;hpb=f39f644fb24a3398bd5a6786f0083eb1b3c51164;p=~andy%2Fgtk diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h index 22753fcd0..7b0c0dc5e 100644 --- a/gtk/gtkwindow.h +++ b/gtk/gtkwindow.h @@ -12,9 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ /* @@ -24,20 +22,18 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) -#error "Only can be included directly." -#endif - #ifndef __GTK_WINDOW_H__ #define __GTK_WINDOW_H__ +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#error "Only can be included directly." +#endif + +#include #include #include -#include "gtk/gtkaccelgroupprivate.h" - - G_BEGIN_DECLS #define GTK_TYPE_WINDOW (gtk_window_get_type ()) @@ -47,73 +43,18 @@ G_BEGIN_DECLS #define GTK_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WINDOW)) #define GTK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WINDOW, GtkWindowClass)) - +typedef struct _GtkWindowPrivate GtkWindowPrivate; typedef struct _GtkWindowClass GtkWindowClass; typedef struct _GtkWindowGeometryInfo GtkWindowGeometryInfo; typedef struct _GtkWindowGroup GtkWindowGroup; typedef struct _GtkWindowGroupClass GtkWindowGroupClass; +typedef struct _GtkWindowGroupPrivate GtkWindowGroupPrivate; struct _GtkWindow { GtkBin bin; - gchar *GSEAL (title); - gchar *GSEAL (wmclass_name); - gchar *GSEAL (wmclass_class); - gchar *GSEAL (wm_role); - - GtkWidget *GSEAL (focus_widget); - GtkWidget *GSEAL (default_widget); - GtkWindow *GSEAL (transient_parent); - GtkWindowGeometryInfo *GSEAL (geometry_info); - GdkWindow *GSEAL (frame); - GtkWindowGroup *GSEAL (group); - - guint16 GSEAL (configure_request_count); - guint GSEAL (allow_shrink) : 1; - guint GSEAL (allow_grow) : 1; - guint GSEAL (configure_notify_received) : 1; - /* The following flags are initially TRUE (before a window is mapped). - * They cause us to compute a configure request that involves - * default-only parameters. Once mapped, we set them to FALSE. - * Then we set them to TRUE again on unmap (for position) - * and on unrealize (for size). - */ - guint GSEAL (need_default_position) : 1; - guint GSEAL (need_default_size) : 1; - guint GSEAL (position) : 3; - guint GSEAL (type) : 4; /* GtkWindowType */ - guint GSEAL (has_user_ref_count) : 1; - guint GSEAL (has_focus) : 1; - - guint GSEAL (modal) : 1; - guint GSEAL (destroy_with_parent) : 1; - - guint GSEAL (has_frame) : 1; - - /* gtk_window_iconify() called before realization */ - guint GSEAL (iconify_initially) : 1; - guint GSEAL (stick_initially) : 1; - guint GSEAL (maximize_initially) : 1; - guint GSEAL (decorated) : 1; - - guint GSEAL (type_hint) : 3; /* GdkWindowTypeHint if the hint is one of the original eight. If not, then - * it contains GDK_WINDOW_TYPE_HINT_NORMAL - */ - guint GSEAL (gravity) : 5; /* GdkGravity */ - - guint GSEAL (is_active) : 1; - guint GSEAL (has_toplevel_focus) : 1; - - guint GSEAL (frame_left); - guint GSEAL (frame_top); - guint GSEAL (frame_right); - guint GSEAL (frame_bottom); - - guint GSEAL (keys_changed_handler); - - GdkModifierType GSEAL (mnemonic_modifier); - GdkScreen *GSEAL (screen); + GtkWindowPrivate *priv; }; struct _GtkWindowClass @@ -121,24 +62,14 @@ struct _GtkWindowClass GtkBinClass parent_class; void (* set_focus) (GtkWindow *window, - GtkWidget *focus); - gboolean (* frame_event) (GtkWindow *window, - GdkEvent *event); + GtkWidget *focus); /* G_SIGNAL_ACTION signals for keybindings */ - void (* activate_focus) (GtkWindow *window); - void (* activate_default) (GtkWindow *window); - - /* as of GTK+ 2.12 the "move-focus" signal has been moved to GtkWidget, - * so this is merley a virtual function now. Overriding it in subclasses - * continues to work though. - */ - void (* move_focus) (GtkWindow *window, - GtkDirectionType direction); - - void (*keys_changed) (GtkWindow *window); - + void (* activate_focus) (GtkWindow *window); + void (* activate_default) (GtkWindow *window); + void (* keys_changed) (GtkWindow *window); + /* Padding for future expansion */ void (*_gtk_reserved1) (void); void (*_gtk_reserved2) (void); @@ -157,7 +88,7 @@ struct _GtkWindowGroup { GObject parent_instance; - GSList *GSEAL (grabs); + GtkWindowGroupPrivate *priv; }; struct _GtkWindowGroupClass @@ -171,17 +102,11 @@ struct _GtkWindowGroupClass void (*_gtk_reserved4) (void); }; -#ifdef G_OS_WIN32 -/* Reserve old names for DLL ABI backward compatibility */ -#define gtk_window_set_icon_from_file gtk_window_set_icon_from_file_utf8 -#define gtk_window_set_default_icon_from_file gtk_window_set_default_icon_from_file_utf8 -#endif - GType gtk_window_get_type (void) G_GNUC_CONST; GtkWidget* gtk_window_new (GtkWindowType type); void gtk_window_set_title (GtkWindow *window, const gchar *title); -G_CONST_RETURN gchar *gtk_window_get_title (GtkWindow *window); +const gchar * gtk_window_get_title (GtkWindow *window); void gtk_window_set_wmclass (GtkWindow *window, const gchar *wmclass_name, const gchar *wmclass_class); @@ -189,7 +114,7 @@ void gtk_window_set_role (GtkWindow *window, const gchar *role); void gtk_window_set_startup_id (GtkWindow *window, const gchar *startup_id); -G_CONST_RETURN gchar *gtk_window_get_role (GtkWindow *window); +const gchar * gtk_window_get_role (GtkWindow *window); void gtk_window_add_accel_group (GtkWindow *window, GtkAccelGroup *accel_group); void gtk_window_remove_accel_group (GtkWindow *window, @@ -208,8 +133,15 @@ gboolean gtk_window_activate_default (GtkWindow *window); void gtk_window_set_transient_for (GtkWindow *window, GtkWindow *parent); GtkWindow *gtk_window_get_transient_for (GtkWindow *window); +GDK_AVAILABLE_IN_3_4 +void gtk_window_set_attached_to (GtkWindow *window, + GtkWidget *attach_widget); +GDK_AVAILABLE_IN_3_4 +GtkWidget *gtk_window_get_attached_to (GtkWindow *window); +GDK_DEPRECATED_IN_3_8_FOR(gtk_widget_set_opacity) void gtk_window_set_opacity (GtkWindow *window, gdouble opacity); +GDK_DEPRECATED_IN_3_8_FOR(gtk_widget_get_opacity) gdouble gtk_window_get_opacity (GtkWindow *window); void gtk_window_set_type_hint (GtkWindow *window, GdkWindowTypeHint hint); @@ -232,9 +164,19 @@ gboolean gtk_window_get_focus_on_map (GtkWindow *window); void gtk_window_set_destroy_with_parent (GtkWindow *window, gboolean setting); gboolean gtk_window_get_destroy_with_parent (GtkWindow *window); +GDK_AVAILABLE_IN_3_4 +void gtk_window_set_hide_titlebar_when_maximized (GtkWindow *window, + gboolean setting); +GDK_AVAILABLE_IN_3_4 +gboolean gtk_window_get_hide_titlebar_when_maximized (GtkWindow *window); void gtk_window_set_mnemonics_visible (GtkWindow *window, gboolean setting); gboolean gtk_window_get_mnemonics_visible (GtkWindow *window); +GDK_AVAILABLE_IN_3_2 +void gtk_window_set_focus_visible (GtkWindow *window, + gboolean setting); +GDK_AVAILABLE_IN_3_2 +gboolean gtk_window_get_focus_visible (GtkWindow *window); void gtk_window_set_resizable (GtkWindow *window, gboolean resizable); @@ -257,22 +199,6 @@ GdkScreen* gtk_window_get_screen (GtkWindow *window); gboolean gtk_window_is_active (GtkWindow *window); gboolean gtk_window_has_toplevel_focus (GtkWindow *window); - - -/* gtk_window_set_has_frame () must be called before realizing the window_*/ -void gtk_window_set_has_frame (GtkWindow *window, - gboolean setting); -gboolean gtk_window_get_has_frame (GtkWindow *window); -void gtk_window_set_frame_dimensions (GtkWindow *window, - gint left, - gint top, - gint right, - gint bottom); -void gtk_window_get_frame_dimensions (GtkWindow *window, - gint *left, - gint *top, - gint *right, - gint *bottom); void gtk_window_set_decorated (GtkWindow *window, gboolean setting); gboolean gtk_window_get_decorated (GtkWindow *window); @@ -291,14 +217,12 @@ gboolean gtk_window_set_icon_from_file (GtkWindow *window, const gchar *filename, GError **err); GdkPixbuf* gtk_window_get_icon (GtkWindow *window); -G_CONST_RETURN -gchar *gtk_window_get_icon_name (GtkWindow *window); +const gchar * gtk_window_get_icon_name (GtkWindow *window); void gtk_window_set_default_icon_list (GList *list); GList* gtk_window_get_default_icon_list (void); void gtk_window_set_default_icon (GdkPixbuf *icon); void gtk_window_set_default_icon_name (const gchar *name); -G_CONST_RETURN -gchar *gtk_window_get_default_icon_name (void); +const gchar * gtk_window_get_default_icon_name (void); gboolean gtk_window_set_default_icon_from_file (const gchar *filename, GError **err); @@ -309,6 +233,8 @@ void gtk_window_set_modal (GtkWindow *window, gboolean modal); gboolean gtk_window_get_modal (GtkWindow *window); GList* gtk_window_list_toplevels (void); +void gtk_window_set_has_user_ref_count (GtkWindow *window, + gboolean setting); void gtk_window_add_mnemonic (GtkWindow *window, guint keyval, @@ -377,7 +303,16 @@ void gtk_window_get_position (GtkWindow *window, gint *root_y); gboolean gtk_window_parse_geometry (GtkWindow *window, const gchar *geometry); + +void gtk_window_set_default_geometry (GtkWindow *window, + gint width, + gint height); +void gtk_window_resize_to_geometry (GtkWindow *window, + gint width, + gint height); + GtkWindowGroup *gtk_window_get_group (GtkWindow *window); +gboolean gtk_window_has_group (GtkWindow *window); /* Ignore this unless you are writing a GUI builder */ void gtk_window_reshow_with_initial_size (GtkWindow *window); @@ -395,49 +330,23 @@ void gtk_window_group_remove_window (GtkWindowGroup *window_grou GtkWindow *window); GList * gtk_window_group_list_windows (GtkWindowGroup *window_group); +GtkWidget * gtk_window_group_get_current_grab (GtkWindowGroup *window_group); +GtkWidget * gtk_window_group_get_current_device_grab (GtkWindowGroup *window_group, + GdkDevice *device); + +GtkApplication *gtk_window_get_application (GtkWindow *window); +void gtk_window_set_application (GtkWindow *window, + GtkApplication *application); -/* --- internal functions --- */ -void _gtk_window_internal_set_focus (GtkWindow *window, - GtkWidget *focus); -void gtk_window_remove_embedded_xid (GtkWindow *window, - GdkNativeWindow xid); -void gtk_window_add_embedded_xid (GtkWindow *window, - GdkNativeWindow xid); -void _gtk_window_reposition (GtkWindow *window, - gint x, - gint y); -void _gtk_window_constrain_size (GtkWindow *window, - gint width, - gint height, - gint *new_width, - gint *new_height); -GtkWidget *_gtk_window_group_get_current_grab (GtkWindowGroup *window_group); - -void _gtk_window_set_has_toplevel_focus (GtkWindow *window, - gboolean has_toplevel_focus); -void _gtk_window_unset_focus_and_default (GtkWindow *window, - GtkWidget *widget); - -void _gtk_window_set_is_active (GtkWindow *window, - gboolean is_active); - -void _gtk_window_set_is_toplevel (GtkWindow *window, - gboolean is_toplevel); - -typedef void (*GtkWindowKeysForeachFunc) (GtkWindow *window, - guint keyval, - GdkModifierType modifiers, - gboolean is_mnemonic, - gpointer data); - -void _gtk_window_keys_foreach (GtkWindow *window, - GtkWindowKeysForeachFunc func, - gpointer func_data); - -/* --- internal (GtkAcceleratable) --- */ -gboolean _gtk_window_query_nonaccels (GtkWindow *window, - guint accel_key, - GdkModifierType accel_mods); + +/* Window grips + */ +void gtk_window_set_has_resize_grip (GtkWindow *window, + gboolean value); +gboolean gtk_window_get_has_resize_grip (GtkWindow *window); +gboolean gtk_window_resize_grip_is_visible (GtkWindow *window); +gboolean gtk_window_get_resize_grip_area (GtkWindow *window, + GdkRectangle *rect); G_END_DECLS