X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkrecentaction.c;h=211ab97ed01f1d4cc7fc7ea2115a7358856af55f;hb=6767541ead7cc150d1dd066d3b84d85559500c28;hp=41f2a264713bbc74d38edad68698a3d5025f711a;hpb=0a07e9733bb259598a09515a3e4cdbcda5feef57;p=~andy%2Fgtk diff --git a/gtk/gtkrecentaction.c b/gtk/gtkrecentaction.c index 41f2a2647..211ab97ed 100644 --- a/gtk/gtkrecentaction.c +++ b/gtk/gtkrecentaction.c @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ #include "config.h" @@ -49,10 +47,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 { @@ -166,16 +160,16 @@ gtk_recent_action_unselect_uri (GtkRecentChooser *chooser, static void gtk_recent_action_select_all (GtkRecentChooser *chooser) { - g_warning (_("This function is not implemented for " - "widgets of class '%s'"), + g_warning ("This function is not implemented for " + "widgets of class '%s'", g_type_name (G_OBJECT_TYPE (chooser))); } static void gtk_recent_action_unselect_all (GtkRecentChooser *chooser) { - g_warning (_("This function is not implemented for " - "widgets of class '%s'"), + g_warning ("This function is not implemented for " + "widgets of class '%s'", g_type_name (G_OBJECT_TYPE (chooser))); } @@ -195,7 +189,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 +253,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 +264,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 +274,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 +306,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 +562,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 +642,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; @@ -664,10 +668,11 @@ gtk_recent_action_init (GtkRecentAction *action) /** * gtk_recent_action_new: * @name: a unique name for the action - * @label: (allow-none): the label displayed in menu items and on buttons, or %NULL + * @label: (allow-none): the label displayed in menu items and on buttons, + * or %NULL * @tooltip: (allow-none): a tooltip for the action, or %NULL - * @stock_id: the stock icon to display in widgets representing the - * action, or %NULL + * @stock_id: (allow-none): the stock icon to display in widgets representing + * the action, or %NULL * * Creates a new #GtkRecentAction object. To add the action to * a #GtkActionGroup and set the accelerator for the action, @@ -696,10 +701,11 @@ gtk_recent_action_new (const gchar *name, /** * gtk_recent_action_new_for_manager: * @name: a unique name for the action - * @label: (allow-none): the label displayed in menu items and on buttons, or %NULL + * @label: (allow-none): the label displayed in menu items and on buttons, + * or %NULL * @tooltip: (allow-none): a tooltip for the action, or %NULL - * @stock_id: the stock icon to display in widgets representing the - * action, or %NULL + * @stock_id: (allow-none): the stock icon to display in widgets representing + * the action, or %NULL * @manager: (allow-none): a #GtkRecentManager, or %NULL for using the default * #GtkRecentManager *