Add docs.

2005-04-04  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_class_init):
	* gtk/gtkruler.c (gtk_ruler_class_init): Add docs.

	* gtk/gtktoggletoolbutton.c: Add an active property.
This commit is contained in:
Matthias Clasen 2005-04-04 06:28:07 +00:00 committed by Matthias Clasen
parent c4e31ace4d
commit b64bc34caf
6 changed files with 112 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2005-04-04 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_class_init):
* gtk/gtkruler.c (gtk_ruler_class_init): Add docs.
* gtk/gtktoggletoolbutton.c: Add an active property.
2005-04-04 Matthias Clasen <mclasen@redhat.com>
Allow completion popups to be wider than the entry. (#131916,

View File

@ -1,3 +1,10 @@
2005-04-04 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_class_init):
* gtk/gtkruler.c (gtk_ruler_class_init): Add docs.
* gtk/gtktoggletoolbutton.c: Add an active property.
2005-04-04 Matthias Clasen <mclasen@redhat.com>
Allow completion popups to be wider than the entry. (#131916,

View File

@ -1,3 +1,10 @@
2005-04-04 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_class_init):
* gtk/gtkruler.c (gtk_ruler_class_init): Add docs.
* gtk/gtktoggletoolbutton.c: Add an active property.
2005-04-04 Matthias Clasen <mclasen@redhat.com>
Allow completion popups to be wider than the entry. (#131916,

View File

@ -365,11 +365,18 @@ gtk_radio_menu_item_class_init (GtkRadioMenuItemClass *klass)
gobject_class->set_property = gtk_radio_menu_item_set_property;
gobject_class->get_property = gtk_radio_menu_item_get_property;
/**
* GtkRadioMenuItem:group:
*
* The radio menu item whose group this widget belongs to.
*
* Since: 2.8
*/
g_object_class_install_property (gobject_class,
PROP_GROUP,
g_param_spec_object ("group",
P_("Group"),
P_("The radio menu item whose group this widget belongs to."),
P_("The radio menu item whose group this widget belongs to."),
GTK_TYPE_RADIO_MENU_ITEM,
GTK_PARAM_WRITABLE));

View File

@ -155,6 +155,13 @@ gtk_ruler_class_init (GtkRulerClass *class)
G_MAXDOUBLE,
0.0,
GTK_PARAM_READWRITE));
/**
* GtkRuler:metric:
*
* The metric used for the ruler.
*
* Since: 2.8
*/
g_object_class_install_property (gobject_class,
PROP_METRIC,
g_param_spec_enum ("metric",

View File

@ -37,6 +37,12 @@ enum {
LAST_SIGNAL
};
enum {
PROP_0,
PROP_ACTIVE
};
#define GTK_TOGGLE_TOOL_BUTTON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_TOGGLE_TOOL_BUTTON, GtkToggleToolButtonPrivate))
struct _GtkToggleToolButtonPrivate
@ -47,6 +53,15 @@ struct _GtkToggleToolButtonPrivate
static void gtk_toggle_tool_button_init (GtkToggleToolButton *button);
static void gtk_toggle_tool_button_class_init (GtkToggleToolButtonClass *klass);
static void gtk_toggle_tool_button_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gtk_toggle_tool_button_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static gboolean gtk_toggle_tool_button_create_menu_proxy (GtkToolItem *button);
static void button_toggled (GtkWidget *widget,
@ -97,9 +112,27 @@ gtk_toggle_tool_button_class_init (GtkToggleToolButtonClass *klass)
toolitem_class = (GtkToolItemClass *)klass;
toolbutton_class = (GtkToolButtonClass *)klass;
object_class->set_property = gtk_toggle_tool_button_set_property;
object_class->get_property = gtk_toggle_tool_button_get_property;
toolitem_class->create_menu_proxy = gtk_toggle_tool_button_create_menu_proxy;
toolbutton_class->button_type = GTK_TYPE_TOGGLE_BUTTON;
/**
* GtkToggleToolButton:active:
*
* If the toggle tool button should be pressed in or not.
*
* Since: 2.8
*/
g_object_class_install_property (gobject_class,
PROP_ACTIVE,
g_param_spec_boolean ("active",
P_("Active"),
P_("If the toggle button should be pressed in or not"),
FALSE,
GTK_PARAM_READWRITE));
/**
* GtkToggleToolButton::toggled:
* @toggle_tool_button: the object that emitted the signal
@ -135,6 +168,46 @@ gtk_toggle_tool_button_init (GtkToggleToolButton *button)
"toggled", G_CALLBACK (button_toggled), button, 0);
}
static void
gtk_toggle_tool_button_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GtkToggleToolButton *button = GTK_TOGGLE_TOOL_BUTTON (object);
switch (prop_id)
{
case PROP_ACTIVE:
button->priv->active = g_value_get_boolean (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gtk_toggle_tool_button_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GtkToggleToolButton *button = GTK_TOGGLE_TOOL_BUTTON (object);
switch (prop_id)
{
case PROP_ACTIVE:
g_value_set_boolean (value, gtk_toggle_tool_button_get_active (button));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static gboolean
gtk_toggle_tool_button_create_menu_proxy (GtkToolItem *item)
{
@ -219,6 +292,7 @@ menu_item_activated (GtkWidget *menu_item,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (_gtk_tool_button_get_button (tool_button)),
toggle_tool_button->priv->active);
g_object_notify (G_OBJECT (toggle_tool_button), "active");
g_signal_emit (toggle_tool_button, toggle_signals[TOGGLED], 0);
}
}
@ -242,6 +316,7 @@ button_toggled (GtkWidget *widget,
toggle_tool_button->priv->active);
}
g_object_notify (G_OBJECT (toggle_tool_button), "active");
g_signal_emit (toggle_tool_button, toggle_signals[TOGGLED], 0);
}
}