Commit Graph

26 Commits

Author SHA1 Message Date
Philip Withnall
5942cd7984 gio: Add SPDX license headers automatically
Add SPDX license (but not copyright) headers to all files which follow a
certain pattern in their existing non-machine-readable header comment.

This commit was entirely generated using the command:
```
git ls-files gio/*.[ch] | xargs perl -0777 -pi -e 's/\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/\n \*\n \* SPDX-License-Identifier: LGPL-2.1-or-later\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/igs'
```

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #1415
2022-05-18 09:18:52 +01:00
Emmanuel Fleury
7c32b1173a Fix signedness warning in gio/gmenu.c:g_menu_remove()
gio/gmenu.c: In function ‘g_menu_remove’:
gio/gmenu.c:483:47: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’}
  483 |   g_return_if_fail (0 <= position && position < menu->items->len);
      |                                               ^
2021-02-08 11:00:33 +01:00
Emmanuel Fleury
2174bcf000 Fix signedness warning in gio/gmenu.c:g_menu_insert_item()
gio/gmenu.c: In function ‘g_menu_insert_item’:
gio/gmenu.c:165:32: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’}
  165 |   if (position < 0 || position > menu->items->len)
      |                                ^
2021-02-08 11:00:33 +01:00
Sebastian Dröge
705a59a315 gio: Add missing nullable annotations 2020-11-11 13:15:21 +02:00
Sébastien Wilmet
3bf4a720c3 gio/: LGPLv2+ -> LGPLv2.1+
Sub-directories inside gio/ already processed in a previous commit:
- fam/
- gdbus-2.0/ (which contains only codegen/)
- gvdb/
- inotify/
- tests/
- win32/
- xdgmime/

Other sub-directories inside gio/:
- completion/: no license headers
- kqueue/: not LGPL, BSD-style license

https://bugzilla.gnome.org/show_bug.cgi?id=776504
2017-05-29 19:53:34 +02:00
Christian Hergert
18a33f72db introspection: use (nullable) or (optional) instead of (allow-none)
If we have an input parameter (or return value) we need to use (nullable).
However, if it is an (inout) or (out) parameter, (optional) is sufficient.

It looks like (nullable) could be used for everything according to the
Annotation documentation, but (optional) is more specific.
2016-11-22 14:14:37 -08:00
Felix Riemann
34277d6996 gio: g_menu_item_set_icon should not fail if icon is NULL
It allows passing a NULL icon to unset the icon and thus should not
log a critical warning if used like that.

https://bugzilla.gnome.org/show_bug.cgi?id=753285
2015-08-10 19:00:24 +02:00
Matthias Clasen
17f51583a8 Docs: Convert examples to |[ ]| 2014-01-31 21:56:33 -05:00
Daniel Mustieles
078dbda148 Updated FSF's address 2014-01-31 14:31:55 +01:00
Matthias Clasen
3872049445 Add includes to all gio docs 2014-01-07 22:55:43 -05:00
Ryan Lortie
c1c1b33f88 GMenu: add g_menu_item_set_icon() convenience
This function takes a GIcon, serialises it and sets the resulting
GVariant as the "icon" attribute on the menu item.  We will need to add
a patch to Gtk to actually consume this icon.

Also add G_MENU_ATTRIBUTE_ICON.

https://bugzilla.gnome.org/show_bug.cgi?id=688820
2013-04-22 16:12:42 -04:00
Ryan Lortie
1de0625103 GMenu: add g_menu_remove_all() API
Removes all of the items from a GMenu.  The keyboard indicator wants to
do this as part of refreshing the layout list, as an example.

https://bugzilla.gnome.org/show_bug.cgi?id=697601
2013-04-19 14:52:51 -04:00
Ryan Lortie
8cddb54659 gaction: add parser for detailed action names
Expand and formalise the syntax for detailed action names, adding a
well-documented (and tested) public parser API for them.

Port the only GLib-based user of detailed action names to the new API:
g_menu_item_set_detailed_action().  The users in Gtk+ will also be
ported soon.

https://bugzilla.gnome.org/show_bug.cgi?id=688954
2013-04-01 16:53:54 -04:00
Ryan Lortie
6798fcdd0f GMenuItem: add constructor to copy from model
Add g_menu_item_new_from_model() for constructing a GMenuItem that is a
copy of a menu item that's in a GMenuModel.
2012-08-20 16:26:25 -04:00
Ryan Lortie
99478dd893 GMenuItem: add getter APIs
GMenuItem has been write-only up to this point.  Add some APIs for
reading back values as well.
2012-08-20 16:26:25 -04:00
Colin Walters
c1ada372e9 gmenu: Remove stray semicolon in g_menu_clear_item() 2012-06-22 10:32:25 -04:00
Lars Uebernickel
ebc3b928a3 docs: reference g_menu_item_new in gmenu convenience menuitem API 2012-05-10 09:35:03 -07:00
David King
87c76bdbb6 docs: Remove some old GMenu documentation 2012-02-21 01:10:54 +01:00
David King
e70b72f5a1 docs: Fix method names in GMenu and GMenuModel 2012-02-21 01:10:54 +01:00
Cosimo Cecchi
adff60ed63 menu: documentation fixes
g_menu_new_section() does not exist, the comment meant
g_menu_item_new_section().
2011-12-21 12:36:19 +01:00
Matthias Clasen
f40de4b152 Add some more since tags 2011-12-10 22:14:34 -05:00
Matthias Clasen
f109415d95 Add since tags 2011-12-10 20:47:22 -05:00
Matthias Clasen
d5a1b674f5 Improve docs
Specify that g_menu_item_set_attribute_value consumes floating
@values.
2011-12-08 18:05:13 -05:00
Matthias Clasen
8d96e68eeb GMenu: Enforce attribute name restrictions
The code assumes in various places that ':' does not occur
in attribute names. We are a little more strict than that,
and only allow lowercase ASCII, digits and '-'.
2011-12-08 18:05:13 -05:00
Matthias Clasen
58a8c02dfb Match up a parameter name 2011-12-08 18:05:12 -05:00
Matthias Clasen
13f5977735 Add GMenu 2011-12-08 18:05:12 -05:00