Make return types G_CONST_RETURN instead of const.

2004-11-09  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkaction.[hc]:
	* gtk/gtkactiongroup.[hc]: Make return types G_CONST_RETURN
	instead of const.

	* gtk/gtk.symbols:
	* gtk/gtkaction.h:
	* gtk/gtkaction.c (gtk_action_get_accel_path): Add
	a function to obtain the accel path of an action. (#148106,
	Michael Natterer)
This commit is contained in:
Matthias Clasen 2004-11-09 19:15:44 +00:00 committed by Matthias Clasen
parent 4ad562fc0c
commit 994f8216f1
9 changed files with 70 additions and 4 deletions

View File

@ -1,5 +1,15 @@
2004-11-09 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkaction.[hc]:
* gtk/gtkactiongroup.[hc]: Make return types G_CONST_RETURN
instead of const.
* gtk/gtk.symbols:
* gtk/gtkaction.h:
* gtk/gtkaction.c (gtk_action_get_accel_path): Add
a function to obtain the accel path of an action. (#148106,
Michael Natterer)
* tests/testiconview.c: Fix double-click activation.
* gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip

View File

@ -1,5 +1,15 @@
2004-11-09 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkaction.[hc]:
* gtk/gtkactiongroup.[hc]: Make return types G_CONST_RETURN
instead of const.
* gtk/gtk.symbols:
* gtk/gtkaction.h:
* gtk/gtkaction.c (gtk_action_get_accel_path): Add
a function to obtain the accel path of an action. (#148106,
Michael Natterer)
* tests/testiconview.c: Fix double-click activation.
* gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip

View File

@ -1,5 +1,15 @@
2004-11-09 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkaction.[hc]:
* gtk/gtkactiongroup.[hc]: Make return types G_CONST_RETURN
instead of const.
* gtk/gtk.symbols:
* gtk/gtkaction.h:
* gtk/gtkaction.c (gtk_action_get_accel_path): Add
a function to obtain the accel path of an action. (#148106,
Michael Natterer)
* tests/testiconview.c: Fix double-click activation.
* gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip

View File

@ -1,5 +1,15 @@
2004-11-09 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkaction.[hc]:
* gtk/gtkactiongroup.[hc]: Make return types G_CONST_RETURN
instead of const.
* gtk/gtk.symbols:
* gtk/gtkaction.h:
* gtk/gtkaction.c (gtk_action_get_accel_path): Add
a function to obtain the accel path of an action. (#148106,
Michael Natterer)
* tests/testiconview.c: Fix double-click activation.
* gtk/gtkstatusbar.c (gtk_statusbar_init): Raise the grip

View File

@ -91,6 +91,7 @@ gtk_action_create_menu_item
gtk_action_create_tool_item
gtk_action_disconnect_accelerator
gtk_action_disconnect_proxy
gtk_action_get_accel_path
gtk_action_get_name
gtk_action_get_proxies
gtk_action_get_sensitive

View File

@ -1193,7 +1193,7 @@ gtk_action_get_proxies (GtkAction *action)
*
* Since: 2.4
**/
const gchar *
G_CONST_RETURN gchar *
gtk_action_get_name (GtkAction *action)
{
g_return_val_if_fail (GTK_IS_ACTION (action), NULL);
@ -1438,6 +1438,30 @@ gtk_action_set_accel_path (GtkAction *action,
action->private_data->accel_quark = g_quark_from_string (accel_path);
}
/**
* gtk_action_get_accel_path:
* @action: the action object
*
* Returns the accel path for this action.
*
* Since: 2.6
*
* Returns: the accel path for this action, or %NULL
* if none is set. The returned string is owned by GTK+
* and must not be freed or modified.
*/
G_CONST_RETURN gchar *
gtk_action_get_accel_path (GtkAction *action)
{
g_return_val_if_fail (GTK_IS_ACTION (action), NULL);
if (action->private_data->accel_quark)
return g_quark_to_string (action->private_data->accel_quark);
else
return NULL;
}
/**
* gtk_action_set_accel_group:
* @action: the action object

View File

@ -85,7 +85,7 @@ GtkAction *gtk_action_new (const gchar *name,
const gchar *label,
const gchar *tooltip,
const gchar *stock_id);
const gchar* gtk_action_get_name (GtkAction *action);
G_CONST_RETURN gchar* gtk_action_get_name (GtkAction *action);
gboolean gtk_action_is_sensitive (GtkAction *action);
gboolean gtk_action_get_sensitive (GtkAction *action);
void gtk_action_set_sensitive (GtkAction *action,
@ -106,6 +106,7 @@ void gtk_action_disconnect_proxy (GtkAction *action,
GSList* gtk_action_get_proxies (GtkAction *action);
void gtk_action_connect_accelerator (GtkAction *action);
void gtk_action_disconnect_accelerator (GtkAction *action);
G_CONST_RETURN gchar *gtk_action_get_accel_path (GtkAction *action);
/* protected ... for use by child actions */
void gtk_action_block_activate_from (GtkAction *action,

View File

@ -387,7 +387,7 @@ gtk_action_group_real_get_action (GtkActionGroup *self,
*
* Since: 2.4
*/
const gchar *
G_CONST_RETURN gchar *
gtk_action_group_get_name (GtkActionGroup *action_group)
{
g_return_val_if_fail (GTK_IS_ACTION_GROUP (action_group), NULL);

View File

@ -105,7 +105,7 @@ struct _GtkRadioActionEntry
GType gtk_action_group_get_type (void);
GtkActionGroup *gtk_action_group_new (const gchar *name);
const gchar *gtk_action_group_get_name (GtkActionGroup *action_group);
G_CONST_RETURN gchar *gtk_action_group_get_name (GtkActionGroup *action_group);
gboolean gtk_action_group_get_sensitive (GtkActionGroup *action_group);
void gtk_action_group_set_sensitive (GtkActionGroup *action_group,
gboolean sensitive);