Commit Graph

15447 Commits

Author SHA1 Message Date
Xavier Claessens
d4791bd383 Doc: Fix g_auto and g_autoptr typo 2015-02-04 15:07:15 +01:00
Xavier Claessens
a1c85833d4 Doc: Add missing functions in gio.types
This is made by doing a build with --rebuild-types option,
then manually remove those functions:
  g_win32_input_stream_get_type
  g_win32_output_stream_get_type
  g_io_extension_get_type

Maybe Makefile.am could remove them automatically so we can
remove gio.types from git and rely on --rebuild-types option?
2015-02-04 15:07:14 +01:00
Xavier Claessens
116d8fa042 Doc: sort and uniquify gio.types 2015-02-04 15:07:14 +01:00
Xavier Claessens
caf9db2dfb Doc: Fix GListModel/GListStore 2015-02-04 15:07:14 +01:00
Chun-wei Fan
642f7a5c79 Visual Studio 2008 Builds: Fix Header "Installation"
Apparently I did not fix the "installation" of gliststore.h and
glistmodel.h fully for Visual Studio 2008 builds.  Fix that.  Doh!
2015-02-04 16:00:52 +08:00
Aurélien Zanelli
5b74681f5b gnulib/vasprintf: handle unsigned modifier for long long
Otherwise, an unsigned integer will be displayed as a signed one if we
use internal printf and if HAVE_LONG_LONG_FORMAT is not defined.

https://bugzilla.gnome.org/show_bug.cgi?id=743936
2015-02-03 11:48:18 -05:00
Lars Uebernickel
c1b0f178ca GListStore: fix preconditions in insert_sorted() 2015-02-03 16:08:37 +01:00
Xavier Claessens
2b536d3cbb docs: fix typos in G_DECLARE_*_TYPE
https://bugzilla.gnome.org/show_bug.cgi?id=743656
2015-02-03 15:57:54 +01:00
Ryan Lortie
26af7c152f tests: add test for GListStore inserted sort
https://bugzilla.gnome.org/show_bug.cgi?id=743927
2015-02-03 15:46:48 +01:00
Ryan Lortie
3f3eac474b GListStore: add sorted insert function
Add g_list_store_insert_sorted() which takes a GCompareDataFunc to
decide where to insert.  This ends up being a very trivial function,
thanks to GSequence.

https://bugzilla.gnome.org/show_bug.cgi?id=743927
2015-02-03 15:46:48 +01:00
Chun-wei Fan
6161b285da gtype.h: Fix Build on non-GCC
Use the (private) _GLIB_DEFINE_AUTOPTR_CHAINUP macro for
G_DECLARE_DERIVABLE_TYPE and G_DECLARE_FINAL_TYPE so that we will
attempt to typedef and define items necessary for GCC
__attribute__((cleanup)) on, well, GCC only.

This fixes the build on non-GCC.

https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-02-03 20:20:46 +08:00
Chun-wei Fan
696db75615 gmacros.h: Add Private Macro _GLIB_DEFINE_AUTOPTR_CHAINUP
This is necessary as we are using _GLIB_AUTOPTR_TYPENAME and
_GLIB_AUTOPTR_FUNC_NAME in gtype.h for G_DECLARE_DERIVABLE_TYPE and
G_DECLARE_FINAL_TYPE, but _GLIB_AUTOPTR_TYPENAME and
_GLIB_AUTOPTR_FUNC_NAME expand to nothing on non-GCC, causing builds on
non-GCC to break, due to bad typedef and function definitions.

This patch defines a new private macro which does what is needed on GCC
builds and does nothing on non-GCC builds, thus fixing the build.

https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-02-03 18:11:30 +08:00
Chun-wei Fan
ccf696a6e1 glistmodel.h: Fix _GListModelInterface Define
"interface" is a reserved word on Visual Studio, so fix the build by
using g_iface instead.

https://bugzilla.gnome.org/show_bug.cgi?id=743827
2015-02-02 11:16:45 +01:00
Ryan Lortie
57a49f6891 fix G_DEFINE_AUTO_CLEANUP_FREE_FUNC on non-GCC
Add the missing 'none' argument to this macro in the non-GCC case.  The
none parameter was added after the others and I forgot to update the
non-GCC case.

https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-02-02 09:17:44 +01:00
Ryan Lortie
08f7f97696 docs: link the GListModel docs from the index 2015-02-02 09:16:35 +01:00
Chun-wei Fan
dee57faa6c MSVC Builds: Fix "Installation" of GListModel Headers
Somehow I had the wrong path for getting the headers... oops.
2015-02-02 14:27:29 +08:00
Chun-wei Fan
25e26ea034 MSVC Builds: Update vs11|vs12/Makefile.am
The rename of install.vxproj to glib-install.vcxproj needs to be applied
here as well for dist'ing the project files correctly.
2015-02-02 14:16:18 +08:00
Chun-wei Fan
444a5fcd4a MSVC Builds: Rename "install" Projects
Rename the project to "install" the GLib files, as we are planning to have
a grand solution file that would build the entire GTK+ stack with its deps,
to ease the process for people building the GTK+ stack from a stock
installation of Visual Studio.
2015-02-02 12:49:42 +08:00
Chun-wei Fan
407adc6ea1 gobject\gtype.h: Make up for Missing '\'
The macro definition for G_DECLARE_DERIVABLE_TYPE was missing a '\' when
we wanted to ignore deprecation warnings for it.
2015-02-02 11:16:29 +08:00
Chun-wei Fan
65f4bd17a2 One More Update For MSVC Builds
We also need to "install" the headers for Lars' new APIs for GListModel/
GListStore.
2015-02-02 11:14:07 +08:00
Chun-wei Fan
50012fb426 MSVC Builds: "Install" the Autocleanup Headers
We are including the autocleanup headers as public headers for all builds,
although they work only for GCC in reality, so "install" them.

Also clean up a bit as we are having "\\" in places, where we only need
"\".
2015-02-02 10:51:25 +08:00
Ryan Lortie
e2f8afdd85 gio: add support for g_auto() and g_autoptr()
Add support to libgio types for the new cleanup macros.

https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-01-30 16:58:40 +01:00
Ryan Lortie
8ea414c8c6 G_DECLARE_*_TYPE: add auto cleanup support
Automatically add support for the new cleanup macros to the type
declaration macros.

This is an API break because now your parent class needs to support
cleanup if you want to use G_DECLARE_*_TYPE.  These macros are only 1
day old, however, so that's probably not a big problem (and we are
already busy adding the macros all over GLib and Gtk+).

https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-01-30 16:52:36 +01:00
Ryan Lortie
3d5de34def gobject: add support for g_auto() and g_autoptr()
Add support to libgobject types for the new cleanup macros.

https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-01-30 16:52:36 +01:00
Ryan Lortie
663834671d glib: add support for g_auto() and g_autoptr()
Add support to the libglib types for the new cleanup macros.

https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-01-30 16:52:36 +01:00
Ryan Lortie
2596919c58 macros: add support for GNUC cleanup __attribute__
Add g_auto() and g_autoptr() as helpers for declaring variables with
automatic cleanup.

Add some macros to help types define cleanup functions for themselves.

Going forward it will be an expectation that people use this macro when
creating a new type, even if they do not intend to use the auto-cleanup
functionality for themselves.

These new macros only work on GCC and clang, which is why we resisted
adding them for so long.  There exist many people who are only
interested in writing programs for these compilers, however, and a
similar API in libgsystem has proven to be extremely popular, so let's
expose this functionality to an even wider audience.

We ignore deprecation warnings when emitting the free functions, which
seems suspicious.  The reason that we do this is not because we want to
call deprecated functions, but just the opposite: sometimes the free
function will be an _unref() function that is only AVAILABLE_IN newer
versions, and these warnings are also implemented as deprecation
warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-01-30 16:49:53 +01:00
Ryan Lortie
b5e1ea6fee DECLARE_TYPE: ignore deprecations in inlines
Prevent complaints about deprecations in the inline functions emitted by
the new G_DECLARE_*_TYPE macros.
2015-01-30 16:49:53 +01:00
Ryan Lortie
9d0389b3b5 G_DECLARE_FINAL_TYPE: trivial fix in docs comment
https://bugzilla.gnome.org/show_bug.cgi?id=743640
2015-01-30 16:49:53 +01:00
Ryan Lortie
93982d4a16 giotypefuncs test: tweak _get_type() regexp
Make sure that we only match the _get_type() function name by
restricting the regexp to matching [A-Za-z0-9_].  We were matching on .*
before which means that if we had two _get_type() functions appearing on
a single line then we would get everything in between them included (by
the default rule of '*' being greedy).

This affected G_DECLARE_*_TYPE which puts several uses of _get_type()
into a single line.
2015-01-30 15:30:02 +01:00
Lars Uebernickel
b69beff426 Add GListModel
GListModel is an interface that represents a dynamic list of GObjects.

Also add GListStore, a simple implementation of GListModel that stores
all objects in memory, using a GSequence.

https://bugzilla.gnome.org/show_bug.cgi?id=729351
2015-01-30 15:08:57 +01:00
Lars Uebernickel
6d55189d8c gsettings: add g_settings_schema_list_children
https://bugzilla.gnome.org/show_bug.cgi?id=743517
2015-01-28 18:09:28 +00:00
Lars Uebernickel
d95bb1f08b gsettings: add g_settings_schema_key_get_name
https://bugzilla.gnome.org/show_bug.cgi?id=743517
2015-01-28 18:09:28 +00:00
Christian Hergert
f3c604d273 G_DECLARE_DERIVED_TYPE: allow forward declarations
This allows multiple declarations such as:

 typedef struct _Foo Foo;

as is needed when you have systems with circular referencing.

https://bugzilla.gnome.org/show_bug.cgi?id=743596
2015-01-28 13:22:23 +00:00
Dan Winship
e8d3f29300 gcredentialsprivate: clarify the USE_FREEBSD_CMSGCRED users
Add comments clarifying what the three non-FreeBSD platforms using
G_CREDENTIALS_USE_FREEBSD_CMSGCRED are.
2015-01-27 07:38:31 -05:00
Peeter Must
4c54b9fe31 gcredentials: Add support for DragonFly
https://bugzilla.gnome.org/show_bug.cgi?id=743508
2015-01-27 07:31:24 -05:00
Ryan Lortie
3b4cb28e17 gtype: add type declaration macros for headers
Add G_DECLARE_DERIVABLE_TYPE() and G_DECLARE_FINAL_TYPE() to allow
skipping almost all of the typical GObject boilerplate code.

These macros make some assumptions about GObject best practice that mean
that they may not be usable with older classes that have to preserve
API/ABI compatibility with a time before these practices existed.

https://bugzilla.gnome.org/show_bug.cgi?id=389585
2015-01-27 11:07:52 +00:00
Chun-wei Fan
e07cc89dee glib-sections.txt: Add g_win32_check_windows_version()
https://bugzilla.gnome.org/show_bug.cgi?id=741895
2015-01-27 12:17:25 +08:00
Chun-wei Fan
bcbf80c355 gwin32: Add g_win32_check_windows_version() API
This adds a public API where one can use to see whether the running version
of Windows where the code is run is at least the specified version, service
pack level, and the type (non-server, server, any) of the running Windows
OS.

This API is done as:
-GetVersion()/GetVersionEx() changed in the way they work since Windows 8.1
 [1][2], so a newer mechanism to check the version of the running Windows
 operating system is needed.  MSDN also states that GetVersion() might be
 further changed or removed after Windows 8.1.  This provides a wrapper for
 VerfyVersionInfo() as well in GLib for most cases, which was recommended
 in place of g_win32_get_windows_version() for more detailed Windows
 version checking.
-Provides an OS-level functionality check, for those that we don't need to
 venture into GetProcAddress(), and also to determine system API behavior
 changes due to differences in OS versions.

Also added a note for the g_win32_get_windows_version() API that since the
behavior of GetVersion() which it uses, is changed since Windows 8.1, users
of the API should be aware.

[1]:
http://msdn.microsoft.com/zh-tw/library/windows/desktop/ms724451%28v=vs.85%29.aspx
[2]:
http://msdn.microsoft.com/zh-tw/library/windows/desktop/ms724451%28v=vs.85%29.aspx

https://bugzilla.gnome.org/show_bug.cgi?id=741895
2015-01-27 12:17:14 +08:00
Cosimo Cecchi
be2d9b4f58 GSimpleAction: add g_simple_action_set_state_hint
Currently the only way to set a state hint on an action is through a
subclass; add a g_simple_action_set_state_hint() method so that this
becomes easier for clients that already use GSimpleAction.

https://bugzilla.gnome.org/show_bug.cgi?id=743521
2015-01-26 12:06:24 +00:00
Ilya Konstantinov
2a0c18041b gthread: add thread name support on Mac OS
https://bugzilla.gnome.org/show_bug.cgi?id=741807
2015-01-26 09:06:13 +00:00
Philip Withnall
1cf7f5a240 gobject: Fix a typo in a documentation comment 2015-01-25 17:09:35 +00:00
Philip Withnall
4462cd30bc gthread: Fix a typo in a documentation comment 2015-01-25 17:09:24 +00:00
Philip Withnall
92041f4b3b gstrfuncs: Document that g_ascii_dtostr() writes a nul terminator
And g_ascii_formatd().

Reviewed-by: Ryan Lortie <desrt@desrt.ca>
2015-01-25 16:22:43 +00:00
Chun-wei Fan
ef09373e03 gio/Makefile.am: Fix MSVC Project Generation
We need to filter out gnetworkmonitornm.c in the MSVC Projects, as that is
UNIX-only code.
2015-01-21 14:28:47 +08:00
Ryan Lortie
29307b4e41 bump version 2015-01-20 01:38:13 -05:00
Ryan Lortie
95ea50d73c GLib 2.43.3 2015-01-20 00:05:28 -05:00
Philip Withnall
11a846b6bf gtestutils: Add an example of using test fixtures
Add a simple example of a test suite with two unit tests both using the
same fixture.

https://bugzilla.gnome.org/show_bug.cgi?id=743014
2015-01-18 23:04:05 +00:00
Inaki Larranaga Murgoitio
ee245b57ff Updated Basque language 2015-01-17 17:14:46 +01:00
Ignacio Casal Quinteiro
cf03e82478 gsocket: always try before waiting for condition
When implementing blocking operations on top of
nonblocking sockets we should always first try to
perform the operation and then if needed handle
EAGAIN and wait with g_socket_wait_condition.
This is an optimization since we avoid calling
wait condition when it is not needed, but most
importantly this fixes hangs on win32 where some
events (in particular FD_WRITE) are only emitted
after the operation fails with EWOULDBLOCK.

https://bugzilla.gnome.org/show_bug.cgi?id=732439
https://bugzilla.gnome.org/show_bug.cgi?id=741707
2015-01-17 15:04:25 +01:00
Paolo Borelli
4f4714285d gsocket: add a testcase that shows a hang on win32
Add a unit test that checks g_socket_new_from_fd by creating
a gsocket, obtaining its fd, duplicating the fd and then creating
a gsocket from the new fd. This shows a hang on win32 since the
gsocket created from the fd never receives the FD_WRITE event
because we wait for the condition without first trying to write
and windows signals the condition only after a EWOULDBLOCK error.

https://bugzilla.gnome.org/show_bug.cgi?id=741707
2015-01-17 15:04:25 +01:00