Debian Codegraph @

docs/dev-notes

raw
1 libgedit-amtk notes - possible things to do or to investigate
2 =============================================================
3
4 For the 'Actions, Menus and Toolbars Kit' part
5 ----------------------------------------------
6
7 - Add convenient API to replace a placeholder by a list of menu/toolbar items?
8 And be able to update the placeholder content when the application runs (so
9 mark items to recognize them later, to know that they are part of the
10 placeholder). Or create a Placeholder object that contains the list of items,
11 so when the Placeholder object is modified, the menu/toolbar is updated
12 accordingly.
13 Or, the application can re-generate the whole submenu or a toolbar each time
14 that it is needed. Or a submenu could be created on-the-fly, upon receiving a
15 signal to open the submenu (?). In these cases, a full-blown placeholder
16 mechanism is not needed, but perhaps a few utility functions would help.
17 A good test-bed for this is the gnome-latex application.
18
19 - Add one more sanity check: check that a GAction is *implemented* when (or
20 after) creating a menu or toolbar item for that action? Because currently
21 when the GAction is not implemented, the menu/toolbar item is just
22 insensitive, there is no warning, no way to know if the menu/toolbar item was
23 set as insensitive explicitly/intentionally or not.
24
25 - An AmtkActionInfo could have a field for the default AmtkFactoryFlags (or to
26 force some flags). For example setting AMTK_FACTORY_IGNORE_ACCELS_FOR_APP for
27 the tepl-cut/copy/paste/select-all actions.
28 But it's perhaps a bit messy.
29
30 - To prevent apps from modifying ActionInfos of libs, maybe seal an ActionInfo
31 when it is added to a store, except for mark_as_used(). But it's maybe a bit
32 too paranoid. Or instead of sealing, have a builder class that creates an
33 immutable ActionInfo, see:
34 https://blogs.gnome.org/otte/2018/02/03/builders/
35
36 - ActionInfo and ActionInfoEntry could have one more field for an identifier,
37 because when using a detailed GAction name the name can become a bit hairy
38 (small tip / side note: to "git grep" it the `--fixed-strings` argument is
39 needed). The detailed GAction name would be the equivalent of the callback in
40 a GtkActionEntry.
41 Because currently, to avoid such hairy names, more GActions need to be
42 implemented, that can in turn call common functions.