Commit Graph

2044 Commits

Author SHA1 Message Date
Jonas Danielsson
bf9c862504 GApplication: Add g_application_add_main_option
This function adds a single main option entry to be handeled by
GApplication. The option entry has it arg_data field set to NULL
and will be added to the applications packed_options.

The rationale for this is that bindings will be able to add
command line options even when they can't use the un-boxed struct
GOptionEntry.

https://bugzilla.gnome.org/show_bug.cgi?id=727455
2014-08-20 16:02:59 +02:00
Rico Tzschichholz
4c8480e6fa docs: Add index for 2.42 api 2014-08-17 22:54:22 +02:00
Dan Winship
b88fdf0b0f docs: hyphenate "High-level" and "Low-level" 2014-08-12 07:50:20 -04:00
Ryan Lortie
cea9de93c8 GApplication: add a "resource base path"
We don't use this for anything inside of GApplication yet, but Gtk is
about to start using it to find various bits of the application (such as
its menus, icons, etc.).

By default, we form the base path from the application ID to end up with
the familiar /org/example/app style.

https://bugzilla.gnome.org/show_bug.cgi?id=722092
2014-07-07 13:40:03 -04:00
Michael Catanzaro
c3842d1969 Fix old wiki links 2014-07-01 23:52:19 -05:00
Edward Hervey
c5c3c320a2 gvalue: New g_value_init_from_instance
Used for the commonly used case (in signal emission) where we
initialize and set a GValue for an instance

Includes a fast-path for GObject

Overall makes it 6 times faster than the previous combination
of g_value_init + g_value_set_instance

Makes signal emission around 10% faster

https://bugzilla.gnome.org/show_bug.cgi?id=731950
2014-06-24 14:21:10 -04:00
Michael Catanzaro
753e6ef7d7 docs: fix typos 2014-06-24 10:49:21 -05:00
Zeeshan Ali (Khattak)
eb6da409fa docs: Correct param to interface's default_init()
https://bugzilla.gnome.org/show_bug.cgi?id=731979
2014-06-21 12:18:58 +01:00
Michael Catanzaro
d552a1f125 docs: fix a broken sentence 2014-06-20 16:44:59 -05:00
Michael Catanzaro
39d70301c5 trivial: docs: add some missing commas 2014-06-06 22:58:48 -05:00
Matthias Clasen
903a5d711e docs: Add an index for 2.40 api 2014-05-31 11:32:55 -04:00
Matthias Clasen
abd4df4b55 docs: Add some missing apis 2014-05-31 10:54:02 -04:00
Matthias Clasen
5b0183fd23 docs: Add a 2.42 api index 2014-05-31 10:54:02 -04:00
Edward Hervey
6072e3650f gtype: Add check for fundamental instance type
When checking whether an instance is of a given fundamental type (such
as G_TYPE_OBJECT), we can avoid over 60%+ of the cost of checking types.

https://bugzilla.gnome.org/show_bug.cgi?id=730984
2014-05-31 15:45:29 +02:00
Philip Withnall
fd9120dc50 gvariant: Clarify type and format strings in the docs
'@' and '&' are only used in format strings as prefixes to type
strings and not to full format strings.

https://bugzilla.gnome.org/show_bug.cgi?id=729269
2014-05-28 10:59:38 +01:00
Ryan Lortie
61a9142cd0 Revert "gvariant: Fix confusion between type and format strings in the docs"
This reverts commit fca1b83be7.

The original documentation was correct.

https://bugzilla.gnome.org/show_bug.cgi?id=729269
2014-05-26 17:34:54 +02:00
Sébastien Wilmet
54d1751fd8 doc: better ordering of GSubprocessLauncher functions
Take the same order as the header.
2014-05-12 00:25:06 +02:00
Sébastien Wilmet
430e6fd6ad doc: various improvements
- GSubprocessLauncher exists since 2.40, not 2.36
- more logical order for g_markup functions
- fix short description of GMarkup
- GMarkupParser: specify that some parameters are NULL-terminated.
- g_string_new (NULL); is possible.
- other trivial fixes.

https://bugzilla.gnome.org/show_bug.cgi?id=728983
2014-05-09 18:47:42 +02:00
Ryan Lortie
0b27719293 docs: add two missing symbols on GDesktopAppInfo
https://bugzilla.gnome.org/show_bug.cgi?id=712391
2014-05-08 16:19:50 -04:00
Philip Withnall
361a6eb856 docs: Fix some minor typos in the GVariant documentation
https://bugzilla.gnome.org/show_bug.cgi?id=729269
2014-05-01 15:34:30 +02:00
Philip Withnall
fca1b83be7 gvariant: Fix confusion between type and format strings in the docs
‘@’ and ‘&’ are only used in format strings, not type strings.

https://bugzilla.gnome.org/show_bug.cgi?id=729269
2014-04-30 16:38:43 +02:00
Philip Withnall
704852ff09 gobject: Document that classes/objects/interfaces are zero-filled
On initialisation, GObject guarantees to zero-fill
class/object/interface structures. Document this so people don’t spend
forever writing:
    my_object->priv->some_member = NULL;
    my_object->priv->some_other_member = NULL;

https://bugzilla.gnome.org/show_bug.cgi?id=729167
2014-04-29 10:40:20 +01:00
Dan Winship
31694f9ccb Bump version to 2.41.0, add GLIB_VERSION_2_42, etc 2014-03-29 12:54:29 -04:00
David King
25f36d8e5e Add g_application_command_line_get_options_dict() to docs 2014-03-10 19:16:28 +00:00
Ryan Lortie
941b8979d0 Add locale-sensitive ASCII transliteration API
Add a new function, g_str_to_ascii() that does locale-dependent ASCII
transliteration of UTF-8 strings.

This function works off of an internal database.  We get the data out of
the localedata shipped with glibc, which seems to be just about the best
source of locale-sensitive transliteration information available
anywhere.

We include a update script with this commit that's not used by anything
at all -- it will just sit in git.  It is intended to be run manually
from time to time.

https://bugzilla.gnome.org/show_bug.cgi?id=710142
2014-02-20 18:27:24 -05:00
Xavier Claessens
0ffa1ea8dd Add G_ÂTYPE_VARIANT_DCT into the doc 2014-02-19 15:51:27 -05:00
Dan Winship
5575a3e9cb gio: don't accept nonstandard IPv4 "numbers-and-dots" addresses
In addition to the standard "192.168.1.1" format, there are numerous
legacy IPv4 address formats (such as "192.168.257",
"0xc0.0xa8.0x01.0x01", "0300.0250.0001.0001", "3232235777", and
"0xc0a80101"). However, none of these forms are ever used any more
except in phishing attempts. GLib wasn't supposed to be accepting
these addresses (neither g_hostname_is_ip_address() nor
g_inet_address_new_from_string() recognizes them), but getaddrinfo()
accepts them, and so the parts of gio that use getaddrinfo()
accidentally did accept those formats.

Fix GNetworkAddress and GResolver to reject these address formats.

https://bugzilla.gnome.org/show_bug.cgi?id=679957
2014-02-15 10:22:24 -05:00
Matthias Clasen
35066ed6c6 Docs: Drop entities, switch away from sgml mode
Since all element markup is now gone from the doc comments,
we can turn off the gtk-doc sgml mode, which means that from
now on, docbook markup is no longer allowed in doc comments.

To make this possible, we have to replace all remaining
entities in doc comments by their replacement text, & -> &
and so on.
2014-02-09 02:07:26 -05:00
Ryan Lortie
0e671286fc GApplication: parse command line options
Add support for parsing command line options with GApplication.

You can add GOptionGroup and GOptionEntry using two new APIs:
g_application_add_option_group() and
g_application_add_main_option_entries().

Also add a "handle-local-options" signal that allows handling of
commandline arguments in the local process without having to override
local_command_line.

As a special feature, you can have a %NULL @arg_data in a GOptionEntry
which will cause the argument to be stored in a GVariantDict.  This
dictionary is available for inspection and modification by the
"handle-local-options" signal and can be forwarded to the primary
instance in cases of command line invocation (where it can be fetched
using g_application_command_line_get_options()).

https://bugzilla.gnome.org/show_bug.cgi?id=721977
2014-02-06 12:02:53 +00:00
Philip Withnall
2b8edf234c gvariant: Document the need to cast varargs when constructing GVariants
Slightly expand on the documentation about casting varargs when
constructing GVariants, and link to it from all the functions where it’s
a necessary consideration.

Add an example of passing flags to a ‘t’ type variable (guint64).
Assuming the flags enum does not have many members, the flag variable
will be 32 bits wide, and needs an explicit cast to be passed into
g_variant_new() as a 64-bit value.

https://bugzilla.gnome.org/show_bug.cgi?id=712837
2014-02-05 09:40:49 +00:00
Ryan Lortie
78ec35f7ab gobject: box GVariantDict
We will want to use this in GApplication for a signal and a property.

https://bugzilla.gnome.org/show_bug.cgi?id=625408
2014-02-04 12:24:19 +00:00
Ryan Lortie
14e62d1fa2 add GVariantDict
...the long-requested mutable dictionary helper for GVariant.

https://bugzilla.gnome.org/show_bug.cgi?id=625408
2014-02-04 11:56:06 +00:00
Matthias Clasen
0bfb09daf1 Fix up missing symbols in glib-sections.txt 2014-02-01 20:40:41 -05:00
Emmanuele Bassi
460e3e9d01 docs: Add missing GTest functions
The GTest message API is missing from the reference.
2014-01-20 20:03:40 +00:00
Matthias Clasen
647412603a More GTree and GNode formatting and documentation fixes
Among other things, add images for tree traversal types,
taken from Wikimedia Commons.
2014-01-19 23:49:12 -05:00
Matthias Clasen
5459d148d1 Move GTraverseType to gnode docs 2014-01-19 22:23:51 -05:00
Ryan Lortie
673ee54cdd win32: add g_win32_get_command_line()
This returns the command line in GLib filename encoding format (ie:
UTF-8) for use with g_option_context_parse_strv().

This will allow parsing of Unicode commandline arguments on Windows,
even if the characters in those arguments fall outside of the range of
the system codepage.

https://bugzilla.gnome.org/show_bug.cgi?id=722025
2014-01-17 20:04:44 -05:00
Ryan Lortie
f062fae4d6 GOptionContext: add memory-friendly parse mode
Add g_option_context_parse_strv() that obeys the normal memory conventions for
dealing with a strv instead of assuming that we're dealing with the 'argv'
parameter to main().

This will help for using GOptionContext with GApplication.

https://bugzilla.gnome.org/show_bug.cgi?id=721947
2014-01-10 12:32:35 -05:00
Michael Catanzaro
6448f87552 docs: fix two typos 2014-01-02 19:40:47 -06:00
Yosef Or Boczko
52cefa239d Fix doc build 2014-01-02 01:40:26 +02:00
Matthias Clasen
58cdf0b474 Drop memory-related trap variables
These are just more lo-tech conditional breakpoint wannabes.
Debuggers can be trusted to support conditional breakpoints
nowadays.
2014-01-01 17:59:22 -05:00
Michael Catanzaro
e9c19583de docs: fix a typo 2013-12-29 14:20:13 -06:00
Ryan Lortie
56fb675d86 GVariant: add way to print context of parse errors
This was a feature intended from the very beginning that somehow never
got written.  It's a way to replace these sort of error messages out of
the GVariant parser:

  1-2,10-15:unable to find a common type

with something in the style of the Vala compiler:

  unable to find a common type:
    [1, 2, 3, 'str']
     ^        ^^^^^

https://bugzilla.gnome.org/show_bug.cgi?id=715028
2013-12-22 11:41:19 -05:00
Ryan Lortie
3f41e49285 Use POSIX-specified <poll.h> over <sys/poll.h>
POSIX specifies that <poll.h> is the correct header to include for
poll(), so let's do that instead.

https://bugzilla.gnome.org/show_bug.cgi?id=141251
2013-12-22 11:33:07 -05:00
Murray Cumming
eeac91f866 GVariant: Add g_variant_parse_error_quark()
Most GErrors, such as GSomethingError, have a function to get
their quark that looks like g_something_error_quark(),
so bindings (such as gtkmm) would expect GVariantParseError
to have g_variant_parse_error_quark(). Instead this had
g_variant_parser_get_error_quark().
This deprecates the old function and adds the correct one,
making life easier for gtkmm (and maybe others).

https://bugzilla.gnome.org/show_bug.cgi?id=708212
2013-12-22 11:27:16 -05:00
Matthias Clasen
12fbc5ec4a Add g_ptr_array_insert to the docs 2013-12-14 23:45:36 -05:00
Matthias Clasen
28c2706da7 Drop g_trap_object_ref debugging mechanism
This is really just a very crude and limited conditional breakpoint.
Update the documentation to explain conditional breakpoints in
gdb instead. Also, remove the link to refdbg, which appears dead.

https://bugzilla.gnome.org/show_bug.cgi?id=719687
2013-12-02 21:48:03 -05:00
Xavier Claessens
c4e9135352 GFile: add GBytes version of _replace_contents_async()
https://bugzilla.gnome.org/show_bug.cgi?id=690525
2013-12-02 14:45:42 -05:00
Dan Winship
97fac93670 gtestutils: add g_assert_nonnull() to go with g_assert_null()
https://bugzilla.gnome.org/show_bug.cgi?id=711800
2013-11-24 14:59:51 -05:00
Dan Winship
f4c30feb95 gtestutils: fix g_test_set_nonfatal_assertions()
g_test_set_nonfatal_assertions() was a no-op, because
g_assertion_message() wasn't actually checking the
test_nonfatal_assertions flag. Fix that and add a test.

Also, g_test_set_nonfatal_assertions() has to set test_mode_fatal to
FALSE as well, or else a failed assertion will cause the test program
to abort at the end of the failed test.

Also, belatedly add this and the new g_assert_* methods to the docs.

https://bugzilla.gnome.org/show_bug.cgi?id=711800
2013-11-24 14:59:51 -05:00