]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkrecentaction.c
GtkIconTheme: fix regression from 0db32f0632ef4675bfcfc9ec201f7af157a48ab0
[~andy/gtk] / gtk / gtkrecentaction.c
index 458d23f01903940cf69db92cc87787fff147198a..211ab97ed01f1d4cc7fc7ea2115a7358856af55f 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
@@ -30,8 +28,6 @@
 #include "gtkrecentchooserutils.h"
 #include "gtkrecentchooserprivate.h"
 #include "gtkprivate.h"
-#include "gtkalias.h"
-
 
 /**
  * SECTION:gtkrecentaction
 
 #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
 {
@@ -168,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)));
 }
 
@@ -197,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
@@ -261,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);
@@ -271,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);
@@ -280,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;
@@ -310,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
@@ -563,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)
     {
@@ -642,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;
@@ -666,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,
@@ -698,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
  *
@@ -782,6 +786,3 @@ gtk_recent_action_set_show_numbers (GtkRecentAction *action,
       g_object_unref (action);
     }
 }
-
-#define __GTK_RECENT_ACTION_C__
-#include "gtkaliasdef.c"