Commit Graph

1024 Commits

Author SHA1 Message Date
Ryan Lortie
47444dacc0 Deprecate g_thread_init()
Move the last few things that needed thread-safe initialisation to a
global ctor.

https://bugzilla.gnome.org/show_bug.cgi?id=660744
2011-10-04 15:31:49 -04:00
Simon McVittie
5bed8317ea Warn when classes/instances exceed the allowed size, if possible
It's impossible to check this if the library user is using
g_type_register_static, but in that case their compiler should hopefully
warn about the truncation. This fixes it for G_DEFINE_TYPE and friends,
at least.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=659916
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Colin Walters <walters@verbum.org>
2011-10-04 09:35:54 +01:00
Ryan Lortie
2a677d1370 locks: drop _INIT macros
All locks are now zero-initialised, so we can drop the G_*_INIT macros
for them.

Adjust various users around GLib accordingly and change the docs.

https://bugzilla.gnome.org/show_bug.cgi?id=659866
2011-10-02 22:33:10 -04:00
Dan Williams
6feff14f19 tests: add signal marshalling return tests for int/uint
https://bugzilla.gnome.org/show_bug.cgi?id=659881
2011-09-28 11:01:53 -05:00
Dan Williams
a343904596 tests: fix generic closure marshalling tests
We're testing enums here, not flags, so we need to make sure
we're trying to send enums through the marshalling.

https://bugzilla.gnome.org/show_bug.cgi?id=659881
2011-09-28 11:01:39 -05:00
Dan Williams
adf7e0740c tests: Add some return value torture testcases for the generic marshaller
Ensure that ENUM types are properly marshalled back from libffi types
to glib types, which was failing on ppc64.

https://bugzilla.gnome.org/show_bug.cgi?id=659881
2011-09-28 11:01:14 -05:00
Colin Walters
f42fe6cdc0 gvalue: Add explicitly signed g_value_get_schar() and g_value_set_schar()
The documentation for G_TYPE_CHAR says:

"The type designated by G_TYPE_CHAR is unconditionally an 8-bit signed
 integer."

However the return value for g_value_get_char() was just "char" which
in C has an unspecified signedness; on e.g. x86 it's signed (which
matches the GType), but on e.g. PowerPC or ARM, it's not.

We can't break the old API, so we need to suck it up and add new API.
Port most internal users, but keep some tests of the old API too.

https://bugzilla.gnome.org/show_bug.cgi?id=659870
2011-09-22 20:05:38 -04:00
Colin Walters
1df8160fa6 tests: Add a some torture test cases for the generic marshaller
In particular this has a test case for a G_TYPE_ENUM which we were
running into a failure on ppc64.

https://bugzilla.gnome.org/show_bug.cgi?id=659881
2011-09-22 18:51:43 -04:00
Emmanuele Bassi
8e716cbb49 Fix annotations for source/target in g_object_bind_property_*
We use gpointer for convience of the C API users, but introspection
users will not like it.

https://bugzilla.gnome.org/show_bug.cgi?id=659838
2011-09-22 17:17:54 +01:00
Ryan Lortie
aecec33c49 gtype: port from GStaticRWLock to GRWLock 2011-09-21 16:09:05 -04:00
Ryan Lortie
b6140c2f89 Port internal GStaticRecMutex users to GRecMutex 2011-09-21 16:09:04 -04:00
Ryan Lortie
1da913a7a3 GParamSpecPool: port from GStaticMutex to GMutex 2011-09-21 16:06:53 -04:00
Dan Winship
5bc7729d16 Make threads mandatory
G_THREADS_ENABLED still exists, but is always defined. It is still
possible to use libglib without threads, but gobject (and everything
above it) is now guaranteed to be using threads (as, in fact, it was
before, since it was accidentally impossible to compile with
--disable-threads).

https://bugzilla.gnome.org/show_bug.cgi?id=616754
2011-09-09 12:41:55 -04:00
Ryan Lortie
9829d04be8 GObject docs: resolve broken links
Some links were broken due to typos, because functionality was removed
in GLib 2.0 or for various other reasons.  Fix up as many of them as is
reasonable.
2011-09-05 18:46:59 -04:00
Pavel Holejsovsky
fe4fc3e8b5 Make GMainLoop, GMainContext and GSource boxed types
Also add some annotations for better usage of these types in bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=657725
2011-08-31 09:37:51 +02:00
Matthias Clasen
1b28408b8b Spelling fixes
Spelling fixes in comments and docs, provided by
Kjartan Maraas in bug 657336.
2011-08-29 14:49:32 -04:00
Pavel Holejsovsky
fd1a12ca4d [gi] Add signal annotations 2011-08-21 17:17:07 +02:00
Pavel Holejsovsky
af210cd0ee Add missing GClosure annotations 2011-08-19 11:44:44 +02:00
Pavel Holejsovsky
de6566b07d Add missing (allow-none) annotations to g_value_set_string functions 2011-08-19 11:44:41 +02:00
Pavel Holejsovsky
d4c5e3b156 Add (allow-none) annotation for GValue setters.
Assorted g_value_set_xxx() and g_value_take_xxx() functions actually
allow NULL in source parameter.
2011-08-17 12:55:12 +02:00
Marc-André Lureau
d2ca14c270 Add G_VALUE_INIT
The implementation of GValue is not public or documented.  When
allocated on the stack, initializing a GValue is usually done as
documented with:

GValue value = { 0, };

There is lot code around (including WebKit) that added all the missing
fields, resulting in this ugly and non-obvious:

GValue value = { 0, { { 0 } } };

However, this doesn't play nice with -Wmissing-field-initializers for
example. Thus, G_VALUE_INIT.

http://bugzilla.gnome.org/show_bug.cgi?id=654793
http://bugzilla.gnome.org/show_bug.cgi?id=577231
2011-08-13 18:16:44 -04:00
Matthias Clasen
f5472ed232 Trivial typo fix 2011-08-13 13:53:48 -04:00
Behdad Esfahbod
ea6e2968bf [gobject] Fix G_DEFINE_BOXED_TYPE compilation with C++ 2011-08-11 19:03:02 +02:00
Matthias Clasen
9bcf89cd70 Document libffi as new dependency 2011-08-08 23:16:07 +02:00
Ryan Lortie
804e3ba4dd gitignore tweaks 2011-07-22 15:47:24 +02:00
Ryan Lortie
706b275116 GParam: try to avoid further invalid uses
In an attempt to avoid some potential future abuses of the GParamSpec
API, qualify the 'name' field of the structure as 'const' and add a
comment noting that it is an interned string.

This is a theoretical API break, but it will only ever result in
warnings -- and even then, only if you were already doing something
questionable.

Clean up some of the warnings that were caused internally in gparam.c
from these changes.
2011-07-21 08:37:27 +02:00
Johan Dahlin
fa2861e3b6 Use a generic marshaller if one is not specified
Since g_cclosure_marshal_generic is always enabled, it makes
sense to always use that instead of using generated ones.

https://bugzilla.gnome.org/show_bug.cgi?id=654917
2011-07-19 14:38:34 -03:00
Ryan Lortie
d6c30e1766 GParamSpec: intern property names
Make it so that the ->name property on all GParamSpec objects is an
interned string.

https://bugzilla.gnome.org/show_bug.cgi?id=654627
2011-07-15 10:23:11 +02:00
Ryan Lortie
58c247e51b GVariant: add g_variant_take_ref()
This function implements the following logic:

  if (g_variant_is_floating (value))
    g_variant_ref_sink (value);

which is used for consuming the return value of callbacks that may or
may not return floating references.

This patch also replaces a few instances of the above code with the new
function (GSettings, GDBus) and lifts a long-standing restriction on the
use of floating values as the return value for signal handlers by
improving g_value_take_variant().

https://bugzilla.gnome.org/show_bug.cgi?id=627974
2011-07-12 19:44:21 +02:00
Matthias Clasen
436dbe7744 Don't test negative values in ulong conversions
This is failing on 32bit build slaves.
2011-07-10 21:57:45 -04:00
Martin Storsjo
7c517bf350 Don't needlessly use "echo -e"
The -e parameter to echo isn't recognized by echo in POSIX sh,
but isn't needed when no escaped characters need to be
interpreted.

This fixes building glib with a mingw cross compiler on Mac OS X.

https://bugzilla.gnome.org/show_bug.cgi?id=654085
2011-07-10 20:47:02 -04:00
Krzesimir Nowak
cacbdf0ea8 Typo fix.
Fixes jhbuilding gobject-introspection.
2011-06-24 13:20:06 +02:00
Christian Persch
316efa1b5d Add boxed GType for GMatchInfo 2011-06-24 01:03:50 +02:00
Matthias Clasen
5db5a46c3d Add tests for GValueArray 2011-06-23 00:05:18 -04:00
Matthias Clasen
f4da19daa6 Improve test coverage for GValue transformations 2011-06-23 00:05:18 -04:00
Matthias Clasen
8f05da99cb Make gmarshal.c actually compile standalone
It was lacking the necessary includes; in the past it has been
included towards the bottom of gsignal.c, and gained its includes
that way.
2011-06-20 22:49:34 -04:00
Colin Walters
b74e2a720a Stop using glib-genmarshal at build time
To help cross compilation, don't use glib-genmarshal in our
build.  This is easy now that we have g_cclosure_marshal_generic().

In gobject/, add gmarshal.[ch] to git (making the existing entry
points stubs).

In gio/, simply switch to using g_cclosure_marshal_generic().

https://bugzilla.gnome.org/show_bug.cgi?id=652168
2011-06-20 17:24:07 -04:00
Colin Walters
5e64717a5f gclosure: Add G_TYPE_ENUM and G_TYPE_PARAM for g_cclosure_marshal_generic()
These are fundamental types missed in the original commit.
2011-06-20 14:03:05 -04:00
Matthias Clasen
6e7a7052e0 Remove a redundant assertion
A gsize is never going below 0.
2011-06-14 18:51:57 -04:00
Colin Walters
7963a4cf95 gclosure: Add missing include 2011-06-14 12:28:57 -04:00
Xan Lopez
42c2e42a39 gclosure: add missing fundamental types to generic marshaler
for GObject type the ffi->gvalue conversion was not handled. The
GFlags type was completely missing.
2011-06-14 12:50:51 +02:00
Ryan Lortie
ce9681b87e Drop a few more G_CONST_RETURN 2011-06-13 09:27:28 -04:00
Dan Winship
7412e073d1 update .gitignores 2011-06-12 16:17:30 -04:00
Ryan Lortie
8073759f8c Remove all uses of G_CONST_RETURN
Just use 'const'.

https://bugzilla.gnome.org/show_bug.cgi?id=644611
2011-06-09 11:15:40 -04:00
Ryan Lortie
8f21e8145c gobject: remove -DG_DISABLE_CONST_RETURNS
GObject had a few cases of depending on G_CONST_RETURN not being defined
to 'const'.  Remove those in preparation for deprecation of
G_CONST_RETURN.
2011-06-09 11:11:30 -04:00
Colomban Wendling
6418769e4c Fix a typo in GBinding
https://bugzilla.gnome.org/show_bug.cgi?id=652081
2011-06-08 16:56:40 -04:00
Colin Walters
dad374b1a0 glib-types.h: Include glib.h, since we use G_BEGIN_DECLS
This header is included individually by g-ir-scanner.
2011-06-07 16:26:43 -04:00
Colin Walters
ab0e9dbfa7 Generate $module-public-headers.txt file, feed it to gtk-doc
Rather than having the gtk-doc build machinery have a list of header
files to exclude, change the GLib build to dump a list of public
header files generated from the maintained Makefile.am files for
each of glib/, gobject/, gio/.

Also, for glib, always install glib-unix.h, even on non-Unix
platforms, for the same reason we install gwin32.h even on Unix.

https://bugzilla.gnome.org/show_bug.cgi?id=651745
2011-06-07 14:18:36 -04:00
Chun-wei Fan
405b4ff4f4 Update the year in the *.rc.in files
Sorry this change came a bit late...
2011-06-07 08:55:31 +08:00
Chun-wei Fan
e154e3325e Clean up gobject/gvaluetransform.c a bit
The check for _MSC_VER here is not necessary here because:
-One cannot compile GLib out-of-the-box with VS 2003 (let alone VS6
 or earlier) since GLib 2.22.4 or so.
-This code compiles fine with the currently-supported VS versions
 (2008/2010) without the error mentioned in the comments.

This will close Bug 652002.
2011-06-07 08:25:07 +08:00
Matthias Clasen
d811f0cdc9 Fix a typo
And reword some docs.
2011-06-05 19:07:06 -04:00
Matthias Clasen
3b242bc5e9 Use g_param_spec_ref_sink instead of separate ref, sink 2011-06-04 23:43:05 -04:00
Matthias Clasen
9eda9d9195 GParamSpec: avoid unnecessary double initialization of qdata 2011-06-04 23:42:07 -04:00
Matthias Clasen
38dc7955e4 No necessary to init qdata atomically 2011-06-04 23:14:32 -04:00
Alexander Larsson
0a918c0d2a Make g_object_get_data use the new faster g_datalist_get_data
https://bugzilla.gnome.org/show_bug.cgi?id=650458
2011-06-03 21:11:26 -04:00
Colin Walters
3bd3067ffc gobject: Use _ prefixing in private headers over G_GNUC_INTERNAL in public headers
This helps out gtk-doc and g-ir-scanner, and also makes much clearer
what's private versus public.

https://bugzilla.gnome.org/show_bug.cgi?id=651745
2011-06-03 12:40:01 -04:00
Colin Walters
a06863de60 Add a boxed type for GVariantBuilder, mark GVariantIter as (skip)
Based on a patch by Giovanni Campagna <gcampagna@src.gnome.org>

From discussion, GVariantIter is not useful for bindings, but
GVariantBuilder may be.

https://bugzilla.gnome.org/show_bug.cgi?id=646635
2011-05-31 13:37:14 -04:00
Ryan Lortie
8382135265 glib: Rewrite gatomic.[ch]
- remove all inline assembly versions

 - implement the atomic operations using either GCC intrinsics, the
   Windows interlocked API or a mutex-based fallback

 - drop gatomic-gcc.c since these are now defined in the header file.
   Adjust Makefile.am accordingly.

 - expand the set of operations: support 'get', 'set', 'compare and
   exchange', 'add', 'or', and 'xor' for both integers and pointers

 - deprecate g_atomic_int_exchange_and_add since g_atomic_int_add (as
   with all the new arithmetic operations) now returns the prior value

 - unify the use of macros: all functions are now wrapped in macros that
   perform the proper casts and checks

 - remove G_GNUC_MAY_ALIAS use; it was never required for the integer
   operations (since casting between pointers that only vary in
   signedness of the target is explicitly permitted) and we avoid the
   need for the pointer operations by using simple 'void *' instead of
   'gpointer *' (which caused the 'type-punned pointer' warning)

 - provide function implementations of g_atomic_int_inc and
   g_atomic_int_dec_and_test: these were strictly macros before

 - improve the documentation to make it very clear exactly which types
   of pointers these operations may be used with

 - remove a few uses of the now-deprecated g_atomic_int_exchange_and_add

 - drop initialisation of gatomic from gthread (by using a GStaticMutex
   instead of a GMutex)

 - update glib.symbols and documentation sections files

Closes #650823 and #650935
2011-05-28 16:10:44 -04:00
Matthias Clasen
2fb57ff46f Quiet down the build a bit 2011-05-28 14:29:08 -04:00
Matthias Clasen
b5056fbaf9 Simply symbols files
The grouping in files/headers is not used anymore, and
the function attributes neither. Adapt abicheck scripts
and .def file generation rules accordingly.
2011-05-23 00:21:06 -04:00
Giovanni Campagna
7c63370e3a GObject: move GLib type definitions to a separate header
This way it is possible to pull them into the GLib GIR file.

Some cleanups by Colin Walters <walters@verbum.org>

https://bugzilla.gnome.org/show_bug.cgi?id=646635
2011-05-19 17:39:33 -04:00
Colin Walters
5645c7aa41 gtype: Remove unused variable 2011-05-18 11:57:21 -04:00
Benjamin Otte
d9440687ff gobject: Speed up g_type_from_name()
The hash table used exclusively for looking up types by name used to map
quarks => types. But we can easily make it map strings => types, which
avoids the quark lookup. And that in trun avoids taking a lock and
consulting another hash table. So this change should make
g_type_from_name() roughly twice as fast.
2011-05-17 15:01:36 +02:00
Benjamin Otte
02877e2902 gobject: Warn if someone uses the wrong property in g_object_get/set
"Interface::property" was not detected before and led to a crash.
2011-05-02 19:33:51 +02:00
Dan Winship
bdc23c44e8 Fix compiler warnings 2011-05-02 11:50:23 -04:00
Dan Winship
181763438a Update .gitignores 2011-05-02 09:54:15 -04:00
David Zeuthen
88ab35f3cb Add a generic libffi based marshaller to libgobject
This code is from https://bugzilla.gnome.org/show_bug.cgi?id=567087
and was adapted by myself to also support the GVariant fundamental
type.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-08 17:34:44 -04:00
Ryan Lortie
7a752e0817 Improve .gitignore 2011-03-31 15:51:01 +05:30
Murray Cumming
30fdc1a799 Docs: Changed can not to cannot. 2011-03-24 09:33:55 +01:00
Emmanuele Bassi
08f0a31289 Revert "Remove all uses of G_CONST_RETURN"
This reverts commit 36741245cc.

The removal has not been discussed, except on Bugzilla:

https://bugzilla.gnome.org/show_bug.cgi?id=644611
2011-03-15 09:03:28 +00:00
Ryan Lortie
36741245cc Remove all uses of G_CONST_RETURN
Just use 'const'.
2011-03-15 01:32:22 -04:00
Christian Persch
61b0e1c8d4 Add G_SIGNAL_MUST_COLLECT
In some cases, signal arguments have to be collected, even if there are i
no signal handlers connected (e.g. for GVariant parameters, where collection
consumes a floating variant).

Based on a patch by Christian Persch.

Bug #643624.
2011-03-15 01:32:22 -04:00
Will Thompson
72016418d3 g_value_array_remove(): clarify docstring formatting 2011-03-03 14:51:41 +00:00
Chun-wei Fan
7b118b0c41 Visual C++ 2010 Project Files: autotools files
These are the updates to the autotools files to
ensure the expansion of the GIO, GLib and GObject
project files (*.vcxproj, *.vcxproj.filters) and to
enable the distribution of the VS2010 project files

The actual VS2010 project files will follow shortly
2011-02-22 19:58:18 +08:00
Matthias Clasen
2c0a8ff4dc Add a testcase for bug 637738 2011-02-18 23:46:09 -05:00
Matthias Clasen
9dd1f75a41 Document G_VALUE_NOCOPY_CONTENTS
https://bugzilla.gnome.org/show_bug.cgi?id=624943
2011-02-18 22:42:24 -05:00
Matthias Clasen
2a1eed20b4 Expand the documentation of g_type_get_qdata()
https://bugzilla.gnome.org/show_bug.cgi?id=613269
2011-02-18 22:35:49 -05:00
Stef Walter
6cd08472b2 Better documentation for g_value_dup_object().
State that NULL is returned when value is NULL.
2011-02-16 00:21:27 -05:00
Matthias Clasen
f1a88e7e42 More GValue conversion tests 2011-02-14 19:20:44 -05:00
Matthias Clasen
cfe8ec429a Vary the order of unreffing dest and src
For slightly better test coverage.
2011-02-14 19:20:44 -05:00
Matthias Clasen
309f5f978b Improve test coverage
Various test additions, mainly in GObject
2011-02-13 23:49:19 -05:00
Matthias Clasen
1e48bff207 Cosmetic rearrangement 2011-02-13 23:49:19 -05:00
Will Thompson
c2d98c5609 GObject: correct documentation typos 2011-02-11 15:21:12 +00:00
Matthias Clasen
126beeee33 Fix a typo 2011-02-07 23:46:02 -05:00
Matthias Clasen
25ab13fd3c Don't use -w in shebang line
This can cause warnings when PERL_PATH gets expanded to /usr/bin/env.
Patch by Adam Sampson, https://bugzilla.gnome.org/show_bug.cgi?id=641477
2011-02-07 23:27:19 -05:00
Matthias Clasen
6fe2f5f11b Prevent unused variable warnings from G_DEFINE_DYNAMIC_TYPE 2011-01-28 12:26:23 -05:00
Michael Natterer
634e9e43cf gobject: add an empty default impl of GObject::constructed()
to allow unconditional upchaining.
2011-01-12 19:45:40 +01:00
Pavel Holejsovsky
422a76b3cd Fix typo in GI annotation 2010-12-29 11:42:14 +01:00
Pavel Holejsovsky
562a834328 Fix typo in function annotation. 2010-12-28 11:59:58 +01:00
Matthias Clasen
bf1027f826 Move ifaceproperties test to gobject/tests/ 2010-12-27 23:49:12 -05:00
Matthias Clasen
068d53358b Make object_interface_check_properties work
As pointed out in bug 637738, it does not currently work, since
g_type_class_peek always returns NULL.
2010-12-27 23:41:10 -05:00
Pavel Holejsovsky
58e36daf29 Add GI annotations to GObject 2010-12-27 22:08:15 +01:00
Pavel Holejsovsky
282366c326 Add GI annotations to GParamSpec 2010-12-27 22:08:07 +01:00
Pavel Holejsovsky
3955bbfde0 Add GI annotations to GType 2010-12-27 20:56:58 +01:00
Pavel Holejsovsky
3264d8d159 Add GI annotations to GClosure and friends. 2010-12-19 22:20:21 +01:00
Pavel Holejsovsky
ea577d60d4 Add GI annotations to GValue and GValueArray. 2010-12-19 10:39:36 +01:00
Will Thompson
ac4722df1c g_object_get_property: document that value must be initialized
I couldn't tell from reading the documentation whether I had to pass in
an uninitialized value, or a value initialized to the exact type, or
something else. It turns out (from reading the source) that you have to
pass in an initialized value, but you can use any type to which the
property's actual type can be transformed.

So, let's document this.
2010-12-17 13:21:07 +00:00
Matthias Clasen
8071012728 Avoid shadowing the dir builtin
Proposed by David Malcolm,

https://bugzilla.gnome.org/show_bug.cgi?id=636387
2010-12-03 14:08:36 -05:00
Benjamin Otte
67740263e9 gobject: Cast token type to guint to avoid gcc warning
The usual fix for all things GScanner...
2010-12-02 20:11:28 +01:00
Jonas Holmberg
dec8323b4b gobject: added property test
Added test for setting properties with g_object_new.
2010-11-28 18:27:47 -05:00
Jonas Holmberg
349f547561 gobject: initialize memory in g_object_new_valist
memset parameters array in g_object_new_valist to zeroes when expanding
the array to avoid acces to uninitialized memory.
2010-11-28 18:27:30 -05:00
Dan Winship
e910205557 Add g_source_set_dummy_callback()
Use g_source_set_closure() and g_close_set_meta_marshal() to allow
setting a do-nothing callback on any source.

https://bugzilla.gnome.org/show_bug.cgi?id=634239
2010-11-26 15:07:28 -05:00
Ryan Lortie
1a1fc130ec New function: g_clear_object()
By analogy to g_clear_error, takes a pass-by-reference GObject reference
and, if non-%NULL, unrefs it and sets it equal to %NULL.

Bug #620263.
2010-11-08 18:21:51 -05:00
Florian Müllner
a62b43fd9c Fix deadlock in g_object_remove_toggle_ref()
The code section guarded with toggle_refs_mutex includes a call to
g_object_unref(), which may call toggle_refs_notify(). As the latter
tries to acquire the same mutex, glib locks up.

https://bugzilla.gnome.org/show_bug.cgi?id=632884
2010-10-22 14:52:41 +02:00
Alberto Garcia
b7616114c6 Protect access to closure, weak refs and toggle refs arrays
This fixes https://bugzilla.gnome.org/show_bug.cgi?id=613822
2010-10-21 15:20:55 +02:00
Ryan Lortie
3c808dc874 GSignal: fix trivial docs typo 2010-10-12 21:34:26 -04:00
Ryan Lortie
15d87c2cc4 GObject: add g_signal_accumulator_first_wins
Deals with the case where we want exactly one signal handler to run.
2010-10-12 21:34:17 -04:00
Javier Jardón
5fa7a1e9ce gtypemodule: Mention g_object_run_dispose correctly in a warning
https://bugzilla.gnome.org/show_bug.cgi?id=630797
2010-10-08 17:22:19 +02:00
Emmanuele Bassi
44a8ff2f8f gobject: Improve install_properties()
Cache the parent type outside of the loop, and fix a typo in the
documentation.
2010-10-08 16:10:18 +01:00
Johan Dahlin
701ce5d201 [introspection] Add GObject annotations
These were moved in from gobject-introspection
2010-09-24 16:23:31 -03:00
Will Thompson
ba17efc396 g_strdup_value_contents(): dump GStrv more usefully
Previously, dumping a GValue holding a GStrv just yielded "((GStrv *)
0xDEADBEEF)". I think it'd be more useful to dump a Python list-style
representation of the GStrv's contents, if it's not NULL.

Fixes: <https://bugzilla.gnome.org/show_bug.cgi?id=629192>
2010-09-13 19:19:46 +01:00
Emmanuele Bassi
9cd43d7a4c gobject: Add install_properties()
Since we added g_object_notify_by_pspec(), an efficient way to install
and notify properties relies on storing the GParamSpec pointers inside
a static arrays, like we do for signal identifiers.

Instead of multiple calls to g_object_class_install_property(), we
should have a single function to take the static array of GParamSpecs
and iterate it.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-09-13 12:34:53 +01:00
Emmanuele Bassi
016cecb179 Revert hack that broke things badly on Windows
This should fix bug #628952.

Don't include glib/gdatasetprivate.h directly. Especially don't define
GLIB_COMPILATION when doing that, as that causes breakage on Windows
because of the variable dllimport/dllexport stuff in gtypes.h that
checks GLIB_COMPILATION. That macro really should be defined only when
compiling code that goes into the libglib DLL. Otherwise the compiler
thinks that variables that should be imported from libglib are
actually defined in the code being compiled.

Just call g_atomic_pointer_get() as such, don't bother with
G_DATALIST_GET_FLAGS.

Signed-off-by: Tor Lillqvist <tml@iki.fi>
2010-09-08 12:06:49 +03:00
Emmanuele Bassi
01a46e5c65 Hack to include glib/gdatasetprivate.h directly
The gdatasetprivate.h header includes gatomic.h directly. It all works
well in GLib, but inside GObject it will trigger the single inclusion
guard.

Since this is a private header, and it's kind of a special case, one way
to fix it is to declare GLIB_COMPILATION around it and fool the single
inclusion guard in gatomic.h into thinking we're compiling GLib and not
GObject.
2010-09-04 17:25:37 +01:00
Matthias Clasen
42080449d0 Add a note about size limits of private structures
Also add some assertions to check these limits, instead of
failing silently.  Bug 604479.
2010-09-03 18:11:08 -04:00
Matthias Clasen
c75429d0a0 Make ordering for overridden interface properties consistent
g_object_class_list_properties tries to sort the returned list of
paramspecs by 'type depth' and param_id. But all the overridden
interface properties have a param_id of 0, so they come out in
a random order.

Bug 628253.
2010-09-03 14:54:22 -04:00
Emmanuele Bassi
d31c1c863a docs: Fix up GDateTime for the GObject reference 2010-08-25 16:24:46 +01:00
Thiago Santos
e35ed21f43 datetime: Add GDateTime to the GType system
As with other GLib data types, use a GBoxed.
2010-08-24 23:41:21 +01:00
Christian Persch
71e73ffdfb Use G_DEFINE_[BOXED|POINTER]_TYPE instead of handwritten code
Now that we have convenience macros to implement boxed and pointer
types, use them.
2010-08-18 00:12:28 +02:00
Christian Persch
dc1999316d Add G_DEFINE_{BOXED,POINTER}_TYPE[_WITH_CODE]
Add convenience type definition macros for boxed and pointer types
similar to G_DEFINE_TYPE for object types. Bug #449565.
2010-08-18 00:12:22 +02:00
Matthias Clasen
e02571e93b Add bug references to some tests 2010-08-13 21:23:23 -04:00
Benjamin Otte
4ac7f8f084 notifyqueue: Dedup pspecs when adding
The previous code dedup'd when thawing and threw nasty warnings your way
if you notified too often. This can now easily be avoided.

Performance should be roughly identical, as both are O(n²).
2010-08-06 23:35:24 +02:00
Ryan Lortie
b3b7ea8e22 Replace -I with $(glib_INCLUDES) and friends
Stop using ad hoc -I in all of our Makefile.am.  Use the new variables
instead.
2010-08-06 13:10:34 -04:00
paul
9f6faaffb6 Add $(top_builddir)/glib to includes
This is required to find glibconfig.h during srcdir != builddir builds
2010-08-05 09:08:34 -04:00
Emmanuele Bassi
4bc9654c63 binding: Add a default marshaller for the closure API
The g_object_bind_property_with_closures() function should set a
marshaller if the two GClosures don't have one already. This simplifies
the caller code and avoids duplication.

We need to add a new marshaller to the gmarshal.list matching the
signature of the GBindingTransformFunc function.
2010-08-04 01:09:28 +01:00
Mark Wielaard
f8ec75620d Don't add (extra) DESTDIR to tapsetdir for tapset_DATA.
https://bugzilla.gnome.org/show_bug.cgi?id=625876
2010-08-03 08:04:58 -04:00
Emmanuele Bassi
5e1c4b18a8 docs: Clarify user_data behavior for bind_property_full() 2010-08-03 10:34:59 +01:00
Emmanuele Bassi
90f7f171e6 binding: Add G_BINDING_INVERT_BOOLEAN
Since GSettings got the same functionality and flag in commit ca3b7b75b
GBinding should also have the ability to automatically invert a boolean
value without requiring a custom transformation function.
2010-08-03 10:29:50 +01:00
Emmanuele Bassi
3be3ad61d1 binding: Add a closure-based variant of bind_property_full()
Since using the function pointer version muddles the memory management
requirements of language bindings, we should implement a GClosure-based
variant on top of g_object_bind_property_full().

https://bugzilla.gnome.org/show_bug.cgi?id=622278
2010-08-03 09:51:49 +01:00
Benjamin Otte
86040bb2eb Revert "notify: Remove unused g_object_notify_queue_clear()"
This reverts commit 0201a81f04 and adds
locks in the right place.

As this file is a public header (see last commit), we cannot just remove
functions from it.
2010-07-23 10:52:51 +02:00
Benjamin Otte
2819dd60b7 notify: Readd g_object_notify_queue_from_object()
gobjectnotifyqueue.c is a public header, so we cannot remove files from
it. (Yes you read that right, this .c file is a public header. See your
installation directory.)
2010-07-23 10:52:51 +02:00
Benjamin Otte
0483ef000a notify: Make dedup code clearer
A for loops seems easier to understand to me than gotos.
2010-07-22 21:56:21 +02:00
Olivier Crête
9026b11e38 notify: Make GObject property change notifications thread safe
Adds locking around object property change notification handling. The
notifications are only emitted after all threads have called
g_object_thaw_notify().

https://bugzilla.gnome.org/show_bug.cgi?id=166020
2010-07-22 21:56:20 +02:00
Olivier Crête
65797f7e54 notify: Remove g_object_notify_queue_from_object()
The function will not be safe with object locking in place, so we remove
it. The workaround is somewhat ugly, but it works.

https://bugzilla.gnome.org/show_bug.cgi?id=166020
2010-07-22 21:56:20 +02:00
Olivier Crête
83026092eb notify: Refactor g_object_notify_queue_thaw()
This adds better error reporting and simplifies the code for adding
thread safety.

https://bugzilla.gnome.org/show_bug.cgi?id=166020
2010-07-22 21:56:20 +02:00
Olivier Crête
0201a81f04 notify: Remove unused g_object_notify_queue_clear()
https://bugzilla.gnome.org/show_bug.cgi?id=166020
2010-07-22 21:56:20 +02:00
Benjamin Otte
a2c5bba31d notify: Emit a g_critical() instead g_return_if_fail()ing
This does not change the code semantically in any way but avoids a
return in the middle of the code.

https://bugzilla.gnome.org/show_bug.cgi?id=166020
2010-07-22 21:56:20 +02:00
Benjamin Otte
24161d9c46 binding: Cast to avoid compiler warning 2010-07-22 21:56:20 +02:00
Ryan Lortie
adde752ec5 More docs fixes
Remove the g*alias.h from the ignore lists

  Remove other old files from ignore lists

  Clean up gobject docs
2010-07-12 17:46:17 -04:00
Ryan Lortie
83d67bf2e7 move glibconfig.h to glib/ 2010-07-12 15:33:05 -04:00
Will Thompson
2504ec988e Document NULL shortcut to g_value_array_insert etc.
You can pass a NULL GValue * to any of g_value_array_insert, _prepend or
_append to add a new, uninitialized value. This is a very useful
shortcut, and it should be documented rather than left languishing in a
comment in the implementation.

Fixes Gnome bug #552363.
2010-07-08 19:30:53 -04:00
Ryan Lortie
0fc50fa5f7 gobject/: fully remove gobjectalias hacks 2010-07-07 19:40:48 -04:00
Matthias Clasen
c2997efb66 Add some more checks to the binding tests 2010-07-05 23:13:18 -04:00
Matthias Clasen
4e97c96654 Remove a redundant branch
Since the name has been interned already at pspec creation time,
we can just call g_intern_string().
2010-07-05 23:13:18 -04:00
Colin Walters
499ece9b52 [gbinding] Move argument reference out of first column
It makes gobject-introspection complain.
2010-06-25 09:26:23 -04:00
Christian Dywan
272836936e Introduce G_PARAM_DEPRECATED and G_ENABLE_DIAGNOSTIC
See https://bugzilla.gnome.org/show_bug.cgi?id=601686
2010-06-23 16:45:12 +02:00
Emmanuele Bassi
f587cb57f2 binding: Add SYNC_CREATE to the flags
When creating a binding between two object properties we might want to
automatically synchronize the two values at the moment of the binding
creation, instead of waiting for the next change.

The G_BINDING_SYNC_CREATE flag does exactly what it says on the tin.

https://bugzilla.gnome.org/show_bug.cgi?id=622281
2010-06-23 15:19:24 +01:00
Ryan Lortie
d3af9c0ec5 neutralise pltcheck.sh 2010-06-23 10:12:14 -04:00
Matthias Clasen
fadac4bd0f Document g_cclosure_marshal_VOID__VARIANT 2010-06-23 09:25:30 -04:00
Ryan Lortie
c9553af68f Use -Bsymbolic-functions, drop g*alias PLT hackery
This is a minimal patch-out of the galias functionality.  We will do a
release like this so that we can easily back it out if there are
reported problems.

A more substantial cleanup (mostly removing #includes from every file)
will follow if there are no issues.
2010-06-21 13:55:28 -04:00