Commit 0a22f63e authored by Allison Karlitskaya's avatar Allison Karlitskaya

Drop public menu APIs from GApplication

This is moving to Gtk, but we don't want to do it all right now.
parent 0c094d66
......@@ -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
......
......@@ -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);
......
......@@ -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);
......
......@@ -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.
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment