[glib] Drop public menu APIs from GApplication



commit 0a22f63ebe7ea1abe78e4b88287aaf31eb1bdb5e
Author: Ryan Lortie <desrt desrt ca>
Date:   Mon Dec 19 10:47:45 2011 -0500

    Drop public menu APIs from GApplication
    
    This is moving to Gtk, but we don't want to do it all right now.

 docs/reference/gio/gio-sections.txt |    4 --
 gio/gapplication.c                  |   74 +++++-----------------------------
 gio/gapplication.h                  |    8 ----
 gio/gapplicationimpl-dbus.c         |   14 +++++--
 gio/gio.symbols                     |    4 --
 5 files changed, 21 insertions(+), 83 deletions(-)
---
diff --git a/docs/reference/gio/gio-sections.txt b/docs/reference/gio/gio-sections.txt
index 7acd2ce..1cea4f3 100644
--- a/docs/reference/gio/gio-sections.txt
+++ b/docs/reference/gio/gio-sections.txt
@@ -2816,10 +2816,6 @@ g_application_get_flags
 g_application_set_flags
 <SUBSECTION>
 g_application_set_action_group
-g_application_set_app_menu
-g_application_get_app_menu
-g_application_set_menubar
-g_application_get_menubar
 <SUBSECTION>
 g_application_get_is_registered
 g_application_get_is_remote
diff --git a/gio/gapplication.c b/gio/gapplication.c
index a4e6185..5e22849 100644
--- a/gio/gapplication.c
+++ b/gio/gapplication.c
@@ -508,6 +508,13 @@ g_application_real_add_platform_data (GApplication    *application,
 }
 
 /* GObject implementation stuff {{{1 */
+static void         g_application_set_app_menu (GApplication *application,
+                                                GMenuModel   *app_menu);
+static GMenuModel * g_application_get_app_menu (GApplication *application);
+static void         g_application_set_menubar  (GApplication *application,
+                                                GMenuModel   *menubar);
+static GMenuModel * g_application_get_menubar  (GApplication *application);
+
 static void
 g_application_set_property (GObject      *object,
                             guint         prop_id,
@@ -582,25 +589,7 @@ g_application_set_action_group (GApplication *application,
     g_object_ref (application->priv->actions);
 }
 
-/**
- * g_application_set_app_menu:
- * @application: a #GApplication
- * @app_menu: (allow-none): a #GMenuModel, or %NULL
- *
- * Sets or unsets the application menu for @application.
- *
- * The application menu is a single menu containing items that typically
- * impact the application as a whole, rather than acting on a specific
- * window or document.  For example, you would expect to see
- * "Preferences" or "Quit" in an application menu, but not "Save" or
- * "Print".
- *
- * If supported, the application menu will be rendered by the desktop
- * environment.
- *
- * Since: 2.32
- */
-void
+static void
 g_application_set_app_menu (GApplication *application,
                             GMenuModel   *app_menu)
 {
@@ -620,18 +609,7 @@ g_application_set_app_menu (GApplication *application,
     }
 }
 
-/**
- * g_application_get_app_menu:
- * @application: a #GApplication
- *
- * Returns the menu model that has been set with
- * g_application_set_app_menu().
- *
- * Returns: the application menu of @application
- *
- * Since: 2.32
- */
-GMenuModel *
+static GMenuModel *
 g_application_get_app_menu (GApplication *application)
 {
   g_return_val_if_fail (G_IS_APPLICATION (application), NULL);
@@ -639,26 +617,7 @@ g_application_get_app_menu (GApplication *application)
   return application->priv->app_menu;
 }
 
-/**
- * g_application_set_menubar:
- * @application: a #GApplication
- * @menubar: (allow-none): a #GMenuModel, or %NULL
- *
- * Sets or unsets the menubar for windows of @application.
- *
- * This is a menubar in the traditional sense.
- *
- * Depending on the desktop environment, this may appear at the top of
- * each window, or at the top of the screen.  In some environments, if
- * both the application menu and the menubar are set, the application
- * menu will be presented as if it were the first item of the menubar.
- * Other environments treat the two as completely separate -- for
- * example, the application menu may be rendered by the desktop shell
- * while the menubar (if set) remains in each individual window.
- *
- * Since: 2.32
- */
-void
+static void
 g_application_set_menubar (GApplication *application,
                             GMenuModel   *menubar)
 {
@@ -678,18 +637,7 @@ g_application_set_menubar (GApplication *application,
     }
 }
 
-/**
- * g_application_get_menubar:
- * @application: a #GApplication
- *
- * Returns the menu model that has been set with
- * g_application_set_menubar().
- *
- * Returns: the menubar for windows of @application
- *
- * Since: 2.32
- */
-GMenuModel *
+static GMenuModel *
 g_application_get_menubar (GApplication *application)
 {
   g_return_val_if_fail (G_IS_APPLICATION (application), NULL);
diff --git a/gio/gapplication.h b/gio/gapplication.h
index 76fcf93..20f90af 100644
--- a/gio/gapplication.h
+++ b/gio/gapplication.h
@@ -117,14 +117,6 @@ GLIB_DEPRECATED
 void                    g_application_set_action_group                  (GApplication             *application,
                                                                          GActionGroup             *action_group);
 
-void                    g_application_set_app_menu                      (GApplication             *application,
-                                                                         GMenuModel               *app_menu);
-GMenuModel             *g_application_get_app_menu                      (GApplication             *application);
-
-void                    g_application_set_menubar                       (GApplication             *application,
-                                                                         GMenuModel               *menubar);
-GMenuModel *            g_application_get_menubar                       (GApplication             *application);
-
 gboolean                g_application_get_is_registered                 (GApplication             *application);
 gboolean                g_application_get_is_remote                     (GApplication             *application);
 
diff --git a/gio/gapplicationimpl-dbus.c b/gio/gapplicationimpl-dbus.c
index d8999d7..aaf3787 100644
--- a/gio/gapplicationimpl-dbus.c
+++ b/gio/gapplicationimpl-dbus.c
@@ -303,11 +303,14 @@ g_application_impl_app_menu_changed (GObject    *source,
                                      gpointer    user_data)
 {
   GApplicationImpl *impl = user_data;
+  GMenuModel *app_menu;
 
   g_assert (source == impl->app);
 
-  g_application_impl_publish_menu (impl, "AppMenu", g_application_get_app_menu (impl->app),
-                                   &impl->app_menu_id, &impl->app_menu_path);
+  g_object_get (impl->app, "app-menu", &app_menu, NULL);
+
+  g_application_impl_publish_menu (impl, "AppMenu", app_menu, &impl->app_menu_id, &impl->app_menu_path);
+  g_clear_object (&app_menu);
 }
 
 static void
@@ -316,11 +319,14 @@ g_application_impl_menubar_changed (GObject    *source,
                                     gpointer    user_data)
 {
   GApplicationImpl *impl = user_data;
+  GMenuModel *menubar;
 
   g_assert (source == impl->app);
 
-  g_application_impl_publish_menu (impl, "MenuBar", g_application_get_menubar (impl->app),
-                                   &impl->menubar_id, &impl->menubar_path);
+  g_object_get (impl->app, "menubar", &menubar, NULL);
+
+  g_application_impl_publish_menu (impl, "MenuBar", menubar, &impl->menubar_id, &impl->menubar_path);
+  g_clear_object (&menubar);
 }
 
 /* Attempt to become the primary instance.
diff --git a/gio/gio.symbols b/gio/gio.symbols
index 74e7e84..3ea45b7 100644
--- a/gio/gio.symbols
+++ b/gio/gio.symbols
@@ -19,8 +19,6 @@ g_application_get_flags
 g_application_get_inactivity_timeout
 g_application_get_is_registered
 g_application_get_is_remote
-g_application_get_app_menu
-g_application_get_menubar
 g_application_hold
 g_application_id_is_valid
 g_application_new
@@ -29,8 +27,6 @@ g_application_register
 g_application_release
 g_application_run
 g_application_set_action_group
-g_application_set_app_menu
-g_application_set_menubar
 g_application_set_application_id
 g_application_set_default
 g_application_set_flags



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]