Commit Graph

112 Commits

Author SHA1 Message Date
Christian Persch
4979c1d075 application: Add dbus register/unregister hooks
When the application is using its D-Bus backend, it is useful to be able
to export extra D-Bus objects at the right time, i.e. *before* the application
tries to own the bus name. This is accomplished here by adding a hook
in GApplicationClass for this; and a corresponding hook that will be called
on unregistration to undo whatever the register hook did.

Bug #675509.
2012-05-29 19:01:42 +02:00
Christian Persch
4b456635e4 Revert "application: Don't print a critical warning here"
This reverts commit 1541478bac.
2012-05-24 17:51:35 +02:00
Christian Persch
1541478bac application: Don't print a critical warning here
It's a runtime error, not a programming error.
2012-05-24 17:33:37 +02:00
Christian Persch
486d563049 application: Clarification about 'primary instance'
For non-unique applications, the 'primary instance' is the current
instance.
2012-05-02 20:15:39 +02:00
Ryan Lortie
eb5381b862 GApplication: add accessor for DBus information
Provide public access to the GDBusConnect and object path that
GApplication is using.  Prevents others from having to guess these
things for themselves based on the application ID.

https://bugzilla.gnome.org/show_bug.cgi?id=671249
2012-04-30 17:43:06 -04:00
Ryan Lortie
16f92a33ac GApplication: allow null application_id
GApplication application ID is now permitted to be NULL, in which case
G_APPLICATION_NON_UNIQUE will be implicitly enabled.

https://bugzilla.gnome.org/show_bug.cgi?id=671249
2012-04-30 17:38:15 -04:00
Robert Ancell
4143842eb4 Add missing allow-none annotations for function parameters.
Found using:
find . -name '*.c' | xargs grep 'or %NULL' | grep ' \* @' | grep -v '@error' | grep -v allow-none
2012-03-31 20:34:28 +11:00
Ryan Lortie
ed51975899 GApplication: add g_application_quit()
A long requested feature; this quits the application immediately,
ignoring the hold count.

https://bugzilla.gnome.org/show_bug.cgi?id=670485
2012-02-21 01:20:39 +01:00
David King
c490a75a18 docs: Fix GApplicationCommandLine typo 2012-02-21 01:10:54 +01:00
David King
69ecc4b496 docs: Fix define typos in GApplication 2012-02-21 01:10:54 +01:00
David King
87c76bdbb6 docs: Remove some old GMenu documentation 2012-02-21 01:10:54 +01:00
Murray Cumming
d4992b3d10 g_application_activate(): Fix typo in docs. 2012-02-15 11:53:03 +01:00
Ryan Lortie
40e9192d72 GApplication: put non-unique apps on D-Bus
For a number of reasons it might be useful to register the object paths
associated with a non-unique application so that the application can at
least field requests to its unique D-Bus name.

https://bugzilla.gnome.org/show_bug.cgi?id=647986
2012-02-09 12:15:49 -05:00
Matthias Clasen
49eeaa9bbd Assorted documentation fixes 2012-01-30 16:16:48 -05:00
Matthias Clasen
4e9f59bff8 e G_SOURCE_CONTINUE/REMOVE internally
Now that we have these macros, we should use them.
This commit covers everything in gio/.
2012-01-25 16:15:18 -05:00
Ryan Lortie
54b986d918 GApplication: drop support for appmenu/menubars
This has been moved over to GtkApplication now.

https://bugzilla.gnome.org/show_bug.cgi?id=668118
2012-01-18 13:39:22 -05:00
Ryan Lortie
0a22f63ebe Drop public menu APIs from GApplication
This is moving to Gtk, but we don't want to do it all right now.
2011-12-19 12:34:16 -05:00
Ryan Lortie
0971d36e4b GApplication: receiving end of GRemoteActionGroup
Use the fact that the action group exporter now speaks to
GRemoteActionGroup to get the platform data into GApplicion without
hacks.

https://bugzilla.gnome.org/show_bug.cgi?id=665737
2011-12-17 12:54:02 -05:00
Ryan Lortie
eefd08996f introduce GRemoteActionGroup
This interfaceifies the extra functions that were on GDBusActionGroup
for dealing with platform data.

The two main benefits of doing this:

  - no longer have to do a silly song and dance in GApplication to avoid
    calling GDBusActionGroup API from non-dbus-aware code

  - the interface can be reused by the action group exporter to avoid
    ugly and unbindable hook callbacks

https://bugzilla.gnome.org/show_bug.cgi?id=665737
2011-12-17 12:54:02 -05:00
Ryan Lortie
ee9f104432 GApplication: send platform data for actions again
Use the _full variants of the GDBusActionGroup API to send platform data
for action invocations once again.
2011-12-16 22:24:03 -05:00
Ryan Lortie
e370631f46 GApplication: emit signals on action changes
Now that we're a GActionMap the story about propagating signals from our
(now-constant) internal action group is vastly simplified.  If someone
calls g_application_set_action_group() then signals will stop working --
but this function is deprecated and they never worked before, so no big
loss there.

https://bugzilla.gnome.org/show_bug.cgi?id=643736
2011-12-16 11:43:59 -05:00
Matthias Clasen
4f5732f721 GApplication: fix a copy-paste error
Activating an action must not turn into a change-state request.
2011-12-12 01:44:41 -05:00
Matthias Clasen
dec7ed8aba Rearrange GApplication long desc a bit 2011-12-12 00:01:20 -05:00
Ryan Lortie
829b4dfb43 Clean up GApplication docs
Clean up the docs for GApplication and related classes.

I'm no longer writing documentation for the structure type of classes
and interfaces.  See https://bugzilla.gnome.org/show_bug.cgi?id=665926
for discussin on the correct way forward on this point.

Also: stop putting gtk-doc comments in installed headers.
2011-12-10 17:23:28 -05:00
Matthias Clasen
8d428e3cc4 GApplication: Make ::startup run-first
https://bugzilla.gnome.org/show_bug.cgi?id=665817
2011-12-08 23:46:32 -05:00
Matthias Clasen
caa6287f39 More documentation fixes 2011-12-08 18:05:15 -05:00
Matthias Clasen
690596e9fb Fully implement app-menu and menubar properties 2011-12-08 18:05:14 -05:00
Ryan Lortie
ac8bc3d407 GApplication: make menu properties readwrite
Otherwise the notify signals won't be emitted.
2011-12-08 18:05:14 -05:00
Ryan Lortie
a9f03596fa GApplication: menu can change after registration
Allow the menu to be changed after registration.  This is quite useful
for setting up the menus from the ::startup handler instead of having to
do it before registration because it lets you skip the work if you're
not the primary instance.
2011-12-08 18:05:14 -05:00
Ryan Lortie
088682d860 GApplication: implement GActionMap
and deprecate g_application_set_action_group().
2011-12-08 18:05:14 -05:00
Ryan Lortie
75f1802a1c Fix some GMenu and GMenuItem leaking 2011-12-08 18:05:14 -05:00
Ryan Lortie
3821627366 GApplication: make distinction about menus
Rename g_application_set_menu to g_application_set_app_menu and make a
couple of fixups.  Clarify the documentation about exactly what this
menu is meant to be.

Add g_application_set_menubar and document that as well.
2011-12-08 18:05:14 -05:00
Matthias Clasen
41c19c7df8 GApplication: Add a menu example to the docs 2011-12-08 18:05:13 -05:00
Matthias Clasen
ae0bd032ca Add g_application_set_menu
This adds ane asy way to export menu information alongside
the actions that are already exported by GApplication.
2011-12-08 18:05:12 -05:00
Matthias Clasen
df4cd241e5 GApplication: use GDBusActionGroup
instead of the internal version of the same
2011-12-08 18:05:12 -05:00
Matthias Clasen
3d686e3d8f Clarify docs around main loop vfuncs
Mention that the vfuncs are no longer used, and tweak the
wording around what g_application_run() does.

https://bugzilla.gnome.org/show_bug.cgi?id=665391
2011-12-07 14:38:37 -05:00
Ryan Lortie
a81cdf297c GApplication: add default application 2011-11-26 20:11:40 -05:00
Matthias Clasen
2cbc6d9ae6 GApplication: Implement query_action 2011-11-26 19:43:46 -05:00
Ryan Lortie
a795e563df Drop last uses of @returns: 2011-11-21 12:02:02 -05:00
Ryan Lortie
43007aa2d2 GApplication: don't create a mainloop
Just iterate the main context directly.  Also: avoid calling the virtual
functions for mainloops.

https://bugzilla.gnome.org/show_bug.cgi?id=658805
2011-09-14 14:09:12 -04:00
Ryan Lortie
01f9479438 GApplication: add chain-up checks
Make sure ::startup and ::shutdown are being chained up.
2011-09-14 14:00:08 -04:00
Brian Koning
15b1c1bf4f GApplication: introduce ::shutdown
Introduce ::shutdown as a dual to ::startup.

https://bugzilla.gnome.org/show_bug.cgi?id=643934
2011-09-14 13:45:44 -04:00
Ryan Lortie
8a7d33024a gio docs: lots more fixes 2011-09-06 00:31:49 -04:00
Johan Dahlin
ec98953e42 Pass in NULL instead of g_cclosure_marshal_generic
NULL is now a shortcut for g_cclosure_marshal_generic, so avoid
referencing it directly.

https://bugzilla.gnome.org/show_bug.cgi?id=654917
2011-07-19 14:38:34 -03:00
Colin Walters
b74e2a720a Stop using glib-genmarshal at build time
To help cross compilation, don't use glib-genmarshal in our
build.  This is easy now that we have g_cclosure_marshal_generic().

In gobject/, add gmarshal.[ch] to git (making the existing entry
points stubs).

In gio/, simply switch to using g_cclosure_marshal_generic().

https://bugzilla.gnome.org/show_bug.cgi?id=652168
2011-06-20 17:24:07 -04:00
Ryan Lortie
9793919d7b Whitespace fixes 2011-05-18 17:56:50 -04:00
Colin Walters
78203f3699 gapplication: Fix typo in property 2011-04-15 14:58:30 -04:00
Ryan Lortie
0f9b83dd36 GApplication: #include "gsettings.h"
Since we call g_settings_sync() from there now...
2011-04-15 09:30:24 -04:00
Ryan Lortie
ff57ed5d6a GApplication: g_settings_sync() on exit
Call g_settings_sync() just before g_applcation_run() returns.  This is
really the correct thing to do in every case that you're using GSettings
and it prevents every single application from having to do it for
themselves.

Closes bug #647419.
2011-04-11 03:41:10 -04:00
Ryan Lortie
9d204338f3 GApplication: add G_APPLICATION_NON_UNIQUE
Add a flag to essentially short-circuit g_application_register().  The
application makes no attempt to acquire the bus name or check for
existing instances with that name.  The application is never considered
as being 'remote' and all requests are handled locally.

Closes #646985.
2011-04-10 07:55:33 -04:00