~ubuntu-branches/ubuntu/trusty/glib2.0/trusty-proposed

« back to all changes in this revision

Viewing changes to gio/gapplicationimpl-dbus.c

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2013-05-14 14:00:47 UTC
  • mfrom: (1.63.19) (172.1.10 experimental)
  • Revision ID: package-import@ubuntu.com-20130514140047-0idsmbto2pmdhlmf
Tags: 2.37.0-0ubuntu1
* New upstream release
  + GApplication has gained a busy state. This feature is intended for
    clients that want to signal a desktop shell their busy state, for instance
    because a long-running operation is pending.
  + GLib can now be built with the bionic C library
  + GIcon can now be serialized to a GVariant
* debian/patches/git_dont_break_bindings,
  debian/patches/15_gio_desktop_app_info_test_bin_true_path.patch,
  debian/patches/17_check_abis_mips_symbols.patch: Dropped, upstream. 
* Update symbols file for this release. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
        "<arg type='a{sv}' name='platform-data' direction='in'/>"
68
68
        "<arg type='i' name='exit-status' direction='out'/>"
69
69
      "</method>"
 
70
    "<property name='Busy' type='b' access='read'/>"
70
71
    "</interface>"
71
72
  "</node>";
72
73
 
99
100
 
100
101
  gboolean         properties_live;
101
102
  gboolean         primary;
 
103
  gboolean         busy;
102
104
  GApplication    *app;
103
105
};
104
106
 
106
108
static GApplicationCommandLine *
107
109
g_dbus_command_line_new (GDBusMethodInvocation *invocation);
108
110
 
 
111
static GVariant *
 
112
g_application_impl_get_property (GDBusConnection *connection,
 
113
                                 const gchar  *sender,
 
114
                                 const gchar  *object_path,
 
115
                                 const gchar  *interface_name,
 
116
                                 const gchar  *property_name,
 
117
                                 GError      **error,
 
118
                                 gpointer      user_data)
 
119
{
 
120
  GApplicationImpl *impl = user_data;
 
121
 
 
122
  if (strcmp (property_name, "Busy") == 0)
 
123
    return g_variant_new_boolean (impl->busy);
 
124
 
 
125
  g_assert_not_reached ();
 
126
 
 
127
  return NULL;
 
128
}
 
129
 
 
130
static void
 
131
send_property_change (GApplicationImpl *impl)
 
132
{
 
133
  GVariantBuilder builder;
 
134
 
 
135
  g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
 
136
  g_variant_builder_add (&builder,
 
137
                         "{sv}",
 
138
                         "Busy", g_variant_new_boolean (impl->busy));
 
139
 
 
140
  g_dbus_connection_emit_signal (impl->session_bus,
 
141
                                 NULL,
 
142
                                 impl->object_path,
 
143
                                 "org.freedesktop.DBus.Properties",
 
144
                                 "PropertiesChanged",
 
145
                                 g_variant_new ("(sa{sv}as)",
 
146
                                                "org.gtk.Application",
 
147
                                                &builder,
 
148
                                                NULL),
 
149
                                 NULL);
 
150
}
109
151
 
110
152
static void
111
153
g_application_impl_method_call (GDBusConnection       *connection,
143
185
      GFile **files;
144
186
      gint n, i;
145
187
 
146
 
      g_variant_get (parameters, "(@ass@a{sv})",
 
188
      g_variant_get (parameters, "(@as&s@a{sv})",
147
189
                     &array, &hint, &platform_data);
148
190
 
149
191
      n = g_variant_n_children (array);
229
271
{
230
272
  const static GDBusInterfaceVTable vtable = {
231
273
    g_application_impl_method_call,
 
274
    g_application_impl_get_property,
 
275
    NULL /* set_property */
232
276
  };
233
277
  GApplicationClass *app_class = G_APPLICATION_GET_CLASS (impl->app);
234
278
  GVariant *reply;
353
397
}
354
398
 
355
399
void
 
400
g_application_impl_set_busy_state (GApplicationImpl *impl,
 
401
                                   gboolean          busy)
 
402
{
 
403
  if (impl->busy != busy)
 
404
    {
 
405
      impl->busy = busy;
 
406
      send_property_change (impl);
 
407
    }
 
408
}
 
409
 
 
410
void
356
411
g_application_impl_destroy (GApplicationImpl *impl)
357
412
{
358
413
  g_application_impl_stop_primary (impl);