diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 10 | ||||
-rw-r--r-- | docs/Changes-2.0.txt | 4 | ||||
-rw-r--r-- | gtk/gtkimage.c | 21 | ||||
-rw-r--r-- | gtk/gtkimage.h | 3 | ||||
-rw-r--r-- | gtk/gtkmenu.c | 70 |
11 files changed, 155 insertions, 13 deletions
@@ -1,3 +1,13 @@ +Fri Aug 24 23:09:05 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkimage.[ch] docs/Changes-2.0.txt: Break compatibility + and make gtk_image_new() take no arguments. The compiler will + catch it, and it is vastly more useful than having + gtk_image_new() be a deprecated alias for gtk_image_new_from_image(). + + * gtk/gtkmenu.c (gtk_menu_set_property): Apply patch + to add tearoff-title property (#51319, Lee Mallabone) + Fri Aug 24 22:12:32 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkmenuitem.[ch]: Remove unused and useless function diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index a9019643a1..ed0c28d66f 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,13 @@ +Fri Aug 24 23:09:05 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkimage.[ch] docs/Changes-2.0.txt: Break compatibility + and make gtk_image_new() take no arguments. The compiler will + catch it, and it is vastly more useful than having + gtk_image_new() be a deprecated alias for gtk_image_new_from_image(). + + * gtk/gtkmenu.c (gtk_menu_set_property): Apply patch + to add tearoff-title property (#51319, Lee Mallabone) + Fri Aug 24 22:12:32 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkmenuitem.[ch]: Remove unused and useless function diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index a9019643a1..ed0c28d66f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +Fri Aug 24 23:09:05 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkimage.[ch] docs/Changes-2.0.txt: Break compatibility + and make gtk_image_new() take no arguments. The compiler will + catch it, and it is vastly more useful than having + gtk_image_new() be a deprecated alias for gtk_image_new_from_image(). + + * gtk/gtkmenu.c (gtk_menu_set_property): Apply patch + to add tearoff-title property (#51319, Lee Mallabone) + Fri Aug 24 22:12:32 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkmenuitem.[ch]: Remove unused and useless function diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index a9019643a1..ed0c28d66f 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,13 @@ +Fri Aug 24 23:09:05 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkimage.[ch] docs/Changes-2.0.txt: Break compatibility + and make gtk_image_new() take no arguments. The compiler will + catch it, and it is vastly more useful than having + gtk_image_new() be a deprecated alias for gtk_image_new_from_image(). + + * gtk/gtkmenu.c (gtk_menu_set_property): Apply patch + to add tearoff-title property (#51319, Lee Mallabone) + Fri Aug 24 22:12:32 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkmenuitem.[ch]: Remove unused and useless function diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index a9019643a1..ed0c28d66f 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,13 @@ +Fri Aug 24 23:09:05 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkimage.[ch] docs/Changes-2.0.txt: Break compatibility + and make gtk_image_new() take no arguments. The compiler will + catch it, and it is vastly more useful than having + gtk_image_new() be a deprecated alias for gtk_image_new_from_image(). + + * gtk/gtkmenu.c (gtk_menu_set_property): Apply patch + to add tearoff-title property (#51319, Lee Mallabone) + Fri Aug 24 22:12:32 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkmenuitem.[ch]: Remove unused and useless function diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index a9019643a1..ed0c28d66f 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,13 @@ +Fri Aug 24 23:09:05 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkimage.[ch] docs/Changes-2.0.txt: Break compatibility + and make gtk_image_new() take no arguments. The compiler will + catch it, and it is vastly more useful than having + gtk_image_new() be a deprecated alias for gtk_image_new_from_image(). + + * gtk/gtkmenu.c (gtk_menu_set_property): Apply patch + to add tearoff-title property (#51319, Lee Mallabone) + Fri Aug 24 22:12:32 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkmenuitem.[ch]: Remove unused and useless function diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index a9019643a1..ed0c28d66f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +Fri Aug 24 23:09:05 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkimage.[ch] docs/Changes-2.0.txt: Break compatibility + and make gtk_image_new() take no arguments. The compiler will + catch it, and it is vastly more useful than having + gtk_image_new() be a deprecated alias for gtk_image_new_from_image(). + + * gtk/gtkmenu.c (gtk_menu_set_property): Apply patch + to add tearoff-title property (#51319, Lee Mallabone) + Fri Aug 24 22:12:32 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkmenuitem.[ch]: Remove unused and useless function diff --git a/docs/Changes-2.0.txt b/docs/Changes-2.0.txt index 9b82b2d85a..7d4ce76205 100644 --- a/docs/Changes-2.0.txt +++ b/docs/Changes-2.0.txt @@ -442,3 +442,7 @@ Incompatible Changes from GTK+-1.2 to GTK+-2.0: - For NO_WINDOW widgets, if you create windows in your realize() method, you must map then in map() and unmap them in unmap(). + +* gtk_image_new() now takes no arguments and creates an empty GtkImage + widget. To create a GtkImage widget from a GdkImage (the least + common usage of GdkImage), use gtk_image_new_from_image.
\ No newline at end of file diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index dd01873b75..509d569c52 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -776,19 +776,18 @@ gtk_image_get_animation (GtkImage *image) return image->data.anim.anim; } +/** + * gtk_image_new: + * @void: a #GtkImage + * + * Creates a new empty #GtkImage widget. + * + * Return value: a newly created #GtkImage widget. + **/ GtkWidget* -gtk_image_new (GdkImage *val, - GdkBitmap *mask) +gtk_image_new (void) { - GtkImage *image; - - g_return_val_if_fail (val != NULL, NULL); - - image = gtk_type_new (GTK_TYPE_IMAGE); - - gtk_image_set (image, val, mask); - - return GTK_WIDGET (image); + return g_object_new (GTK_TYPE_IMAGE, NULL); } void diff --git a/gtk/gtkimage.h b/gtk/gtkimage.h index 71c80dfd0a..b528ef4ac9 100644 --- a/gtk/gtkimage.h +++ b/gtk/gtkimage.h @@ -125,6 +125,7 @@ struct _GtkImageClass GtkType gtk_image_get_type (void) G_GNUC_CONST; +GtkWidget* gtk_image_new (void); GtkWidget* gtk_image_new_from_pixmap (GdkPixmap *pixmap, GdkBitmap *mask); GtkWidget* gtk_image_new_from_image (GdkImage *image, @@ -177,8 +178,6 @@ GdkPixbufAnimation* gtk_image_get_animation (GtkImage *image); #ifndef GTK_DISABLE_DEPRECATED /* These three are deprecated */ -GtkWidget* gtk_image_new (GdkImage *val, - GdkBitmap *mask); void gtk_image_set (GtkImage *image, GdkImage *val, GdkBitmap *mask); diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 5cdb821371..fb9dbaac3d 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -37,6 +37,7 @@ #include "gtkhbox.h" #include "gtkvscrollbar.h" #include "gtksettings.h" +#include "gtkintl.h" #define MENU_ITEM_CLASS(w) GTK_MENU_ITEM_GET_CLASS (w) @@ -59,9 +60,21 @@ struct _GtkMenuAttachData GtkMenuDetachFunc detacher; }; +enum { + PROP_0, + PROP_TEAROFF_TITLE +}; static void gtk_menu_class_init (GtkMenuClass *klass); static void gtk_menu_init (GtkMenu *menu); +static void gtk_menu_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void gtk_menu_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); static void gtk_menu_destroy (GtkObject *object); static void gtk_menu_realize (GtkWidget *widget); static void gtk_menu_unrealize (GtkWidget *widget); @@ -146,6 +159,7 @@ gtk_menu_get_type (void) static void gtk_menu_class_init (GtkMenuClass *class) { + GObjectClass *gobject_class; GtkObjectClass *object_class; GtkWidgetClass *widget_class; GtkContainerClass *container_class; @@ -153,12 +167,23 @@ gtk_menu_class_init (GtkMenuClass *class) GtkBindingSet *binding_set; + gobject_class = (GObjectClass*) class; object_class = (GtkObjectClass*) class; widget_class = (GtkWidgetClass*) class; container_class = (GtkContainerClass*) class; menu_shell_class = (GtkMenuShellClass*) class; parent_class = gtk_type_class (gtk_menu_shell_get_type ()); + gobject_class->set_property = gtk_menu_set_property; + gobject_class->get_property = gtk_menu_get_property; + + g_object_class_install_property (gobject_class, + PROP_TEAROFF_TITLE, + g_param_spec_string ("tearoff-title", + _("Tearoff Title"), + _("A title that may be displayed by the window manager when this menu is torn-off."), + "", + G_PARAM_READABLE | G_PARAM_WRITABLE)); object_class->destroy = gtk_menu_destroy; widget_class->realize = gtk_menu_realize; @@ -223,6 +248,50 @@ gtk_menu_class_init (GtkMenuClass *class) GTK_MENU_DIR_CHILD); } + +static void +gtk_menu_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GtkMenu *menu; + + menu = GTK_MENU (object); + + switch (prop_id) + { + case PROP_TEAROFF_TITLE: + gtk_menu_set_title (menu, g_value_get_string (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gtk_menu_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GtkMenu *menu; + + menu = GTK_MENU (object); + + switch (prop_id) + { + case PROP_TEAROFF_TITLE: + g_value_set_string (value, gtk_object_get_data (GTK_OBJECT (menu), + "gtk-menu-title")); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + static gboolean gtk_menu_window_event (GtkWidget *window, GdkEvent *event, @@ -945,6 +1014,7 @@ gtk_menu_set_title (GtkMenu *menu, gtk_object_set_data_full (GTK_OBJECT (menu), "gtk-menu-title", g_strdup (title), (GtkDestroyNotify) g_free); + g_object_notify (G_OBJECT (menu), "tearoff_title"); } /** |