[gtk+/refactor: 85/106] GtkRecentAction: move public members to private structure
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/refactor: 85/106] GtkRecentAction: move public members to private structure
- Date: Tue, 13 Jul 2010 17:37:09 +0000 (UTC)
commit e61cad0d612970fa4b1c7d60bbdf574718052cff
Author: Javier Jardón <jjardon gnome org>
Date: Thu Jul 8 01:48:01 2010 +0200
GtkRecentAction: move public members to private structure
gtk/gtkrecentaction.c | 28 +++++++++++++++++-----------
gtk/gtkrecentaction.h | 2 +-
2 files changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkrecentaction.c b/gtk/gtkrecentaction.c
index 41f2a26..5d73594 100644
--- a/gtk/gtkrecentaction.c
+++ b/gtk/gtkrecentaction.c
@@ -49,10 +49,6 @@
#define FALLBACK_ITEM_LIMIT 10
-#define GTK_RECENT_ACTION_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- GTK_TYPE_RECENT_ACTION, \
- GtkRecentActionPrivate))
struct _GtkRecentActionPrivate
{
@@ -195,7 +191,7 @@ gtk_recent_action_get_items (GtkRecentChooser *chooser)
static GtkRecentManager *
gtk_recent_action_get_recent_manager (GtkRecentChooser *chooser)
{
- return GTK_RECENT_ACTION_GET_PRIVATE (chooser)->manager;
+ return GTK_RECENT_ACTION (chooser)->priv->manager;
}
static void
@@ -259,7 +255,8 @@ static void
gtk_recent_action_add_filter (GtkRecentChooser *chooser,
GtkRecentFilter *filter)
{
- GtkRecentActionPrivate *priv = GTK_RECENT_ACTION_GET_PRIVATE (chooser);
+ GtkRecentAction *action = GTK_RECENT_ACTION (chooser);
+ GtkRecentActionPrivate *priv = action->priv;
if (priv->current_filter != filter)
set_current_filter (GTK_RECENT_ACTION (chooser), filter);
@@ -269,7 +266,8 @@ static void
gtk_recent_action_remove_filter (GtkRecentChooser *chooser,
GtkRecentFilter *filter)
{
- GtkRecentActionPrivate *priv = GTK_RECENT_ACTION_GET_PRIVATE (chooser);
+ GtkRecentAction *action = GTK_RECENT_ACTION (chooser);
+ GtkRecentActionPrivate *priv = action->priv;
if (priv->current_filter == filter)
set_current_filter (GTK_RECENT_ACTION (chooser), NULL);
@@ -278,10 +276,12 @@ gtk_recent_action_remove_filter (GtkRecentChooser *chooser,
static GSList *
gtk_recent_action_list_filters (GtkRecentChooser *chooser)
{
+ GtkRecentAction *action = GTK_RECENT_ACTION (chooser);
+ GtkRecentActionPrivate *priv = action->priv;
GSList *retval = NULL;
GtkRecentFilter *current_filter;
- current_filter = GTK_RECENT_ACTION_GET_PRIVATE (chooser)->current_filter;
+ current_filter = priv->current_filter;
retval = g_slist_prepend (retval, current_filter);
return retval;
@@ -308,11 +308,14 @@ gtk_recent_chooser_iface_init (GtkRecentChooserIface *iface)
static void
gtk_recent_action_activate (GtkAction *action)
{
+ GtkRecentAction *recent_action = GTK_RECENT_ACTION (action);
+ GtkRecentActionPrivate *priv = recent_action->priv;
+
/* we have probably been invoked by a menu tool button or by a
* direct call of gtk_action_activate(); since no item has been
* selected, we must unset the current recent chooser pointer
*/
- GTK_RECENT_ACTION_GET_PRIVATE (action)->current_chooser = NULL;
+ priv->current_chooser = NULL;
}
static void
@@ -561,7 +564,8 @@ gtk_recent_action_get_property (GObject *gobject,
GValue *value,
GParamSpec *pspec)
{
- GtkRecentActionPrivate *priv = GTK_RECENT_ACTION_GET_PRIVATE (gobject);
+ GtkRecentAction *action = GTK_RECENT_ACTION (gobject);
+ GtkRecentActionPrivate *priv = action->priv;
switch (prop_id)
{
@@ -640,7 +644,9 @@ gtk_recent_action_init (GtkRecentAction *action)
{
GtkRecentActionPrivate *priv;
- action->priv = priv = GTK_RECENT_ACTION_GET_PRIVATE (action);
+ action->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (action,
+ GTK_TYPE_RECENT_ACTION,
+ GtkRecentActionPrivate);
priv->show_numbers = FALSE;
priv->show_icons = TRUE;
diff --git a/gtk/gtkrecentaction.h b/gtk/gtkrecentaction.h
index 777a8ba..ef4493f 100644
--- a/gtk/gtkrecentaction.h
+++ b/gtk/gtkrecentaction.h
@@ -47,7 +47,7 @@ struct _GtkRecentAction
GtkAction parent_instance;
/*< private >*/
- GtkRecentActionPrivate *GSEAL (priv);
+ GtkRecentActionPrivate *priv;
};
struct _GtkRecentActionClass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]