Commit Graph

2079 Commits

Author SHA1 Message Date
Ryan Lortie
2880767702 Add g_hash_table_get_keys_as_array()
Returns a %NULL-terminated array of the keys of a hashtable.

In the case that the hash table has strings for keys, this is actually a
gchar**.

https://bugzilla.gnome.org/show_bug.cgi?id=710964
2013-10-27 09:26:53 -07:00
Ryan Lortie
e52ff01552 docs: dist manpage gapplication.xml 2013-10-24 15:31:45 -04:00
Ryan Lortie
fe7069749f file-info: Add a G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID attribute
This indicates whether the thumbnail (given by G_FILE_ATTRIBUTE_THUMBNAIL_PATH)
is valid — i.e. to represent the file in its current state. If
G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID is FALSE (for a normal _or_ failed
thumbnail) it means the file has changed since the thumbnail was generated, and
the thumbnail is out of date.

Part of checking thumbnail validity (by the spec) involves parsing
headers out of the thumbnail .png so we include some (small) code to do
that in a separate file.  We will likely want to copy this code to gvfs
to do the same for GVfsFile.

Heavily based on a patch from Philip Withnall <philip.withnall@collabora.co.uk>
who suggested the feature and designed the API.

https://bugzilla.gnome.org/show_bug.cgi?id=709898
2013-10-23 11:56:28 -04:00
Ryan Lortie
6957004007 GNotification: finish documentation
Add the missing documentation and add the section to the GIO reference
docs.  Fix up a few small documentation issues.

https://bugzilla.gnome.org/show_bug.cgi?id=688492
2013-10-21 14:30:30 -04:00
Ross Lagerwall
d55180c73b docs: Remove comment about calling g_type_init()
https://bugzilla.gnome.org/show_bug.cgi?id=709966
2013-10-18 10:32:18 -04:00
Matthias Clasen
fd90101f4a Include gapplication(1) in the tools section 2013-10-17 21:03:18 -04:00
Matthias Clasen
c848323948 Fix up subprocess docs
The GSubprocessLauncher docs had their own long description,
but were not properly set up as their own section.
2013-10-17 20:55:53 -04:00
Matthias Clasen
71534d9d62 Fix up gio-sections.txt 2013-10-17 20:45:32 -04:00
Matthias Clasen
ea52ce07d8 Generate introspected docs for GSimpleProxyResolver 2013-10-17 20:38:15 -04:00
Matthias Clasen
4cae0703f7 Add index for 2.40 api additions 2013-10-17 20:16:13 -04:00
Ryan Lortie
542ad4db03 Fixup GSubprocess documentation bits 2013-10-17 15:01:42 -04:00
Colin Walters
5b48dc40cc GSubprocess: New class for spawning child processes
There are a number of nice things this class brings:

0) Has a race-free termination API on all platforms (on UNIX, calls to
   kill() and waitpid() are coordinated as not to cause problems).
1) Operates in terms of G{Input,Output}Stream, not file descriptors
2) Standard GIO-style async API for wait() with cancellation
3) Makes some simple cases easy, like synchronously spawning a
   process with an argument list
4) Makes hard cases possible, like asynchronously running a process
   with stdout/stderr merged, output directly to a file path

Much rewriting and code review from Ryan Lortie <desrt@desrt.ca>

https://bugzilla.gnome.org/show_bug.cgi?id=672102
2013-10-17 14:32:44 -04:00
Ihar Hrachyshka
aaddd823bc Removed obsolete makefile rules
Removed test, test-report, full-report, perf-report.  They all come from
an old (now obsolete) approach toward glib testing[1]. Now the blessed
ways to test glib are 'make check' and installed tests.

[1]: https://mail.gnome.org/archives/gtk-devel-list/2007-November/msg00000.html

https://bugzilla.gnome.org/show_bug.cgi?id=709995
2013-10-17 13:20:14 -04:00
Ryan Lortie
9defb6b1b1 New gapplication(1) tool
This is essentially a commandline implementation of the client-side of
the org.freedesktop.Application D-Bus interface.

It includes support for tab-completion based on desktop files and their
contents.

https://bugzilla.gnome.org/show_bug.cgi?id=704218
2013-10-17 10:12:27 -04:00
Ryan Lortie
38dfce5992 Add simple string "search" function
Add a pair of functions to make it easier to do simple string matching.

This will be useful for use with things like GtkSearchBar and will also
be the basis of the searching done by the (soon to appear)
g_desktop_app_info_search()

https://bugzilla.gnome.org/show_bug.cgi?id=709753
2013-10-14 16:48:42 -04:00
Ryan Lortie
4c510801cf Add g_str_is_ascii()
Add a function for checking if a string is pure ASCII.

https://bugzilla.gnome.org/show_bug.cgi?id=709753
2013-10-14 16:48:37 -04:00
Ryan Lortie
5d7a7df867 Add g_key_file_save_to_file()
To write a keyfile to disk.

https://bugzilla.gnome.org/show_bug.cgi?id=309224
2013-10-04 12:18:20 -04:00
Ryan Lortie
748c86e45f gio docs: add some missing functions 2013-09-23 17:07:33 -04:00
Ryan Lortie
6ec2bb17c3 GFile: add new g_file_measure_disk_usage() API
This is essentially the equivalent of 'du'.

This is currently only supported on local files.  gvfs will add support for the
interface later.

https://bugzilla.gnome.org/show_bug.cgi?id=704893
2013-09-06 13:16:17 -04:00
Sébastien Wilmet
6fbb146342 GRegex: add g_regex_get_max_lookbehind()
It is useful for multi-segment regex matching.

A unit test is included.

https://bugzilla.gnome.org/show_bug.cgi?id=689794
2013-07-23 15:43:22 +02:00
Matthias Clasen
371fb88362 gsettings tool: Improve documentation
Mention that gsettings needs a session bus to make changes.
2013-07-16 19:21:31 -04:00
Ryan Lortie
c04a063b78 GAction: add function for printing detailed names
A counterpart for parsing of detailed actions into (name, target) pairs,
this new function prints them back.

We also add a new function to check for validity of action names.  Only
valid action names are allowed when printing.  Parsing accepts _some_
invalid names for backwards compatibility.

https://bugzilla.gnome.org/show_bug.cgi?id=704157
2013-07-13 13:41:03 -04:00
Ryan Lortie
6dc5c118e4 Implement the Desktop Action specification
For some time, the desktop file specification has supported "additional
application actions".  This is intended to allow for additional methods
of starting an app, such as a mail client having a "Compose New Message"
action that brings up the compose window instead of the folder list.

This patch adds support for this with a relatively minimal API.

In the case that the application is a GApplication and DBusActivatable,
desktop actions are translated into GActions that have been added to the
application with g_action_map_add_action().  This more or less closes
the loop on being able to activate an application with an action
invocation (instead of 'activate').

https://bugzilla.gnome.org/show_bug.cgi?id=664444
2013-07-11 12:48:08 -04:00
Ryan Lortie
f77e121650 add GPropertyAction
Add a new type of GAction that represents the value of a property on an
object.  As an example, this might be used on the "visible-child-name"
property of a GtkStack.

https://bugzilla.gnome.org/show_bug.cgi?id=703270
2013-07-11 12:35:45 -04:00
Ryan Lortie
1c586e44be Add g_variant_new_printf
Add a quick way to get a floating GVariant from printf formatting.
2013-07-11 12:16:44 -04:00
Matthias Clasen
89f9f227d6 Add G_TYPE_CHECKSUM to the docs 2013-07-09 13:31:04 -04:00
Sébastien Wilmet
b05bf77223 Doc: small fixes
This commit adds the GTestSubprocessFlags enum to the docs, and fixes
several minor typos in various places.

https://bugzilla.gnome.org/show_bug.cgi?id=703254
2013-06-30 10:32:18 +02:00
Matthias Clasen
d30a2d92f3 docs: minor formatting fixes to the gresource man page
Make the SECTION argument appear the same way throughout.
2013-06-29 22:46:38 -04:00
Ryan Lortie
a61f718e5e small docs xml fixup 2013-06-24 11:19:25 -04:00
Emmanuele Bassi
54cc43630d Rename the generated private data getter function
As it turns out, we have examples of internal functions called
type_name_get_private() in the wild (especially among older libraries),
so we need to use a name for the per-instance private data getter
function that hopefully won't conflict with anything.
2013-06-24 15:43:04 +01:00
Emmanuele Bassi
1f6f7e1c4d docs: Clean up the GObject tutorial a bit
Started off by using the new instance private data macro, ended up
cleaning up the obscure, out of date, or simply broken concepts and
paragraphs.

https://bugzilla.gnome.org/show_bug.cgi?id=700035
2013-06-24 14:18:01 +01:00
Emmanuele Bassi
f870d5abdb docs: Include newly added functions and macros
The functions are private, and an implementation detail of the macros.

https://bugzilla.gnome.org/show_bug.cgi?id=700035
2013-06-24 14:18:01 +01:00
Emmanuele Bassi
270d73a1e0 docs: Fix g_binding_unbind() in the API reference 2013-06-12 11:24:55 +01:00
William Jon McCann
a681e11f92 Fix property example in gobject tutorial
https://bugzilla.gnome.org/show_bug.cgi?id=692848
2013-05-30 10:25:29 -04:00
Ryan Lortie
c7e965f4ee docs/: ignore gtester Makefile targets
Mark 'test', 'test-report', 'perf-report' and 'full-report' as PHONY in
docs/Makefile.am to prevent recursion of gtester into the documentation
subdirectories.  Stop including Makefile.decl from these directories
since it is no longer necessary.

This will clear up the warnings about EXTRA_DIST being defined once in
gtk-doc.make and again in Makefile.decl.
2013-05-29 21:36:50 -04:00
Ryan Lortie
575a9da718 gtest: Add more path building API
Add a pair of functions for returning strings that don't need to be
freed.  This is a bit of a hack but it will turn the 99% case of using
these functions from:

  gchar *tmp;
  tmp = g_test_build_filename (...);
  fd = open (tmp, ...);
  g_free (tmp);

to:

  fd = open (g_test_get_filename (...), ...);

which is a pretty substantial win.

https://bugzilla.gnome.org/show_bug.cgi?id=549783
2013-05-29 09:03:32 -04:00
Ryan Lortie
0c4806733c Add g_test_build_filename()
This function allows testcases to find data files in various situations
of srcdir == builddir, srcdir != builddir and for installed tests.

https://bugzilla.gnome.org/show_bug.cgi?id=549783
2013-05-29 09:03:31 -04:00
Jason L. Quinn
47d96381a2 spelling fixes of 'runtine' and 'adresses' in cross.xml and running.xml, respectively
https://bugzilla.gnome.org/show_bug.cgi?id=697849
2013-05-23 22:11:50 -04:00
Dan Winship
960f5500e2 gtestutils: add g_test_trap_subprocess()
g_test_trap_fork() doesn't work on Windows and is potentially flaky on
unix anyway given the fork-but-don't-exec. Replace it with
g_test_trap_subprocess(), which re-spawns the same program with
arguments telling it to run a specific (otherwise-ignored) test case.

Make the existing g_test_trap_fork() unit tests be unix-only (they
never passed on Windows anyway), and add a parallel set of
g_test_trap_subprocess() tests.

Also fix the logic of gtestutils's "-p" argument (which is used by the
subprocess tests); previously if you had tests "/foo/bar" and
"/foo/bar/baz", and ran the test program with "-p /foo/bar/baz", it
would run "/foo/bar" too. Fix that and add tests.

https://bugzilla.gnome.org/show_bug.cgi?id=679683
2013-05-13 12:10:52 -04:00
Matthias Clasen
6104230bce Document all gtester-report options
The --subunit option was missing from the man page.
2013-05-04 21:10:43 -04:00
Matthias Clasen
794401c0a2 Document all glib-mkenums placeholders
The @ENUMPREFIX@ placeholder was missing in the man page.
2013-05-04 21:08:18 -04:00
Matthias Clasen
f10dc91cee Document all glib-genmarshal options
The --stdinc option was missing from the man page.
2013-05-04 21:05:24 -04:00
Matthias Clasen
8d99b24a03 Fix a typo 2013-05-04 21:03:00 -04:00
Matthias Clasen
7b60a469b7 Document all gdbus-codegen options
The --help and --xml-files options were missing from the man page.
2013-05-04 21:01:35 -04:00
Emmanuele Bassi
a360b314aa binding: Add an explicit unbind()
Higher order languages with garbage collection can have issues releasing
a binding, as they do not control the last reference being dropped on
the binding, source, or target instances.

https://bugzilla.gnome.org/show_bug.cgi?id=698018
2013-05-02 15:50:21 -07:00
Matthias Clasen
20012ec9a9 Add 2.38 indexes to the docs 2013-05-01 00:16:25 -04:00
Cosimo Cecchi
03dd6cf1b5 docs: fix docs for g_icon_[de]serialize() 2013-04-24 11:58:47 -04:00
Ryan Lortie
c18462b580 GParamSpec: add g_param_spec_get_default_value()
The way of getting the default value out of a GParamSpec is to allocate
a GValue, initialise it, then call g_param_spec_set_default() to set the
default value into that GValue.

This is exactly how we handle setting the default value for all of the
construct properties that were not explicitly passed to g_object_new().

Instead of doing the alloc/init/store on all construct properties on
every call to g_object_new(), we can cache those GValues in the private
data of the GParamSpec itself and reuse them.

This patch does not actually make that change to g_object_new() yet, but
it adds the API to GParamSpec so that a future patch to GObject can make
the change.

https://bugzilla.gnome.org/show_bug.cgi?id=698056
2013-04-23 14:39:09 -04:00
Ryan Lortie
c30c0bb34d GType: add accessor for instance private offset
Since instance private data is now always at a constant offset to the
instance pointer, we can add an accessor for it that doesn't also
require an instance.

The idea is that classes can call this from their class_init and store
it in a file-scoped static variable and use that to find their private
data on instances very quickly, without a priv pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=698056
2013-04-23 14:39:09 -04: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
9cc222c0bf Introduce GBytesIcon
GBytesIcon is an icon that has a GBytes inside of it where the GBytes
contains some sort of encoded image in a widely-recognised file format.
Ideally this will be a PNG.

It implements GLoadableIcon, so GTK will already understand how to use
it, but we will add another patch there to make things more efficient.

https://bugzilla.gnome.org/show_bug.cgi?id=688820
2013-04-21 16:25:15 -04:00
Ryan Lortie
dbb65b5465 GVariant: add new g_variant_new_take_string() API
Lots of people have variously asked for APIs like
g_variant_new_string_printf() in order to avoid having to use
g_strdup_printf(), create a GVariant using g_variant_new_string(), then
free the temporary string.

Instead of supporting that, plus a million other potential cases,
introduce g_variant_new_take_string() as a compromise.

It's not possible to write:

 v = g_variant_new_take_string (g_strdup_printf (....));

to get the desired result and avoid the extra copies.  In addition, it
works with many other functions.

https://bugzilla.gnome.org/show_bug.cgi?id=698455
2013-04-20 18:58:24 -04:00
Sébastien Wilmet
a2a44a9617 Add async version of g_file_make_directory()
https://bugzilla.gnome.org/show_bug.cgi?id=548353
2013-04-19 21:38:13 +02: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
Jason Quinn
a12157b1f8 building.xml: Fix a typo of "fo" to "of"
https://bugzilla.gnome.org/show_bug.cgi?id=697771
2013-04-11 05:00:59 -04:00
Sébastien Wilmet
733bf96202 Add async version of g_file_trash()
https://bugzilla.gnome.org/show_bug.cgi?id=548353
2013-04-10 22:32:33 +02:00
Cosimo Cecchi
db325cd6a3 application: introduce methods to mark the application as busy
This feature is intended for clients that want to signal a desktop shell
their busy state, for instance because a long-running operation is
pending.
The API works in a similar way to g_application_hold and
g_application_release: applications can call g_application_mark_busy()
to increase a counter that will keep the application marked as busy
until the counter reaches zero again.

The busy state is exported read-only on the org.gtk.Application interface
for clients to use.

https://bugzilla.gnome.org/show_bug.cgi?id=672018
2013-04-04 13:13:53 -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
Tristan Van Berkom
dd0ea5dcc2 Added examples to GTestDBus documentation 2013-03-21 16:37:21 +09:00
Matthias Clasen
d59acb701e Small cleanup to tutorial headings
This makes all the subsection headers consistent.
https://bugzilla.gnome.org/show_bug.cgi?id=659428
2013-03-17 23:01:21 -04:00
Thomas Perl
e4695bd6f5 docs/reference/glib/cross.xml: Fix typo: yes/np -> yes/no
https://bugzilla.gnome.org/show_bug.cgi?id=693502
2013-02-15 10:12:36 -05:00
Dan Winship
ee17a54c28 GSimpleProxyResolver: new simple GProxyResolver class
Add GSimpleProxyResolver, for letting people do static proxy
resolution, and to use as a base class for other resolvers (such as
GProxyResolverGnome).

https://bugzilla.gnome.org/show_bug.cgi?id=691105
2013-02-14 10:24:14 -05:00
Dan Winship
7c49869eae GSocketClient: add proxy-resolver property
Add a proxy-resolver property to GSocketClient, to allow overriding
proxy resolution in situations where you need to force a particular
proxy rather than using the system defaults.

https://bugzilla.gnome.org/show_bug.cgi?id=691105
2013-02-14 10:24:14 -05:00
Matthias Clasen
844527c037 Document GIO_USE_FILE_MONITOR 2013-02-03 14:08:02 -05:00
Matthias Clasen
c5ec4831fa Trivial doc comment formatting fix 2013-02-03 13:46:50 -05:00
Matthias Clasen
9c72b5776a add 2.36 index to gobject docs 2013-02-03 13:26:36 -05:00
Matthias Clasen
349e601864 Add 2.36 index to glib docs 2013-02-03 13:25:56 -05:00
Matthias Clasen
f302c65584 Add a 2.36 index to gio docs 2013-02-03 13:24:59 -05:00
Matthias Clasen
1e4b5a3267 Minor doc build cleanups 2013-02-03 13:22:28 -05:00
Matthias Clasen
79d7a138af Make GUnixFDSourceFunc show up in the docs 2013-02-03 13:17:59 -05:00
Matthias Clasen
ab328469f5 Silence automake
automake doesn't like INCLUDES anymore.
2013-02-02 22:54:15 -05:00
Colin Walters
f398bec5bc Add g_close(), use it
There are two benefits to this:

1) We can centralize any operating system specific knowledge of
   close-vs-EINTR handling.  For example, while on Linux we should never
   retry, if someone cared enough later about HP-UX, they could come by
   and change this one spot.
2) For places that do care about the return value and want to provide
   the caller with a GError, this function makes it convenient to do so.

Note that gspawn.c had an incorrect EINTR loop-retry around close().

https://bugzilla.gnome.org/show_bug.cgi?id=682819
2013-01-29 09:46:04 -05:00
Ryan Lortie
6d1a663609 Add a UNIX fd source
https://bugzilla.gnome.org/show_bug.cgi?id=658020
2013-01-15 14:08:02 -05:00
Ryan Lortie
cbf68cb22d gsource: Add support for file descriptors on UNIX
Adding file descriptors to a GSource provides similar functionality to
the old g_source_add_poll() API with two main differences.

First: the list of handles is managed internally and therefore users are
prevented from randomly modifying the ->events field.  This prepares us
for an epoll future where changing the event mask is a syscall.

Second: keeping the list internally allows us to check the ->revents for
events for ourselves, allowing the source to skip implementing
check/prepare.  This also prepares us for the future by allowing an
implementation that doesn't need to iterate over all of the sources
every time.

https://bugzilla.gnome.org/show_bug.cgi?id=686853
2013-01-15 14:08:02 -05:00
Ryan Lortie
768574635d GSource: new API g_source_set_ready_time()
Add an API to mark a GSource to automatically become ready at the
specified monotonic time.

https://bugzilla.gnome.org/show_bug.cgi?id=657729
2013-01-15 14:08:02 -05:00
Dieter Verfaillie
af27baaaef Fix build with --enable-gtk-doc
https://bugzilla.gnome.org/show_bug.cgi?id=691001
2013-01-02 13:10:31 +01:00
Matthias Clasen
3e5068c186 Add a --with-python option
The effect is the same as specifying PYTHON=python3, but a
configure option works better in jhbuild.
https://bugzilla.gnome.org/show_bug.cgi?id=684103
2013-01-01 15:49:06 -05:00
Jasper St. Pierre
5e62827efd gmarkup: Make GMarkupParseContext a boxed type
At the same time, add a refcount and public ref/unref methods.
This makes it usable from introspectable.

https://bugzilla.gnome.org/show_bug.cgi?id=690084
2013-01-01 11:03:19 -05:00
Matthias Clasen
157f80c244 Drop a broken link
The GSettings migration docs had a link to the no-longer existing
gsettings-tutorial branch of gnome-utils. Remove it.
https://bugzilla.gnome.org/show_bug.cgi?id=690043
2013-01-01 10:25:07 -05:00
Matthias Clasen
08dce819cc Revert "gtestutils: add g_test_trap_subprocess(), deprecate g_test_trap_fork()"
This reverts commit e3a29184d5.
2012-12-19 15:20:45 -05:00
Simon McVittie
8f65536504 GCredentials: add getter/setter for the Unix process ID
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=687920
2012-12-19 15:08:09 -05:00
Dan Winship
e3a29184d5 gtestutils: add g_test_trap_subprocess(), deprecate g_test_trap_fork()
g_test_trap_fork() doesn't work on Windows and is potentially flaky on
unix anyway given the fork-but-don't-exec. Replace it with
g_test_trap_subprocess(), which re-spawns the same program with
arguments telling it to run a specific (otherwise-ignored) test case.

Make the existing g_test_trap_fork() unit tests be unix-only (they
never passed on Windows anyway), and add a parallel set of
g_test_trap_subprocess() tests.

https://bugzilla.gnome.org/show_bug.cgi?id=679683
2012-12-19 14:35:08 -05:00
Colin Walters
2149b29468 Add g_get_num_processors()
Based on a patch from John Cupitt <jcupitt@gmail.com>

Useful for thread pools which should scale to number of processors.

See https://bugzilla.gnome.org/show_bug.cgi?id=687223

https://bugzilla.gnome.org/show_bug.cgi?id=614930
2012-12-18 13:13:15 -05:00
Jasper St. Pierre
3c87ab97ff gfileenumerator: Add a g_file_enumerator_get_child method
This is a new convenience method designed to simplify some use
cases of GFileEnumerator, by making it easy to get the next file
from a file enumerator.

https://bugzilla.gnome.org/show_bug.cgi?id=690083
2012-12-13 21:38:18 -05:00
Dan Winship
211ed1775d gsocket: add getsockopt/setsockopt wrappers
Add g_socket_get_option() and g_socket_set_option(), wrapping
getsockopt/setsockopt for the case of integer-valued options. Update
code to use these instead of the underlying calls.

https://bugzilla.gnome.org/show_bug.cgi?id=623187
2012-12-12 15:20:22 +01:00
Dan Winship
b377e69685 Add gnetworking.h
Install a public "gnetworking.h" header that can be used to include
the relevant OS-dependent networking headers. This does not really
abstract away unix-vs-windows however; error codes, in particular,
are incompatible.

gnetworkingprivate.h now contains just a few internal URI-related
functions

Also add a g_networking_init() function to gnetworking.h, which can be
used to explicitly initialize OS-level networking, rather than having
that happen as a side-effect of registering GInetAddress.

https://bugzilla.gnome.org/show_bug.cgi?id=623187
2012-12-12 15:20:22 +01:00
Alexander Larsson
e218b96a6b Add g_type_get_type_registration_serial()
This lets you cache type lookup information and then know when
the cache information is out of date. In particular, we want this
in order to be able to cache g_type_from_name() lookups in the Gtk+
theme machinery.

https://bugzilla.gnome.org/show_bug.cgi?id=689847
2012-12-10 12:55:28 +01:00
Dan Winship
e97a2f4195 win32: suppress fatal error dialog box when running tests
When running a test program (ie, if g_test_init() has been called),
don't pop up a dialog box when a fatal error occurs. Just print the
message to stderr and exit.

https://bugzilla.gnome.org/show_bug.cgi?id=679683
2012-12-05 11:15:19 -05:00
Matthias Clasen
2b6be7544c Add new api to the docs 2012-11-28 00:58:03 -05:00
Colin Walters
ed5c17e11f GMemoryOutputStream: Add new _resizable() constructor usable from bindings
Really, the memory output stream API is too warped around the model
where it's a fixed size buffer that you've already allocated.  Even in
C, I find myself always wanting to use it to just accumulate data into
an arbitrary-sized buffer it allocates.

Unfortunately, it's also not usable from bindings because it's not
common to bind g_free() and g_realloc(), but if you just pass NULL, you
get the default of a fixed size, which is useless as per above.

I am going to use this from a gjs test case, and the GSubprocess test
cases also will use it.

https://bugzilla.gnome.org/show_bug.cgi?id=688931
2012-11-27 20:45:21 -05:00
Ryan Lortie
3baf256a2c gio: New API for GFile from remote commandline arg
Add a pair of new APIs: one to GFile to create a new file from a
commandline arg relative to a given cwd and one to
GApplicationCommandLine to create a GFile from an arg, relative to the
cwd of the invoking commandline.

https://bugzilla.gnome.org/show_bug.cgi?id=689037
2012-11-27 10:10:37 -05:00
Matthias Clasen
419a1e4040 Add new API to the docs 2012-11-21 21:20:25 -05:00
Sebastian Dröge
46a92a760b Add boxed GType for GThread
https://bugzilla.gnome.org/show_bug.cgi?id=688704
2012-11-20 15:03:06 +01:00
Kalev Lember
11e306a759 Fix a broken link in GConf migration guide
gnome-utils git repo was moved to archive/ and this broke the link.
2012-11-16 17:33:14 +01:00
Dan Winship
03ef7ba5ab win32: re-fix the _utf8 compat function situation
The previous fix didn't work, because every place within glib that
used any of the functions also needed to be including win32compat.h.

So, move the prototypes back to their original headers (but at least
all in one place at the bottom).

https://bugzilla.gnome.org/show_bug.cgi?id=688109
2012-11-16 08:22:06 -05:00
Dan Winship
08f4f92fed win32: add gwin32compat.h, for utf8-renaming compatibility defines
To avoid -Wmissing-prototype warnings, we need to prototype both the
original and the _utf8 versions of all of the functions that have had
_utf8-renaming on Windows. But duplicating all the prototypes is ugly,
so rather than doing them "in-place", move them all to a new header
file just for that.

https://bugzilla.gnome.org/show_bug.cgi?id=688109
2012-11-15 14:19:05 -05:00
Matthias Clasen
8caf39b59b Add an option to make glib-compile-resources use G_GNUC_INTERNAL
https://bugzilla.gnome.org/show_bug.cgi?id=687742
2012-11-09 22:14:39 -05:00
Martin Pitt
1af1b2b2bb Box GPollFD to make it introspectable
https://bugzilla.gnome.org/show_bug.cgi?id=686797
2012-11-05 14:41:31 +01:00
Martin Pitt
a5c5730085 Revert "Box GPollFD to make it introspectable"
This reverts commit 932f4250b8.

This got pushed accidentally and has not been accepted yet. It's also not clear
whether we want this in the first place.

https://bugzilla.gnome.org/show_bug.cgi?id=686797
2012-10-25 11:27:39 +02:00
Martin Pitt
932f4250b8 Box GPollFD to make it introspectable
https://bugzilla.gnome.org/show_bug.cgi?id=686797
2012-10-25 07:58:09 +02:00
Colin Walters
4fb2d737ac gvariant: Make g_variant_new_from_bytes() public
Now that GBytes has been made public, we should make
g_variant_new_from_bytes() public too.

Add g_variant_get_data_as_bytes() to match.

https://bugzilla.gnome.org/show_bug.cgi?id=677062
2012-10-23 16:25:49 +02:00
Ryan Lortie
7c42ab23b5 Convert g_type_init() to a ctor
Move the guts of g_type_init() into a ctor and turn g_type_init() itself
into a do-nothing function.

g_type_init_with_debug_flags() now ignores its arguments, but it has
always been possible to achieve the same effect via environment
variables.

https://bugzilla.gnome.org/show_bug.cgi?id=686161
2012-10-16 09:39:24 -04:00
Dan Winship
55e7ca6e1b gio: deprecate gioscheduler, soft deprecate GSimpleAsyncResult
Reimplement gioscheduler in terms of GTask, and deprecate the original
gioscheduler methods. Update docs to point people to GTask rather than
gioscheduler and GSimpleAsyncResult, but don't actually formally
deprecate GSimpleAsyncResult yet.

https://bugzilla.gnome.org/show_bug.cgi?id=661767
2012-10-10 10:29:36 -04:00
Dan Winship
4aeefa70a1 GTask: new GAsyncResult implementation / threaded task manager
GTask is a replacement for GSimpleAsyncResult and GIOScheduler, that
also allows for making cancellable wrappers around non-cancellable
functions (as in GThreadedResolver).

https://bugzilla.gnome.org/show_bug.cgi?id=661767
2012-10-10 10:29:36 -04:00
Dan Winship
eb2f5c1e0f Add GLIB_VERSION_2_36 and related 2012-10-03 16:36:38 -04:00
David Zeuthen
fa6a684630 gdbus-codegen: make members of an interface inherit the "Since" annotation
This is the expected (and sane) behavior - without this bug-fix you'd
have to add "Since" to every member of a newly added D-Bus interface.

Also show-case this in the codegen example.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-10-03 11:13:12 -04:00
Matthias Clasen
3ff9645a4d Typo fix 2012-09-23 19:55:40 -04:00
Matthias Clasen
580b58c3c0 Update GConf migration guide
Newer intltool makes this much easier. Yay
https://bugzilla.gnome.org/show_bug.cgi?id=674620
2012-09-23 11:23:29 -04:00
Matthias Clasen
80105f173a Fix the doc build 2012-09-14 19:40:24 -04:00
William Jon McCann
cc3238a9c9 Add api to get the generic icon name for a mime type
https://bugzilla.gnome.org/show_bug.cgi?id=683744
2012-09-13 12:50:02 -04:00
Matthias Clasen
47a3b76ac5 Move GIO-specific information to the GIO docs 2012-09-11 23:15:03 -04:00
Matthias Clasen
fc7dc33113 Add a section about writing GLib applications
For now, this includes some information about threads and security.
2012-09-11 22:41:18 -04:00
Matthias Clasen
6a50dc511b Drop GVFS_INOTIFY_DIAG debug feature
Just not a good idea to have this in production code.
2012-09-11 20:24:30 -04:00
Martin Pitt
02f143c2d9 Box GTimeZone to make it introspectable
https://bugzilla.gnome.org/show_bug.cgi?id=683167
2012-09-06 06:18:42 +02:00
Matthias Clasen
a30f6a6eb8 Add new api to symbol lists and docs
https://bugzilla.gnome.org/show_bug.cgi?id=682849
2012-09-02 15:10:20 -04:00
William Jon McCann
40b4fae42e Add ability to get symbolic icon for content type
https://bugzilla.gnome.org/show_bug.cgi?id=682101
2012-08-30 11:04:43 -04:00
William Jon McCann
a15a071f35 Add symbolic icon support to gfileinfo
https://bugzilla.gnome.org/show_bug.cgi?id=682101
2012-08-30 11:04:43 -04:00
William Jon McCann
a2dca48bf7 Add symbolic icon support to drive, volume, and mount
We need symbolic icon support for display in Nautilus.

https://bugzilla.gnome.org/show_bug.cgi?id=682101
2012-08-30 11:04:43 -04:00
Matthias Clasen
702b448865 Add a G_DEFINE_QUARK macro
https://bugzilla.gnome.org/show_bug.cgi?id=627240
2012-08-28 00:08:07 -04:00
Dan Winship
0c0cdfd9c4 gtestutils: add g_test_add_data_func_full()
Like g_test_add_data_func(), but includes a GDestroyNotify for the
test data.

https://bugzilla.gnome.org/show_bug.cgi?id=682560
2012-08-27 07:31:13 -04:00
Colin Walters
ac7c050d37 docs: Ensure CLEANFILES is set before we use +=
We need to be defensive about this in the case where gtk-doc.make is
empty.
2012-08-25 17:13:43 -04:00
Ryan Lortie
59394b3e1e Revert the GMarkup attribute collect changes
We need to have some more discussion on this topic.

This reverts commits 86329ba44f and
8d40389d15.

https://bugzilla.gnome.org/show_bug.cgi?id=665634
2012-08-20 18:34:13 -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
Ryan Lortie
34653169e5 GVariant: add g_variant_check_format_string()
For some time now people have been asking for a way to check for type
compatibility between GVariant instances and format strings.  There are
several APIs inside of GLib itself that would benefit from this.

This patch introduces a way to do that.
2012-08-20 16:26:25 -04:00
Dan Winship
25ac137c0a gtestutils: add g_text_expect_message()
Add g_test_expect_message() and g_test_assert_expected_messages(), to
allow tests of warnings, error messages, return-if-fails, etc.

https://bugzilla.gnome.org/show_bug.cgi?id=679556
2012-08-20 13:54:52 -04:00
Colin Walters
056d39c9f7 GMappedFile: Add g_mapped_file_get_bytes()
This is yet another API that has a data/length/refcount combination
that one might often want to turn into a GBytes.

https://bugzilla.gnome.org/show_bug.cgi?id=677065
2012-08-17 00:48:40 -04:00
Matthias Clasen
8d40389d15 gmarkup: Add g_markup_collect_known_attributes()
Add a variant of g_markup_collect_attributes() which will
ignore unknown attributes (such as those from different XML
namespaces) when parsing markup, rather than returning
G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE as g_markup_collect_attributes()
does.

Patch by Philip Withnall,
https://bugzilla.gnome.org/show_bug.cgi?id=665634
2012-08-16 23:40:08 -04:00
Matthias Clasen
2ccf64ba59 Improve glib-genmarshal man page
Expand the example in glib-genmarshal.1 to include the actual
commandline invocations, and update the generated function
names to match reality.
https://bugzilla.gnome.org/show_bug.cgi?id=637460
2012-08-16 18:46:17 -04:00
Colin Walters
aa50b8aec3 build: Fix the --disable-man case
The manpage listing needs to be inside the conditional.
2012-08-16 18:31:02 -04:00
Matthias Clasen
b60168a5f5 Remove man page placeholder generation
I don't see a good reason for this - if man page generation is
disabled, man pages are not produced, and things like 'make dist'
will fail. That is simpler and better.

https://bugzilla.gnome.org/show_bug.cgi?id=681336
2012-08-16 18:06:11 -04:00
Matthias Clasen
4cd5a63f12 Clean up man pages on 'clean'
Follow the automake heuristic that says "if 'make' created it,
'make clean' should remove it".

https://bugzilla.gnome.org/show_bug.cgi?id=681336
2012-08-16 18:06:08 -04:00
Matthias Clasen
ce531302cd Make --enable-man and --enable-gtk-doc independent
Previously, --enable-man --disable-gtk-doc would silently skip
man page generation, because we didn't even desdend into docs/reference.
Fix this by always going there.

https://bugzilla.gnome.org/show_bug.cgi?id=681336
2012-08-16 18:06:05 -04:00
Matthias Clasen
317d91d06b Fix an example
Pointed out by Chandni Verma in
https://bugzilla.gnome.org/show_bug.cgi?id=682025
2012-08-16 17:21:03 -04:00
Sebastian Geiger
6b201748b5 compiling.xml: Add note and fix gcc example
Because of the '--as-needed' default option
for the linker, the linking will fail, if the
file name appears after any of the options or
the pkg-config invocation.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=681854
2012-08-15 02:34:50 +09:00
David Rothlisberger
be7095980e gobject docs: Remove confusing acronym
In the wikipedia disambiguation page[1] the only entry that even
remotely makes sense in this context is "and so on". Google searches
for "aso memory management" and "aso garbage collection" don't yield
anything relevant.

[1] http://en.wikipedia.org/wiki/ASO

https://bugzilla.gnome.org/show_bug.cgi?id=679996
2012-08-06 10:26:45 -04:00
David Rothlisberger
bcda26a504 gobject docs: Remove incorrect reference to signals docs
The chapter on signals comes after this chapter, not before (see
"tut_gobject.xml" in docs/reference/gobject/gobject-docs.xml).

https://bugzilla.gnome.org/show_bug.cgi?id=679996
2012-08-06 10:26:44 -04:00
Stef Walter
278fe0c67f gchecksum: Add g_compute_checksum_for_bytes()
* Add a GBytes based version of g_compute_checksum_for_data()
 * Add appropriate tests

https://bugzilla.gnome.org/show_bug.cgi?id=680912
2012-08-06 10:38:39 +02:00
Javier Jardón
0f6a092cc5 Make gtk-doc not a hard dependency of GLib
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=674314
2012-08-05 22:29:28 +09:00
Matthias Clasen
08dd0f246a docs: Improve man page consistency
Make Options sections refsect1 instead of refsect2, and use
uppercase for argument names. Also add a product name, and
shorten some argument names.
2012-08-03 23:36:45 -04:00
Matthias Clasen
d241978412 docs: Improve man page generation
Use $(AM_V_GEN) for generating man pages, and set some parameters
for the XSL stylesheets. Among other things, don't generate AUTHORS
and COPYRIGHT sections.
2012-08-03 23:36:45 -04:00
Stef Walter
6ddf40f301 gtlscertificate: Add g_tls_certificate_is_same() function
* Certificate equality in PKIX in general is equality between
   the DER encoding of the certificates.

https://bugzilla.gnome.org/show_bug.cgi?id=681116
2012-08-03 18:58:30 +02:00
Colin Walters
14a1c20177 GFile: Add g_file_delete_async()
This looks like it was stubbed out but not implemented; the vtable
entry dates to commit 3781343738 which
is just alex's initial merge of gio into glib.

I was working on some code that wants an asynchronous rm -rf
equivalent, and so yeah, this is desirable.

https://bugzilla.gnome.org/show_bug.cgi?id=680760
2012-07-30 05:01:06 -04:00
Colin Walters
f7abd3ce13 Add g_spawn_check_exit_status()
Many (if not "almost all") programs that spawn other programs via
g_spawn_sync() or the like simply want to check whether or not the
child exited successfully, but doing so requires use of
platform-specific functionality and there's actually a fair amount of
boilerplate involved.

This new API will help drain a *lot* of mostly duplicated code in
GNOME, from gnome-session to gdm.  And we can see that some bits even
inside GLib were doing it wrong; for example checking the exit status
on Unix, but ignoring it on Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=679691
2012-07-10 18:03:56 -04:00
Dan Winship
82d914d808 gio: add g_async_result_is_tagged()
Rather than doing a two step first-check-the-GAsyncResult-subtype-then-
check-the-tag, add a GAsyncResult-level method so that you can do them
both at once, simplifying the code for "short-circuit" async return
values where the vmethod never gets called.

https://bugzilla.gnome.org/show_bug.cgi?id=661767
2012-07-10 10:49:20 -04:00
Dan Winship
f8532a13e2 gio: Add g_async_result_legacy_propagate_error()
Finish deprecating the "handle GSimpleAsyncResult errors in the
wrapper function" idiom (and protect against future GSimpleAsyncResult
deprecation warnings) by adding a "legacy" GAsyncResult method
to do it in those classes/methods where it had been traditionally
done.

(This applies only to wrapper methods; in cases where an _async
vmethod explicitly uses GSimpleAsyncResult, its corresponding _finish
vmethod still uses g_simple_async_result_propagate_error.)

https://bugzilla.gnome.org/show_bug.cgi?id=667375
https://bugzilla.gnome.org/show_bug.cgi?id=661767
2012-07-10 10:49:14 -04:00
Stef Walter
3b0f1cc432 Fix up GObject interface documentation
* Document how to override interfaces already implemented
   in a base class, and also call those base class implementations
   from a derived reimplementation.
 * Don't recomend people use base_init() style functions to
   initialize interface signals and properties, use default_init()
   aka class_init() instead (as G_DEFINE_INTERFACE() uses).
 * The above solves the interface init called multiple times
   problem, so remove some needless naysaying about that.
 * Document default_init() in the interface initialization discussion
 * Linkify more stuff.
 * Remove some crud and typos

https://bugzilla.gnome.org/show_bug.cgi?id=675504
2012-07-09 17:47:39 +02:00
Colin Walters
4ac0d78d5d GString: Tweak documentation, add g_string_free_to_bytes()
The docs for GString should really mention GByteArray, and what makes
it different.  Drop the comparison to Java which is dated and actually
inaccurate (because StringBuffer operates on Unicode).

While we're here, add g_string_free_to_bytes(), which further
complements the spread of GBytes-based API.  For example, one can
create a buffer using GString, then send it off via
g_output_stream_write_bytes().

https://bugzilla.gnome.org/show_bug.cgi?id=677064
2012-07-06 10:19:12 -04:00
Ryan Lortie
5d7fa1c783 GObject docs fixup 2012-07-03 15:40:44 -04:00
Christian Persch
69a12e3275 regex: Add accessor for PCRE_INFO_HASCRORLF
This flag is new in PCRE 7.3, and checks whether there is an explicit
CR or LF reference in the pattern.
2012-07-02 15:59:34 +02:00