Commit 8de6598f authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Break compatibility and make gtk_image_new() take no arguments. The

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)
parent 5600b79e
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
......
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
......
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
......
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
......
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
......
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
......
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
......
......@@ -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
......@@ -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
......
......@@ -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);
......
......@@ -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");
}
/**
......
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