mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-05-23 14:00:40 +02:00
Revert "GDBusActionGroup: add static platform registration"
This reverts commit fcc9902e98a6a6568a1150441c8680fd4615d437.
This commit is contained in:
parent
e370631f46
commit
e5ed11bcf8
@ -27,14 +27,10 @@
|
|||||||
#include "gdbusmethodinvocation.h"
|
#include "gdbusmethodinvocation.h"
|
||||||
#include "gdbusintrospection.h"
|
#include "gdbusintrospection.h"
|
||||||
#include "gdbusconnection.h"
|
#include "gdbusconnection.h"
|
||||||
#include "gdbusactiongroup.h"
|
|
||||||
#include "gactiongroup.h"
|
#include "gactiongroup.h"
|
||||||
#include "gapplication.h"
|
#include "gapplication.h"
|
||||||
#include "gdbuserror.h"
|
#include "gdbuserror.h"
|
||||||
|
|
||||||
extern GDBusActionGroupEmitHookFunc g_dbus_action_group_before_emit_hook;
|
|
||||||
extern GDBusActionGroupEmitHookFunc g_dbus_action_group_after_emit_hook;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:gactiongroupexporter
|
* SECTION:gactiongroupexporter
|
||||||
* @title: GActionGroup exporter
|
* @title: GActionGroup exporter
|
||||||
@ -453,9 +449,6 @@ g_action_group_exporter_pre_emit (GActionGroupExporter *exporter,
|
|||||||
if (G_IS_APPLICATION (exporter->action_group))
|
if (G_IS_APPLICATION (exporter->action_group))
|
||||||
G_APPLICATION_GET_CLASS (exporter->action_group)
|
G_APPLICATION_GET_CLASS (exporter->action_group)
|
||||||
->before_emit (G_APPLICATION (exporter->action_group), platform_data);
|
->before_emit (G_APPLICATION (exporter->action_group), platform_data);
|
||||||
|
|
||||||
else if (g_dbus_action_group_before_emit_hook != NULL)
|
|
||||||
(* g_dbus_action_group_before_emit_hook) (exporter->action_group, platform_data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -465,9 +458,6 @@ g_action_group_exporter_post_emit (GActionGroupExporter *exporter,
|
|||||||
if (G_IS_APPLICATION (exporter->action_group))
|
if (G_IS_APPLICATION (exporter->action_group))
|
||||||
G_APPLICATION_GET_CLASS (exporter->action_group)
|
G_APPLICATION_GET_CLASS (exporter->action_group)
|
||||||
->after_emit (G_APPLICATION (exporter->action_group), platform_data);
|
->after_emit (G_APPLICATION (exporter->action_group), platform_data);
|
||||||
|
|
||||||
else if (g_dbus_action_group_after_emit_hook != NULL)
|
|
||||||
(* g_dbus_action_group_after_emit_hook) (exporter->action_group, platform_data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -38,10 +38,6 @@
|
|||||||
* that is exported over D-Bus with g_dbus_connection_export_action_group().
|
* that is exported over D-Bus with g_dbus_connection_export_action_group().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
G_GNUC_INTERNAL GDBusActionGroupSendHookFunc g_dbus_action_group_send_hook;
|
|
||||||
G_GNUC_INTERNAL GDBusActionGroupEmitHookFunc g_dbus_action_group_before_emit_hook;
|
|
||||||
G_GNUC_INTERNAL GDBusActionGroupEmitHookFunc g_dbus_action_group_after_emit_hook;
|
|
||||||
|
|
||||||
struct _GDBusActionGroup
|
struct _GDBusActionGroup
|
||||||
{
|
{
|
||||||
GObject parent_instance;
|
GObject parent_instance;
|
||||||
@ -372,15 +368,10 @@ g_dbus_action_group_change_state (GActionGroup *g_group,
|
|||||||
GVariant *value)
|
GVariant *value)
|
||||||
{
|
{
|
||||||
GDBusActionGroup *group = G_DBUS_ACTION_GROUP (g_group);
|
GDBusActionGroup *group = G_DBUS_ACTION_GROUP (g_group);
|
||||||
GVariantBuilder platform_data_builder;
|
|
||||||
|
|
||||||
g_variant_builder_init (&platform_data_builder, G_VARIANT_TYPE_VARDICT);
|
|
||||||
if (g_dbus_action_group_send_hook != NULL)
|
|
||||||
(* g_dbus_action_group_send_hook) (group, &platform_data_builder);
|
|
||||||
|
|
||||||
/* Don't bother with the checks. The other side will do it again. */
|
/* Don't bother with the checks. The other side will do it again. */
|
||||||
g_dbus_connection_call (group->connection, group->bus_name, group->object_path, "org.gtk.Actions", "SetState",
|
g_dbus_connection_call (group->connection, group->bus_name, group->object_path, "org.gtk.Actions", "SetState",
|
||||||
g_variant_new ("(sva{sv})", action_name, value, &platform_data_builder),
|
g_variant_new ("(sva{sv})", action_name, value, NULL),
|
||||||
NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL);
|
NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -390,7 +381,6 @@ g_dbus_action_group_activate (GActionGroup *g_group,
|
|||||||
GVariant *parameter)
|
GVariant *parameter)
|
||||||
{
|
{
|
||||||
GDBusActionGroup *group = G_DBUS_ACTION_GROUP (g_group);
|
GDBusActionGroup *group = G_DBUS_ACTION_GROUP (g_group);
|
||||||
GVariantBuilder platform_data_builder;
|
|
||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
|
g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
|
||||||
@ -398,12 +388,8 @@ g_dbus_action_group_activate (GActionGroup *g_group,
|
|||||||
if (parameter)
|
if (parameter)
|
||||||
g_variant_builder_add (&builder, "v", parameter);
|
g_variant_builder_add (&builder, "v", parameter);
|
||||||
|
|
||||||
g_variant_builder_init (&platform_data_builder, G_VARIANT_TYPE_VARDICT);
|
|
||||||
if (g_dbus_action_group_send_hook != NULL)
|
|
||||||
(* g_dbus_action_group_send_hook) (group, &platform_data_builder);
|
|
||||||
|
|
||||||
g_dbus_connection_call (group->connection, group->bus_name, group->object_path, "org.gtk.Actions", "Activate",
|
g_dbus_connection_call (group->connection, group->bus_name, group->object_path, "org.gtk.Actions", "Activate",
|
||||||
g_variant_new ("(sava{sv})", action_name, &builder, &platform_data_builder),
|
g_variant_new ("(sava{sv})", action_name, &builder, NULL),
|
||||||
NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL);
|
NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -521,17 +507,3 @@ g_dbus_action_group_sync (GDBusActionGroup *group,
|
|||||||
|
|
||||||
return reply != NULL;
|
return reply != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
g_dbus_action_group_register_platform (GDBusActionGroupSendHookFunc send,
|
|
||||||
GDBusActionGroupEmitHookFunc before,
|
|
||||||
GDBusActionGroupEmitHookFunc after)
|
|
||||||
{
|
|
||||||
g_return_if_fail (g_dbus_action_group_send_hook == NULL &&
|
|
||||||
g_dbus_action_group_before_emit_hook == NULL &&
|
|
||||||
g_dbus_action_group_after_emit_hook == NULL);
|
|
||||||
|
|
||||||
g_dbus_action_group_send_hook = send;
|
|
||||||
g_dbus_action_group_before_emit_hook = before;
|
|
||||||
g_dbus_action_group_after_emit_hook = after;
|
|
||||||
}
|
|
||||||
|
@ -49,14 +49,6 @@ GDBusActionGroup * g_dbus_action_group_get (GDBusConn
|
|||||||
const gchar *bus_name,
|
const gchar *bus_name,
|
||||||
const gchar *object_path);
|
const gchar *object_path);
|
||||||
|
|
||||||
typedef void (* GDBusActionGroupSendHookFunc) (GDBusActionGroup *group,
|
|
||||||
GVariantBuilder *builder);
|
|
||||||
typedef void (* GDBusActionGroupEmitHookFunc) (GActionGroup *group,
|
|
||||||
GVariant *platform_data);
|
|
||||||
void g_dbus_action_group_register_platform (GDBusActionGroupSendHookFunc send_hook,
|
|
||||||
GDBusActionGroupEmitHookFunc before_hook,
|
|
||||||
GDBusActionGroupEmitHookFunc after_hook);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __G_DBUS_ACTION_GROUP_H__ */
|
#endif /* __G_DBUS_ACTION_GROUP_H__ */
|
||||||
|
@ -1442,7 +1442,6 @@ g_simple_action_new_stateful
|
|||||||
g_simple_action_set_enabled
|
g_simple_action_set_enabled
|
||||||
g_simple_action_set_state
|
g_simple_action_set_state
|
||||||
g_dbus_action_group_get_type
|
g_dbus_action_group_get_type
|
||||||
g_dbus_action_group_register_platform
|
|
||||||
g_dbus_action_group_get
|
g_dbus_action_group_get
|
||||||
g_dbus_menu_model_get_type
|
g_dbus_menu_model_get_type
|
||||||
g_dbus_menu_model_get
|
g_dbus_menu_model_get
|
||||||
|
Loading…
x
Reference in New Issue
Block a user