summaryrefslogtreecommitdiff
path: root/gtk/gtkactionmuxer.c
Commit message (Collapse)AuthorAgeFilesLines
* actionmuxer: Plug a memory leakTimm Bäder2019-07-071-0/+2
|
* Fix a crash in action muxer destructionMatthias Clasen2019-06-301-9/+0
| | | | | | | | | | I've seen a crash when the action muxer gets disposed during widget destroy, and tries to disconnect from widget signals too late. There is no real need to disconnect, since the only time an action muxer is going away is when its widget is destroyed, so just don't do it.
* action muxer: Don't activate disabled actionsMatthias Clasen2019-06-231-4/+7
| | | | We really shouldn't.
* action muxer: Change inheritanceMatthias Clasen2019-06-221-3/+12
| | | | | | | | | Previously, we would not look any further for an action once we found a match for the prefix, defining inheritance by groups. Change this to inheritance for individual actions, since we are moving towards individual actions as the main ingredient in GTKs action support.
* action muxer: Remove unused apiMatthias Clasen2019-06-221-14/+0
|
* Replace stateful actions by property actionsMatthias Clasen2019-06-221-11/+163
| | | | | | | | | | The only cases of stateful actions we've seen so far have been boolean properties, and we don't really want to add much state handling API, so lets just go with property actions for now. Adapt the only user in GtkText.
* widget actions: Add an explicit state typeMatthias Clasen2019-06-211-4/+2
| | | | | | | Make the state type part of the API for installing stateful widget actions. That lets us introspect it. Update all callers.
* Allow registering actions per-classMatthias Clasen2019-06-181-11/+142
| | | | | | | | | | | | | | | | | | Add a facility to register and install actions at class init time. The intended use for these actions is for a) context and other model-based menus b) key bindings Most of these actions are going to be stateless, so add separate apis for the simple and stateful cases. We avoid creating an action group for these by teaching the action muxer about these actions. The action muxer also maintains the enabled state for these actions.
* Give the action muxer a widgetMatthias Clasen2019-06-181-2/+24
| | | | | This will be used in the future to obtain widget class actions.
* widget: Remove gtk_widget_list_action_prefixesMatthias Clasen2019-06-151-6/+0
| | | | | This function was added just for the inspector, and is not used there anymore. Drop it.
* action muxer: cosmeticsMatthias Clasen2019-06-151-9/+10
|
* action muxer: Add some convenience apiMatthias Clasen2019-06-151-0/+13
| | | | | | Instead of duplicating this code in multiple places, add an api to look up an action group for a prefixed name, and return the unprefixed name at the same time.
* Rename a bunch of private headersMatthias Clasen2019-06-101-2/+2
| | | | | We want to follow the convention that all private headers have names ending in private.h
* gtk: fix all uses of g_cclosure_marshal_genericChristian Hergert2019-06-021-2/+11
| | | | | | | | | | | | | | This adds specific marshallers for all of the locations where a generic marshaller is being used. It also provides va_marshallers to reduce the chances that we get stack traces from perf going through ffi_call_unix64. This is forward ported from gtk-3-24. # Conflicts: # gtk/gtkeventcontrollerkey.c # gtk/gtkeventcontrollermotion.c # gtk/gtkgesture.c # gtk/gtkgesturemultipress.c
* Rename GtkActionMuxer's private headerEmmanuele Bassi2018-02-021-1/+1
| | | | Follow the naming policy for private headers.
* app: share function to normalise detailed action nameSébastien Wilmet2016-04-221-0/+20
| | | | | | | Put the function in gtkactionmuxer.c, where gtk_print_action_and_target() is implemented. https://bugzilla.gnome.org/show_bug.cgi?id=764879
* Cast the return value of g_array_free to void* before casting to char**Ting-Wei Lan2016-01-111-1/+1
| | | | | | | | Let the compiler know that we don't want to use it as char*, so there is no alignment error. https://bugzilla.gnome.org/show_bug.cgi?id=760350 https://bugzilla.gnome.org/show_bug.cgi?id=755659
* Intern all signal names beforehandMatthias Clasen2015-09-121-1/+2
| | | | This avoids pointless allocations
* widget: add helpers to resolve GActionGroups available to GtkWidgetChristian Hergert2014-12-111-2/+2
| | | | | | | | These functions, while added for use by the GTK inspector, are generally useful to applications that need to resolve what action groups are available to a particular GtkWidget. https://bugzilla.gnome.org/show_bug.cgi?id=741386
* GtkActionMuxer: Plug a memory leakMatthias Clasen2014-06-281-0/+2
| | | | valgrind complained that we leak the primary_accels table.
* GtkActionMuxer: Add gettersMatthias Clasen2014-05-141-0/+21
| | | | | | | Add a way to enumerate all prefixes, and to get the action group for a prefix. https://bugzilla.gnome.org/show_bug.cgi?id=730095
* docs: use proper quotations instead of '*'William Jon McCann2014-02-071-2/+2
|
* docs: use proper quotesWilliam Jon McCann2014-02-051-8/+8
|
* docs: don't use <varnam>William Jon McCann2014-02-041-2/+2
|
* docs: use ` instead of <literal>William Jon McCann2014-02-041-4/+4
|
* docs: mark gtkdoc blocks as private for internal only APIWilliam Jon McCann2014-01-211-6/+6
|
* Use g_return_val_if_fail where return value needed.Daniel Svensson2013-10-291-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=710987
* GtkActionMuxer: store primary accelsRyan Lortie2013-10-151-0/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reuse the existing infrastructure in GtkActionMuxer for propagation of accelerator information: in particular, what accel label ought to appear on menu items for a particular action and target. This is a good idea because we want accels to travel along with the actions that they're tied to and reusing GtkActionMuxer will allow us to do that without creating another hierarchy of a different class for the sole purpose of filling in accel labels on menu items. Doing it this ways also allows those who copy/paste GtkActionMuxer to insert the accels for themselves. Add a new method on the GtkActionObserver interface to report changes. This patch introduces a new concept: "action and target" notation for actions. This format looks like so: "'target'|app.action" or for non-targeted actions: "|app.action" and it is used over a number of possible alternative formats for some good reasons: - it's very easy to get a nul-terminated action name out of this format when we need it, by using strrchr('|') + 1 - we can also get the target out of it using g_variant_parse() because this function takes a pointer to a 'limit' character that is not parsed past: we use the '|' for this - it's extremely easy to hash on this format (just use a normal string hash) vs. attempting to hash on a string plus a GVariant A close contender was to use detailed action strings here, but these are not used for two reasons: - it's not possible to easily get the action name or target out of the strings without more work than the "action and target" format requires - we still intend to use detailed action strings on API (since they are a lot nicer to look at) but detailed action strings can be given in non-canonical forms (eg: 'foo::bar' and 'foo("bar")' are equivalent) so we'd have to go through a normalisation step anyway. Since we're doing that already, we may as well convert to a more convenient internal format. This new "action and target" format is going to start appearing in a lot more places as action descriptions are introduced. I suspect that nobody is using '|' in their action names, but in case I am proven wrong, we can always switch to using something more exotic as a separator character (such as '\x01' or '\xff' or the like).
* action stuff: Introspection fixesJasper St. Pierre2013-05-131-7/+9
|
* action stuff: stop abusing GLib's namespaceRyan Lortie2013-05-131-0/+776
Rename our internal GActionMuxer, GActionObserver and GActionObservable classes and interfaces to have names in our own namespace. These classes were originally intended for GIO but turned out to be too special-purpose to be useful there, so we never made them public API but have just been copying them around (without bothering to properly rename them). Now that other people will be copying them out of Gtk, it's even more important to prevent this namespace abuse from spreading further.