Commit 0ef453b8 authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

present the argument access masks on their announcement.

Thu Feb 19 06:56:52 1998  Tim Janik  <timj@gimp.org>

        * gtkbox.c:
        * gtkbutton.c:
        * gtkcontainer.c:
        * gtkframe.c:
        * gtklabel.c:
        * gtkobject.c:
        * gtkwidget.c:
        * gtkwindow.c:
        present the argument access masks on their announcement.

        * gtk/gtkobject.h:
        * gtk/gtkobject.c:
        (gtk_object_add_arg_type): take an additional argument describing
        the access mask of the new arg. this can be of GTK_ARG_READABLE,
        GTK_ARG_WRITABLE or GTK_ARG_READWRITE (the latter is an alias for
        the two previous ones).
        (gtk_object_query_args): provide an access_mask array if desired.

        * gtk/gtkwidget.c (gtk_widget_real_realize):
        realized the assumtion that widget is a NO_WINDOW widget
        in actuall code.

        * gtkwindow.c:
        slight changes to gtk_window_configure_event that will make
        the resizing behaviour a little less odd.
        sigh, for some (buggy) reason, there are still container resizes
        triggered by manual resizing to very small window sizes.
        the cointainer resizes will cause gtk_real_window_move_resize to
        be invoked, which makes the app look like it wants to fight the users
        resizing action. ;(
parent a4b322cc
Thu Feb 19 06:56:52 1998 Tim Janik <timj@gimp.org>
* gtkbox.c:
* gtkbutton.c:
* gtkcontainer.c:
* gtkframe.c:
* gtklabel.c:
* gtkobject.c:
* gtkwidget.c:
* gtkwindow.c:
present the argument access masks on their announcement.
* gtk/gtkobject.h:
* gtk/gtkobject.c:
(gtk_object_add_arg_type): take an additional argument describing
the access mask of the new arg. this can be of GTK_ARG_READABLE,
GTK_ARG_WRITABLE or GTK_ARG_READWRITE (the latter is an alias for
the two previous ones).
(gtk_object_query_args): provide an access_mask array if desired.
* gtk/gtkwidget.c (gtk_widget_real_realize):
realized the assumtion that widget is a NO_WINDOW widget
in actuall code.
* gtkwindow.c:
slight changes to gtk_window_configure_event that will make
the resizing behaviour a little less odd.
sigh, for some (buggy) reason, there are still container resizes
triggered by manual resizing to very small window sizes.
the cointainer resizes will cause gtk_real_window_move_resize to
be invoked, which makes the app look like it wants to fight the users
resizing action. ;(
Thu Feb 19 01:11:48 1998 Owen Taylor <owt1@cornell.edu>
* configure.in gdk/gdk.[ch] gdk/gdkcc.c
......
Thu Feb 19 06:56:52 1998 Tim Janik <timj@gimp.org>
* gtkbox.c:
* gtkbutton.c:
* gtkcontainer.c:
* gtkframe.c:
* gtklabel.c:
* gtkobject.c:
* gtkwidget.c:
* gtkwindow.c:
present the argument access masks on their announcement.
* gtk/gtkobject.h:
* gtk/gtkobject.c:
(gtk_object_add_arg_type): take an additional argument describing
the access mask of the new arg. this can be of GTK_ARG_READABLE,
GTK_ARG_WRITABLE or GTK_ARG_READWRITE (the latter is an alias for
the two previous ones).
(gtk_object_query_args): provide an access_mask array if desired.
* gtk/gtkwidget.c (gtk_widget_real_realize):
realized the assumtion that widget is a NO_WINDOW widget
in actuall code.
* gtkwindow.c:
slight changes to gtk_window_configure_event that will make
the resizing behaviour a little less odd.
sigh, for some (buggy) reason, there are still container resizes
triggered by manual resizing to very small window sizes.
the cointainer resizes will cause gtk_real_window_move_resize to
be invoked, which makes the app look like it wants to fight the users
resizing action. ;(
Thu Feb 19 01:11:48 1998 Owen Taylor <owt1@cornell.edu>
* configure.in gdk/gdk.[ch] gdk/gdkcc.c
......
Thu Feb 19 06:56:52 1998 Tim Janik <timj@gimp.org>
* gtkbox.c:
* gtkbutton.c:
* gtkcontainer.c:
* gtkframe.c:
* gtklabel.c:
* gtkobject.c:
* gtkwidget.c:
* gtkwindow.c:
present the argument access masks on their announcement.
* gtk/gtkobject.h:
* gtk/gtkobject.c:
(gtk_object_add_arg_type): take an additional argument describing
the access mask of the new arg. this can be of GTK_ARG_READABLE,
GTK_ARG_WRITABLE or GTK_ARG_READWRITE (the latter is an alias for
the two previous ones).
(gtk_object_query_args): provide an access_mask array if desired.
* gtk/gtkwidget.c (gtk_widget_real_realize):
realized the assumtion that widget is a NO_WINDOW widget
in actuall code.
* gtkwindow.c:
slight changes to gtk_window_configure_event that will make
the resizing behaviour a little less odd.
sigh, for some (buggy) reason, there are still container resizes
triggered by manual resizing to very small window sizes.
the cointainer resizes will cause gtk_real_window_move_resize to
be invoked, which makes the app look like it wants to fight the users
resizing action. ;(
Thu Feb 19 01:11:48 1998 Owen Taylor <owt1@cornell.edu>
* configure.in gdk/gdk.[ch] gdk/gdkcc.c
......
Thu Feb 19 06:56:52 1998 Tim Janik <timj@gimp.org>
* gtkbox.c:
* gtkbutton.c:
* gtkcontainer.c:
* gtkframe.c:
* gtklabel.c:
* gtkobject.c:
* gtkwidget.c:
* gtkwindow.c:
present the argument access masks on their announcement.
* gtk/gtkobject.h:
* gtk/gtkobject.c:
(gtk_object_add_arg_type): take an additional argument describing
the access mask of the new arg. this can be of GTK_ARG_READABLE,
GTK_ARG_WRITABLE or GTK_ARG_READWRITE (the latter is an alias for
the two previous ones).
(gtk_object_query_args): provide an access_mask array if desired.
* gtk/gtkwidget.c (gtk_widget_real_realize):
realized the assumtion that widget is a NO_WINDOW widget
in actuall code.
* gtkwindow.c:
slight changes to gtk_window_configure_event that will make
the resizing behaviour a little less odd.
sigh, for some (buggy) reason, there are still container resizes
triggered by manual resizing to very small window sizes.
the cointainer resizes will cause gtk_real_window_move_resize to
be invoked, which makes the app look like it wants to fight the users
resizing action. ;(
Thu Feb 19 01:11:48 1998 Owen Taylor <owt1@cornell.edu>
* configure.in gdk/gdk.[ch] gdk/gdkcc.c
......
Thu Feb 19 06:56:52 1998 Tim Janik <timj@gimp.org>
* gtkbox.c:
* gtkbutton.c:
* gtkcontainer.c:
* gtkframe.c:
* gtklabel.c:
* gtkobject.c:
* gtkwidget.c:
* gtkwindow.c:
present the argument access masks on their announcement.
* gtk/gtkobject.h:
* gtk/gtkobject.c:
(gtk_object_add_arg_type): take an additional argument describing
the access mask of the new arg. this can be of GTK_ARG_READABLE,
GTK_ARG_WRITABLE or GTK_ARG_READWRITE (the latter is an alias for
the two previous ones).
(gtk_object_query_args): provide an access_mask array if desired.
* gtk/gtkwidget.c (gtk_widget_real_realize):
realized the assumtion that widget is a NO_WINDOW widget
in actuall code.
* gtkwindow.c:
slight changes to gtk_window_configure_event that will make
the resizing behaviour a little less odd.
sigh, for some (buggy) reason, there are still container resizes
triggered by manual resizing to very small window sizes.
the cointainer resizes will cause gtk_real_window_move_resize to
be invoked, which makes the app look like it wants to fight the users
resizing action. ;(
Thu Feb 19 01:11:48 1998 Owen Taylor <owt1@cornell.edu>
* configure.in gdk/gdk.[ch] gdk/gdkcc.c
......
Thu Feb 19 06:56:52 1998 Tim Janik <timj@gimp.org>
* gtkbox.c:
* gtkbutton.c:
* gtkcontainer.c:
* gtkframe.c:
* gtklabel.c:
* gtkobject.c:
* gtkwidget.c:
* gtkwindow.c:
present the argument access masks on their announcement.
* gtk/gtkobject.h:
* gtk/gtkobject.c:
(gtk_object_add_arg_type): take an additional argument describing
the access mask of the new arg. this can be of GTK_ARG_READABLE,
GTK_ARG_WRITABLE or GTK_ARG_READWRITE (the latter is an alias for
the two previous ones).
(gtk_object_query_args): provide an access_mask array if desired.
* gtk/gtkwidget.c (gtk_widget_real_realize):
realized the assumtion that widget is a NO_WINDOW widget
in actuall code.
* gtkwindow.c:
slight changes to gtk_window_configure_event that will make
the resizing behaviour a little less odd.
sigh, for some (buggy) reason, there are still container resizes
triggered by manual resizing to very small window sizes.
the cointainer resizes will cause gtk_real_window_move_resize to
be invoked, which makes the app look like it wants to fight the users
resizing action. ;(
Thu Feb 19 01:11:48 1998 Owen Taylor <owt1@cornell.edu>
* configure.in gdk/gdk.[ch] gdk/gdkcc.c
......
Thu Feb 19 06:56:52 1998 Tim Janik <timj@gimp.org>
* gtkbox.c:
* gtkbutton.c:
* gtkcontainer.c:
* gtkframe.c:
* gtklabel.c:
* gtkobject.c:
* gtkwidget.c:
* gtkwindow.c:
present the argument access masks on their announcement.
* gtk/gtkobject.h:
* gtk/gtkobject.c:
(gtk_object_add_arg_type): take an additional argument describing
the access mask of the new arg. this can be of GTK_ARG_READABLE,
GTK_ARG_WRITABLE or GTK_ARG_READWRITE (the latter is an alias for
the two previous ones).
(gtk_object_query_args): provide an access_mask array if desired.
* gtk/gtkwidget.c (gtk_widget_real_realize):
realized the assumtion that widget is a NO_WINDOW widget
in actuall code.
* gtkwindow.c:
slight changes to gtk_window_configure_event that will make
the resizing behaviour a little less odd.
sigh, for some (buggy) reason, there are still container resizes
triggered by manual resizing to very small window sizes.
the cointainer resizes will cause gtk_real_window_move_resize to
be invoked, which makes the app look like it wants to fight the users
resizing action. ;(
Thu Feb 19 01:11:48 1998 Owen Taylor <owt1@cornell.edu>
* configure.in gdk/gdk.[ch] gdk/gdkcc.c
......
......@@ -5,14 +5,17 @@ Forthcoming Changes for GTK+ 0.99.4:
* Additions on the signal code for querying information about certain signals,
and pending handlers of signals.
* Support for user signals, and major changes to internal signal handler
handling for proper removal and invokation of after signals.
* GtkTooltips became a true descendant of GtkObject.
handling for proper signal removal and invokation of after signals.
* GtkTooltips became a true descendant of GtkObject and facilitates an
extra tip string which can be used as e.g. an index into context help.
* Split up of the widget/object flags into a private and a public portion,
consult docs/widget_system.txt on this.
* Support for hot keys on gtk programs via gtk_key_snooper_install().
* Reimplementation of the *_interp functions as *_full functions to provide
simple callback functions as well.
* Idle functions are now prioritized.
* Many enhancements to GtkNotebook.
* Access masks for widget arguments (GTK_ARG_READABLE/GTK_ARG_WRITABLE).
* Clean ups and many many bug fixes by a lot of people all over the place.
* New, long and descriptive ChangeLog entries for bored readers ;)
......
......@@ -86,8 +86,8 @@ gtk_box_class_init (GtkBoxClass *class)
parent_class = gtk_type_class (gtk_container_get_type ());
gtk_object_add_arg_type ("GtkBox::spacing", GTK_TYPE_INT, ARG_SPACING);
gtk_object_add_arg_type ("GtkBox::homogeneous", GTK_TYPE_BOOL, ARG_HOMOGENEOUS);
gtk_object_add_arg_type ("GtkBox::spacing", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_SPACING);
gtk_object_add_arg_type ("GtkBox::homogeneous", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HOMOGENEOUS);
widget_class->map = gtk_box_map;
widget_class->unmap = gtk_box_unmap;
......
......@@ -129,7 +129,7 @@ gtk_button_class_init (GtkButtonClass *klass)
parent_class = gtk_type_class (gtk_container_get_type ());
gtk_object_add_arg_type ("GtkButton::label", GTK_TYPE_STRING, ARG_LABEL);
gtk_object_add_arg_type ("GtkButton::label", GTK_TYPE_STRING, GTK_ARG_WRITABLE, ARG_LABEL);
button_signals[PRESSED] =
gtk_signal_new ("pressed",
......
......@@ -139,10 +139,10 @@ gtk_container_class_init (GtkContainerClass *class)
widget_class = (GtkWidgetClass*) class;
parent_class = gtk_type_class (gtk_widget_get_type ());
gtk_object_add_arg_type ("GtkContainer::border_width", GTK_TYPE_LONG, ARG_BORDER_WIDTH);
gtk_object_add_arg_type ("GtkContainer::auto_resize", GTK_TYPE_BOOL, ARG_AUTO_RESIZE);
gtk_object_add_arg_type ("GtkContainer::block_resize", GTK_TYPE_BOOL, ARG_BLOCK_RESIZE);
gtk_object_add_arg_type ("GtkContainer::child", GTK_TYPE_WIDGET, ARG_CHILD);
gtk_object_add_arg_type ("GtkContainer::border_width", GTK_TYPE_LONG, GTK_ARG_READWRITE, ARG_BORDER_WIDTH);
gtk_object_add_arg_type ("GtkContainer::auto_resize", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_AUTO_RESIZE);
gtk_object_add_arg_type ("GtkContainer::block_resize", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_BLOCK_RESIZE);
gtk_object_add_arg_type ("GtkContainer::child", GTK_TYPE_WIDGET, GTK_ARG_WRITABLE, ARG_CHILD);
container_signals[ADD] =
gtk_signal_new ("add",
......
......@@ -86,10 +86,10 @@ gtk_frame_class_init (GtkFrameClass *class)
parent_class = gtk_type_class (gtk_bin_get_type ());
gtk_object_add_arg_type ("GtkFrame::label", GTK_TYPE_STRING, ARG_LABEL);
gtk_object_add_arg_type ("GtkFrame::label_xalign", GTK_TYPE_DOUBLE, ARG_LABEL_XALIGN);
gtk_object_add_arg_type ("GtkFrame::label_yalign", GTK_TYPE_DOUBLE, ARG_LABEL_YALIGN);
gtk_object_add_arg_type ("GtkFrame::shadow", GTK_TYPE_ENUM, ARG_SHADOW);
gtk_object_add_arg_type ("GtkFrame::label", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_LABEL);
gtk_object_add_arg_type ("GtkFrame::label_xalign", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_LABEL_XALIGN);
gtk_object_add_arg_type ("GtkFrame::label_yalign", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_LABEL_YALIGN);
gtk_object_add_arg_type ("GtkFrame::shadow", GTK_TYPE_ENUM, GTK_ARG_READWRITE, ARG_SHADOW);
object_class->finalize = gtk_frame_finalize;
......
......@@ -78,8 +78,8 @@ gtk_label_class_init (GtkLabelClass *class)
parent_class = gtk_type_class (gtk_misc_get_type ());
gtk_object_add_arg_type ("GtkLabel::label", GTK_TYPE_STRING, ARG_LABEL);
gtk_object_add_arg_type ("GtkLabel::justify", GTK_TYPE_ENUM, ARG_JUSTIFY);
gtk_object_add_arg_type ("GtkLabel::label", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_LABEL);
gtk_object_add_arg_type ("GtkLabel::justify", GTK_TYPE_ENUM, GTK_ARG_READWRITE, ARG_JUSTIFY);
object_class->finalize = gtk_label_finalize;
......
......@@ -54,6 +54,7 @@ struct _GtkArgInfo
char *name;
GtkType type;
GtkType class_type;
guint access_mask;
guint arg_id;
guint seq_id;
};
......@@ -172,9 +173,18 @@ gtk_object_class_init (GtkObjectClass *class)
class->nsignals = 0;
class->n_args = 0;
gtk_object_add_arg_type ("GtkObject::user_data", GTK_TYPE_POINTER, ARG_USER_DATA);
gtk_object_add_arg_type ("GtkObject::signal", GTK_TYPE_SIGNAL, ARG_SIGNAL);
gtk_object_add_arg_type ("GtkObject::object_signal", GTK_TYPE_SIGNAL, ARG_OBJECT_SIGNAL);
gtk_object_add_arg_type ("GtkObject::user_data",
GTK_TYPE_POINTER,
GTK_ARG_READWRITE,
ARG_USER_DATA);
gtk_object_add_arg_type ("GtkObject::signal",
GTK_TYPE_SIGNAL,
GTK_ARG_WRITABLE,
ARG_SIGNAL);
gtk_object_add_arg_type ("GtkObject::object_signal",
GTK_TYPE_SIGNAL,
GTK_ARG_WRITABLE,
ARG_OBJECT_SIGNAL);
object_signals[DESTROY] =
gtk_signal_new ("destroy",
......@@ -653,6 +663,13 @@ gtk_object_getv (GtkObject *object,
g_free (lookup_name);
continue;
}
else if (!info->access_mask & GTK_ARG_READABLE)
{
g_warning ("arg is not supplied for read-access: \"%s\"\n", lookup_name);
args[i].type = GTK_TYPE_INVALID;
g_free (lookup_name);
continue;
}
else
g_free (lookup_name);
......@@ -693,11 +710,14 @@ gtk_query_arg_foreach (gpointer key,
GtkArg*
gtk_object_query_args (GtkType class_type,
guint **access_masks,
guint *nargs)
{
GtkArg *args;
GtkQueryArgData query_data;
if (access_masks)
*access_masks = NULL;
g_return_val_if_fail (nargs != NULL, NULL);
*nargs = 0;
g_return_val_if_fail (gtk_type_is_a (class_type, gtk_object_get_type ()), NULL);
......@@ -730,6 +750,8 @@ gtk_object_query_args (GtkType class_type,
args = g_new0 (GtkArg, len);
*nargs = len;
if (access_masks)
*access_masks = g_new (guint, len);
do
{
......@@ -742,6 +764,8 @@ gtk_object_query_args (GtkType class_type,
args[info->seq_id - 1].type = info->type;
args[info->seq_id - 1].name = info->name;
if (access_masks)
(*access_masks)[info->seq_id - 1] = info->access_mask;
}
while (list);
......@@ -840,6 +864,11 @@ gtk_object_setv (GtkObject *object,
g_warning ("invalid arg for %s: \"%s\"\n", gtk_type_name (object->klass->type), lookup_name);
arg_ok = FALSE;
}
else if (!info->access_mask & GTK_ARG_WRITABLE)
{
g_warning ("arg is not supplied for write-access: \"%s\"\n", lookup_name);
arg_ok = FALSE;
}
g_free (lookup_name);
......@@ -861,6 +890,7 @@ gtk_object_setv (GtkObject *object,
void
gtk_object_add_arg_type (const char *arg_name,
GtkType arg_type,
guint access_mask,
guint arg_id)
{
GtkArgInfo *info;
......@@ -868,7 +898,10 @@ gtk_object_add_arg_type (const char *arg_name,
gchar *arg_part;
GtkType class_type;
g_return_if_fail (arg_name != NULL);
g_return_if_fail (arg_type > GTK_TYPE_NONE);
g_return_if_fail (arg_id > 0);
g_return_if_fail ((access_mask & GTK_ARG_READWRITE) != 0);
arg_part = strchr (arg_name, ':');
if (!arg_part || (arg_part[0] != ':') || (arg_part[1] != ':'))
......@@ -891,6 +924,7 @@ gtk_object_add_arg_type (const char *arg_name,
info->name = g_strdup (arg_name);
info->type = arg_type;
info->class_type = class_type;
info->access_mask = access_mask & (GTK_ARG_READABLE | GTK_ARG_WRITABLE);
info->arg_id = arg_id;
info->seq_id = ++((GtkObjectClass*) gtk_type_class (class_type))->n_args;
......
......@@ -65,18 +65,28 @@ extern "C" {
#define GTK_OBJECT_TYPE(obj) (GTK_OBJECT (obj)->klass->type)
#define GTK_OBJECT_SIGNALS(obj) (GTK_OBJECT (obj)->klass->signals)
#define GTK_OBJECT_NSIGNALS(obj) (GTK_OBJECT (obj)->klass->nsignals)
/* GtkObject only uses the first 4 bits of the flags field.
* GtkWidget uses the remaining bits. Though this is a kinda nasty
* break up, it does make the size of GtkWidget smaller.
*/
enum
{
GTK_DESTROYED = 1 << 0,
GTK_FLOATING = 1 << 1,
GTK_RESERVED_1 = 1 << 2,
GTK_RESERVED_2 = 1 << 3
};
{
GTK_DESTROYED = 1 << 0,
GTK_FLOATING = 1 << 1,
GTK_RESERVED_1 = 1 << 2,
GTK_RESERVED_2 = 1 << 3
};
/* GtkArg access bits for gtk_object_add_arg_type
*/
enum
{
GTK_ARG_READABLE = 1 << 0,
GTK_ARG_WRITABLE = 1 << 1,
};
#define GTK_ARG_READWRITE (GTK_ARG_READABLE | GTK_ARG_WRITABLE)
/* Macros for extracting the object_flags from GtkObject.
*/
......@@ -236,15 +246,19 @@ void gtk_object_setv (GtkObject *object,
/* Allocate a GtkArg array of size nargs that hold the
* names and types of the args that can be used with
* gtk_object_set/gtk_object_get.
* gtk_object_set/gtk_object_get. if (*acess_masks!=NULL)
* the pointer will be set to point to a newly allocated
* guint array that holds the access masks of the args.
* It is the callers response to do a
* g_free (returned_args).
* g_free (returned_args); g_free (*acess_masks).
*/
GtkArg* gtk_object_query_args (GtkType class_type,
guint **acess_masks,
guint *nargs);
void gtk_object_add_arg_type (const gchar *arg_name,
GtkType arg_type,
guint access_mask,
guint arg_id);
GtkType gtk_object_get_arg_type (const gchar *arg_name);
......
......@@ -277,21 +277,21 @@ gtk_widget_class_init (GtkWidgetClass *klass)
parent_class = gtk_type_class (gtk_object_get_type ());
gtk_object_add_arg_type ("GtkWidget::x", GTK_TYPE_INT, ARG_X);
gtk_object_add_arg_type ("GtkWidget::y", GTK_TYPE_INT, ARG_Y);
gtk_object_add_arg_type ("GtkWidget::width", GTK_TYPE_INT, ARG_WIDTH);
gtk_object_add_arg_type ("GtkWidget::height", GTK_TYPE_INT, ARG_HEIGHT);
gtk_object_add_arg_type ("GtkWidget::visible", GTK_TYPE_BOOL, ARG_VISIBLE);
gtk_object_add_arg_type ("GtkWidget::sensitive", GTK_TYPE_BOOL, ARG_SENSITIVE);
gtk_object_add_arg_type ("GtkWidget::can_focus", GTK_TYPE_BOOL, ARG_CAN_FOCUS);
gtk_object_add_arg_type ("GtkWidget::has_focus", GTK_TYPE_BOOL, ARG_HAS_FOCUS);
gtk_object_add_arg_type ("GtkWidget::can_default", GTK_TYPE_BOOL, ARG_CAN_DEFAULT);
gtk_object_add_arg_type ("GtkWidget::has_default", GTK_TYPE_BOOL, ARG_HAS_DEFAULT);
gtk_object_add_arg_type ("GtkWidget::events", GTK_TYPE_GDK_EVENT_MASK, ARG_EVENTS);
gtk_object_add_arg_type ("GtkWidget::extension_events", GTK_TYPE_GDK_EVENT_MASK, ARG_EXTENSION_EVENTS);
gtk_object_add_arg_type ("GtkWidget::name", GTK_TYPE_STRING, ARG_NAME);
gtk_object_add_arg_type ("GtkWidget::style", GTK_TYPE_STYLE, ARG_STYLE);
gtk_object_add_arg_type ("GtkWidget::parent", GTK_TYPE_CONTAINER, ARG_PARENT);
gtk_object_add_arg_type ("GtkWidget::x", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_X);
gtk_object_add_arg_type ("GtkWidget::y", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_Y);
gtk_object_add_arg_type ("GtkWidget::width", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_WIDTH);
gtk_object_add_arg_type ("GtkWidget::height", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_HEIGHT);
gtk_object_add_arg_type ("GtkWidget::visible", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_VISIBLE);
gtk_object_add_arg_type ("GtkWidget::sensitive", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_SENSITIVE);
gtk_object_add_arg_type ("GtkWidget::can_focus", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_CAN_FOCUS);
gtk_object_add_arg_type ("GtkWidget::has_focus", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HAS_FOCUS);
gtk_object_add_arg_type ("GtkWidget::can_default", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_CAN_DEFAULT);
gtk_object_add_arg_type ("GtkWidget::has_default", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HAS_DEFAULT);
gtk_object_add_arg_type ("GtkWidget::events", GTK_TYPE_GDK_EVENT_MASK, GTK_ARG_READWRITE, ARG_EVENTS);
gtk_object_add_arg_type ("GtkWidget::extension_events", GTK_TYPE_GDK_EVENT_MASK, GTK_ARG_READWRITE, ARG_EXTENSION_EVENTS);
gtk_object_add_arg_type ("GtkWidget::name", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_NAME);
gtk_object_add_arg_type ("GtkWidget::style", GTK_TYPE_STYLE, GTK_ARG_READWRITE, ARG_STYLE);
gtk_object_add_arg_type ("GtkWidget::parent", GTK_TYPE_CONTAINER, GTK_ARG_READWRITE, ARG_PARENT);
widget_signals[SHOW] =
gtk_signal_new ("show",
......@@ -3337,6 +3337,7 @@ gtk_widget_real_realize (GtkWidget *widget)
{
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (GTK_WIDGET_NO_WINDOW (widget));
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
if (widget->parent)
......
......@@ -151,12 +151,12 @@ gtk_window_class_init (GtkWindowClass *klass)
parent_class = gtk_type_class (gtk_bin_get_type ());
gtk_object_add_arg_type ("GtkWindow::type", GTK_TYPE_WINDOW_TYPE, ARG_TYPE);
gtk_object_add_arg_type ("GtkWindow::title", GTK_TYPE_STRING, ARG_TITLE);
gtk_object_add_arg_type ("GtkWindow::auto_shrink", GTK_TYPE_BOOL, ARG_AUTO_SHRINK);
gtk_object_add_arg_type ("GtkWindow::allow_shrink", GTK_TYPE_BOOL, ARG_ALLOW_SHRINK);
gtk_object_add_arg_type ("GtkWindow::allow_grow", GTK_TYPE_BOOL, ARG_ALLOW_GROW);
gtk_object_add_arg_type ("GtkWindow::window_position", GTK_TYPE_ENUM, ARG_WIN_POS);
gtk_object_add_arg_type ("GtkWindow::type", GTK_TYPE_WINDOW_TYPE, GTK_ARG_READWRITE, ARG_TYPE);
gtk_object_add_arg_type ("GtkWindow::title", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_TITLE);
gtk_object_add_arg_type ("GtkWindow::auto_shrink", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_AUTO_SHRINK);
gtk_object_add_arg_type ("GtkWindow::allow_shrink", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_ALLOW_SHRINK);
gtk_object_add_arg_type ("GtkWindow::allow_grow", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_ALLOW_GROW);
gtk_object_add_arg_type ("GtkWindow::window_position", GTK_TYPE_ENUM, GTK_ARG_READWRITE, ARG_WIN_POS);
window_signals[MOVE_RESIZE] =
gtk_signal_new ("move_resize",
......@@ -715,23 +715,26 @@ gtk_window_configure_event (GtkWidget *widget,
!GTK_WIDGET_MAPPED (window->bin.child))
gtk_widget_map (window->bin.child);
if (window->resize_count > 1)
window->resize_count -= 1;
else
if (window->resize_count > 0)
{
if ((window->auto_shrink &&
((event->width != widget->requisition.width) ||
(event->height != widget->requisition.height))) ||
(event->width < widget->requisition.width) ||
(event->height < widget->requisition.height))
window->resize_count -= 1;
if ((window->resize_count == 0) &&
((event->width != widget->requisition.width) ||
(event->height != widget->requisition.height)))
{
window->resize_count = 1;
gdk_window_resize (widget->window,
widget->requisition.width,
widget->requisition.height);
/*
printf ("configure-event resize: %d!=%d (%d) %d!=%d (%d)\n",
event->width, widget->requisition.width,
event->width != widget->requisition.width,
event->height, widget->requisition.height,
event->height != widget->requisition.height);
*/
}
else
window->resize_count = 0;
}
window->handling_resize = FALSE;
......@@ -1063,6 +1066,11 @@ gtk_real_window_move_resize (GtkWindow *window,
gdk_window_resize (widget->window,
widget->requisition.width,
widget->requisition.height);
/*
printf ("move-resize resize: %d %d\n",
width != widget->requisition.width,
height != widget->requisition.height);
*/
}
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment