upgrade to glibmm 2.16

git-svn-id: svn://localhost/ardour2/branches/3.0@5303 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2009-07-02 13:12:38 +00:00
parent 5b97b13766
commit e916ac2821
211 changed files with 26478 additions and 4168 deletions

View file

@ -5,8 +5,11 @@ SUBDIRS = private
sublib_name = glibmm
sublib_libname = glibmm-2.4
sublib_libversion = $(LIBGLIBMM_SO_VERSION)
sublib_namespace = Glib
sublib_cflags = $(GLIBMM_CFLAGS)
sublib_topdir = glib
sublib_win32_dlls_libs =
sublib_files_extra_posix_cc =
sublib_files_extra_win32_cc =
@ -59,6 +62,7 @@ sublib_files_extra_general_h = \
exceptionhandler.h \
helperlist.h \
init.h \
i18n-lib.h \
i18n.h \
interface.h \
iochannel.h \
@ -69,6 +73,7 @@ sublib_files_extra_general_h = \
object.h \
objectbase.h \
pattern.h \
priorities.h \
property.h \
propertyproxy.h \
propertyproxy_base.h \
@ -89,17 +94,13 @@ sublib_files_extra_general_h = \
value_custom.h \
wrap.h
include $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment
include $(top_srcdir)/build_shared/Makefile_build.am_fragment
files_built_general_cc += value_basictypes.cc
files_built_general_h += signalproxy.h value_basictypes.h
sublib_files_extra_general_cc += value_basictypes.cc
sublib_files_extra_general_h += signalproxy.h value_basictypes.h
lib_LTLIBRARIES = libglibmm-2.4.la
if OS_WIN32
libglibmm_2_4_la_SOURCES = $(files_all_general_cc) $(files_all_win32_cc)
else
libglibmm_2_4_la_SOURCES = $(files_all_general_cc) $(files_all_posix_cc)
endif
libglibmm_2_4_la_SOURCES = $(files_built_cc) $(files_extra_cc)
libglibmm_2_4_la_LDFLAGS = $(common_ldflags)
libglibmm_2_4_la_LIBADD = $(GLIBMM_LIBS)

View file

@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -14,6 +14,8 @@
@SET_MAKE@
# Built files
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
@ -33,16 +35,21 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
DIST_COMMON = $(am__sublib_include_HEADERS_DIST) \
$(srcdir)/../src/Makefile_list_of_hg.am_fragment \
DIST_COMMON = $(srcdir)/../src/Makefile_list_of_hg.am_fragment \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(sublib_include_HEADERS) \
$(top_srcdir)/build_shared/Makefile_build.am_fragment \
$(top_srcdir)/build_shared/Makefile_build_extra.am_fragment \
$(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment \
$(top_srcdir)/build_shared/Makefile_gensrc_platform.am_fragment
$(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment
subdir = glib/glibmm
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__aclocal_m4_deps = $(top_srcdir)/scripts/c_std.m4 \
$(top_srcdir)/scripts/cxx.m4 $(top_srcdir)/scripts/cxx_std.m4 \
$(top_srcdir)/scripts/dk-feature.m4 \
$(top_srcdir)/scripts/docgen.m4 \
$(top_srcdir)/scripts/glibmm_check_perl.m4 \
$(top_srcdir)/scripts/macros.m4 \
$(top_srcdir)/scripts/reduced.m4 $(top_srcdir)/scripts/sun.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@ -62,41 +69,39 @@ libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
am__DEPENDENCIES_1 =
libglibmm_2_4_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am__libglibmm_2_4_la_SOURCES_DIST = convert.cc date.cc fileutils.cc \
iochannel.cc keyfile.cc markup.cc module.cc optioncontext.cc \
optionentry.cc optiongroup.cc regex.cc shell.cc spawn.cc \
thread.cc unicode.cc wrap_init.cc value_basictypes.cc class.cc \
containers.cc debug.cc dispatcher.cc error.cc exception.cc \
exceptionhandler.cc init.cc interface.cc main.cc miscutils.cc \
object.cc objectbase.cc pattern.cc property.cc \
propertyproxy.cc propertyproxy_base.cc quark.cc random.cc \
signalproxy.cc signalproxy_connectionnode.cc \
am__libglibmm_2_4_la_SOURCES_DIST = checksum.cc convert.cc date.cc \
fileutils.cc iochannel.cc keyfile.cc markup.cc module.cc \
optioncontext.cc optionentry.cc optiongroup.cc regex.cc \
shell.cc spawn.cc thread.cc nodetree.cc unicode.cc uriutils.cc \
wrap_init.cc class.cc containers.cc debug.cc dispatcher.cc \
error.cc exception.cc exceptionhandler.cc init.cc interface.cc \
main.cc miscutils.cc object.cc objectbase.cc pattern.cc \
property.cc propertyproxy.cc propertyproxy_base.cc quark.cc \
random.cc signalproxy.cc signalproxy_connectionnode.cc \
streamiochannel.cc stringutils.cc threadpool.cc timer.cc \
timeval.cc ustring.cc utility.cc value.cc value_custom.cc \
wrap.cc
am__objects_1 = convert.lo date.lo fileutils.lo iochannel.lo \
keyfile.lo markup.lo module.lo optioncontext.lo optionentry.lo \
optiongroup.lo regex.lo shell.lo spawn.lo thread.lo unicode.lo
am__objects_2 = $(am__objects_1) wrap_init.lo value_basictypes.lo
am__objects_3 = class.lo containers.lo debug.lo dispatcher.lo error.lo \
wrap.cc value_basictypes.cc
am__objects_1 = checksum.lo convert.lo date.lo fileutils.lo \
iochannel.lo keyfile.lo markup.lo module.lo optioncontext.lo \
optionentry.lo optiongroup.lo regex.lo shell.lo spawn.lo \
thread.lo nodetree.lo unicode.lo uriutils.lo
am__objects_2 =
@OS_WIN32_FALSE@am__objects_3 = $(am__objects_1) $(am__objects_2) \
@OS_WIN32_FALSE@ $(am__objects_2)
@OS_WIN32_TRUE@am__objects_3 = $(am__objects_1) $(am__objects_2) \
@OS_WIN32_TRUE@ $(am__objects_2)
am__objects_4 = $(am__objects_3) wrap_init.lo
am__objects_5 = class.lo containers.lo debug.lo dispatcher.lo error.lo \
exception.lo exceptionhandler.lo init.lo interface.lo main.lo \
miscutils.lo object.lo objectbase.lo pattern.lo property.lo \
propertyproxy.lo propertyproxy_base.lo quark.lo random.lo \
signalproxy.lo signalproxy_connectionnode.lo \
streamiochannel.lo stringutils.lo threadpool.lo timer.lo \
timeval.lo ustring.lo utility.lo value.lo value_custom.lo \
wrap.lo
am__objects_4 =
@OS_WIN32_FALSE@am__objects_5 = $(am__objects_3) $(am__objects_4)
@OS_WIN32_TRUE@am__objects_5 = $(am__objects_3) $(am__objects_4)
am__objects_6 = $(am__objects_5)
am__objects_7 = $(am__objects_2) $(am__objects_6)
am__objects_8 = $(am__objects_4)
am__objects_9 = $(am__objects_8)
@OS_WIN32_FALSE@am_libglibmm_2_4_la_OBJECTS = $(am__objects_7) \
@OS_WIN32_FALSE@ $(am__objects_9)
@OS_WIN32_TRUE@am_libglibmm_2_4_la_OBJECTS = $(am__objects_7) \
@OS_WIN32_TRUE@ $(am__objects_9)
wrap.lo value_basictypes.lo
@OS_WIN32_FALSE@am__objects_6 = $(am__objects_2) $(am__objects_5)
@OS_WIN32_TRUE@am__objects_6 = $(am__objects_2) $(am__objects_5)
am_libglibmm_2_4_la_OBJECTS = $(am__objects_4) $(am__objects_6)
libglibmm_2_4_la_OBJECTS = $(am_libglibmm_2_4_la_OBJECTS)
libglibmm_2_4_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
@ -121,18 +126,6 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__sublib_include_HEADERS_DIST = convert.h date.h fileutils.h \
iochannel.h keyfile.h markup.h module.h optioncontext.h \
optionentry.h optiongroup.h regex.h shell.h spawn.h thread.h \
unicode.h signalproxy.h value_basictypes.h arrayhandle.h \
class.h containerhandle_shared.h containers.h debug.h \
dispatcher.h error.h exception.h exceptionhandler.h \
helperlist.h init.h i18n.h interface.h listhandle.h main.h \
miscutils.h object.h objectbase.h pattern.h property.h \
propertyproxy.h propertyproxy_base.h quark.h random.h refptr.h \
sarray.h signalproxy_connectionnode.h slisthandle.h \
streamiochannel.h stringutils.h threadpool.h timer.h timeval.h \
ustring.h utility.h value.h value_custom.h wrap.h wrap_init.h
sublib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(sublib_include_HEADERS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
@ -158,10 +151,12 @@ CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@ $(strip $(extra_defines))
DEFS = @DEFS@ -DG_LOG_DOMAIN=\"$(sublib_name)\" $(extra_win32_defines)
DEPDIR = @DEPDIR@
DISABLE_DEPRECATED_API_CFLAGS = @DISABLE_DEPRECATED_API_CFLAGS@
DISABLE_DEPRECATED_CFLAGS = @DISABLE_DEPRECATED_CFLAGS@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@ -183,6 +178,8 @@ GMMPROC_DIR = @GMMPROC_DIR@
GREP = @GREP@
GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
GTHREAD_LIBS = @GTHREAD_LIBS@
GTKMMPROC_MERGECDOCS = @GTKMMPROC_MERGECDOCS@
GTKMM_DOXYGEN_INPUT = @GTKMM_DOXYGEN_INPUT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@ -195,9 +192,11 @@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
M4 = @M4@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
@ -207,6 +206,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL_PATH = @PERL_PATH@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SED = @SED@
@ -263,172 +263,122 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = private
sublib_name = glibmm
sublib_libname = glibmm-2.4
sublib_libversion = $(LIBGLIBMM_SO_VERSION)
sublib_namespace = Glib
sublib_cflags = $(GLIBMM_CFLAGS)
sublib_topdir = glib
sublib_win32_dlls_libs =
sublib_files_extra_posix_cc =
sublib_files_extra_win32_cc =
sublib_files_extra_general_cc = \
class.cc \
containers.cc \
debug.cc \
dispatcher.cc \
error.cc \
exception.cc \
exceptionhandler.cc \
init.cc \
interface.cc \
main.cc \
miscutils.cc \
object.cc \
objectbase.cc \
pattern.cc \
property.cc \
propertyproxy.cc \
propertyproxy_base.cc \
quark.cc \
random.cc \
signalproxy.cc \
signalproxy_connectionnode.cc \
streamiochannel.cc \
stringutils.cc \
threadpool.cc \
timer.cc \
timeval.cc \
ustring.cc \
utility.cc \
value.cc \
value_custom.cc \
wrap.cc
sublib_files_extra_general_cc = class.cc containers.cc debug.cc \
dispatcher.cc error.cc exception.cc exceptionhandler.cc \
init.cc interface.cc main.cc miscutils.cc object.cc \
objectbase.cc pattern.cc property.cc propertyproxy.cc \
propertyproxy_base.cc quark.cc random.cc signalproxy.cc \
signalproxy_connectionnode.cc streamiochannel.cc \
stringutils.cc threadpool.cc timer.cc timeval.cc ustring.cc \
utility.cc value.cc value_custom.cc wrap.cc \
value_basictypes.cc
sublib_files_extra_posix_h =
sublib_files_extra_win32_h =
sublib_files_extra_general_h = \
arrayhandle.h \
class.h \
containerhandle_shared.h \
containers.h \
debug.h \
dispatcher.h \
error.h \
exception.h \
exceptionhandler.h \
helperlist.h \
init.h \
i18n.h \
interface.h \
iochannel.h \
keyfile.h \
listhandle.h \
main.h \
miscutils.h \
object.h \
objectbase.h \
pattern.h \
property.h \
propertyproxy.h \
propertyproxy_base.h \
quark.h \
random.h \
refptr.h \
sarray.h \
signalproxy_connectionnode.h \
slisthandle.h \
streamiochannel.h \
stringutils.h \
threadpool.h \
timer.h \
timeval.h \
ustring.h \
utility.h \
value.h \
value_custom.h \
wrap.h
sublib_files_extra_general_h = arrayhandle.h class.h \
containerhandle_shared.h containers.h debug.h dispatcher.h \
error.h exception.h exceptionhandler.h helperlist.h init.h \
i18n-lib.h i18n.h interface.h iochannel.h keyfile.h \
listhandle.h main.h miscutils.h object.h objectbase.h \
pattern.h priorities.h property.h propertyproxy.h \
propertyproxy_base.h quark.h random.h refptr.h sarray.h \
signalproxy_connectionnode.h slisthandle.h streamiochannel.h \
stringutils.h threadpool.h timer.h timeval.h ustring.h \
utility.h value.h value_custom.h wrap.h signalproxy.h \
value_basictypes.h
files_posix_hg =
files_win32_hg =
files_general_hg = convert.hg date.hg fileutils.hg iochannel.hg keyfile.hg markup.hg module.hg optioncontext.hg optionentry.hg optiongroup.hg regex.hg shell.hg spawn.hg thread.hg unicode.hg
files_all_hg = $(files_general_hg) $(files_posix_hg) $(files_win32_hg)
@OS_WIN32_FALSE@files_hg = $(files_general_hg) $(files_posix_hg)
@OS_WIN32_TRUE@files_hg = $(files_general_hg) $(files_win32_hg)
files_built_general_cc = $(files_general_hg:.hg=.cc) wrap_init.cc \
value_basictypes.cc
files_built_general_h = $(files_general_hg:.hg=.h) signalproxy.h \
value_basictypes.h
files_built_posix_cc = $(files_posix_hg:.hg=.cc)
files_built_posix_h = $(files_posix_hg:.hg=.h)
files_built_win32_cc = $(files_win32_hg:.hg=.cc)
files_built_win32_h = $(files_win32_hg:.hg=.h)
files_built_all_cc = $(files_built_general_cc) \
$(files_built_posix_cc) \
$(files_built_win32_cc)
files_general_hg = checksum.hg convert.hg date.hg fileutils.hg iochannel.hg keyfile.hg markup.hg \
module.hg optioncontext.hg optionentry.hg optiongroup.hg regex.hg \
shell.hg spawn.hg thread.hg nodetree.hg unicode.hg uriutils.hg
files_built_all_h = $(files_built_general_h) \
$(files_built_posix_h) \
$(files_built_win32_h)
files_general_deprecated_hg =
files_all_hg = \
$(files_posix_hg) \
$(files_win32_hg) \
$(files_general_hg) \
$(files_general_deprecated_hg)
@OS_WIN32_FALSE@files_extra_cc_tmp = $(sublib_files_extra_general_cc) $(sublib_files_extra_posix_cc)
@OS_WIN32_TRUE@files_extra_cc_tmp = $(sublib_files_extra_general_cc) $(sublib_files_extra_win32_cc)
@OS_WIN32_FALSE@files_extra_h_tmp = $(sublib_files_extra_general_h) $(sublib_files_extra_posix_h)
@OS_WIN32_TRUE@files_extra_h_tmp = $(sublib_files_extra_general_h) $(sublib_files_extra_win32_h)
files_extra_cc = $(files_extra_cc_tmp)
files_extra_h = $(files_extra_h_tmp) wrap_init.h
files_extra_all_cc = $(sublib_files_extra_general_cc) $(sublib_files_extra_posix_cc) $(sublib_files_extra_win32_cc)
files_extra_all_h = $(sublib_files_extra_general_h) \
$(sublib_files_extra_posix_h) $(sublib_files_extra_win32_h) \
wrap_init.h
files_all_general_cc = $(files_built_general_cc) $(files_extra_cc)
files_all_posix_cc = $(files_built_posix_cc)
files_all_win32_cc = $(files_built_win32_cc)
@OS_WIN32_FALSE@files_hg = $(files_general_hg) $(files_posix_hg) $(files_general_deprecated_hg)
@OS_WIN32_TRUE@files_hg = $(files_general_hg) $(files_win32_hg) $(files_general_deprecated_hg)
files_built_cc = $(files_hg:.hg=.cc) wrap_init.cc
files_built_h = $(files_hg:.hg=.h)
files_all_built_cc = $(files_all_hg:.hg=.cc) wrap_init.cc
files_all_built_h = $(files_all_hg:.hg=.h)
# Extra files
files_all_extra_cc = \
$(sublib_files_extra_posix_cc) \
$(sublib_files_extra_win32_cc) \
$(sublib_files_extra_general_cc) \
$(sublib_files_extra_general_deprecated_cc)
files_all_extra_h = $(sublib_files_extra_posix_h) \
$(sublib_files_extra_win32_h) $(sublib_files_extra_general_h) \
$(sublib_files_extra_general_deprecated_h) wrap_init.h
@OS_WIN32_FALSE@files_extra_cc = \
@OS_WIN32_FALSE@ $(sublib_files_extra_posix_cc) \
@OS_WIN32_FALSE@ $(sublib_files_extra_general_cc)
@OS_WIN32_TRUE@files_extra_cc = \
@OS_WIN32_TRUE@ $(sublib_files_extra_win32_cc) \
@OS_WIN32_TRUE@ $(sublib_files_extra_general_cc)
@OS_WIN32_FALSE@files_extra_h = $(sublib_files_extra_posix_h) \
@OS_WIN32_FALSE@ $(sublib_files_extra_general_h) wrap_init.h
@OS_WIN32_TRUE@files_extra_h = $(sublib_files_extra_win32_h) \
@OS_WIN32_TRUE@ $(sublib_files_extra_general_h) wrap_init.h
@PLATFORM_WIN32_FALSE@extra_win32_defines =
# Support for DLL on mingw using libtool > 1.4
# When creating DLLs on win32, we need to explicitly add a few extra
# When creating DLLs on win32, we need to explicitly add a few extra
# libraries at link time to resolve symbols (remember a dll is like an
# executable).
@PLATFORM_WIN32_TRUE@extra_win32_defines = \
@PLATFORM_WIN32_TRUE@ -D$(shell echo $(sublib_name) | tr [:lower:] [:upper:])_BUILD
@PLATFORM_WIN32_FALSE@no_undefined =
@PLATFORM_WIN32_TRUE@no_undefined = -no-undefined -Wl,--export-all-symbols
@PLATFORM_WIN32_TRUE@no_undefined = -no-undefined -Wl,--export-all-symbols
@PLATFORM_WIN32_FALSE@win32_dlls_extra_libs =
@PLATFORM_WIN32_TRUE@win32_dlls_extra_libs = $(sublib_win32_dlls_libs)
common_ldflags = -version-info $(LIBGLIBMM_SO_VERSION) $(no_undefined)
all_includes = -I$(top_builddir)/glib -I$(top_srcdir)/glib \
common_ldflags = -version-info $(sublib_libversion) $(no_undefined)
# All modules can include all other modules,
# for instance, so that gdkmm can use headers in pangomm.
all_includes = -I$(top_builddir)/$(sublib_topdir) -I$(top_srcdir)/$(sublib_topdir) \
-I$(top_builddir)/glib -I$(top_srcdir)/glib -I$(top_builddir) \
-I$(top_builddir)/gio -I$(top_srcdir)/gio \
$(sublib_cflags) $(GTHREAD_CFLAGS)
extra_defines = -DG_LOG_DOMAIN=\"$(sublib_name)\" $(extra_win32_defines) \
$(DISABLE_DEPRECATED_CFLAGS) $(DISABLE_DEPRECATED_API_CFLAGS)
dist_sources = $(files_built_all_cc) $(files_extra_all_cc) \
$(files_built_all_h) $(files_extra_all_h)
dist_sources = $(files_all_built_cc) $(files_all_extra_cc) $(files_all_built_h) $(files_all_extra_h)
DISTFILES = $(DIST_COMMON) $(dist_sources) $(TEXINFOS) $(EXTRA_DIST)
DEFAULT_INCLUDES =
INCLUDES = $(strip $(all_includes))
# DISABLE_DEPRECATED_CFLAGS and DISABLE_DEPRECATED_API_CFLAGS are empty unless the appropriate --enable-*=no options are specified to configure:
INCLUDES = $(strip $(all_includes)) $(DISABLE_DEPRECATED_CFLAGS) $(DISABLE_DEPRECATED_API_CFLAGS)
sublib_includedir = $(includedir)/$(sublib_libname)/$(sublib_name)
@OS_WIN32_FALSE@sublib_include_HEADERS = $(files_built_general_h) \
@OS_WIN32_FALSE@ $(files_built_posix_h) \
@OS_WIN32_FALSE@ $(files_extra_h)
@OS_WIN32_TRUE@sublib_include_HEADERS = $(files_built_general_h) \
@OS_WIN32_TRUE@ $(files_built_win32_h) \
@OS_WIN32_TRUE@ $(files_extra_h)
sublib_include_HEADERS = $(files_all_built_h) $(files_all_extra_h)
lib_LTLIBRARIES = libglibmm-2.4.la
@OS_WIN32_FALSE@libglibmm_2_4_la_SOURCES = $(files_all_general_cc) $(files_all_posix_cc)
@OS_WIN32_TRUE@libglibmm_2_4_la_SOURCES = $(files_all_general_cc) $(files_all_win32_cc)
libglibmm_2_4_la_SOURCES = $(files_built_cc) $(files_extra_cc)
libglibmm_2_4_la_LDFLAGS = $(common_ldflags)
libglibmm_2_4_la_LIBADD = $(GLIBMM_LIBS)
all: all-recursive
.SUFFIXES:
.SUFFIXES: .cc .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment $(srcdir)/../src/Makefile_list_of_hg.am_fragment $(top_srcdir)/build_shared/Makefile_gensrc_platform.am_fragment $(top_srcdir)/build_shared/Makefile_build_extra.am_fragment $(top_srcdir)/build_shared/Makefile_build.am_fragment $(am__configure_deps)
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/build_shared/Makefile_build.am_fragment $(srcdir)/../src/Makefile_list_of_hg.am_fragment $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@ -463,8 +413,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
@ -472,8 +422,8 @@ uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLTLIBRARIES:
@ -493,6 +443,7 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checksum.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/class.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/containers.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert.Plo@am__quote@
@ -511,6 +462,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/markup.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miscutils.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nodetree.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objectbase.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/optioncontext.Plo@am__quote@
@ -534,6 +486,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeval.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unicode.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uriutils.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ustring.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utility.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/value.Plo@am__quote@
@ -661,8 +614,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@ -687,8 +640,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@ -698,13 +651,12 @@ ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
@ -874,33 +826,7 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-sublib_includeHEADERS
maintainer-clean-local:
(cd $(srcdir) && rm -f $(files_built_all_cc) $(files_built_all_h))
cvsignore:
( \
echo ".deps"; \
echo ".libs"; \
echo "*.la"; \
echo "*.lo"; \
echo "Makefile"; \
echo "Makefile.in"; \
echo; \
list='$(strip $(files_built_all_cc) $(files_built_all_h))'; \
for file in $$list; do \
echo "$$file"; \
done \
) >$(srcdir)/.cvsignore
( \
echo "Makefile"; \
echo "Makefile.in"; \
echo; \
list='$(strip $(files_all_hg:.hg=_p.h))'; \
for file in $$list; do \
echo "$$file"; \
done \
) >$(srcdir)/private/.cvsignore
.PHONY: cvsignore
(cd $(srcdir) && rm -f $(files_all_built_cc) $(files_all_built_h))
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View file

@ -2,21 +2,21 @@
#ifndef _GLIBMM_ARRAYHANDLE_H
#define _GLIBMM_ARRAYHANDLE_H
/* $Id: arrayhandle.h 32 2003-04-21 17:39:41Z murrayc $ */
/* $Id: arrayhandle.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -0,0 +1,160 @@
// Generated by gtkmmproc -- DO NOT MODIFY!
#include <glibmm/checksum.h>
#include <glibmm/private/checksum_p.h>
/* $Id$ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glibmm/utility.h>
#include <glibmm/checksum.h>
namespace Glib
{
Checksum::Checksum(ChecksumType type)
: gobject_(g_checksum_new((GChecksumType)type))
{
}
Checksum::operator bool() const
{
return gobject_ != 0;
}
gssize Checksum::get_length(ChecksumType checksum_type)
{
return g_checksum_type_get_length((GChecksumType)checksum_type);
}
std::string Checksum::compute_checksum(ChecksumType type, const std::string& data)
{
return Glib::convert_return_gchar_ptr_to_ustring(g_compute_checksum_for_string(((GChecksumType)type), data.c_str(), data.size()));
}
void Checksum::update(const std::string& data)
{
g_checksum_update(gobj(), (const guchar*)data.c_str(), data.size());
}
} // Glib namespace
namespace
{
} // anonymous namespace
namespace Glib
{
Glib::Checksum wrap(GChecksum* object, bool take_copy /* = false */)
{
return Glib::Checksum(object, take_copy);
}
} // namespace Glib
namespace Glib
{
Checksum::Checksum()
:
gobject_ (0) // Allows creation of invalid wrapper, e.g. for output arguments to methods.
{}
Checksum::Checksum(const Checksum& src)
:
gobject_ ((src.gobject_) ? g_checksum_copy(src.gobject_) : 0)
{}
Checksum::Checksum(GChecksum* castitem, bool make_a_copy /* = false */)
{
if(!make_a_copy)
{
// It was given to us by a function which has already made a copy for us to keep.
gobject_ = castitem;
}
else
{
// We are probably getting it via direct access to a struct,
// so we can not just take it - we have to take a copy of it.
if(castitem)
gobject_ = g_checksum_copy(castitem);
else
gobject_ = 0;
}
}
Checksum& Checksum::operator=(const Checksum& src)
{
GChecksum *const new_gobject = (src.gobject_) ? g_checksum_copy(src.gobject_) : 0;
if(gobject_)
g_checksum_free(gobject_);
gobject_ = new_gobject;
return *this;
}
Checksum::~Checksum()
{
if(gobject_)
g_checksum_free(gobject_);
}
GChecksum* Checksum::gobj_copy() const
{
return g_checksum_copy(gobject_);
}
void Checksum::reset()
{
g_checksum_reset(gobj());
}
void Checksum::update(const guchar* data, gsize length)
{
g_checksum_update(gobj(), data, length);
}
void Checksum::get_digest(guint8 * buffer, gsize * digest_len) const
{
g_checksum_get_digest(const_cast<GChecksum*>(gobj()), buffer, digest_len);
}
std::string Checksum::get_string() const
{
return Glib::convert_const_gchar_ptr_to_stdstring(g_checksum_get_string(const_cast<GChecksum*>(gobj())));
}
std::string Checksum::compute_checksum(ChecksumType type, const guchar* data, gsize length)
{
return Glib::convert_return_gchar_ptr_to_stdstring(g_compute_checksum_for_data(((GChecksumType)type), data, length));
}
} // namespace Glib

View file

@ -0,0 +1,224 @@
// -*- c++ -*-
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_CHECKSUM_H
#define _GLIBMM_CHECKSUM_H
/* $Id$ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib.h>
#include <string>
#ifndef DOXYGEN_SHOUD_SKIP_THIS
extern "C" { typedef struct _GChecksum GChecksum; }
#endif
namespace Glib
{
/** Computes the checksum for data.
* This is a generic API for computing checksums (or "digests") for a sequence of arbitrary bytes,
* using various hashing algorithms like MD5, SHA-1 and SHA-256. Checksums are commonly used in various environments and specifications.
*
* glibmm supports incremental checksums by calling update() as long as there's data available and then using get_string()
* or get_digest() to compute the checksum and return it either as a string in hexadecimal form, or as a raw sequence of bytes.
* To compute the checksum for binary blobs and NULL-terminated strings in one go, use the static compute_checksum() convenience functions().
*
* @newin2p16
*/
class Checksum
{
public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef Checksum CppObjectType;
typedef GChecksum BaseObjectType;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
Checksum();
// Use make_a_copy=true when getting it directly from a struct.
explicit Checksum(GChecksum* castitem, bool make_a_copy = false);
Checksum(const Checksum& src);
Checksum& operator=(const Checksum& src);
~Checksum();
GChecksum* gobj() { return gobject_; }
const GChecksum* gobj() const { return gobject_; }
///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
GChecksum* gobj_copy() const;
protected:
GChecksum* gobject_;
private:
public:
/**
* @class ChecksumType:
* @a CHECKSUM_MD5: Use the MD5 hashing algorithm
* @a CHECKSUM_SHA1: Use the SHA-1 hashing algorithm
* @a CHECKSUM_SHA256: Use the SHA-256 hashing algorithm
*
* The hashing algorithm to be used by Checksum when performing the
* digest of some data.
*
* Note that the ChecksumType enumeration may be extended at a later
* date to include new hashing algorithm types.
*
* @newin2p16
*/
/** @addtogroup glibmmEnums Enums and Flags */
/**
* @ingroup glibmmEnums
*/
enum ChecksumType
{
CHECKSUM_MD5,
CHECKSUM_SHA1,
CHECKSUM_SHA256
};
/** Creates a new Checksum, using the checksum algorithm @a checksum_type.
* If the checksum_type is not known, then operator bool() will return false.
*
* @param type checksum type, one of defined above.
*/
explicit Checksum(ChecksumType checksum_type);
/** Returns true if the Checksum object is valid.
* This will return false, for instance, if an unsupported checksum type was provided to the constructor.
*/
operator bool() const;
/** Resets the state of the @a checksum back to it's initial state.
*
* @newin2p18
*/
void reset();
/** Feeds @a data into an existing Checksum. The checksum must still be
* open, that is g_checksum_get_string() or g_checksum_get_digest() must
* not have been called on @a checksum.
*
* @newin2p16
* @param data Buffer used to compute the checksum.
* @param length Size of the buffer, or -1 if it is a null-terminated string.
*/
void update(const guchar* data, gsize length);
/** Feeds data into an existing Checksum.
* The checksum must still be open, that is get_string() or get_digest() must not have been called on the checksum.
*
* @param data Buffer used to compute the checksum
*/
void update(const std::string& data);
/** Gets the digest from @a checksum as a raw binary vector and places it
* into @a buffer. The size of the digest depends on the type of checksum.
*
* Once this function has been called, the Checksum is closed and can
* no longer be updated with g_checksum_update().
*
* @newin2p16
* @param buffer Output buffer.
* @param digest_len An inout parameter. The caller initializes it to the size of @a buffer.
* After the call it contains the length of the digest.
*/
void get_digest(guint8 *buffer, gsize *digest_len) const;
/** Gets the digest as an hexadecimal string.
*
* Once this function has been called the Checksum can no longer be
* updated with g_checksum_update().
* @return The hexadecimal representation of the checksum. The
* returned string is owned by the checksum and should not be modified
* or freed.
*
* @newin2p16.
*/
std::string get_string() const;
/** Computes the checksum for a binary @a data of @a length. This is a
* convenience wrapper for g_checksum_new(), g_checksum_get_string()
* and g_checksum_free().
* @param checksum_type A ChecksumType.
* @param data Binary blob to compute the digest of.
* @param length Length of @a data.
* @return The digest of the binary data as a string in hexadecimal.
* The returned string should be freed with g_free() when done using it.
*
* @newin2p16.
*/
static std::string compute_checksum(ChecksumType type, const guchar* data, gsize length);
/** Computes the checksum of a string.
*
* @param checksum_type A ChecksumType
* @param str The string to compute the checksum of.
* @result The checksum as a hexadecimal string.
*/
static std::string compute_checksum(ChecksumType type, const std::string& str);
//We don't use _WRAP_METHOD because this is not really a GCheckSum function:
/** Gets the length in bytes of digests of type @a checksum_type.
*
* @param checksum_type A ChecksumType.
* @result The checksum length, or -1 if @a checksum_type is not supported.
*/
static gssize get_length(ChecksumType checksum_type);
};
} //namespace Glib
namespace Glib
{
/** A Glib::wrap() method for this object.
*
* @param object The C instance.
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
* @result A C++ instance that wraps this C instance.
*
* @relates Glib::Checksum
*/
Glib::Checksum wrap(GChecksum* object, bool take_copy = false);
} // namespace Glib
#endif /* _GLIBMM_CHECKSUM_H */

View file

@ -1,19 +1,19 @@
// -*- c++ -*-
/* $Id: class.cc 336 2006-10-04 12:06:14Z murrayc $ */
/* $Id: class.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 1998-2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -2,22 +2,22 @@
#ifndef _GLIBMM_CLASS_H
#define _GLIBMM_CLASS_H
/* $Id: class.h 291 2006-05-12 08:08:45Z murrayc $ */
/* $Id: class.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright 2001 Free Software Foundation
* Copyright (C) 1998-2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -2,21 +2,21 @@
#ifndef _GLIBMM_CONTAINERHANDLE_SHARED_H
#define _GLIBMM_CONTAINERHANDLE_SHARED_H
/* $Id: containerhandle_shared.h 322 2006-09-19 20:36:43Z murrayc $ */
/* $Id: containerhandle_shared.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -29,7 +29,6 @@
#include <list>
#include <glib-object.h>
#include <glib/gmem.h>
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <glibmm/wrap.h>
@ -54,11 +53,16 @@ namespace Glib
/**
* @ingroup ContHandles
*/
//! Ownership of the container
/*! Defines how and if the container will release the list and
* its elemens when it is destroyed
*/
enum OwnershipType
{
OWNERSHIP_NONE = 0,
OWNERSHIP_SHALLOW, //Release the list, but not its elements, when the container is deleted
OWNERSHIP_DEEP //Release the list, and its elements, when the container is deleted.
OWNERSHIP_NONE = 0, /*!< Do not release anything */
OWNERSHIP_SHALLOW, /*!< Release the list, but not its elements, when the container is deleted */
OWNERSHIP_DEEP /*!< Release the list, and its elements, when the container is deleted. */
};
@ -314,40 +318,22 @@ struct TypeTraits<std::string>
{ g_free(const_cast<CTypeNonConst>(str)); }
};
/** Specialization for bool
/** Specialization for bool.
* @ingroup ContHelpers
*/
template <>
struct TypeTraits<bool>
{
typedef bool CppType;
typedef gboolean* CType;
typedef gboolean* CTypeNonConst;
typedef bool CppType;
typedef gboolean CType;
typedef gboolean CTypeNonConst;
static CType to_c_type (CppType val) { return (int*)GINT_TO_POINTER(val); }
static CType to_c_type (CType ptr) { return ptr; }
static CppType to_cpp_type(CType ptr)
{
if(ptr)
{
//We use this for gboolean too, because it is actually an int.
return GPOINTER_TO_INT(ptr);
}
else
return CppType();
}
static void release_c_type(CType /* ptr */)
{
}
static CType to_c_type (CppType item) { return static_cast<CType>(item); }
static CType to_c_type (CType item) { return item; }
static CppType to_cpp_type (CType item) { return (item != 0); }
static void release_c_type (CType) {}
};
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#ifndef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
/* The STL containers in Sun's libCstd don't support templated sequence
@ -368,6 +354,4 @@ void fill_container(Cont& container, In pbegin, In pend)
} // namespace Glib
#endif /* _GLIBMM_CONTAINERHANDLE_SHARED_H */

View file

@ -1,22 +1,22 @@
// -*- c++ -*-
/* $Id: containers.cc 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: containers.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* containers.h
*
* Copyright (C) 1998-2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -2,29 +2,28 @@
#ifndef _GLIBMM_CONTAINERS_H
#define _GLIBMM_CONTAINERS_H
/* $Id: containers.h 229 2005-11-23 07:22:43Z murrayc $ */
/* $Id: containers.h 779 2009-01-19 17:58:50Z murrayc $ */
/* containers.h
*
* Copyright (C) 1998-2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/glist.h>
#include <glib/gslist.h>
#include <glib.h>
#include <glibmm/sarray.h> /* for backward compatibility */
#include <iterator>

View file

@ -10,23 +10,24 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gconvert.h>
#include <glib.h>
#include <glib/gunicode.h>
//#include <glib/gtestutils.h> //For g_assert() in glib >= 2.15.0
//#include <glib/gmessages.h> //For g_assert() in glib < 2.15.0
#include <glib.h> //For g_assert() in all versions of glib.
#include <glibmm/utility.h>

View file

@ -9,22 +9,22 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gtypes.h> /* for gsize */
#include <glib.h> /* for gsize */
#include <glibmm/error.h>
#include <glibmm/ustring.h>

View file

@ -10,22 +10,23 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gmem.h>
#include <glib.h>
//#include <glib/gtestutils.h> //For g_assert() in glib >= 2.15.0
//#include <glib/gmessages.h> //For g_assert() in glib < 2.15.0
#include <glib.h> //For g_assert() in all versions of glib.
#include <ctime>
#include <algorithm>
@ -61,6 +62,20 @@ Date::Date(const GDate& castitem)
gobject_ (castitem)
{}
Date::Date(const Date& other)
{
g_date_clear(&gobject_, 1);
g_date_set_julian(&gobject_, other.get_julian());
}
Date& Date::operator=(const Date& other)
{
if (&other != this)
g_date_set_julian(&gobject_, other.get_julian());
return *this;
}
void Date::clear()
{
g_date_clear(&gobject_, 1);

View file

@ -9,16 +9,16 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -28,8 +28,7 @@
#include <glibmm/ustring.h>
#include <glib/gdate.h>
#include <glib/gtypes.h>
#include <glib.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C" { struct tm; }
@ -100,18 +99,63 @@ enum DMY
static const Year BAD_YEAR = 0;
static const guint32 BAD_JULIAN = 0;
/** Construct an undefined date.
*/
Date();
/** Construct a date with the given day, month and year.
* @param day The day.
* @param month The month.
* @param year The year.
*/
Date(Day day, Month month, Year year);
/** Construct a date from a julian day.
* @param julian_day The julian day (guint32).
*/
explicit Date(guint32 julian_day);
#ifndef DOXYGEN_SHOULD_SKIP_THIS
explicit Date(const GDate& castitem);
#endif
void clear();
/** Clear the date. The cleared dates will not represent an existing date, but will not contain garbage.
* @param month Month to set.
/** Construct a Glib::Date by copying the contents of a GDate.
* @param castitem The GDate.
*
* @newin2p18
*/
explicit Date(const GDate& castitem);
/** Construct a Glib::Date from another.
* @param other the other Glib::Date.
*
* @newin2p18
*/
Date(const Date& other);
/** Assign another date to this one. For example:
* @code
* ...
* Glib::Date my_date;
* my_date = other_date;
* @endcode
*
* @param other The other Glib::Date.
*
* @newin2p18
*/
Date& operator=(const Date& other);
/// Provides access to the underlying C instance.
GDate* gobj() { return &gobject_; }
/// Provides access to the underlying C instance.
const GDate* gobj() const { return &gobject_; }
private:
GDate gobject_;
public:
/** Clear the date. The cleared dates will not represent an existing date,
* but will not contain garbage.
*/
void clear();
/** Parses a user-inputted string str, and try to figure out what date it represents, taking the current locale into account. If the string is successfully parsed, the date will be valid after the call. Otherwise, it will be invalid.
* This function is not appropriate for file formats and the like; it isn't very precise, and its exact behavior varies with the locale. It's intended to be a heuristic routine that guesses what the user means by a given string (and it does work pretty well in that capacity).
@ -160,6 +204,8 @@ enum DMY
*/
void set_time(const GTimeVal& timeval);
/** Set this Glib::Date to the current time.
*/
void set_time_current();
/** Sets the month of the year. If the resulting day-month-year triplet is invalid, the date will be invalid.
@ -191,7 +237,6 @@ enum DMY
//TODO: Why return Date& (which is always *this) from these methods?
//Isn't it enough to also change the current instance?
//Maybe we need a copy constructor too.
//murrayc
/** Add a number of days to a Date.
@ -419,14 +464,6 @@ enum DMY
* @return true if the date is a valid one.
*/
static bool valid_dmy(Day day, Month month, Year year);
#ifndef DOXYGEN_SHOULD_SKIP_THIS
GDate* gobj() { return &gobject_; }
const GDate* gobj() const { return &gobject_; }
#endif
private:
GDate gobject_;
};

View file

@ -1,18 +1,18 @@
/* $Id: debug.cc 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: debug.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -2,35 +2,33 @@
#ifndef _GLIBMM_DEBUG_H
#define _GLIBMM_DEBUG_H
/* $Id: debug.h 17 2003-01-22 12:09:02Z murrayc $ */
/* $Id: debug.h 785 2009-02-17 19:03:06Z daniel $ */
/* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gmacros.h>
#include <glib.h>
#include <glibmmconfig.h>
// Some stuff that's useful when debugging gtkmm internals:
#ifdef GLIBMM_DEBUG_REFCOUNTING
#include <glib.h>
/* We can't use G_GNUC_PRETTY_FUNCTION because it's always disabled in C++,
/* We can't use the equivalent GLib macro because it's always disabled in C++,
* even though __PRETTY_FUNCTION__ works fine in C++ as well if you use it
* right (i.e. concatenation with string literals isn't allowed).
*/

View file

@ -1,19 +1,19 @@
// -*- c++ -*-
/* $Id: dispatcher.cc 370 2007-01-20 10:53:28Z daniel $ */
/* $Id: dispatcher.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -2,21 +2,21 @@
#ifndef _GLIBMM_DISPATCHER_H
#define _GLIBMM_DISPATCHER_H
/* $Id: dispatcher.h 370 2007-01-20 10:53:28Z daniel $ */
/* $Id: dispatcher.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -1,27 +1,28 @@
// -*- c++ -*-
/* $Id: error.cc 291 2006-05-12 08:08:45Z murrayc $ */
/* $Id: error.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* error.cc
*
* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gerror.h>
#include <glib.h>
//#include <glib/gtestutils.h> //For g_assert() in glib >= 2.15.0
//#include <glib/gmessages.h> //For g_assert() in glib < 2.15.0
#include <glib.h> //For g_assert() in all versions of glib.
#include <map>
#include <glibmmconfig.h>

View file

@ -1,21 +1,21 @@
// -*- c++ -*-
#ifndef _GLIBMM_ERROR_H
#define _GLIBMM_ERROR_H
/* $Id: error.h 336 2006-10-04 12:06:14Z murrayc $ */
/* $Id: error.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -24,7 +24,7 @@
extern "C" { typedef struct _GError GError; }
#endif
#include <glib/gquark.h>
#include <glib.h>
#include <glibmm/exception.h>
#include <glibmmconfig.h> //For GLIBMM_EXCEPTIONS_ENABLED

View file

@ -1,26 +1,29 @@
// -*- c++ -*-
/* $Id: exception.cc 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: exception.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* exception.cc
*
* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib.h>
//#include <glib/gtestutils.h> //For g_assert() in glib >= 2.15.0
//#include <glib/gmessages.h> //For g_assert() in glib < 2.15.0
#include <glib.h> //For g_assert() in all versions of glib.
#include <glibmm/exception.h>

View file

@ -1,23 +1,23 @@
// -*- c++ -*-
#ifndef _GLIBMM_EXCEPTION_H
#define _GLIBMM_EXCEPTION_H
/* $Id: exception.h 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: exception.h 779 2009-01-19 17:58:50Z murrayc $ */
/* exception.h
*
* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -1,21 +1,21 @@
// -*- c++ -*-
/* $Id: exceptionhandler.cc 291 2006-05-12 08:08:45Z murrayc $ */
/* $Id: exceptionhandler.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* exceptionhandler.cc
*
* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -2,23 +2,23 @@
#ifndef _GLIBMM_EXCEPTIONHANDLER_H
#define _GLIBMM_EXCEPTIONHANDLER_H
/* $Id: exceptionhandler.h 291 2006-05-12 08:08:45Z murrayc $ */
/* $Id: exceptionhandler.h 779 2009-01-19 17:58:50Z murrayc $ */
/* exceptionhandler.h
*
* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -10,23 +10,21 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gdir.h>
#include <glib/gfileutils.h>
#include <glib/gstrfuncs.h>
#include <glib.h>
#include <glibmm/utility.h>
@ -58,7 +56,7 @@ Dir::~Dir()
std::string Dir::read_name()
{
const char *const name = g_dir_read_name(gobject_);
return (name) ? std::string(name) : std::string();
return Glib::convert_const_gchar_ptr_to_stdstring(name);
}
void Dir::rewind()

View file

@ -9,16 +9,16 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -1,23 +1,23 @@
// -*- c++ -*-
#ifndef _GLIBMM_HELPERLIST_H
#define _GLIBMM_HELPERLIST_H
/* $Id: helperlist.h 386 2007-03-23 17:31:16Z murrayc $ */
/* $Id: helperlist.h 779 2009-01-19 17:58:50Z murrayc $ */
/* helperlist.h
*
* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -110,7 +110,8 @@ public:
{
size_type j = 0;
iterator i;
for(i = begin(), j = 0; i != end(), j < l; ++i, ++j);
for(i = begin(), j = 0; i != end(), j < l; ++i, ++j)
;
return (*i);
}

View file

@ -0,0 +1,30 @@
// -*- c++ -*-
#ifndef _GLIBMM_I18N_LIB_H
#define _GLIBMM_I18N_LIB_H
/* $Id: i18n-lib.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
// Include this file to define internationalization macros such as _().
// This file must be included by the application, after system headers such as <iostream>.
#include <glib/gi18n-lib.h>
#endif /* _GLIBMM_I18N_LIB_H */

View file

@ -2,21 +2,21 @@
#ifndef _GLIBMM_I18N_H
#define _GLIBMM_I18N_H
/* $Id: i18n.h 77 2004-03-02 23:29:57Z murrayc $ */
/* $Id: i18n.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -1,19 +1,19 @@
// -*- c++ -*-
/* $Id: init.cc 54 2003-11-03 09:27:33Z murrayc $ */
/* $Id: init.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2003 The glibmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -2,21 +2,21 @@
#ifndef _GLIBMM_INIT_H
#define _GLIBMM_INIT_H
/* $Id: init.h 54 2003-11-03 09:27:33Z murrayc $ */
/* $Id: init.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -26,7 +26,7 @@ namespace Glib
/** Initialize glibmm.
* You may call this more than once.
* You do nott need to call this if you are using Glib::MainLoop or Gtk::Main,
* You do not need to call this if you are using Glib::MainLoop or Gtk::Main,
* because they call it for you.
*/
void init();

View file

@ -1,19 +1,19 @@
// -*- c++ -*-
/* $Id: interface.cc 209 2005-03-07 15:42:20Z murrayc $ */
/* $Id: interface.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -2,21 +2,21 @@
#ifndef _GLIBMM_INTERFACE_H
#define _GLIBMM_INTERFACE_H
/* $Id: interface.h 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: interface.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -41,7 +41,20 @@ public:
typedef GTypeInterface BaseClassType;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
/** Called by constructors of derived classes. Provide the result of
* the Class object's init() function to ensure that it is properly
* initialized.
*
* @param interface_class The Class object for the derived type.
*/
explicit Interface(const Glib::Interface_Class& interface_class);
/** Called by constructors of derived classes.
*
* @param cast_item A C instance that will be wrapped by the new
* C++ instance. This does not take a reference, so call reference()
* if necessary.
*/
explicit Interface(GObject* castitem);
virtual ~Interface();

View file

@ -10,16 +10,16 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -28,7 +28,6 @@
#include <glibmm/iochannel.h>
#include <glibmm/utility.h>
#include <glibmm/main.h>
#include <glib.h>
namespace
@ -449,12 +448,15 @@ Glib::RefPtr<IOChannel> wrap(GIOChannel* gobject, bool take_copy)
/**** Glib::GlibmmIOChannel ************************************************/
// static
#ifdef GLIBMM_EXCEPTIONS_ENABLED
GIOStatus GlibmmIOChannel::io_read(GIOChannel* channel, char* buf, gsize count,
gsize* bytes_read, GError** err)
#else
//Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
GIOStatus GlibmmIOChannel::io_read(GIOChannel* channel, char* buf, gsize count,
gsize* bytes_read, GError** /* err */)
#endif
{
if(!&err) err = err; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
#ifdef GLIBMM_EXCEPTIONS_ENABLED
@ -477,12 +479,15 @@ GIOStatus GlibmmIOChannel::io_read(GIOChannel* channel, char* buf, gsize count,
return G_IO_STATUS_ERROR;
}
// static
#ifdef GLIBMM_EXCEPTIONS_ENABLED
GIOStatus GlibmmIOChannel::io_write(GIOChannel* channel, const char* buf, gsize count,
gsize* bytes_written, GError** err)
#else
//Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
GIOStatus GlibmmIOChannel::io_write(GIOChannel* channel, const char* buf, gsize count,
gsize* bytes_written, GError** /* err */)
#endif
{
if(!&err) err = err; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
#ifdef GLIBMM_EXCEPTIONS_ENABLED
@ -505,11 +510,13 @@ GIOStatus GlibmmIOChannel::io_write(GIOChannel* channel, const char* buf, gsize
return G_IO_STATUS_ERROR;
}
// static
#ifdef GLIBMM_EXCEPTIONS_ENABLED
GIOStatus GlibmmIOChannel::io_seek(GIOChannel* channel, gint64 offset, GSeekType type, GError** err)
#else
//Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
GIOStatus GlibmmIOChannel::io_seek(GIOChannel* channel, gint64 offset, GSeekType type, GError** /* err */)
#endif
{
if(!&err) err = err; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
#ifdef GLIBMM_EXCEPTIONS_ENABLED
@ -532,11 +539,13 @@ GIOStatus GlibmmIOChannel::io_seek(GIOChannel* channel, gint64 offset, GSeekType
return G_IO_STATUS_ERROR;
}
// static
#ifdef GLIBMM_EXCEPTIONS_ENABLED
GIOStatus GlibmmIOChannel::io_close(GIOChannel* channel, GError** err)
#else
//Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
GIOStatus GlibmmIOChannel::io_close(GIOChannel* channel, GError** /* err */)
#endif
{
if(!&err) err = err; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
#ifdef GLIBMM_EXCEPTIONS_ENABLED
@ -594,11 +603,13 @@ void GlibmmIOChannel::io_free(GIOChannel* channel)
g_free(channel);
}
// static
#ifdef GLIBMM_EXCEPTIONS_ENABLED
GIOStatus GlibmmIOChannel::io_set_flags(GIOChannel* channel, GIOFlags flags, GError** err)
#else
//Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
GIOStatus GlibmmIOChannel::io_set_flags(GIOChannel* channel, GIOFlags flags, GError** /* err */)
#endif
{
if(!&err) err = err; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
#ifdef GLIBMM_EXCEPTIONS_ENABLED

View file

@ -10,16 +10,16 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -29,7 +29,7 @@
#include <glibmm/main.h>
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <glib/gtypes.h>
#include <glib.h>
#include <string>
#include <glibmmconfig.h>
@ -269,11 +269,10 @@ public:
* @throw Glib::ConvertError
*/
/** This function cannot be called on a channel with <tt>0</tt> encoding.
/** Reads a Unicode character from @a channel.
* This function cannot be called on a channel with <tt>0</tt> encoding.
* @param thechar A location to return a character.
* @param error A location to return an error of type G::ConvertError
* or G::IOChannelError.
* @return A G::IOStatus.
* @return A IOStatus.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus read(gunichar& thechar);
@ -305,8 +304,6 @@ public:
* success if count &lt; 6 and the channel's encoding is non-<tt>0</tt>.
* This indicates that the next UTF-8 character is too wide for
* the buffer.
* @param error A location to return an error of type G::ConvertError
* or G::IOChannelError.
* @return The status of the operation.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
@ -392,12 +389,10 @@ public:
* @param count The size of the buffer. If -1, the buffer
* is taken to be a nul-terminated string.
* @param bytes_written The number of bytes written. This can be nonzero
* even if the return value is not G::IO_STATUS_NORMAL.
* If the return value is G::IO_STATUS_NORMAL and the
* even if the return value is not IO_STATUS_NORMAL.
* If the return value is IO_STATUS_NORMAL and the
* channel is blocking, this will always be equal
* to @a count if @a count &gt;= 0.
* @param error A location to return an error of type G::ConvertError
* or G::IOChannelError.
* to @a count if @a count &gt;= 0.
* @return The status of the operation.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
@ -414,11 +409,10 @@ public:
* @throw Glib::ConvertError
*/
/** This function cannot be called on a channel with <tt>0</tt> encoding.
/** Writes a Unicode character to @a channel.
* This function cannot be called on a channel with <tt>0</tt> encoding.
* @param thechar A character.
* @param error A location to return an error of type G::ConvertError
* or G::IOChannelError.
* @return A G::IOStatus.
* @return A IOStatus.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus write(gunichar unichar);
@ -438,12 +432,11 @@ public:
*/
/** Replacement for g_io_channel_seek() with the new API.
* @param offset The offset in bytes from the position specified by @a type .
* @param type A G::SeekType. The type G::SEEK_CUR is only allowed in those
* @param offset The offset in bytes from the position specified by @a type.
* @param type A SeekType. The type SEEK_CUR is only allowed in those
* cases where a call to g_io_channel_set_encoding()
* is allowed. See the documentation for
* g_io_channel_set_encoding() for details.
* @param error A location to return an error of type G::IOChannelError.
* @return The status of the operation.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
@ -460,10 +453,9 @@ public:
*/
/** Flushes the write buffer for the GIOChannel.
* @param error Location to store an error of type G::IOChannelError.
* @return The status of the operation: One of
* G::IO_CHANNEL_NORMAL, G::IO_CHANNEL_AGAIN, or
* G::IO_CHANNEL_ERROR.
* IO_CHANNEL_NORMAL, IO_CHANNEL_AGAIN, or
* IO_CHANNEL_ERROR.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus flush();
@ -482,10 +474,10 @@ public:
*/
/** Close an IO channel. Any pending data to be written will be
* flushed if @a flush is <tt>true</tt>. The channel will not be freed until the
* flushed if @a flush is <tt>true</tt>. The channel will not be freed until the
* last reference is dropped using g_io_channel_unref().
* @param flush If <tt>true</tt>, flush pending.
* @param err Location to store a G::IOChannelError.
* @param err Location to store a IOChannelError.
* @return The status of the operation.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
@ -509,7 +501,7 @@ public:
*/
/** Sets the buffer size.
* @param size The size of the buffer. 0 == pick a good size.
* @param size The size of the buffer, or 0 to let GLib pick a good size.
*/
void set_buffer_size(gsize size);
@ -525,10 +517,10 @@ public:
* @return Bitwise combination of the flags set on the channel.
*/
/** Gets the current flags for a G::IOChannel, including read-only
* flags such as G::IO_FLAG_IS_READABLE.
/** Gets the current flags for a IOChannel, including read-only
* flags such as IO_FLAG_IS_READABLE.
*
* The values of the flags G::IO_FLAG_IS_READABLE and G::IO_FLAG_IS_WRITEABLE
* The values of the flags IO_FLAG_IS_READABLE and IO_FLAG_IS_WRITEABLE
* are cached for internal use by the channel when it is created.
* If they should change at some later point (e.g. partial shutdown
* of a socket with the UNIX shutdown() function), the user
@ -544,9 +536,8 @@ public:
* @throw Glib::IOChannelError
*/
/** Sets the (writeable) flags in @a channel to ( @a flags & G::IO_CHANNEL_SET_MASK).
/** Sets the (writeable) flags in @a channel to ( @a flags & IO_CHANNEL_SET_MASK).
* @param flags The flags to set on the IO channel.
* @param error A location to return an error of type G::IOChannelError.
* @return The status of the operation.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
@ -579,11 +570,11 @@ public:
*
* A buffered channel can only be set unbuffered if the channel's
* internal buffers have been flushed. Newly created channels or
* channels which have returned G::IO_STATUS_EOF
* channels which have returned IO_STATUS_EOF
* not require such a flush. For write-only channels, a call to
* g_io_channel_flush() is sufficient. For all other channels,
* the buffers may be flushed by a call to g_io_channel_seek_position().
* This includes the possibility of seeking with seek type G::SEEK_CUR
* This includes the possibility of seeking with seek type SEEK_CUR
* and an offset of zero. Note that this means that socket-based
* channels cannot be set unbuffered once they have had data
* read from them.
@ -601,8 +592,8 @@ public:
* @return The buffering status of the channel.
*/
/** Return Value: <tt>true</tt> if the @a channel is buffered.
* @return <tt>true</tt> if the @a channel is buffered.
/** Return Value: <tt>true</tt> if the @a channel is buffered.
* @return <tt>true</tt> if the @a channel is buffered.
*/
bool get_buffered() const;
@ -612,11 +603,10 @@ public:
* @return Bitwise combination of Glib::IOCondition flags.
*/
/** This function returns a G::IOCondition depending on whether there
* is data to be read/space to write data in the
* internal buffers in the G::IOChannel. Only the flags G::IO_IN and
* G::IO_OUT may be set.
* @return A G::IOCondition.
/** This function returns a IOCondition depending on whether there
* is data to be read/space to write data in the internal buffers in
* the IOChannel. Only the flags IO_IN and IO_OUT may be set.
* @return A IOCondition.
*/
IOCondition get_buffer_condition() const;

View file

@ -7,16 +7,16 @@
/* Copyright 2006 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -41,61 +41,94 @@ KeyFile::KeyFile(GKeyFile* castitem, bool takes_ownership)
KeyFile::~KeyFile()
{
if (owns_gobject_)
g_key_file_free(gobject_);
g_key_file_free(gobject_);
}
bool KeyFile::load_from_data(const Glib::ustring& data, KeyFileFlags flags)
{
GError *error = 0;
bool retvalue = g_key_file_load_from_data(gobj(), data.c_str(), data.bytes(), ((GKeyFileFlags)(flags)), &(error));
if(error) :: Glib::Error::throw_exception(error);
return retvalue;
GError* error = 0;
const gboolean result = g_key_file_load_from_data(
gobj(), data.c_str(), data.bytes(),
static_cast<GKeyFileFlags>(unsigned(flags)),
&error);
if(error)
Glib::Error::throw_exception(error);
return (result != 0);
}
bool KeyFile::load_from_data_dirs(const std::string& file, std::string& full_path, KeyFileFlags flags)
bool KeyFile::load_from_data_dirs(const std::string& file, std::string& full_path,
KeyFileFlags flags)
{
GError *error = 0;
char *full_path_c;
bool retvalue = g_key_file_load_from_data_dirs(gobj(), file.c_str(), &full_path_c, ((GKeyFileFlags)(flags)), &(error));
full_path = Glib::convert_return_gchar_ptr_to_ustring(full_path_c);
if(error) :: Glib::Error::throw_exception(error);
return retvalue;
GError* error = 0;
char* full_path_c = 0;
const gboolean result = g_key_file_load_from_data_dirs(
gobj(), file.c_str(), &full_path_c,
static_cast<GKeyFileFlags>(unsigned(flags)),
&error);
if(error)
Glib::Error::throw_exception(error);
if(full_path_c)
full_path = Glib::ScopedPtr<char>(full_path_c).get();
else
full_path.erase();
return (result != 0);
}
Glib::ustring KeyFile::to_data()
{
GError *error = 0;
gsize size;
Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_key_file_to_data(gobj(), &size, &error));
if(error) :: Glib::Error::throw_exception(error);
return retvalue;
GError* error = 0;
char *const str = g_key_file_to_data(gobj(), 0, &error);
if(error)
Glib::Error::throw_exception(error);
return Glib::convert_return_gchar_ptr_to_ustring(str);
}
Glib::ArrayHandle<Glib::ustring> KeyFile::get_groups() const
{
gchar** group_names = 0;
gsize number_of_groups = 0;
group_names = g_key_file_get_groups(const_cast<GKeyFile*>(gobj()), &number_of_groups);
return Glib::ArrayHandle<Glib::ustring>(group_names, number_of_groups, Glib::OWNERSHIP_DEEP);
gsize length = 0;
char** const array = g_key_file_get_groups(const_cast<GKeyFile*>(gobj()), &length);
return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
}
Glib::ArrayHandle<Glib::ustring> KeyFile::get_keys(const Glib::ustring& group_name) const
{
gchar** key_names = 0;
gsize number_of_keys = 0;
GError* error = 0;
key_names = g_key_file_get_keys(const_cast<GKeyFile*>(gobj()), group_name.c_str(), &number_of_keys, &error);
gsize length = 0;
GError* error = 0;
char** const array = g_key_file_get_keys(
const_cast<GKeyFile*>(gobj()),
(group_name.empty()) ? 0 : group_name.c_str(),
&length, &error);
if(error)
Glib::Error::throw_exception(error);
return Glib::ArrayHandle<Glib::ustring>(key_names, number_of_keys, Glib::OWNERSHIP_DEEP);
return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
}
Glib::ustring KeyFile::get_locale_string(const Glib::ustring& group_name, const Glib::ustring& key) const
Glib::ustring KeyFile::get_locale_string(const Glib::ustring& group_name,
const Glib::ustring& key) const
{
GError *error = 0;
Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_key_file_get_locale_string(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), 0, &(error)));
if(error) ::Glib::Error::throw_exception(error);
return retvalue;
GError* error = 0;
char *const str = g_key_file_get_locale_string(
const_cast<GKeyFile*>(gobj()),
(group_name.empty()) ? 0 : group_name.c_str(),
key.c_str(), 0, &error);
if(error)
Glib::Error::throw_exception(error);
return Glib::convert_return_gchar_ptr_to_ustring(str);
}
#ifdef GLIBMM_EXCEPTIONS_ENABLED
@ -105,19 +138,17 @@ int KeyFile::get_integer(const Glib::ustring& key, std::auto_ptr<Glib::Error>& e
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* gerror = 0;
int retvalue = g_key_file_get_integer(const_cast<GKeyFile*>(gobj()), NULL, key.c_str(), &(gerror));
const int value = g_key_file_get_integer(const_cast<GKeyFile*>(gobj()),
0, key.c_str(), &gerror);
if(gerror)
#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
::Glib::Error::throw_exception(gerror);
Glib::Error::throw_exception(gerror);
#else
if(gerror)
error = ::Glib::Error::throw_exception(gerror);
#endif //GLIBMM_EXCEPTIONS_ENABLED
return retvalue;
error = Glib::Error::throw_exception(gerror);
#endif
return value;
}
#ifdef GLIBMM_EXCEPTIONS_ENABLED
double KeyFile::get_double(const Glib::ustring& key) const
#else
@ -142,49 +173,76 @@ void KeyFile::set_double(const Glib::ustring& key, double value)
g_key_file_set_double(gobj(), 0, key.c_str(), value);
}
Glib::ArrayHandle<Glib::ustring> KeyFile::get_string_list(const Glib::ustring& group_name, const Glib::ustring& key) const
// TODO: alternative code path with exceptions disabled
Glib::ArrayHandle<Glib::ustring> KeyFile::get_string_list(const Glib::ustring& group_name,
const Glib::ustring& key) const
{
gchar** string_list = 0;
gsize length_of_list = 0;
GError* error = 0;
string_list = g_key_file_get_string_list(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &length_of_list, &error);
gsize length = 0;
GError* error = 0;
char** const array = g_key_file_get_string_list(
const_cast<GKeyFile*>(gobj()),
(group_name.empty()) ? 0 : group_name.c_str(),
key.c_str(), &length, &error);
if(error)
Glib::Error::throw_exception(error);
return Glib::ArrayHandle<Glib::ustring>(string_list, length_of_list, Glib::OWNERSHIP_DEEP);
return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
}
Glib::ArrayHandle<Glib::ustring> KeyFile::get_locale_string_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& locale) const
// TODO: alternative code path with exceptions disabled
Glib::ArrayHandle<Glib::ustring> KeyFile::get_locale_string_list(const Glib::ustring& group_name,
const Glib::ustring& key,
const Glib::ustring& locale) const
{
gchar** string_list = 0;
gsize length_of_list = 0;
GError* error = 0;
string_list = g_key_file_get_locale_string_list(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), locale.c_str(), &length_of_list, &error);
gsize length = 0;
GError* error = 0;
char** const array = g_key_file_get_locale_string_list(
const_cast<GKeyFile*>(gobj()),
(group_name.empty()) ? 0 : group_name.c_str(),
key.c_str(), locale.c_str(), &length, &error);
if(error)
Glib::Error::throw_exception(error);
return Glib::ArrayHandle<Glib::ustring>(string_list, length_of_list, Glib::OWNERSHIP_DEEP);
return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
}
Glib::ArrayHandle<bool> KeyFile::get_boolean_list(const Glib::ustring& group_name, const Glib::ustring& key) const
// TODO: alternative code path with exceptions disabled
Glib::ArrayHandle<bool> KeyFile::get_boolean_list(const Glib::ustring& group_name,
const Glib::ustring& key) const
{
gboolean* bool_list = 0;
gsize length_of_list = 0;
GError* error = 0;
bool_list = g_key_file_get_boolean_list(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &length_of_list, &error);
gsize length = 0;
GError* error = 0;
gboolean *const array = g_key_file_get_boolean_list(
const_cast<GKeyFile*>(gobj()),
(group_name.empty()) ? 0 : group_name.c_str(),
key.c_str(), &length, &error);
if(error)
Glib::Error::throw_exception(error);
return Glib::ArrayHandle<bool>(&bool_list, length_of_list, Glib::OWNERSHIP_DEEP);
return Glib::ArrayHandle<bool>(array, length, Glib::OWNERSHIP_SHALLOW);
}
Glib::ArrayHandle<int> KeyFile::get_integer_list(const Glib::ustring& group_name, const Glib::ustring& key) const
Glib::ArrayHandle<int> KeyFile::get_integer_list(const Glib::ustring& group_name,
const Glib::ustring& key) const
{
gint* integer_list = 0;
gsize length_of_list = 0;
GError* error = 0;
integer_list = g_key_file_get_integer_list(const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &length_of_list, &error);
gsize length = 0;
GError* error = 0;
int *const array = g_key_file_get_integer_list(
const_cast<GKeyFile*>(gobj()),
(group_name.empty()) ? 0 : group_name.c_str(),
key.c_str(), &length, &error);
if(error)
Glib::Error::throw_exception(error);
return Glib::ArrayHandle<int>(integer_list, length_of_list, Glib::OWNERSHIP_DEEP);
return Glib::ArrayHandle<int>(array, length, Glib::OWNERSHIP_SHALLOW);
}
Glib::ArrayHandle<double> KeyFile::get_double_list(const Glib::ustring& group_name, const Glib::ustring& key) const
@ -198,67 +256,84 @@ Glib::ArrayHandle<double> KeyFile::get_double_list(const Glib::ustring& group_na
return Glib::ArrayHandle<double>(integer_list, length_of_list, Glib::OWNERSHIP_DEEP);
}
void KeyFile::set_string_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ArrayHandle<Glib::ustring>& list)
void KeyFile::set_string_list(const Glib::ustring& group_name, const Glib::ustring& key,
const Glib::ArrayHandle<Glib::ustring>& list)
{
gsize length_of_list = list.size();
g_key_file_set_string_list(gobj(), group_name.c_str(), key.c_str(), list.data(), length_of_list);
g_key_file_set_string_list(gobj(), (group_name.empty()) ? 0 : group_name.c_str(),
key.c_str(), list.data(), list.size());
}
void KeyFile::set_locale_string_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& locale, const Glib::ArrayHandle<Glib::ustring>& list)
void KeyFile::set_locale_string_list(const Glib::ustring& group_name,
const Glib::ustring& key, const Glib::ustring& locale,
const Glib::ArrayHandle<Glib::ustring>& list)
{
gsize length_of_list = list.size();
g_key_file_set_locale_string_list(gobj(), group_name.c_str(), key.c_str(), locale.c_str(), list.data(), length_of_list);
g_key_file_set_locale_string_list(gobj(), (group_name.empty()) ? 0 : group_name.c_str(),
key.c_str(), locale.c_str(), list.data(), list.size());
}
void KeyFile::set_integer_list(const Glib::ustring& group_name, const Glib::ustring& key, Glib::ArrayHandle<int>& list)
void KeyFile::set_integer_list(const Glib::ustring& group_name, const Glib::ustring& key,
const Glib::ArrayHandle<int>& list)
{
gsize length_of_list = list.size();
g_key_file_set_integer_list(gobj(), group_name.c_str(), key.c_str(), const_cast<int*>(list.data()), length_of_list);
g_key_file_set_integer_list(gobj(), (group_name.empty()) ? 0 : group_name.c_str(),
key.c_str(), const_cast<int*>(list.data()), list.size());
}
void KeyFile::set_double_list(const Glib::ustring& group_name, const Glib::ustring& key, Glib::ArrayHandle<double>& list)
void KeyFile::set_double_list(const Glib::ustring& group_name, const Glib::ustring& key,
const Glib::ArrayHandle<double>& list)
{
gsize length_of_list = list.size();
g_key_file_set_double_list(gobj(), group_name.c_str(), key.c_str(), const_cast<double*>(list.data()), length_of_list);
g_key_file_set_double_list(gobj(), group_name.c_str(), key.c_str(),
const_cast<double*>(list.data()), list.size());
}
void KeyFile::set_boolean_list(const Glib::ustring& group_name, const Glib::ustring& key, Glib::ArrayHandle<bool>& list)
void KeyFile::set_boolean_list(const Glib::ustring& group_name, const Glib::ustring& key,
const Glib::ArrayHandle<bool>& list)
{
gsize length_of_list = list.size();
g_key_file_set_boolean_list(gobj(), group_name.c_str(), key.c_str(), *(list.data()), length_of_list);
g_key_file_set_boolean_list(gobj(), (group_name.empty()) ? 0 : group_name.c_str(),
key.c_str(), const_cast<gboolean*>(list.data()), list.size());
}
Glib::ustring KeyFile::get_comment() const
{
GError *error = 0;
Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_key_file_get_comment(const_cast<GKeyFile*>(gobj()), 0, 0, &(error)));
if(error) ::Glib::Error::throw_exception(error);
return retvalue;
GError* error = 0;
char *const str = g_key_file_get_comment(const_cast<GKeyFile*>(gobj()), 0, 0, &error);
if(error)
Glib::Error::throw_exception(error);
return Glib::convert_return_gchar_ptr_to_ustring(str);
}
Glib::ustring KeyFile::get_comment(const Glib::ustring& group_name) const
{
GError *error = 0;
Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_key_file_get_comment(const_cast<GKeyFile*>(gobj()), group_name.c_str(), 0, &(error)));
if(error) ::Glib::Error::throw_exception(error);
return retvalue;
GError* error = 0;
char *const str = g_key_file_get_comment(const_cast<GKeyFile*>(gobj()),
(group_name.empty()) ? 0 : group_name.c_str(),
0, &error);
if(error)
Glib::Error::throw_exception(error);
return Glib::convert_return_gchar_ptr_to_ustring(str);
}
void KeyFile::set_comment(const Glib::ustring& comment)
{
GError *error = 0;
g_key_file_set_comment(gobj(), 0, 0, comment.c_str(), &(error));
if(error) ::Glib::Error::throw_exception(error);
GError* error = 0;
g_key_file_set_comment(gobj(), 0, 0, comment.c_str(), &error);
if(error)
Glib::Error::throw_exception(error);
}
void KeyFile::set_comment(const Glib::ustring& group_name, const Glib::ustring& comment)
{
GError *error = 0;
g_key_file_set_comment(gobj(), group_name.c_str(), 0, comment.c_str(), &(error));
if(error) ::Glib::Error::throw_exception(error);
GError* error = 0;
g_key_file_set_comment(gobj(), (group_name.empty()) ? 0 : group_name.c_str(),
0, comment.c_str(), &error);
if(error)
Glib::Error::throw_exception(error);
}
}
} // namespace Glib
namespace
{

View file

@ -7,16 +7,16 @@
/* Copyright(C) 2006 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or(at your option) any later version.
* version 2.1 of the License, or(at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -26,7 +26,7 @@
#include <glibmm/arrayhandle.h>
#include <glibmm/error.h>
#include <glibmm/utility.h>
#include <glib/gkeyfile.h>
#include <glib.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C" { typedef struct _GKeyFile GKeyFile; }
@ -153,8 +153,8 @@ private:
*
* Key-value pairs generally have the form key=value, with the exception of localized strings, which have the form
* key[locale]=value. Space before and after the '=' character are ignored. Newline, tab, carriage return and
* backslash characters in value are escaped as \n, \t, \r, and \\, respectively. To preserve leading spaces in
* values, these can also be escaped as \s.
* backslash characters in value are escaped as \\n, \\t, \\r, and \\\\, respectively. To preserve leading spaces in
* values, these can also be escaped as \\s.
*
* Key files can store strings (possibly with localized variants), integers, booleans and lists of these. Lists are
* separated by a separator character, typically ';' or ','. To use the list separator character in a value in a
@ -207,12 +207,13 @@ public:
public:
/** Loads a key file into an empty G::KeyFile structure.
* If the file could not be loaded then %error is set to
* either a G::FileError or G::KeyFileError.
/** Loads a key file into an empty KeyFile instance.
* If the file could not be loaded then a FileError or KeyFileError exception is thrown.
*
* @a throw Glib::FileError
* @a throw Glib::KeyFileError
* @param file The path of a filename to load, in the GLib file name encoding.
* @param flags Flags from G::KeyFileFlags.
* @param error Return location for a G::Error, or <tt>0</tt>.
* @param flags Flags from KeyFileFlags.
* @return <tt>true</tt> if a key file could be loaded, <tt>false</tt> othewise
* @newin2p6.
*/
@ -283,20 +284,19 @@ public:
Glib::ArrayHandle<Glib::ustring> get_keys(const Glib::ustring& group_name) const;
/** Looks whether the key file has the group @a group_name .
/** Looks whether the key file has the group @a group_name.
* @param group_name A group name.
* @return <tt>true</tt> if @a group_name is a part of @a key_file , <tt>false</tt>
* @return <tt>true</tt> if @a group_name is a part of @a key_file, <tt>false</tt>
* otherwise.
* @newin2p6.
*/
bool has_group(const Glib::ustring& group_name) const;
/** Looks whether the key file has the key @a key in the group
* @a group_name .
/** Looks whether the key file has the key @a key in the group
* @a group_name.
* @param group_name A group name.
* @param key A key name.
* @param error Return location for a G::Error.
* @return <tt>true</tt> if @a key is a part of @a group_name , <tt>false</tt>
* @return <tt>true</tt> if @a key is a part of @a group_name, <tt>false</tt>
* otherwise.
*
* @newin2p6.
@ -308,12 +308,13 @@ public:
#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Return value: a newly allocated string or <tt>0</tt> if the specified
/** Returns the value associated with @a key under @a group_name.
*
* @a throw Glib::FileError in the event the key cannot be found (with the Glib::KEY_FILE_ERROR_KEY_NOT_FOUND code).
* @a throw Glib::KeyFileError in the event that the @a group_name cannot be found (with the Glib::KEY_FILE_ERROR_GROUP_NOT_FOUND).
* @param group_name A group name.
* @param key A key.
* @param error Return location for a G::Error, or <tt>0</tt>.
* @return A newly allocated string or <tt>0</tt> if the specified
* key cannot be found.
* @return The value as a string.
*
* @newin2p6.
*/
@ -327,7 +328,6 @@ public:
/** Return value: a newly allocated string or <tt>0</tt> if the specified
* @param group_name A group name.
* @param key A key.
* @param error Return location for a G::Error, or <tt>0</tt>.
* @return A newly allocated string or <tt>0</tt> if the specified
* key cannot be found.
*
@ -349,8 +349,7 @@ public:
/** Return value: a newly allocated string or <tt>0</tt> if the specified
* @param group_name A group name.
* @param key A key.
* @param locale A locale or <tt>0</tt>.
* @param error Return location for a G::Error, or <tt>0</tt>.
* @param locale A locale identifier or <tt>0</tt>.
* @return A newly allocated string or <tt>0</tt> if the specified
* key cannot be found.
*
@ -363,12 +362,11 @@ public:
#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Return value: the value associated with the key as a boolean, or
/** Return value: the value associated with the key as a boolean,
* @param group_name A group name.
* @param key A key.
* @param error Return location for a G::Error.
* @return The value associated with the key as a boolean, or
* <tt>false</tt> if the key was not found or could not be parsed.
* @return The value associated with the key as a boolean,
* or <tt>false</tt> if the key was not found or could not be parsed.
*
* @newin2p6.
*/
@ -391,7 +389,6 @@ public:
/** Return value: the value associated with the key as an integer, or
* @param group_name A group name.
* @param key A key.
* @param error Return location for a G::Error.
* @return The value associated with the key as an integer, or
* 0 if the key was not found or could not be parsed.
*
@ -418,7 +415,6 @@ public:
/** Return value: the value associated with the key as a double, or
* @param group_name A group name.
* @param key A key.
* @param error Return location for a G::Error.
* @return The value associated with the key as a double, or
* 0.0 if the key was not found or could not be parsed.
*
@ -431,8 +427,8 @@ public:
#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Associates a new double value with @a key under @a group_name .
* If @a key cannot be found then it is created.
/** Associates a new double value with @a key under @a group_name.
* If @a key cannot be found then it is created.
*
* @newin2p14
* @param group_name A group name.
@ -518,14 +514,12 @@ public:
Glib::ustring get_comment(const Glib::ustring& group_name) const;
/** Retrieves a comment above @a key from @a group_name .
* @a group_name . If @a key is <tt>0</tt> then @a comment will
* be read from above @a group_name . If both @a key
* and @a group_name are <tt>0</tt>, then @a comment will
* be read from above the first group in the file.
/** Retrieves a comment above @a key from @a group_name.
* If @a key is <tt>0</tt> then @a comment will be read from above
* @a group_name. If both @a key and @a group_name are <tt>0</tt>, then
* @a comment will be read from above the first group in the file.
* @param group_name A group name, or <tt>0</tt>.
* @param key A key.
* @param error Return location for a G::Error.
* @return A comment that should be freed with g_free()
*
* @newin2p6.
@ -546,9 +540,9 @@ public:
*/
void set_list_separator(gchar separator);
/** Associates a new value with @a key under @a group_name . If @a key
* cannot be found then it is created. If @a group_name cannot be
* found then it is created.
/** Associates a new value with @a key under @a group_name.
* If @a key cannot be found then it is created.
* If @a group_name cannot be found then it is created.
*
* @newin2p6
* @param group_name A group name.
@ -557,9 +551,9 @@ public:
*/
void set_value(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& value);
/** Associates a new string value with @a key under @a group_name . If
* @a key cannot be found then it is created. If @a group_name
* cannot be found then it is created.
/** Associates a new string value with @a key under @a group_name.
* If @a key cannot be found then it is created.
* If @a group_name cannot be found then it is created.
*
* @newin2p6
* @param group_name A group name.
@ -568,20 +562,19 @@ public:
*/
void set_string(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& string);
/** Associates a string value for @a key and @a locale under
* @a group_name . If the translation for @a key cannot be found
* then it is created.
/** Associates a string value for @a key and @a locale under @a group_name.
* If the translation for @a key cannot be found then it is created.
*
* @newin2p6
* @param group_name A group name.
* @param key A key.
* @param locale A locale.
* @param locale A locale identifier.
* @param string A string.
*/
void set_locale_string(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& locale, const Glib::ustring& string);
/** Associates a new boolean value with @a key under @a group_name .
* If @a key cannot be found then it is created.
/** Associates a new boolean value with @a key under @a group_name.
* If @a key cannot be found then it is created.
*
* @newin2p6
* @param group_name A group name.
@ -590,8 +583,8 @@ public:
*/
void set_boolean(const Glib::ustring& group_name, const Glib::ustring& key, bool value);
/** Associates a new integer value with @a key under @a group_name .
* If @a key cannot be found then it is created.
/** Associates a new integer value with @a key under @a group_name.
* If @a key cannot be found then it is created.
*
* @newin2p6
* @param group_name A group name.
@ -627,7 +620,7 @@ public:
* @param key The name of a key
* @param list A list holding object of type bool
*/
void set_boolean_list(const Glib::ustring& group_name, const Glib::ustring& key, Glib::ArrayHandle<bool>& list);
void set_boolean_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ArrayHandle<bool>& list);
/** Sets a list of integers for the @a key under @a group_name.
@ -636,7 +629,7 @@ public:
* @param key The name of a key
* @param list A list holding object of type int
*/
void set_integer_list(const Glib::ustring& group_name, const Glib::ustring& key, Glib::ArrayHandle<int>& list);
void set_integer_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ArrayHandle<int>& list);
/** Sets a list of doubles for the @a key under @a group_name.
@ -647,7 +640,7 @@ public:
*
* @newin2p14
*/
void set_double_list(const Glib::ustring& group_name, const Glib::ustring& key, Glib::ArrayHandle<double>& list);
void set_double_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ArrayHandle<double>& list);
/** Places @a comment at the start of the file, before the first group.
@ -667,17 +660,16 @@ public:
* @param comment The comment
*/
/** Places a comment above @a key from @a group_name .
* @a group_name . If @a key is <tt>0</tt> then @a comment will
* be written above @a group_name . If both @a key
* and @a group_name are <tt>0</tt>, then @a comment will
* be written above the first group in the file.
*
* @newin2p6
/** Places a comment above @a key from @a group_name.
* If @a key is <tt>0</tt> then @a comment will be written above @a group_name.
* If both @a key and @a group_name are <tt>0</tt>, then @a comment will be
* written above the first group in the file.
* @param group_name A group name, or <tt>0</tt>.
* @param key A key.
* @param comment A comment.
* @param error Return location for a G::Error.
* @return <tt>true</tt> if the comment was written, <tt>false</tt> otherwise
*
* @newin2p6.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void set_comment(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& comment);
@ -686,16 +678,15 @@ public:
#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Removes a comment above @a key from @a group_name .
* @a group_name . If @a key is <tt>0</tt> then @a comment will
* be written above @a group_name . If both @a key
* and @a group_name are <tt>0</tt>, then @a comment will
* be written above the first group in the file.
*
* @newin2p6
/** Removes a comment above @a key from @a group_name.
* If @a key is <tt>0</tt> then @a comment will be removed above @a group_name.
* If both @a key and @a group_name are <tt>0</tt>, then @a comment will
* be removed above the first group in the file.
* @param group_name A group name, or <tt>0</tt>.
* @param key A key.
* @param error Return location for a G::Error.
* @return <tt>true</tt> if the comment was removed, <tt>false</tt> otherwise
*
* @newin2p6.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void remove_comment(const Glib::ustring& group_name, const Glib::ustring& key);
@ -704,12 +695,12 @@ public:
#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Removes @a key in @a group_name from the key file.
*
* @newin2p6
/** Removes @a key in @a group_name from the key file.
* @param group_name A group name.
* @param key A key name to remove.
* @param error Return location for a G::Error or <tt>0</tt>.
* @return <tt>true</tt> if the key was removed, <tt>false</tt> otherwise
*
* @newin2p6.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void remove_key(const Glib::ustring& group_name, const Glib::ustring& key);
@ -718,12 +709,12 @@ public:
#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Removes the specified group, @a group_name ,
* from the key file.
*
* @newin2p6
/** Removes the specified group, @a group_name,
* from the key file.
* @param group_name A group name.
* @param error Return location for a G::Error or <tt>0</tt>.
* @return <tt>true</tt> if the group was removed, <tt>false</tt> otherwise
*
* @newin2p6.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void remove_group(const Glib::ustring& group_name);

View file

@ -2,26 +2,26 @@
#ifndef _GLIBMM_LISTHANDLE_H
#define _GLIBMM_LISTHANDLE_H
/* $Id: listhandle.h 32 2003-04-21 17:39:41Z murrayc $ */
/* $Id: listhandle.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/glist.h>
#include <glib.h>
#include <glibmm/containerhandle_shared.h>

View file

@ -1,19 +1,19 @@
// -*- c++ -*-
/* $Id: main.cc 420 2007-06-22 15:29:58Z murrayc $ */
/* $Id: main.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -24,7 +24,6 @@
#include <glibmm/wrap.h>
#include <glibmm/iochannel.h>
#include <glib.h>
#include <algorithm>
GLIBMM_USING_STD(min)
@ -311,6 +310,12 @@ sigc::connection SignalTimeout::connect(const sigc::slot<bool>& slot,
return connection;
}
void SignalTimeout::connect_once(const sigc::slot<void>& slot,
unsigned int interval, int priority)
{
connect(sigc::bind_return(slot, false), interval, priority);
}
/* Note that this is our equivalent of g_timeout_add_seconds(). */
sigc::connection SignalTimeout::connect_seconds(const sigc::slot<bool>& slot,
unsigned int interval, int priority)
@ -334,6 +339,12 @@ sigc::connection SignalTimeout::connect_seconds(const sigc::slot<bool>& slot,
return connection;
}
void SignalTimeout::connect_seconds_once(const sigc::slot<void>& slot,
unsigned int interval, int priority)
{
connect_seconds(sigc::bind_return(slot, false), interval, priority);
}
SignalTimeout signal_timeout()
{
return SignalTimeout(0); // 0 means default context
@ -369,6 +380,11 @@ sigc::connection SignalIdle::connect(const sigc::slot<bool>& slot, int priority)
return connection;
}
void SignalIdle::connect_once(const sigc::slot<void>& slot, int priority)
{
connect(sigc::bind_return(slot, false), priority);
}
SignalIdle signal_idle()
{
return SignalIdle(0); // 0 means default context

View file

@ -2,27 +2,26 @@
#ifndef _GLIBMM_MAIN_H
#define _GLIBMM_MAIN_H
/* $Id: main.h 420 2007-06-22 15:29:58Z murrayc $ */
/* $Id: main.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/giochannel.h>
#include <glib/gmain.h>
#include <glib.h>
#include <vector>
#include <sigc++/sigc++.h>
@ -30,6 +29,7 @@
#include <glibmmconfig.h>
#include <glibmm/refptr.h>
#include <glibmm/timeval.h>
#include <glibmm/priorities.h>
GLIBMM_USING_STD(vector)
@ -47,41 +47,6 @@ class IOChannel;
* @{
*/
enum
{
/*! Use this for high priority event sources. It is not used within
* GLib or GTK+.<br><br>
*/
PRIORITY_HIGH = -100,
/*! Use this for default priority event sources. In glibmm this
* priority is used by default when installing timeout handlers with
* SignalTimeout::connect(). In GDK this priority is used for events
* from the X server.<br><br>
*/
PRIORITY_DEFAULT = 0,
/*! Use this for high priority idle functions. GTK+ uses
* <tt>PRIORITY_HIGH_IDLE&nbsp;+&nbsp;10</tt> for resizing operations, and
* <tt>PRIORITY_HIGH_IDLE&nbsp;+&nbsp;20</tt> for redrawing operations.
* (This is done to ensure that any pending resizes are processed before
* any pending redraws, so that widgets are not redrawn twice unnecessarily.)
* <br><br>
*/
PRIORITY_HIGH_IDLE = 100,
/*! Use this for default priority idle functions. In glibmm this priority is
* used by default when installing idle handlers with SignalIdle::connect().
* <br><br>
*/
PRIORITY_DEFAULT_IDLE = 200,
/*! Use this for very low priority background tasks. It is not used within
* GLib or GTK+.
*/
PRIORITY_LOW = 300
};
/** A bitwise combination representing an I/O condition to watch for on an
* event source.
@ -195,6 +160,20 @@ public:
sigc::connection connect(const sigc::slot<bool>& slot, unsigned int interval,
int priority = PRIORITY_DEFAULT);
/** Connects an timeout handler that runs only once.
* This method takes a function pointer to a function with a void return
* and no parameters. After running once it is not called again.
*
* @see connect
* @param slot A slot to call when @a interval has elapsed. For example:
* @code
* void on_timeout_once()
* @endcode
* @param interval The timeout in milliseconds.
* @param priority The priority of the new event source.
*/
void connect_once(const sigc::slot<void>& slot, unsigned int interval,
int priority = PRIORITY_DEFAULT);
/** Connects a timeout handler with whole second granularity.
*
@ -226,6 +205,23 @@ public:
sigc::connection connect_seconds(const sigc::slot<bool>& slot, unsigned int interval,
int priority = PRIORITY_DEFAULT);
/** Connects an timeout handler that runs only once with whole second
* granularity.
*
* This method takes a function pointer to a function with a void return
* and no parameters. After running once it is not called again.
*
* @see connect_seconds
* @param slot A slot to call when @a interval has elapsed. For example:
* @code
* void on_timeout_once()
* @endcode
* @param interval The timeout in milliseconds.
* @param priority The priority of the new event source.
*/
void connect_seconds_once(const sigc::slot<void>& slot, unsigned int interval,
int priority = PRIORITY_DEFAULT);
private:
GMainContext* context_;
@ -257,6 +253,12 @@ public:
*/
sigc::connection connect(const sigc::slot<bool>& slot, int priority = PRIORITY_DEFAULT_IDLE);
/** Connects an idle handler that runs only once.
* This method takes a function pointer to a function with a void return
* and no parameters. After running once it is not called again.
*/
void connect_once(const sigc::slot<void>& slot, int priority = PRIORITY_DEFAULT_IDLE);
private:
GMainContext* context_;

View file

@ -10,16 +10,16 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -104,7 +104,7 @@ void ParserCallbacks::start_element(GMarkupParseContext* context,
void* user_data,
GError** error)
{
if(!&error) error = error; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
(void)error; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
ParseContext& cpp_context = *static_cast<ParseContext*>(user_data);
g_return_if_fail(context == cpp_context.gobj());
@ -145,7 +145,7 @@ void ParserCallbacks::end_element(GMarkupParseContext* context,
void* user_data,
GError** error)
{
if(!&error) error = error; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
(void)error; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
ParseContext& cpp_context = *static_cast<ParseContext*>(user_data);
g_return_if_fail(context == cpp_context.gobj());
@ -174,7 +174,7 @@ void ParserCallbacks::text(GMarkupParseContext* context,
void* user_data,
GError** error)
{
if(!&error) error = error; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
(void)error; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
ParseContext& cpp_context = *static_cast<ParseContext*>(user_data);
g_return_if_fail(context == cpp_context.gobj());
@ -203,7 +203,7 @@ void ParserCallbacks::passthrough(GMarkupParseContext* context,
void* user_data,
GError** error)
{
if(!&error) error = error; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
(void)error; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
ParseContext& cpp_context = *static_cast<ParseContext*>(user_data);
g_return_if_fail(context == cpp_context.gobj());

View file

@ -9,16 +9,16 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -86,7 +86,8 @@ public:
PARSE,
UNKNOWN_ELEMENT,
UNKNOWN_ATTRIBUTE,
INVALID_CONTENT
INVALID_CONTENT,
MISSING_ATTRIBUTE
};
MarkupError(Code error_code, const Glib::ustring& error_message);
@ -173,7 +174,8 @@ Glib::ustring escape_text(const Glib::ustring& text);
enum ParseFlags
{
DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0,
TREAT_CDATA_AS_TEXT = 1 << 1
TREAT_CDATA_AS_TEXT = 1 << 1,
PREFIX_ERROR_POSITION = 1 << 2
};
/** @ingroup glibmmEnums */

View file

@ -1,19 +1,19 @@
// -*- c++ -*-
/* $Id: miscutils.cc 420 2007-06-22 15:29:58Z murrayc $ */
/* $Id: miscutils.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -2,21 +2,21 @@
#ifndef _GLIBMM_MISCUTILS_H
#define _GLIBMM_MISCUTILS_H
/* $Id: miscutils.h 428 2007-07-29 12:43:29Z murrayc $ */
/* $Id: miscutils.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -10,16 +10,16 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -9,16 +9,16 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -0,0 +1,20 @@
// Generated by gtkmmproc -- DO NOT MODIFY!
#include <glibmm/nodetree.h>
#include <glibmm/private/nodetree_p.h>
#include <glibmm/nodetree.h>
namespace
{
} // anonymous namespace
namespace Glib
{
} // namespace Glib

View file

@ -0,0 +1,774 @@
// -*- c++ -*-
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_NODETREE_H
#define _GLIBMM_NODETREE_H
/* Copyright (C) 2007 glibmm development team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <map>
#include <stack>
#include <deque>
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <glibmm/error.h>
#include <glibmm/arrayhandle.h>
#include <glib.h>
namespace Glib
{
//Hand-written, instead of using _WRAP_ENUM,
//because the C enum values don't have a prefix.
/** Specifies the type of traveral performed by methods such as NodeTree::_traverse() and NodeTree::find().
*
* @ingroup glibmmEnums
*/
enum TraverseType
{
TRAVERSE_IN_ORDER = G_IN_ORDER, /*!< Visits a node's left child first, then the node itself, then its right child. This is the one to use if you want the output sorted according to the compare function. */
TRAVERSE_PRE_ORDER = G_PRE_ORDER, /*!< Visits a node, then its children. */
TRAVERSE_POST_ORDER = G_POST_ORDER, /*!< Visits the node's children, then the node itself. */
TRAVERSE_LEVEL_ORDER = G_LEVEL_ORDER /*!< For NodeTree, it vists the root node first, then its children, then its grandchildren, and so on. Note that this is less efficient than the other orders. This is not implemented for Glib::Tree. */
};
/** N-ary Trees - trees of data with any number of branches
* The NodeTree class and its associated functions provide an N-ary tree data structure, in which nodes in the tree can contain arbitrary data.
*
* To insert a node into a tree use insert(), insert_before(), append() or prepend().
*
* To create a new node and insert it into a tree use insert_data(), insert_data_before(), append_data() and prepend_data().
*
* To reverse the children of a node use reverse_children().
*
* To find a node use root(), find(), find_child(), index_of(), child_index(), first_child(), last_child(), nth_child(), first_sibling(), prev_sibling(), next_sibling() or last_sibling().
*
* To get information about a node or tree use is_leaf(), is_root(), depth(), node_count(), child_count(), is_ancestor() or max_height().
*
* To traverse a tree, calling a function for each node visited in the traversal, use traverse() or foreach().
*
* To remove a node or subtree from a tree use unlink().
*
* @newin2p18
*/
template <typename T>
class NodeTree
{
public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef NodeTree CppObjectType;
typedef GNode BaseObjectType;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
private:
public:
typedef sigc::slot<bool, NodeTree<T>&> TraverseFunc;
typedef sigc::slot<void, NodeTree<T>&> ForeachFunc;
private:
static NodeTree<T>* wrap(GNode* node)
{
if (!node)
return 0;
return reinterpret_cast<NodeTree<T>* >(node->data);
}
public:
NodeTree()
{
clone();
}
explicit NodeTree(const T& the_data) :
data_(the_data)
{
clone();
}
NodeTree(const NodeTree<T>& node) :
data_(node.data())
{
clone(&node);
}
/** Removes the instance and its children from the tree,
* freeing any memory allocated.
*/
~NodeTree()
{
if(!is_root())
unlink();
clear();
}
NodeTree<T>& operator=(const NodeTree<T>& node)
{
clear();
clone(&node);
data_ = node.data();
return *this;
}
/// Provides access to the underlying C GObject.
inline GNode* gobj()
{
return gobject_;
}
/// Provides access to the underlying C GObject.
inline const GNode* gobj() const
{
return gobject_;
}
/** Inserts a NodeTree beneath the parent at the given position.
*
* @param position the position to place node at, with respect to its siblings
* If position is -1, node is inserted as the last child of parent
* @param node the NodeTree to insert
* @return the inserted NodeTree
*/
NodeTree<T>& insert(int position, NodeTree<T>& node)
{
g_node_insert(gobj(), position, node.gobj());
return node;
}
/** Inserts a NodeTree beneath the parent before the given sibling.
*
* @param sibling the sibling NodeTree to place node before.
* @param node the NodeTree to insert
* @return the inserted NodeTree
*/
NodeTree<T>& insert_before(NodeTree<T>& sibling, NodeTree<T>& node)
{
g_node_insert_before(gobj(), sibling.gobj(), node.gobj());
return node;
}
/** Inserts a NodeTree beneath the parent after the given sibling.
*
* @param sibling the sibling NodeTree to place node after.
* @param node the NodeTree to insert
* @return the inserted NodeTree
*/
NodeTree<T>& insert_after(NodeTree<T>& sibling, NodeTree<T>& node)
{
g_node_insert_after(gobj(), sibling.gobj(), node.gobj());
return node;
}
/** Inserts a NodeTree as the last child.
*
* @param node the NodeTree to append
* @return the new NodeTree
*/
NodeTree<T>& append(NodeTree<T>& node)
{
g_node_append(gobj(), node.gobj());
return node;
}
/** Inserts a NodeTree as the first child.
*
* @param data the data for the NodeTree
* @return the NodeTree
*/
NodeTree<T>& prepend(NodeTree<T>& node)
{
g_node_prepend(gobj(), node.gobj());
return node;
}
/** Inserts a new NodeTree at the given position.
*
* @param position the position to place the new NodeTree at.
* If position is -1, the new NodeTree is inserted as the last child of parent
* @param data the data for the new NodeTree
* @return the new NodeTree
*/
NodeTree<T>* insert_data(int position, const T& the_data)
{
NodeTree<T>* node = new NodeTree<T>(the_data);
insert(position, *node);
return node;
}
/** Inserts a new NodeTree before the given sibling.
*
* @param sibling the sibling NodeTree to place node before.
* @param data the data for the new NodeTree
* @return the new NodeTree
*/
NodeTree<T>* insert_data_before(NodeTree<T>& sibling, const T& the_data)
{
NodeTree<T>* node = new NodeTree<T>(the_data);
insert_before(sibling, *node);
return node;
}
/** Inserts a new NodeTree as the last child.
*
* @param data the data for the new NodeTree
* @return the new NodeTree
*/
NodeTree<T>* append_data(const T& the_data)
{
NodeTree<T>* node = new NodeTree<T>(the_data);
append(*node);
return node;
}
/** Inserts a new NodeTree as the first child.
*
* @param data the data for the new NodeTree
* @return the new NodeTree
*/
NodeTree<T>* prepend_data(const T& the_data)
{
NodeTree<T>* node = new NodeTree<T>(the_data);
prepend(*node);
return node;
}
/** Reverses the order of the children.
*/
void reverse_children()
{
g_node_reverse_children(gobj());
}
/** Returns a pointer to the root of the tree.
*
* @return A pointer to the root of the tree.
*/
NodeTree<T>* get_root()
{
return wrap(g_node_get_root(gobj()));
}
const NodeTree<T>* get_root() const
{
return wrap(g_node_get_root(gobj()));
}
/** Specifies which nodes are visited during several of the NodeTree methods,
* including traverse() and find().
*
* @ingroup glibmmEnums
*/
enum TraverseFlags
{
TRAVERSE_LEAVES = G_TRAVERSE_LEAVES, /*!< Only leaf nodes should be visited. */
TRAVERSE_NON_LEAVES = G_TRAVERSE_NON_LEAVES, /*!< Only non-leaf nodes should be visited. */
TRAVERSE_ALL = G_TRAVERSE_ALL, /*!< All nodes should be visited. */
TRAVERSE_MASK = G_TRAVERSE_MASK /*!< A mask of all traverse flags. */
};
/** Traverses a tree starting at the current node.
* It calls the given function for each node visited.
* The traversal can be halted at any point by returning true from @a func.
*
* @param order The order in which nodes are visited.
* @param flags Which types of children are to be visited.
* @param max_depth The maximum depth of the traversal.
* Nodes below this depth will not be visited.
* If max_depth is -1 all nodes in the tree are visited.
* If max_depth is 1, only the root is visited.
* If max_depth is 2, the root and its children are visited. And so on.
* @param func the slot to invoke for each visited child
*/
void traverse(const TraverseFunc& func, TraverseType order = TRAVERSE_IN_ORDER, TraverseFlags flags = TRAVERSE_ALL, int max_depth = -1)
{
TraverseFunc func_copy = func;
g_node_traverse(gobj(), (GTraverseType)order, (GTraverseFlags)flags, max_depth, c_callback_traverse, reinterpret_cast<gpointer>(&func_copy));
}
;
/** Calls a function for each of the children of a NodeTree.
* Note that it doesn't descend beneath the child nodes.
*
* @param flags Wwhich types of children are to be visited.
* @param func The slot to invoke for each visited node.
*/
void foreach(const ForeachFunc& func, TraverseFlags flags = TRAVERSE_ALL)
{
ForeachFunc func_copy = func;
g_node_children_foreach(gobj(), (GTraverseFlags)flags, c_callback_foreach, reinterpret_cast<gpointer>(&func_copy));
}
/** Finds the first child of a NodeTree with the given data.
*
* @param flags Which types of children are to be visited, one of TRAVERSE_ALL, TRAVERSE_LEAVES and TRAVERSE_NON_LEAVES.
* @param data The data for which to search.
* @return the found child, or 0 if the data is not found
*/
NodeTree<T>* find_child(const T& the_data, TraverseFlags flags = TRAVERSE_ALL)
{
sigc::slot<void, GNode*, const T&, GNode**> real_slot = sigc::ptr_fun(on_compare_child);
GNode* child = 0;
typedef sigc::slot<void, GNode*> type_foreach_gnode_slot;
type_foreach_gnode_slot bound_slot = sigc::bind(real_slot, the_data, &child);
g_node_children_foreach(gobj(), (GTraverseFlags)flags, c_callback_foreach_compare_child, reinterpret_cast<gpointer>(&bound_slot));
return wrap(child);
}
/** Finds the first child of a NodeTree with the given data.
*
* @param flags Which types of children are to be visited, one of TRAVERSE_ALL, TRAVERSE_LEAVES and TRAVERSE_NON_LEAVES.
* @param data The data for which to search.
* @return the found child, or 0 if the data is not found
*/
const NodeTree<T>* find_child(const T& the_data, TraverseFlags flags = TRAVERSE_ALL) const
{
return const_cast<NodeTree<T>*>(this)->find_child(flags, the_data);
}
/** Finds a node in a tree.
*
* @param order The order in which nodes are visited: IN_ORDER, TRAVERSE_PRE_ORDER, TRAVERSE_POST_ORDER, or TRAVERSE_LEVEL_ORDER
* @param flags Which types of children are to be visited: one of TRAVERSE_ALL, TRAVERSE_LEAVES and TRAVERSE_NON_LEAVES.
* @param data The data for which to search.
* @return The found node, or 0 if the data is not found.
*/
NodeTree<T>* find(const T& the_data, TraverseType order = TRAVERSE_IN_ORDER, TraverseFlags flags = TRAVERSE_ALL)
{
//We use a sigc::slot for the C callback, so we can bind some extra data.
sigc::slot<gboolean, GNode*, const T&, GNode**> real_slot = sigc::ptr_fun(on_compare_node);
GNode* child = 0;
typedef sigc::slot<gboolean, GNode*> type_traverse_gnode_slot;
type_traverse_gnode_slot bound_slot = sigc::bind(real_slot, the_data, &child);
g_node_traverse(const_cast<GNode*>(gobj()), (GTraverseType)order, (GTraverseFlags)flags, -1, c_callback_traverse_compare_node, reinterpret_cast<gpointer>(&bound_slot));
return wrap(child);
}
/** Finds a node in a tree.
*
* @param order The order in which nodes are visited.
* @param flags Which types of children are to be visited.
* @param data The data for which to search.
* @return The found node, or 0 if the data is not found.
*/
const NodeTree<T>* find(const T& the_data, TraverseType order = TRAVERSE_IN_ORDER, TraverseFlags flags = TRAVERSE_ALL) const
{
return const_cast<NodeTree<T>*>(this)->find(order, flags, the_data);
}
/** Gets the position of the first child which contains the given data.
*
* @param data The data to find.
* @return The index of the child which contains data, or -1 if the data is not found.
*/
int child_index(const T& the_data) const
{
int n = 0;
for(const NodeTree<T>* i = first_child(); i != 0; i = i->next_sibling())
{
if((i->data()) == the_data)
return n;
n++;
}
return -1;
}
/** Gets the position with respect to its siblings.
* child must be a child of node.
* The first child is numbered 0, the second 1, and so on.
*
* @param child A child
* @return The position of @a child with respect to its siblings.
*/
int child_position(const NodeTree<T>& child) const
{
return g_node_child_position(const_cast<GNode*>(gobj()), const_cast<GNode*>(child.gobj()));
}
/** Gets the first child.
*
* @return The first child, or 0 if the node has no children.
*/
NodeTree<T>* first_child()
{
return wrap(g_node_first_child(gobj()));
}
/** Gets the first child.
*
* @return The first child, or 0 if the node has no children.
*/
const NodeTree<T>* first_child() const
{
return const_cast<NodeTree<T>*>(this)->first_child();
}
/** Gets the last child.
*
* @return The last child, or 0 if the node has no children.
*/
NodeTree<T>* last_child()
{
return wrap(g_node_last_child(gobj()));
}
/** Gets the last child.
*
* @return The last child, or 0 if the node has no children.
*/
const NodeTree<T>* last_child() const
{
return const_cast<NodeTree<T>*>(this)->last_child();
}
/** Gets the nth child.
*
* @return The nth child, or 0 if n is too large.
*/
NodeTree<T>* nth_child(int n)
{
return wrap(g_node_nth_child(gobj(), n));
}
/** Gets the nth child.
*
* @return The nth child, or 0 if n is too large.
*/
const NodeTree<T>* nth_child(int n) const
{
return const_cast<NodeTree<T>*>(this)->nth_child(n);
}
/** Gets the first sibling
* @return The first sibling, or 0 if the node has no siblings.
*/
NodeTree<T>* first_sibling()
{
return wrap(g_node_first_sibling(gobj()));
}
/** Gets the first sibling
* @return The first sibling, or 0 if the node has no siblings.
*/
const NodeTree<T>* first_sibling() const
{
return const_cast<NodeTree<T>*>(this)->first_sibling();
}
/** Gets the previous sibling.
*
* @return The previous sibling, or 0 if the node has no siblings.
*/
NodeTree<T>* prev_sibling()
{
return wrap(g_node_prev_sibling(gobj()));
}
/** Gets the previous sibling.
*
* @return The previous sibling, or 0 if the node has no siblings.
*/
const NodeTree<T>* prev_sibling() const
{
return const_cast<NodeTree<T>*>(this)->prev_sibling();
}
/** Gets the next sibling
*
* @return The next sibling, or 0 if the node has no siblings.
*/
NodeTree<T>* next_sibling()
{
return wrap(g_node_next_sibling(gobj()));
}
/** Gets the next sibling
*
* @return The next sibling, or 0 if the node has no siblings.
*/
const NodeTree<T>* next_sibling() const
{
return const_cast<NodeTree<T>*>(this)->next_sibling();
}
/** Gets the last sibling.
*
* @return The last sibling, or 0 if the node has no siblings.
*/
NodeTree<T>* last_sibling()
{
return wrap(g_node_last_sibling(gobj()));
}
/** Gets the last sibling.
*
* @return The last sibling, or 0 if the node has no siblings.
*/
const NodeTree<T>* last_sibling() const
{
return const_cast<NodeTree<T>*>(this)->last_sibling();
}
/** Returns true if this is a leaf node.
*
* @return true if this is a leaf node.
*/
bool is_leaf() const
{
return G_NODE_IS_LEAF(const_cast<GNode*>(gobj()));
}
/** Returns true if this is the root node.
*
* @return true if this is the root node.
*/
bool is_root() const
{
return G_NODE_IS_ROOT(const_cast<GNode*>(gobj()));
}
/** Gets the depth of this node.
* The root node has a depth of 1.
* For the children of the root node the depth is 2. And so on.
*
* @return the depth of this node
*/
guint depth() const
{
return g_node_depth(const_cast<GNode*>(gobj()));
}
/** Gets the number of nodes in a tree.
*
* @param flags Which types of children are to be counted: one of TRAVERSE_ALL, TRAVERSE_LEAVES and TRAVERSE_NON_LEAVES
* @return The number of nodes in the tree.
*/
guint node_count(TraverseFlags flags = TRAVERSE_ALL) const
{
return g_node_n_nodes(const_cast<GNode*>(gobj()), (GTraverseFlags)flags);
}
/** Gets the number children.
*
* @return The number of children.
*/
guint child_count() const
{
return g_node_n_children(const_cast<GNode*>(gobj()));
}
/** Returns true if this is an ancestor of @a descendant.
* This is true if this is the parent of @a descendant,
* or if this is the grandparent of @a descendant etc.
*
* @param descendant A node.
* @return true if this is an ancestor of descendant.
*/
bool is_ancestor(const NodeTree<T>& descendant) const
{
return g_node_is_ancestor(const_cast<GNode*>(gobj()), const_cast<GNode*>(descendant.gobj()));
}
/** Gets the maximum height of all branches beneath this node.
* This is the maximum distance from the node to all leaf nodes.
* If root has no children, 1 is returned. If root has children, 2 is returned. And so on.
*
* @return The maximum height of all branches.
*/
guint get_max_height() const
{
return g_node_max_height(const_cast<GNode*>(gobj()));
}
/** Unlinks a node from a tree, resulting in two separate trees.
*/
void unlink()
{
g_node_unlink(gobj());
}
#if 0 //Commented-out because people can just use the copy constructor.
/** Recursively copies a node and it's data.
*
* Returns: a new node containing the copies of the data.
*/
NodeTree<T>* copy_deep() const
{
//Use copy constructor instead of g_node_copy_deep to create C++ wrappers also not only the wrapped C objects.
return new NodeTree<T>(*this);
}
#endif
/// Accessor for this node's data
T& data()
{
return data_;
}
/// Accessor for this node's data
const T& data() const
{
return data_;
}
/** Accessor for this node's parent.
*
* @return The node's parent.
*/
const NodeTree<T>* parent() const
{
return wrap(gobj()->parent);
}
// Do not wrap this shallow copy function, because it is not useful:
private:
void clear()
{
//Free the children (not just with g_node_destroy(), to avoid the leaking of C++ wrapper objects):
while(NodeTree<T>* i = first_child())
delete i;
//Free the wrapped object (g_node_free not available)
g_slice_free(GNode, gobject_);
gobject_ = 0;
}
///Create a new GNode, taking the contents of an existing node if one is specified.
void clone(const NodeTree<T>* node = 0)
{
//Store the this pointer in the GNode so we can discover this wrapper later:
gobject_ = g_node_new(reinterpret_cast<gpointer>(this));
if(node)
{
//Prepend the copied children of @node to the constructing node.
for(const NodeTree<T>* i = node->last_child(); i != 0; i = i->prev_sibling())
prepend(*(new NodeTree<T>(*i)));
}
}
/// Wrapper for invoking a TraverseFunc.
static gboolean c_callback_traverse(GNode* node, gpointer slot)
{
const TraverseFunc* tf = reinterpret_cast<const TraverseFunc*>(slot);
return (*tf)(*wrap(node));
}
/// Wrapper for invoking a ForeachFunc.
static void c_callback_foreach(GNode* node, gpointer slot)
{
const ForeachFunc* ff = reinterpret_cast<const ForeachFunc*>(slot);
(*ff)(*wrap(node));
}
/// Method for comparing a single child (Internal use).
static void on_compare_child(GNode* node, const T& needle, GNode** result)
{
if((0 != result) && (wrap(node)->data() == needle))
{
*result = node;
}
}
/// Wrapper for invoking a sigc::slot<void,GNode*> (Internal use).
static void c_callback_foreach_compare_child(GNode* node, gpointer data)
{
const ForeachFunc* slot = reinterpret_cast<const ForeachFunc*>(data);
(*slot)(*wrap(node));
}
/// Method for comparing a single node (Internal use).
static gboolean on_compare_node(GNode* node, const T& needle, GNode** result)
{
if(wrap(node)->data() == needle)
{
*result = node;
return TRUE;
}
return FALSE;
}
/// Wrapper for invoking a sigc::slot<gboolean,GNode*> (Internal use).
static gboolean c_callback_traverse_compare_node(GNode* node, gpointer data)
{
const TraverseFunc* slot = reinterpret_cast<const TraverseFunc*>(data);
return (*slot)(*wrap(node));
}
GNode* gobject_;
T data_;
};
} // namespace Glib
#endif /* _GLIBMM_NODETREE_H */

View file

@ -1,19 +1,19 @@
// -*- c++ -*-
/* $Id: object.cc 369 2007-01-20 10:19:33Z daniel $ */
/* $Id: object.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright 1998-2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -22,13 +22,14 @@
#include <glibmm/private/object_p.h>
#include <glibmm/property.h>
#include <glib.h>
#include <glib-object.h>
#include <gobject/gvaluecollector.h>
#include <cstdarg>
#include <cstring>
#include <string.h>
//Weak references:
//I'm not sure what the point of these are apart from being a hacky way out of circular references,
//but maybe we could make it easier to use them by making a Java Reference Object -style class like so:

View file

@ -1,21 +1,21 @@
// -*- c++ -*-
#ifndef _GLIBMM_OBJECT_H
#define _GLIBMM_OBJECT_H
/* $Id: object.h 369 2007-01-20 10:19:33Z daniel $ */
/* $Id: object.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -26,7 +26,7 @@
# error "X11/Xlib.h seems to have been included before this header. Due to some commonly-named macros in X11/Xlib.h, it may only be included after any glibmm, gdkmm, or gtkmm headers."
#endif
#include <glib/gmacros.h> /* for G_GNUC_NULL_TERMINATED */
#include <glib.h> /* for G_GNUC_NULL_TERMINATED */
#include <glibmm/objectbase.h>
#include <glibmm/wrap.h>
#include <glibmm/quark.h>

View file

@ -1,19 +1,19 @@
// -*- c++ -*-
/* $Id: objectbase.cc 337 2006-11-10 02:24:49Z murrayc $ */
/* $Id: objectbase.cc 785 2009-02-17 19:03:06Z daniel $ */
/* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -83,8 +83,6 @@ void ObjectBase::initialize(GObject* castitem)
return; // Don't initialize the wrapper twice.
}
//g_print("%s : %s\n", G_GNUC_PRETTY_FUNCTION, G_OBJECT_TYPE_NAME(castitem));
gobject_ = castitem;
_set_current_wrapper(castitem);
}
@ -257,6 +255,11 @@ void ObjectBase::get_property_value(const Glib::ustring& property_name, Glib::Va
}
void ObjectBase::connect_property_changed(const Glib::ustring& property_name, const sigc::slot<void>& slot)
{
connect_property_changed_with_return(property_name, slot);
}
sigc::connection ObjectBase::connect_property_changed_with_return(const Glib::ustring& property_name, const sigc::slot<void>& slot)
{
// Create a proxy to hold our connection info
// This will be deleted by destroy_notify_handler.
@ -271,9 +274,12 @@ void ObjectBase::connect_property_changed(const Glib::ustring& property_name, co
notify_signal_name.c_str(), (GCallback)(&PropertyProxyConnectionNode::callback), pConnectionNode,
&PropertyProxyConnectionNode::destroy_notify_handler,
G_CONNECT_AFTER);
return sigc::connection(pConnectionNode->slot_);
}
bool _gobject_cppinstance_already_deleted(GObject* gobject)
{
//This function is used to prevent calling wrap() on a GTK+ instance whose gtkmm instance has been deleted.

View file

@ -2,21 +2,21 @@
#ifndef _GLIBMM_OBJECTBASE_H
#define _GLIBMM_OBJECTBASE_H
/* $Id: objectbase.h 385 2007-03-23 17:23:42Z murrayc $ */
/* $Id: objectbase.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -112,9 +112,20 @@ public:
/** You can use the signal_changed() signal of the property proxy instead,
* but this is necessary when using the reduced API.
*
* See also connect_property_changed_with_return().
*/
void connect_property_changed(const Glib::ustring& property_name, const sigc::slot<void>& slot);
/** You can use the signal_changed() signal of the property proxy instead,
* but this is necessary when using the reduced API.
*
* This method was added because connect_property_changed() does not return a sigc::connection,
* and we could not break the ABI by changing that function.
*/
sigc::connection connect_property_changed_with_return(const Glib::ustring& property_name, const sigc::slot<void>& slot);
//TODO: Why are these virtual?
/** Increment the reference count for this object.
* You should never need to do this manually - use the object via a RefPtr instead.
*/
@ -125,10 +136,10 @@ public:
*/
virtual void unreference() const;
///Provides access to the underlying C GtkObject.
///Provides access to the underlying C GObject.
inline GObject* gobj() { return gobject_; }
///Provides access to the underlying C GtkObject.
///Provides access to the underlying C GObject.
inline const GObject* gobj() const { return gobject_; }
/// Give a ref-ed copy to someone. Use for direct struct access.

View file

@ -10,23 +10,23 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glibmm/utility.h>
#include <glibmm/exceptionhandler.h>
#include <glib/goption.h>
#include <glib.h>
namespace Glib
{
@ -115,6 +115,11 @@ void OptionContext::set_translate_func (const SlotTranslate& slot)
&Private::SignalProxy_translate_gtk_callback_destroy);
}
Glib::ustring OptionContext::get_help(bool main_help) const
{
return Glib::convert_return_gchar_ptr_to_ustring(g_option_context_get_help(const_cast<GOptionContext*>(gobj()), static_cast<int>(main_help), NULL));
}
} // namespace Glib
namespace
@ -195,6 +200,11 @@ bool OptionContext::parse(int& argc, char**& argv, std::auto_ptr<Glib::Error>& e
}
Glib::ustring OptionContext::get_help(bool main_help, const OptionGroup& group) const
{
return Glib::convert_return_gchar_ptr_to_ustring(g_option_context_get_help(const_cast<GOptionContext*>(gobj()), static_cast<int>(main_help), const_cast<GOptionGroup*>((group).gobj())));
}
void OptionContext::set_summary(const Glib::ustring& summary)
{
g_option_context_set_summary(gobj(), summary.c_str());

View file

@ -9,16 +9,16 @@
/* Copyright (C) 2004 The glibmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -80,6 +80,7 @@ class OptionContext
private:
public:
/** Creates a new option context.
@ -112,7 +113,7 @@ public:
bool get_help_enabled() const;
/** Sets whether to ignore unknown options or not. If an argument is
* ignored, it is left in the @a argv array after parsing. By default,
* ignored, it is left in the @a argv array after parsing. By default,
* g_option_context_parse() treats unknown options as error.
*
* This setting does not affect non-option arguments (i.e. arguments
@ -134,20 +135,20 @@ public:
/** Parses the command line arguments, recognizing options
* which have been added to @a context . A side-effect of
* which have been added to @a context. A side-effect of
* calling this function is that g_set_prgname() will be
* called.
*
* If the parsing is successful, any parsed arguments are
* removed from the array and @a argc and @a argv are updated
* accordingly. A '--' option is stripped from @a argv
* removed from the array and @a argc and @a argv are updated
* accordingly. A '--' option is stripped from @a argv
* unless there are unparsed options before and after it,
* or some of the options after it start with '-'. In case
* of an error, @a argc and @a argv are left unmodified.
* of an error, @a argc and @a argv are left unmodified.
*
* If automatic &lt;option&gt;--help&lt;/option&gt; support is enabled
* (see g_option_context_set_help_enabled()), and the
* @a argv array contains one of the recognized help options,
* @a argv array contains one of the recognized help options,
* this function will produce help output to stdout and
* call <tt>exit (0)</tt>.
*
@ -157,7 +158,6 @@ public:
* arguments.
* @param argc A pointer to the number of command line arguments.
* @param argv A pointer to the array of command line arguments.
* @param error A return location for errors.
* @return <tt>true</tt> if the parsing was successful,
* <tt>false</tt> if an error occurred
*
@ -196,6 +196,18 @@ public:
//const OptionGroup& get_main_group() const;
/** Returns: A newly allocated string containing the help text
* @param main_help If <tt>true</tt>, only include the main group.
* @param group The OptionGroup to create help for, or <tt>0</tt>.
* @return A newly allocated string containing the help text
*
* @newin2p14.
*/
Glib::ustring get_help(bool main_help, const OptionGroup& group) const;
//TODO: Documentation.
Glib::ustring get_help(bool main_help = true) const;
GOptionContext* gobj() { return gobject_; }
const GOptionContext* gobj() const { return gobject_; }

View file

@ -10,23 +10,22 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glibmm/utility.h>
#include <glib/goption.h>
#include <glib/gmem.h>
#include <glib.h>
namespace Glib
{
@ -80,6 +79,42 @@ OptionEntry& OptionEntry::operator=(const OptionEntry& src)
return *this;
}
void OptionEntry::set_long_name(const Glib::ustring& value)
{
if(gobject_->long_name)
{
g_free((gchar*)(gobject_->long_name));
gobject_->long_name = NULL;
}
//Note that we do not use NULL for an empty string,
//because G_OPTION_REMAINING is actually a "", so it actually has a distinct meaning:
//TODO: Wrap G_OPTION_REMAINING in C++ somehow, maybe as an explicit set_long_name(void) or set_is_remaining()? murrayc.
gobj()->long_name = (value).c_str() ? g_strdup((value).c_str()) : NULL;
}
void OptionEntry::set_description(const Glib::ustring& value)
{
if(gobject_->description)
{
g_free((gchar*)(gobject_->description));
gobject_->description = NULL;
}
gobj()->description = (value).empty() ? NULL : g_strdup((value).c_str());
}
void OptionEntry::set_arg_description(const Glib::ustring& value)
{
if(gobject_->arg_description)
{
g_free((gchar*)(gobject_->arg_description));
gobject_->arg_description = NULL;
}
gobj()->arg_description = (value).empty() ? NULL : g_strdup((value).c_str());
}
} // namespace Glib
@ -98,11 +133,6 @@ namespace Glib
return Glib::convert_const_gchar_ptr_to_ustring(gobj()->long_name);
}
void OptionEntry::set_long_name(const Glib::ustring& value)
{
gobj()->long_name = g_strdup((value).c_str());
}
gchar OptionEntry::get_short_name() const
{
return gobj()->short_name;
@ -128,21 +158,11 @@ namespace Glib
return Glib::convert_const_gchar_ptr_to_ustring(gobj()->description);
}
void OptionEntry::set_description(const Glib::ustring& value)
{
gobj()->description = g_strdup((value).c_str());
}
Glib::ustring OptionEntry::get_arg_description() const
{
return Glib::convert_const_gchar_ptr_to_ustring(gobj()->arg_description);
}
void OptionEntry::set_arg_description(const Glib::ustring& value)
{
gobj()->arg_description = g_strdup((value).c_str());
}
} // namespace Glib

View file

@ -9,16 +9,16 @@
/* Copyright (C) 2004 The glibmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -77,10 +77,12 @@ public:
OptionEntry& operator=(const OptionEntry& src);
//#m4 __CONVERSION(`Glib::ustring',`const gchar*',`($3).empty() ? NULL : g_strdup(($3).c_str())')
Glib::ustring get_long_name() const;
void set_long_name(const Glib::ustring& value);
void set_long_name(const Glib::ustring& value);
gchar get_short_name() const;
void set_short_name(const gchar& value);
@ -90,11 +92,15 @@ public:
//TODO: G_OPTION_ARG_CALLBACK,
Glib::ustring get_description() const;
void set_description(const Glib::ustring& value);
void set_description(const Glib::ustring& value);
Glib::ustring get_arg_description() const;
void set_arg_description(const Glib::ustring& value);
void set_arg_description(const Glib::ustring& value);
GOptionEntry* gobj() { return gobject_; }
const GOptionEntry* gobj() const { return gobject_; }

View file

@ -10,16 +10,16 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -28,8 +28,7 @@
#include <glibmm/optioncontext.h>
#include <glibmm/utility.h>
//#include <glibmm/containers.h>
#include <glib/gmem.h> // g_malloc
#include <glib/goption.h>
#include <glib.h> // g_malloc
namespace Glib
{

View file

@ -9,16 +9,16 @@
/* Copyright (C) 2004 The glibmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -27,7 +27,7 @@
#include <glibmm/ustring.h>
#include <map>
#include <vector>
#include <glib/goption.h> //TODO: Try to hide this.
#include <glib.h> //TODO: Try to hide this.
#ifndef DOXYGEN_SHOULD_SKIP_THIS

View file

@ -1,26 +1,26 @@
// -*- c++ -*-
/* $Id: pattern.cc 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: pattern.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* pattern.cc
*
* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gpattern.h>
#include <glib.h>
#include <glibmm/pattern.h>

View file

@ -2,23 +2,23 @@
#ifndef _GLIBMM_PATTERN_H
#define _GLIBMM_PATTERN_H
/* $Id: pattern.h 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: pattern.h 779 2009-01-19 17:58:50Z murrayc $ */
/* pattern.h
*
* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -0,0 +1,65 @@
// -*- c++ -*-
#ifndef _GLIBMM_PRIORITIES_H
#define _GLIBMM_PRIORITIES_H
/* $Id: priorities.h 420 2007-06-22 15:29:58Z murrayc $ */
/* Copyright (C) 2002-2008 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
namespace Glib
{
enum
{
/*! Use this for high priority event sources. It is not used within
* GLib or GTK+.<br><br>
*/
PRIORITY_HIGH = -100,
/*! Use this for default priority event sources. In glibmm this
* priority is used by default when installing timeout handlers with
* SignalTimeout::connect(). In GDK this priority is used for events
* from the X server.<br><br>
*/
PRIORITY_DEFAULT = 0,
/*! Use this for high priority idle functions. GTK+ uses
* <tt>PRIORITY_HIGH_IDLE&nbsp;+&nbsp;10</tt> for resizing operations, and
* <tt>PRIORITY_HIGH_IDLE&nbsp;+&nbsp;20</tt> for redrawing operations.
* (This is done to ensure that any pending resizes are processed before
* any pending redraws, so that widgets are not redrawn twice unnecessarily.)
* <br><br>
*/
PRIORITY_HIGH_IDLE = 100,
/*! Use this for default priority idle functions. In glibmm this priority is
* used by default when installing idle handlers with SignalIdle::connect().
* <br><br>
*/
PRIORITY_DEFAULT_IDLE = 200,
/*! Use this for very low priority background tasks. It is not used within
* GLib or GTK+.
*/
PRIORITY_LOW = 300
};
} //namespace Glib
#endif //#ifndef _GLIBMM_PRIORITIES_H

View file

@ -2,19 +2,18 @@
## The gtkmm development team.
include $(srcdir)/../../src/Makefile_list_of_hg.am_fragment
include $(top_srcdir)/build_shared/Makefile_gensrc_platform.am_fragment
files_built_h = $(files_hg:.hg=_p.h)
files_built_all_h = $(files_all_hg:.hg=_p.h)
files_extra_h = interface_p.h object_p.h
files_extra_all_h = interface_p.h object_p.h
files_built_p_h = $(files_hg:.hg=_p.h)
files_built_all_p_h = $(files_all_hg:.hg=_p.h)
files_extra_p_h = interface_p.h object_p.h
files_extra_all_p_h = interface_p.h object_p.h
dist_sources = $(files_built_all_h) $(files_extra_all_h)
dist_sources = $(files_built_all_p_h) $(files_extra_all_p_h)
DISTFILES = $(DIST_COMMON) $(dist_sources)
private_includedir = $(includedir)/glibmm-2.4/glibmm/private
private_include_HEADERS = $(files_built_h) $(files_extra_h)
private_include_HEADERS = $(files_built_p_h) $(files_extra_p_h)
maintainer-clean-local:
(cd $(srcdir) && rm -f $(files_built_h))
(cd $(srcdir) && rm -f $(files_built_p_h))

View file

@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -14,6 +14,8 @@
@SET_MAKE@
# Built files
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@ -35,10 +37,17 @@ host_triplet = @host@
DIST_COMMON = $(am__private_include_HEADERS_DIST) \
$(srcdir)/../../src/Makefile_list_of_hg.am_fragment \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/build_shared/Makefile_gensrc_platform.am_fragment
$(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment
subdir = glib/glibmm/private
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__aclocal_m4_deps = $(top_srcdir)/scripts/c_std.m4 \
$(top_srcdir)/scripts/cxx.m4 $(top_srcdir)/scripts/cxx_std.m4 \
$(top_srcdir)/scripts/dk-feature.m4 \
$(top_srcdir)/scripts/docgen.m4 \
$(top_srcdir)/scripts/glibmm_check_perl.m4 \
$(top_srcdir)/scripts/macros.m4 \
$(top_srcdir)/scripts/reduced.m4 $(top_srcdir)/scripts/sun.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@ -48,11 +57,11 @@ CONFIG_HEADER = $(top_builddir)/config.h \
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
am__private_include_HEADERS_DIST = convert_p.h date_p.h fileutils_p.h \
iochannel_p.h keyfile_p.h markup_p.h module_p.h \
am__private_include_HEADERS_DIST = checksum_p.h convert_p.h date_p.h \
fileutils_p.h iochannel_p.h keyfile_p.h markup_p.h module_p.h \
optioncontext_p.h optionentry_p.h optiongroup_p.h regex_p.h \
shell_p.h spawn_p.h thread_p.h unicode_p.h interface_p.h \
object_p.h
shell_p.h spawn_p.h thread_p.h nodetree_p.h unicode_p.h \
uriutils_p.h interface_p.h object_p.h
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@ -84,8 +93,10 @@ CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DISABLE_DEPRECATED_API_CFLAGS = @DISABLE_DEPRECATED_API_CFLAGS@
DISABLE_DEPRECATED_CFLAGS = @DISABLE_DEPRECATED_CFLAGS@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@ -107,6 +118,8 @@ GMMPROC_DIR = @GMMPROC_DIR@
GREP = @GREP@
GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
GTHREAD_LIBS = @GTHREAD_LIBS@
GTKMMPROC_MERGECDOCS = @GTKMMPROC_MERGECDOCS@
GTKMM_DOXYGEN_INPUT = @GTKMM_DOXYGEN_INPUT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@ -119,9 +132,11 @@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
M4 = @M4@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
@ -131,6 +146,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL_PATH = @PERL_PATH@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SED = @SED@
@ -187,26 +203,63 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
files_posix_hg =
files_win32_hg =
files_general_hg = convert.hg date.hg fileutils.hg iochannel.hg keyfile.hg markup.hg module.hg optioncontext.hg optionentry.hg optiongroup.hg regex.hg shell.hg spawn.hg thread.hg unicode.hg
files_all_hg = $(files_general_hg) $(files_posix_hg) $(files_win32_hg)
@OS_WIN32_FALSE@files_hg = $(files_general_hg) $(files_posix_hg)
@OS_WIN32_TRUE@files_hg = $(files_general_hg) $(files_win32_hg)
files_built_h = $(files_hg:.hg=_p.h)
files_built_all_h = $(files_all_hg:.hg=_p.h)
files_extra_h = interface_p.h object_p.h
files_extra_all_h = interface_p.h object_p.h
dist_sources = $(files_built_all_h) $(files_extra_all_h)
files_general_hg = checksum.hg convert.hg date.hg fileutils.hg iochannel.hg keyfile.hg markup.hg \
module.hg optioncontext.hg optionentry.hg optiongroup.hg regex.hg \
shell.hg spawn.hg thread.hg nodetree.hg unicode.hg uriutils.hg
files_general_deprecated_hg =
files_all_hg = \
$(files_posix_hg) \
$(files_win32_hg) \
$(files_general_hg) \
$(files_general_deprecated_hg)
@OS_WIN32_FALSE@files_hg = $(files_general_hg) $(files_posix_hg) $(files_general_deprecated_hg)
@OS_WIN32_TRUE@files_hg = $(files_general_hg) $(files_win32_hg) $(files_general_deprecated_hg)
files_built_cc = $(files_hg:.hg=.cc) wrap_init.cc
files_built_h = $(files_hg:.hg=.h)
files_all_built_cc = $(files_all_hg:.hg=.cc) wrap_init.cc
files_all_built_h = $(files_all_hg:.hg=.h)
# Extra files
files_all_extra_cc = \
$(sublib_files_extra_posix_cc) \
$(sublib_files_extra_win32_cc) \
$(sublib_files_extra_general_cc) \
$(sublib_files_extra_general_deprecated_cc)
files_all_extra_h = $(sublib_files_extra_posix_h) \
$(sublib_files_extra_win32_h) $(sublib_files_extra_general_h) \
$(sublib_files_extra_general_deprecated_h) wrap_init.h
@OS_WIN32_FALSE@files_extra_cc = \
@OS_WIN32_FALSE@ $(sublib_files_extra_posix_cc) \
@OS_WIN32_FALSE@ $(sublib_files_extra_general_cc)
@OS_WIN32_TRUE@files_extra_cc = \
@OS_WIN32_TRUE@ $(sublib_files_extra_win32_cc) \
@OS_WIN32_TRUE@ $(sublib_files_extra_general_cc)
@OS_WIN32_FALSE@files_extra_h = $(sublib_files_extra_posix_h) \
@OS_WIN32_FALSE@ $(sublib_files_extra_general_h) wrap_init.h
@OS_WIN32_TRUE@files_extra_h = $(sublib_files_extra_win32_h) \
@OS_WIN32_TRUE@ $(sublib_files_extra_general_h) wrap_init.h
files_built_p_h = $(files_hg:.hg=_p.h)
files_built_all_p_h = $(files_all_hg:.hg=_p.h)
files_extra_p_h = interface_p.h object_p.h
files_extra_all_p_h = interface_p.h object_p.h
dist_sources = $(files_built_all_p_h) $(files_extra_all_p_h)
DISTFILES = $(DIST_COMMON) $(dist_sources)
private_includedir = $(includedir)/glibmm-2.4/glibmm/private
private_include_HEADERS = $(files_built_h) $(files_extra_h)
private_include_HEADERS = $(files_built_p_h) $(files_extra_p_h)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../src/Makefile_list_of_hg.am_fragment $(top_srcdir)/build_shared/Makefile_gensrc_platform.am_fragment $(am__configure_deps)
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../src/Makefile_list_of_hg.am_fragment $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@ -264,8 +317,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@ -277,8 +330,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@ -288,13 +341,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
@ -437,7 +489,7 @@ uninstall-am: uninstall-private_includeHEADERS
maintainer-clean-local:
(cd $(srcdir) && rm -f $(files_built_h))
(cd $(srcdir) && rm -f $(files_built_p_h))
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View file

@ -0,0 +1,8 @@
// -*- c++ -*-
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_CHECKSUM_P_H
#define _GLIBMM_CHECKSUM_P_H
#endif /* _GLIBMM_CHECKSUM_P_H */

View file

@ -0,0 +1,8 @@
// -*- c++ -*-
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_NODETREE_P_H
#define _GLIBMM_NODETREE_P_H
#endif /* _GLIBMM_NODETREE_P_H */

View file

@ -0,0 +1,8 @@
// -*- c++ -*-
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_URIUTILS_P_H
#define _GLIBMM_URIUTILS_P_H
#endif /* _GLIBMM_URIUTILS_P_H */

View file

@ -1,19 +1,19 @@
// -*- c++ -*-
/* $Id: property.cc 291 2006-05-12 08:08:45Z murrayc $ */
/* $Id: property.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -1,21 +1,21 @@
// -*- c++ -*-
#ifndef _GLIBMM_PROPERTY_H
#define _GLIBMM_PROPERTY_H
/* $Id: property.h 291 2006-05-12 08:08:45Z murrayc $ */
/* $Id: property.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -1,21 +1,21 @@
// -*- c++ -*-
/* $Id: propertyproxy.cc 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: propertyproxy.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* propertyproxy.cc
*
* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -1,23 +1,23 @@
// -*- c++ -*-
#ifndef _GLIBMM_PROPERTYPROXY_H
#define _GLIBMM_PROPERTYPROXY_H
/* $Id: propertyproxy.h 291 2006-05-12 08:08:45Z murrayc $ */
/* $Id: propertyproxy.h 779 2009-01-19 17:58:50Z murrayc $ */
/* propertyproxy.h
*
* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -39,6 +39,11 @@ namespace Glib
* @endcode
*
* You may also receive notification when a property's value changes, by connecting to signal_changed().
*
* You may register new properties for your class (actually for the underlying GType)
* simply by adding a PropertyProxy instance as a class member.
* However, your constructor must call the Glib::ObjectBase constructor with a new GType name,
* in order to register a new GType.
*/
template <class T>
class PropertyProxy : public PropertyProxy_Base

View file

@ -1,21 +1,21 @@
// -*- c++ -*-
/* $Id: propertyproxy_base.cc 354 2006-11-28 12:59:19Z murrayc $ */
/* $Id: propertyproxy_base.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* propertyproxy_base.h
*
* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -1,23 +1,23 @@
// -*- c++ -*-
#ifndef _GLIBMM_PROPERTYPROXY_BASE_H
#define _GLIBMM_PROPERTYPROXY_BASE_H
/* $Id: propertyproxy_base.h 337 2006-11-10 02:24:49Z murrayc $ */
/* $Id: propertyproxy_base.h 779 2009-01-19 17:58:50Z murrayc $ */
/* propertyproxy_base.h
*
* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -1,25 +1,24 @@
/* $Id: quark.cc 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: quark.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* quark.cc
*
* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gquark.h>
#include <glibmm/quark.h>
namespace Glib

View file

@ -1,28 +1,28 @@
// -*- c++ -*-
#ifndef _GLIBMM_QUARK_H
#define _GLIBMM_QUARK_H
/* $Id: quark.h 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: quark.h 779 2009-01-19 17:58:50Z murrayc $ */
/* quark.h
*
* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gquark.h>
#include <glib.h>
#include <glibmm/ustring.h>

View file

@ -1,27 +1,26 @@
// -*- c++ -*-
/* $Id: random.cc 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: random.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* random.cc
*
* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glibmm/random.h>
#include <glib/grand.h>
namespace Glib

View file

@ -2,28 +2,28 @@
#ifndef _GLIBMM_RANDOM_H
#define _GLIBMM_RANDOM_H
/* $Id: random.h 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: random.h 779 2009-01-19 17:58:50Z murrayc $ */
/* random.h
*
* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gtypes.h>
#include <glib.h>
extern "C" { typedef struct _GRand GRand; }

View file

@ -2,21 +2,21 @@
#ifndef _GLIBMM_REFPTR_H
#define _GLIBMM_REFPTR_H
/* $Id: refptr.h 216 2005-04-07 08:28:46Z murrayc $ */
/* $Id: refptr.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -116,9 +116,15 @@ public:
*/
inline operator bool() const;
/// Set underlying instance to 0, decrementing reference count of existing instance appropriately.
#ifndef GLIBMM_DISABLE_DEPRECATED
/// @deprecated Use reset() instead because this leads to confusion with clear() methods on the underlying class. For instance, people use .clear() when they mean ->clear().
inline void clear();
#endif //GLIBMM_DISABLE_DEPRECATED
/** Set underlying instance to 0, decrementing reference count of existing instance appropriately.
* @newin2p16
*/
inline void reset();
/** Dynamic cast to derived class.
*
@ -279,8 +285,16 @@ RefPtr<T_CppObject>::operator bool() const
return (pCppObject_ != 0);
}
#ifndef GLIBMM_DISABLE_DEPRECATED
template <class T_CppObject> inline
void RefPtr<T_CppObject>::clear()
{
reset();
}
#endif //GLIBMM_DISABLE_DEPRECATED
template <class T_CppObject> inline
void RefPtr<T_CppObject>::reset()
{
RefPtr<T_CppObject> temp; // swap with an empty RefPtr<> to clear *this
this->swap(temp);

View file

@ -7,16 +7,16 @@
/* Copyright (C) 2007 The glibmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -7,16 +7,16 @@
/* Copyright (C) 2007 The glibmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -26,7 +26,7 @@
#include <glibmm/ustring.h>
#include <glibmm/error.h>
#include <glibmm/arrayhandle.h>
#include <glib/gregex.h>
#include <glib.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GRegex GRegex;
@ -155,10 +155,48 @@ class RegexError : public Glib::Error
public:
enum Code
{
COMPILE,
OPTIMIZE,
REPLACE,
MATCH
COMPILE = 0,
OPTIMIZE = 1,
REPLACE = 2,
MATCH = 3,
INTERNAL = 4,
STRAY_BACKSLASH = 101,
MISSING_CONTROL_CHAR = 102,
UNRECOGNIZED_ESCAPE = 103,
QUANTIFIERS_OUT_OF_ORDER = 104,
QUANTIFIER_TOO_BIG = 105,
UNTERMINATED_CHARACTER_CLASS = 106,
INVALID_ESCAPE_IN_CHARACTER_CLASS = 107,
RANGE_OUT_OF_ORDER = 108,
NOTHING_TO_REPEAT = 109,
UNRECOGNIZED_CHARACTER = 112,
POSIX_NAMED_CLASS_OUTSIDE_CLASS = 113,
UNMATCHED_PARENTHESIS = 114,
INEXISTENT_SUBPATTERN_REFERENCE = 115,
UNTERMINATED_COMMENT = 118,
EXPRESSION_TOO_LARGE = 120,
MEMORY_ERROR = 121,
VARIABLE_LENGTH_LOOKBEHIND = 125,
MALFORMED_CONDITION = 126,
TOO_MANY_CONDITIONAL_BRANCHES = 127,
ASSERTION_EXPECTED = 128,
UNKNOWN_POSIX_CLASS_NAME = 130,
POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED = 131,
HEX_CODE_TOO_LARGE = 134,
INVALID_CONDITION = 135,
SINGLE_BYTE_MATCH_IN_LOOKBEHIND = 136,
INFINITE_LOOP = 140,
MISSING_SUBPATTERN_NAME_TERMINATOR = 142,
DUPLICATE_SUBPATTERN_NAME = 143,
MALFORMED_PROPERTY = 146,
UNKNOWN_PROPERTY = 147,
SUBPATTERN_NAME_TOO_LONG = 148,
TOO_MANY_SUBPATTERNS = 149,
INVALID_OCTAL_VALUE = 151,
TOO_MANY_BRANCHES_IN_DEFINE = 154,
DEFINE_REPETION = 155,
INCONSISTENT_NEWLINE_OPTIONS = 156,
MISSING_BACK_REFERENCE = 157
};
RegexError(Code error_code, const Glib::ustring& error_message);
@ -270,13 +308,13 @@ public:
#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<Glib::Regex> create(const Glib::ustring& pattern, RegexCompileFlags compile_options = static_cast<RegexCompileFlags>(0), RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0));
#else
static Glib::RefPtr<Glib::Regex> create(const Glib::ustring& pattern, RegexCompileFlags compile_options = static_cast<RegexCompileFlags>(0), RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0), std::auto_ptr<Glib::Error>& error);
static Glib::RefPtr<Glib::Regex> create(const Glib::ustring& pattern, RegexCompileFlags compile_options, RegexMatchFlags match_options, std::auto_ptr<Glib::Error>& error);
#endif /* !GLIBMM_EXCEPTIONS_ENABLED */
/** Gets the pattern string associated with @a regex , i.e.\ a copy of
/** Gets the pattern string associated with @a regex, i.e.\ a copy of
* the string passed to g_regex_new().
* @return The pattern of @a regex
* @return The pattern of @a regex
*
* @newin2p14.
*/
@ -296,9 +334,9 @@ public:
*/
int get_capture_count() const;
/** Retrieves the number of the subexpression named @a name .
/** Retrieves the number of the subexpression named @a name.
* @param name Name of the subexpression.
* @return The number of the subexpression or -1 if @a name
* @return The number of the subexpression or -1 if @a name
* does not exists
*
* @newin2p14.
@ -308,21 +346,21 @@ public:
static Glib::ustring escape_string(const Glib::ustring& string);
/** Scans for a match in @a string for @a pattern .
/** Scans for a match in @a string for @a pattern.
*
* This function is equivalent to g_regex_match() but it does not
* require to compile the pattern with g_regex_new(), avoiding some
* lines of code when you need just to do a match without extracting
* substrings, capture counts, and so on.
*
* If this function is to be called on the same @a pattern more than
* If this function is to be called on the same @a pattern more than
* once, it's more efficient to compile the pattern once with
* g_regex_new() and then use g_regex_match().
* @param pattern The regular expression.
* @param string The string to scan for matches.
* @param compile_options Compile options for the regular expression.
* @param match_options Match options.
* @return <tt>true</tt> is the string matched, <tt>false</tt> otherwise
* @param compile_options Compile options for the regular expression, or 0.
* @param match_options Match options, or 0.
* @return <tt>true</tt> if the string matched, <tt>false</tt> otherwise
*
* @newin2p14.
*/
@ -375,7 +413,7 @@ public:
* some lines of code when you need just to do a split without
* extracting substrings, capture counts, and so on.
*
* If this function is to be called on the same @a pattern more than
* If this function is to be called on the same @a pattern more than
* once, it's more efficient to compile the pattern once with
* g_regex_new() and then use g_regex_split().
*
@ -387,15 +425,15 @@ public:
* you'll need to check for the empty string before calling this
* function.
*
* A pattern that can match empty strings splits @a string into
* A pattern that can match empty strings splits @a string into
* separate characters wherever it matches the empty string between
* characters. For example splitting "ab c" using as a separator
* "\s*", you will get "a", "b" and "c".
* @param pattern The regular expression.
* @param string The string to scan for matches.
* @param compile_options Compile options for the regular expression.
* @param match_options Match options.
* @return A <tt>0</tt>-terminated gchar ** array. Free it using g_strfreev()
* @param compile_options Compile options for the regular expression, or 0.
* @param match_options Match options, or 0.
* @return A <tt>0</tt>-terminated array of strings. Free it using g_strfreev()
*
* @newin2p14.
*/
@ -414,7 +452,7 @@ public:
* you do need to represent empty elements, you'll need to check for the
* empty string before calling this function.
*
* A pattern that can match empty strings splits @a string into separate
* A pattern that can match empty strings splits @a string into separate
* characters wherever it matches the empty string between characters.
* For example splitting "ab c" using as a separator "\s*", you will get
* "a", "b" and "c".
@ -440,21 +478,20 @@ public:
* you do need to represent empty elements, you'll need to check for the
* empty string before calling this function.
*
* A pattern that can match empty strings splits @a string into separate
* A pattern that can match empty strings splits @a string into separate
* characters wherever it matches the empty string between characters.
* For example splitting "ab c" using as a separator "\s*", you will get
* "a", "b" and "c".
*
* Setting @a start_position differs from just passing over a shortened
* string and setting G::REGEX_MATCH_NOTBOL in the case of a pattern
* Setting @a start_position differs from just passing over a shortened
* string and setting REGEX_MATCH_NOTBOL in the case of a pattern
* that begins with any kind of lookbehind assertion, such as "\b".
* @param string The string to split with the pattern.
* @param string_len The length of @a string , or -1 if @a string is nul-terminated.
* @param string_len The length of @a string, or -1 if @a string is nul-terminated.
* @param start_position Starting index of the string to match.
* @param match_options Match time option flags.
* @param max_tokens The maximum number of tokens to split @a string into.
* @param max_tokens The maximum number of tokens to split @a string into.
* If this is less than 1, the string is split completely.
* @param error Return location for a G::Error.
* @return A <tt>0</tt>-terminated gchar ** array. Free it using g_strfreev()
*
* @newin2p14.
@ -473,7 +510,7 @@ public:
#endif /* !GLIBMM_EXCEPTIONS_ENABLED */
/** Replaces all occurances of the pattern in @a regex with the
/** Replaces all occurances of the pattern in @a regex with the
* replacement text. Backreferences of the form '\number' or
* '\g&lt;number&gt;' in the replacement text are interpolated by the
* number-th captured subexpression of the match, '\g&lt;name&gt;' refers
@ -512,19 +549,18 @@ public:
*
* If you do not need to use backreferences use g_regex_replace_literal().
*
* The @a replacement string must be UTF-8 encoded even if G::REGEX_RAW was
* The @a replacement string must be UTF-8 encoded even if REGEX_RAW was
* passed to g_regex_new(). If you want to use not UTF-8 encoded stings
* you can use g_regex_replace_literal().
*
* Setting @a start_position differs from just passing over a shortened
* string and setting G::REGEX_MATCH_NOTBOL in the case of a pattern that
* Setting @a start_position differs from just passing over a shortened
* string and setting REGEX_MATCH_NOTBOL in the case of a pattern that
* begins with any kind of lookbehind assertion, such as "\b".
* @param string The string to perform matches against.
* @param string_len The length of @a string , or -1 if @a string is nul-terminated.
* @param string_len The length of @a string, or -1 if @a string is nul-terminated.
* @param start_position Starting index of the string to match.
* @param replacement Text to replace each match with.
* @param match_options Options for the match.
* @param error Location to store the error occuring, or <tt>0</tt> to ignore errors.
* @return A newly allocated string containing the replacements
*
* @newin2p14.
@ -542,20 +578,19 @@ public:
#endif /* !GLIBMM_EXCEPTIONS_ENABLED */
/** Replaces all occurances of the pattern in @a regex with the
* replacement text. @a replacement is replaced literally, to
/** Replaces all occurances of the pattern in @a regex with the
* replacement text. @a replacement is replaced literally, to
* include backreferences use g_regex_replace().
*
* Setting @a start_position differs from just passing over a
* shortened string and setting G::REGEX_MATCH_NOTBOL in the
* Setting @a start_position differs from just passing over a
* shortened string and setting REGEX_MATCH_NOTBOL in the
* case of a pattern that begins with any kind of lookbehind
* assertion, such as "\b".
* @param string The string to perform matches against.
* @param string_len The length of @a string , or -1 if @a string is nul-terminated.
* @param string_len The length of @a string, or -1 if @a string is nul-terminated.
* @param start_position Starting index of the string to match.
* @param replacement Text to replace each match with.
* @param match_options Options for the match.
* @param error Location to store the error occuring, or <tt>0</tt> to ignore errors.
* @return A newly allocated string containing the replacements
*
* @newin2p14.
@ -574,18 +609,17 @@ public:
/** Replaces occurances of the pattern in regex with the output of
* @a eval for that occurance.
* @a eval for that occurance.
*
* Setting @a start_position differs from just passing over a shortened
* string and setting G::REGEX_MATCH_NOTBOL in the case of a pattern
* Setting @a start_position differs from just passing over a shortened
* string and setting REGEX_MATCH_NOTBOL in the case of a pattern
* that begins with any kind of lookbehind assertion, such as "\b".
* @param string String to perform matches against.
* @param string_len The length of @a string , or -1 if @a string is nul-terminated.
* @param string_len The length of @a string, or -1 if @a string is nul-terminated.
* @param start_position Starting index of the string to match.
* @param match_options Options for the match.
* @param eval A function to call for each match.
* @param user_data User data to pass to the function.
* @param error Location to store the error occuring, or <tt>0</tt> to ignore errors.
* @return A newly allocated string containing the replacements
*
* @newin2p14.
@ -597,20 +631,19 @@ public:
#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Checks whether @a replacement is a valid replacement string
/** Checks whether @a replacement is a valid replacement string
* (see g_regex_replace()), i.e.\ that all escape sequences in
* it are valid.
*
* If @a has_references is not <tt>0</tt> then @a replacement is checked
* If @a has_references is not <tt>0</tt> then @a replacement is checked
* for pattern references. For instance, replacement text 'foo<tt>\\n</tt>'
* does not contain references and may be evaluated without information
* about actual match, but '\0\1' (whole match followed by first
* subpattern) requires valid G::MatchInfo object.
* subpattern) requires valid MatchInfo object.
* @param replacement The replacement string.
* @param has_references Location to store information about
* references in @a replacement or <tt>0</tt>.
* @param error Location to store error.
* @return Whether @a replacement is a valid replacement string
* references in @a replacement or <tt>0</tt>.
* @return Whether @a replacement is a valid replacement string
*
* @newin2p14.
*/

View file

@ -2,23 +2,23 @@
#ifndef _GLIBMM_SARRAY_H
#define _GLIBMM_SARRAY_H
/* $Id: sarray.h 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: sarray.h 779 2009-01-19 17:58:50Z murrayc $ */
/* array.h
*
* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -10,16 +10,16 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -9,22 +9,22 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gshell.h>
#include <glib.h>
#include <string>
#include <glibmm/arrayhandle.h>

View file

@ -1,22 +1,22 @@
// -*- c++ -*-
/* $Id: signalproxy.cc 291 2006-05-12 08:08:45Z murrayc $ */
/* $Id: signalproxy.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* signalproxy.cc
*
* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -1,22 +1,22 @@
// -*- c++ -*-
/* $Id: signalproxy_connectionnode.cc 137 2004-10-07 16:02:01Z philipl $ */
/* $Id: signalproxy_connectionnode.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* signalproxy_connectionnode.cc
*
* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -2,29 +2,29 @@
#ifndef _GLIBMM_SIGNALPROXY_CONNECTIONNODE_H
#define _GLIBMM_SIGNALPROXY_CONNECTIONNODE_H
/* $Id: signalproxy_connectionnode.h 446 2007-09-26 15:10:44Z murrayc $ */
/* $Id: signalproxy_connectionnode.h 779 2009-01-19 17:58:50Z murrayc $ */
/* signalproxy_connectionnode.h
*
* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <sigc++/sigc++.h>
#include <glib/gtypes.h>
#include <glib.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GObject GObject;

View file

@ -2,26 +2,26 @@
#ifndef _GLIBMM_SLISTHANDLE_H
#define _GLIBMM_SLISTHANDLE_H
/* $Id: slisthandle.h 32 2003-04-21 17:39:41Z murrayc $ */
/* $Id: slisthandle.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gslist.h>
#include <glib.h>
#include <glibmm/containerhandle_shared.h>

View file

@ -10,21 +10,21 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gspawn.h>
#include <glib.h>
#include <glibmm/exceptionhandler.h>
#include <glibmm/utility.h>
@ -76,6 +76,7 @@ namespace Glib
/**** process spawning functions *******************************************/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_async_with_pipes(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
@ -85,10 +86,21 @@ void spawn_async_with_pipes(const std::string& working_directory,
int* standard_input,
int* standard_output,
int* standard_error)
#else
void spawn_async_with_pipes(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags,
const sigc::slot<void>& child_setup,
Pid* child_pid,
int* standard_input,
int* standard_output,
int* standard_error, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
const bool setup_slot = !child_setup.empty();
sigc::slot<void> child_setup_ = child_setup;
GError* error = 0;
GError* gerror = 0;
g_spawn_async_with_pipes(
working_directory.c_str(),
@ -99,12 +111,18 @@ void spawn_async_with_pipes(const std::string& working_directory,
(setup_slot) ? &child_setup_ : 0,
child_pid,
standard_input, standard_output, standard_error,
&error);
&gerror);
if(error)
Glib::Error::throw_exception(error);
#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
Glib::Error::throw_exception(gerror);
#else
if(gerror)
error = ::Glib::Error::throw_exception(gerror);
#endif //GLIBMM_EXCEPTIONS_ENABLED
}
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_async_with_pipes(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags,
@ -113,10 +131,20 @@ void spawn_async_with_pipes(const std::string& working_directory,
int* standard_input,
int* standard_output,
int* standard_error)
#else
void spawn_async_with_pipes(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags,
const sigc::slot<void>& child_setup,
Pid* child_pid,
int* standard_input,
int* standard_output,
int* standard_error, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
const bool setup_slot = !child_setup.empty();
sigc::slot<void> child_setup_ = child_setup;
GError* error = 0;
GError* gerror = 0;
g_spawn_async_with_pipes(
working_directory.c_str(),
@ -126,22 +154,36 @@ void spawn_async_with_pipes(const std::string& working_directory,
(setup_slot) ? &child_setup_ : 0,
child_pid,
standard_input, standard_output, standard_error,
&error);
&gerror);
if(error)
Glib::Error::throw_exception(error);
#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
Glib::Error::throw_exception(gerror);
#else
if(gerror)
error = ::Glib::Error::throw_exception(gerror);
#endif //GLIBMM_EXCEPTIONS_ENABLED
}
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_async(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags,
const sigc::slot<void>& child_setup,
Pid* child_pid)
#else
void spawn_async(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags,
const sigc::slot<void>& child_setup,
Pid* child_pid, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
const bool setup_slot = !child_setup.empty();
sigc::slot<void> child_setup_ = child_setup;
GError* error = 0;
GError* gerror = 0;
g_spawn_async(
working_directory.c_str(),
@ -151,21 +193,34 @@ void spawn_async(const std::string& working_directory,
(setup_slot) ? &child_setup_callback : 0,
(setup_slot) ? &child_setup_ : 0,
child_pid,
&error);
&gerror);
if(error)
Glib::Error::throw_exception(error);
#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
Glib::Error::throw_exception(gerror);
#else
if(gerror)
error = ::Glib::Error::throw_exception(gerror);
#endif //GLIBMM_EXCEPTIONS_ENABLED
}
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_async(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags,
const sigc::slot<void>& child_setup,
Pid* child_pid)
#else
void spawn_async(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags,
const sigc::slot<void>& child_setup,
Pid* child_pid, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
const bool setup_slot = !child_setup.empty();
sigc::slot<void> child_setup_ = child_setup;
GError* error = 0;
GError* gerror = 0;
g_spawn_async(
working_directory.c_str(),
@ -174,12 +229,18 @@ void spawn_async(const std::string& working_directory,
(setup_slot) ? &child_setup_callback : 0,
(setup_slot) ? &child_setup_ : 0,
child_pid,
&error);
&gerror);
if(error)
Glib::Error::throw_exception(error);
#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
Glib::Error::throw_exception(gerror);
#else
if(gerror)
error = ::Glib::Error::throw_exception(gerror);
#endif //GLIBMM_EXCEPTIONS_ENABLED
}
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_sync(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
@ -188,13 +249,23 @@ void spawn_sync(const std::string& working_directory,
std::string* standard_output,
std::string* standard_error,
int* exit_status)
#else
void spawn_sync(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags,
const sigc::slot<void>& child_setup,
std::string* standard_output,
std::string* standard_error,
int* exit_status, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
const bool setup_slot = !child_setup.empty();
sigc::slot<void> child_setup_ = child_setup;
Glib::ScopedPtr<char> buf_standard_output;
Glib::ScopedPtr<char> buf_standard_error;
GError* error = 0;
GError* gerror = 0;
g_spawn_sync(
working_directory.c_str(),
@ -206,15 +277,21 @@ void spawn_sync(const std::string& working_directory,
(standard_output) ? buf_standard_output.addr() : 0,
(standard_error) ? buf_standard_error.addr() : 0,
exit_status,
&error);
&gerror);
if(error)
Glib::Error::throw_exception(error);
#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
Glib::Error::throw_exception(gerror);
#else
if(gerror)
error = ::Glib::Error::throw_exception(gerror);
#endif //GLIBMM_EXCEPTIONS_ENABLED
copy_output_buf(standard_output, buf_standard_output.get());
copy_output_buf(standard_error, buf_standard_error.get());
}
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_sync(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags,
@ -222,13 +299,22 @@ void spawn_sync(const std::string& working_directory,
std::string* standard_output,
std::string* standard_error,
int* exit_status)
#else
void spawn_sync(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags,
const sigc::slot<void>& child_setup,
std::string* standard_output,
std::string* standard_error,
int* exit_status, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
const bool setup_slot = !child_setup.empty();
sigc::slot<void> child_setup_ = child_setup;
Glib::ScopedPtr<char> buf_standard_output;
Glib::ScopedPtr<char> buf_standard_error;
GError* error = 0;
GError* gerror = 0;
g_spawn_sync(
working_directory.c_str(),
@ -239,42 +325,68 @@ void spawn_sync(const std::string& working_directory,
(standard_output) ? buf_standard_output.addr() : 0,
(standard_error) ? buf_standard_error.addr() : 0,
exit_status,
&error);
&gerror);
if(error)
Glib::Error::throw_exception(error);
#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
Glib::Error::throw_exception(gerror);
#else
if(gerror)
error = ::Glib::Error::throw_exception(gerror);
#endif //GLIBMM_EXCEPTIONS_ENABLED
copy_output_buf(standard_output, buf_standard_output.get());
copy_output_buf(standard_error, buf_standard_error.get());
}
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_command_line_async(const std::string& command_line)
#else
void spawn_command_line_async(const std::string& command_line, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
GError* error = 0;
g_spawn_command_line_async(command_line.c_str(), &error);
GError* gerror = 0;
g_spawn_command_line_async(command_line.c_str(), &gerror);
if(error)
Glib::Error::throw_exception(error);
#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
Glib::Error::throw_exception(gerror);
#else
if(gerror)
error = ::Glib::Error::throw_exception(gerror);
#endif //GLIBMM_EXCEPTIONS_ENABLED
}
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_command_line_sync(const std::string& command_line,
std::string* standard_output,
std::string* standard_error,
int* exit_status)
#else
void spawn_command_line_sync(const std::string& command_line,
std::string* standard_output,
std::string* standard_error,
int* exit_status, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
Glib::ScopedPtr<char> buf_standard_output;
Glib::ScopedPtr<char> buf_standard_error;
GError* error = 0;
GError* gerror = 0;
g_spawn_command_line_sync(
command_line.c_str(),
(standard_output) ? buf_standard_output.addr() : 0,
(standard_error) ? buf_standard_error.addr() : 0,
exit_status,
&error);
&gerror);
if(error)
Glib::Error::throw_exception(error);
#ifdef GLIBMM_EXCEPTIONS_ENABLED
if(gerror)
Glib::Error::throw_exception(gerror);
#else
if(gerror)
error = ::Glib::Error::throw_exception(gerror);
#endif //GLIBMM_EXCEPTIONS_ENABLED
copy_output_buf(standard_output, buf_standard_output.get());
copy_output_buf(standard_error, buf_standard_error.get());

View file

@ -9,16 +9,16 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@ -143,6 +143,155 @@ private:
};
/** Executes a child program asynchronously (your program will not
* block waiting for the child to exit). The child program is
* specified by the only argument that must be provided, @a argv.
* The first string in @a argv is of
* course the name of the program to execute. By default, the name of
* the program must be a full path; the PATH shell variable
* will only be searched if you pass the SPAWN_SEARCH_PATH flag.
*
* On Windows, note that all the string or string vector arguments to
* this function and the other spawn*() functions are in UTF-8, the
* GLib file name encoding. Unicode characters that are not part of
* the system codepage passed in these arguments will be correctly
* available in the spawned program only if it uses wide character API
* to retrieve its command line. For C programs built with Microsoft's
* tools it is enough to make the program have a wmain() instead of
* main(). wmain() has a wide character argument vector as parameter.
*
* At least currently, mingw doesn't support wmain(), so if you use
* mingw to develop the spawned program, it will have to call the
* undocumented function __wgetmainargs() to get the wide character
* argument vector and environment. See gspawn-win32-helper.c in the
* GLib sources or init.c in the mingw runtime sources for a prototype
* for that function. Alternatively, you can retrieve the Win32 system
* level wide character command line passed to the spawned program
* using the GetCommandLineW() function.
*
* On Windows the low-level child process creation API
* CreateProcess() doesn't use argument vectors,
* but a command line. The C runtime library's
* spawn*() family of functions (which
* spawn_async_with_pipes() eventually calls) paste the argument
* vector elements together into a command line, and the C runtime startup code
* does a corresponding reconstruction of an argument vector from the
* command line, to be passed to main(). Complications arise when you have
* argument vector elements that contain spaces of double quotes. The
* spawn*() functions don't do any quoting or
* escaping, but on the other hand the startup code does do unquoting
* and unescaping in order to enable receiving arguments with embedded
* spaces or double quotes. To work around this asymmetry,
* spawn_async_with_pipes() will do quoting and escaping on argument
* vector elements that need it before calling the C runtime
* spawn() function.
*
* @a envp is a lists of strings, where each string
* has the form KEY=VALUE. This will become
* the child's environment.
*
* @a flags should be the bitwise OR of any flags you want to affect the
* function's behaviour. The SPAWN_DO_NOT_REAP_CHILD flags means that
* the child will not automatically be reaped; you must use a
* ChildWatch source to be notified about the death of the child
* process. Eventually you must call spawn_close_pid() on the
* @a child_pid, in order to free resources which may be associated
* with the child process. (On Unix, using a ChildWatch source is
* equivalent to calling waitpid() or handling the SIGCHLD signal
* manually. On Windows, calling spawn_close_pid() is equivalent
* to calling CloseHandle() on the process handle returned in
* @a child_pid).
*
* PAWN_LEAVE_DESCRIPTORS_OPEN means that the parent's open file
* descriptors will be inherited by the child; otherwise all
* descriptors except stdin/stdout/stderr will be closed before
* calling exec() in the child. SPAWN_SEARCH_PATH
* means that argv[0] need not be an absolute path, it
* will be looked for in the user's PATH.
* SPAWN_STDOUT_TO_DEV_NULL means that the child's standard output will
* be discarded, instead of going to the same location as the parent's
* standard output. If you use this flag, @a standard_output must be NULL.
* SPAWN_STDERR_TO_DEV_NULL means that the child's standard error
* will be discarded, instead of going to the same location as the parent's
* standard error. If you use this flag, @a standard_error must be NULL.
* SPAWN_CHILD_INHERITS_STDIN means that the child will inherit the parent's
* standard input (by default, the child's standard input is attached to
* /dev/null). If you use this flag, @a standard_input must be NULL.
* G_SPAWN_FILE_AND_ARGV_ZERO means that the first element of @a argv is
* the file to execute, while the remaining elements are the
* actual argument vector to pass to the file. Normally
* spawn_async_with_pipes() uses argv[0] as the file to execute, and
* passes all of @a argv to the child.
*
* @a child_setup is a callback slot. On POSIX
* platforms, the function is called in the child after GLib has
* performed all the setup it plans to perform (including creating
* pipes, closing file descriptors, etc.) but before calling
* exec(). That is, @a child_setup is called just
* before calling exec() in the child. Obviously
* actions taken in this function will only affect the child, not the
* parent. On Windows, there is no separate fork() and exec()
* functionality. Child processes are created and run with
* a single API call, CreateProcess(). @a child_setup is
* called in the parent process just before creating the child
* process. You should carefully consider what you do in @a child_setup
* if you intend your software to be portable to Windows.
*
* If non-NULL, @a child_pid will on Unix be filled with the child's
* process ID. You can use the process ID to send signals to the
* child, or to use child_watch_add() (or waitpid()) if you specified the
* SPAWN_DO_NOT_REAP_CHILD flag. On Windows, @a child_pid will be
* filled with a handle to the child process only if you specified the
* SPAWN_DO_NOT_REAP_CHILD flag. You can then access the child
* process using the Win32 API, for example wait for its termination
* with the WaitFor*() functions, or examine its
* exit code with GetExitCodeProcess(). You should close the handle
* with CloseHandle() or spawn_close_pid() when you no longer need it.
*
* If non-NULL, the @a standard_input, @a standard_output, @a standard_error
* locations will be filled with file descriptors for writing to the child's
* standard input or reading from its standard output or standard error.
* The caller of pawn_async_with_pipes() must close these file descriptors
* when they are no longer in use. If these parameters are NULL, the corresponding
* pipe won't be created.
*
* If @a standard_input is NULL, the child's standard input is attached to
* /dev/null unless SPAWN_CHILD_INHERITS_STDIN is set.
*
* If @a standard_error is NULL, the child's standard error goes to the same
* location as the parent's standard error unless SPAWN_STDERR_TO_DEV_NULL
* is set.
*
* If @a standard_output is NULL, the child's standard output goes to the same
* location as the parent's standard output unless SPAWN_STDOUT_TO_DEV_NULL
* is set.
*
* If @a child_pid is not NULL and an error does not occur then the returned
* pid must be closed using spawn_close_pid().
*
* @note
* If you are writing a gtkmm application, and the program you
* are spawning is a graphical application, too, then you may
* want to use spawn_on_screen_with_pipes() instead to ensure that
* the spawned program opens its windows on the right screen.
*
* @param working_directory Child's current working directory, or an empty string to inherit the parent's, in the GLib file name encoding.
* @param argv Child's argument vector.
* @param envp Child's environment.
* @param flags Flags from SpawnFlags
* @param child_setup Slot to run in the child just before exec().
* @param child_pid Return location for child process ID, or NULL.
* @param standard_input Return location for file descriptor to write to child's stdin, or NULL.
* @param standard_output Return location for file descriptor to read child's stdout, or NULL.
* @param standard_error Return location for file descriptor to read child's stderr, or NULL.
*
* @throws SpawnError Errors are reported even if they occur in the child (for example if the
* executable in argv[0] is not found). Typically
* the message field of returned errors should be displayed
* to users. If an error occurs, @a child_pid, @a standard_input, @a standard_output,
* and @a standard_error will not be filled with valid values.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_async_with_pipes(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
@ -152,7 +301,36 @@ void spawn_async_with_pipes(const std::string& working_directory,
int* standard_input = 0,
int* standard_output = 0,
int* standard_error = 0);
#else
void spawn_async_with_pipes(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags,
const sigc::slot<void>& child_setup,
Pid* child_pid,
int* standard_input,
int* standard_output,
int* standard_error, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Like the main spawn_async_with_pipes() method, but inheriting the parent's environment.
*
* @param working_directory Child's current working directory, or an empty string to inherit the parent's, in the GLib file name encoding.
* @param argv Child's argument vector.
* @param flags Flags from SpawnFlags
* @param child_setup Slot to run in the child just before exec().
* @param child_pid Return location for child process ID, or NULL.
* @param standard_input Return location for file descriptor to write to child's stdin, or NULL.
* @param standard_output Return location for file descriptor to read child's stdout, or NULL.
* @param standard_error Return location for file descriptor to read child's stderr, or NULL.
*
* @throws SpawnError Errors are reported even if they occur in the child (for example if the
* executable in argv[0] is not found). Typically
* the message field of returned errors should be displayed
* to users. If an error occurs, @a child_pid, @a standard_input, @a standard_output,
* and @a standard_error will not be filled with valid values.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_async_with_pipes(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags = SpawnFlags(0),
@ -161,20 +339,115 @@ void spawn_async_with_pipes(const std::string& working_directory,
int* standard_input = 0,
int* standard_output = 0,
int* standard_error = 0);
#else
void spawn_async_with_pipes(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags,
const sigc::slot<void>& child_setup,
Pid* child_pid,
int* standard_input,
int* standard_output,
int* standard_error, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED
/** See pawn_async_with_pipes() for a full description. This function
* simply calls the spawn_async_with_pipes() without any pipes.
*
* @note
* If you are writing a GTK+ application, and the program you
* are spawning is a graphical application, too, then you may
* want to use gdk_spawn_on_screen() instead to ensure that
* the spawned program opens its windows on the right screen.
*
* @param working_directory Child's current working directory, or an empty string to inherit parent's.
* @param argv Child's argument vector.
* @param env Child's environment.
* @param flags Flags from SpawnFlags.
* @param child_setup Slot to run in the child just before exec().
* @param child_pid Return location for child process ID, or NULL
*
* @throws SpawnError Errors are reported even if they occur in the child (for example if the
* executable in argv[0] is not found). Typically
* the message field of returned errors should be displayed
* to users.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_async(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags = SpawnFlags(0),
const sigc::slot<void>& child_setup = sigc::slot<void>(),
Pid* child_pid = 0);
#else
void spawn_async(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags,
const sigc::slot<void>& child_setup,
Pid* child_pid, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Like the main spawn_async() method, but inheriting the parent's environment.
*
* @param working_directory Child's current working directory, or an empty string to inherit parent's.
* @param argv Child's argument vector.
* @param env Child's environment.
* @param flags Flags from SpawnFlags.
* @param child_setup Slot to run in the child just before exec().
* @param child_pid Return location for child process ID, or NULL
*
* @throws SpawnError Errors are reported even if they occur in the child (for example if the
* executable in argv[0] is not found). Typically
* the message field of returned errors should be displayed
* to users.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_async(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags = SpawnFlags(0),
const sigc::slot<void>& child_setup = sigc::slot<void>(),
Pid* child_pid = 0);
#else
void spawn_async(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags,
const sigc::slot<void>& child_setup,
Pid* child_pid, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Executes a child synchronously (waits for the child to exit before returning).
* All output from the child is stored in @a standard_output and @a standard_error,
* if those parameters are non-NULL. Note that you must set the
* SPAWN_STDOUT_TO_DEV_NULL and SPAWN_STDERR_TO_DEV_NULL flags when
* passing NULL for @a standard_output and @a standard_error.
* If @a exit_status is non-NULL, the exit status of the child is stored
* there as it would be returned by waitpid(); standard UNIX macros such
* as WIFEXITED() and WEXITSTATUS() must be used to evaluate the exit status.
* Note that this function calls waitpid() even if @a exit_status is NULL, and
* does not accept the SPAWN_DO_NOT_REAP_CHILD flag.
* If an error occurs, no data is returned in @a standard_output,
* @a standard_error, or @a exit_status.
*
* This function calls spawn_async_with_pipes() internally; see that
* function for full details on the other parameters and details on
* how these functions work on Windows.
*
* @param working_directory Child's current working directory, or an empty string to inherit the parent's, in the GLib file name encoding.
* @param argv Child's argument vector.
* @param envp Child's environment.
* @param flags Flags from SpawnFlags
* @param child_setup Slot to run in the child just before exec().
* @param standard_output Return location for file descriptor to read child's stdout, or NULL.
* @param standard_error Return location for file descriptor to read child's stderr, or NULL.
* @param exit_status Return location for child exit status, as returned by waitpid(), or NULL
*
* @throws SpawnError Errors are reported even if they occur in the child (for example if the
* executable in argv[0] is not found). Typically
* the message field of returned errors should be displayed
* to users. If an error occurs, @a child_pid, @a standard_input, @a standard_output,
* and @a standard_error will not be filled with valid values.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_sync(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
@ -183,7 +456,34 @@ void spawn_sync(const std::string& working_directory,
std::string* standard_output = 0,
std::string* standard_error = 0,
int* exit_status = 0);
#else
void spawn_sync(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags,
const sigc::slot<void>& child_setup,
std::string* standard_output,
std::string* standard_error,
int* exit_status, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Like the main spawn_sync() method, but inheriting the parent's environment.
*
* @param working_directory Child's current working directory, or an empty string to inherit the parent's, in the GLib file name encoding.
* @param argv Child's argument vector.
* @param flags Flags from SpawnFlags
* @param child_setup Slot to run in the child just before exec().
* @param standard_output Return location for file descriptor to read child's stdout, or NULL.
* @param standard_error Return location for file descriptor to read child's stderr, or NULL.
* @param exit_status Return location for child exit status, as returned by waitpid(), or NULL
*
* @throws SpawnError Errors are reported even if they occur in the child (for example if the
* executable in argv[0] is not found). Typically
* the message field of returned errors should be displayed
* to users. If an error occurs, @a child_pid, @a standard_input, @a standard_output,
* and @a standard_error will not be filled with valid values.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_sync(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags = SpawnFlags(0),
@ -191,14 +491,91 @@ void spawn_sync(const std::string& working_directory,
std::string* standard_output = 0,
std::string* standard_error = 0,
int* exit_status = 0);
#else
void spawn_sync(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags,
const sigc::slot<void>& child_setup,
std::string* standard_output,
std::string* standard_error ,
int* exit_status, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED
/** A simple version of spawn_async() that parses a command line with
* shell_parse_argv() and passes it to spawn_async(). It runs a
* command line in the background. Unlike spawn_async(), the
* SPAWN_SEARCH_PATH flag is enabled, other flags are not. Note
* that SPAWN_SEARCH_PATH can have security implications, so
* consider using spawn_async() directly if appropriate.
*
* The same concerns on Windows apply as for spawn_command_line_sync().
*
* @param command_line A command line.
*
* @throws SpawnError Errors are reported even if they occur in the child (for example if the
* executable in argv[0] is not found). Typically
* the message field of returned errors should be displayed
* to users.
* @throws ShellError If the command line could not be parsed.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_command_line_async(const std::string& command_line);
#else
void spawn_command_line_async(const std::string& command_line, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED
/** A simple version of spawn_sync() with little-used parameters
* removed, taking a command line instead of an argument vector. See
* spawn_sync() for full details. @a command_line will be parsed by
* shell_parse_argv(). Unlike spawn_sync(), the SPAWN_SEARCH_PATH flag
* is enabled. Note that SPAWN_SEARCH_PATH can have security
* implications, so consider using spawn_sync() directly if
* appropriate.
*
* If @a exit_status is non-NULL, the exit status of the child is stored there as
* it would be returned by waitpid(); standard UNIX macros such as WIFEXITED()
* and WEXITSTATUS() must be used to evaluate the exit status.
*
* On Windows, please note the implications of shell_parse_argv()
* parsing @a command_line. Parsing is done according to Unix shell rules, not
* Windows command interpreter rules.
* Space is a separator, and backslashes are
* special. Thus you cannot simply pass a @a command_line containing
* canonical Windows paths, like "c:\\program files\\app\\app.exe", as
* the backslashes will be eaten, and the space will act as a
* separator. You need to enclose such paths with single quotes, like
* "'c:\\program files\\app\\app.exe' 'e:\\folder\\argument.txt'".
*
* @param command_line A command line.
* @param standard_output Return location for child output.
* @param standard_error Return location for child errors.
* @param exit_status Return location for child exit status, as returned by waitpid().
*
* @throws SpawnError Errors are reported even if they occur in the child (for example if the
* executable in argv[0] is not found). Typically
* the message field of returned errors should be displayed
* to users.
* @throws ShellError If the command line could not be parsed.
*/
#ifdef GLIBMM_EXCEPTIONS_ENABLED
void spawn_command_line_sync(const std::string& command_line,
std::string* standard_output = 0,
std::string* standard_error = 0,
int* exit_status = 0);
#else
void spawn_command_line_sync(const std::string& command_line,
std::string* standard_output,
std::string* standard_error,
int* exit_status, std::auto_ptr<Glib::Error>& error;
#endif //GLIBMM_EXCEPTIONS_ENABLED
/** On some platforms, notably WIN32, the Pid type represents a resource
* which must be closed to prevent resource leaking. close_pid()
* is provided for this purpose. It should be used on all platforms, even
* though it doesn't do anything under UNIX.
*
* @param pid The process identifier to close.
*/
void spawn_close_pid(Pid pid);
/** @} group Spawn */

View file

@ -1,18 +1,18 @@
/* $Id: streamiochannel.cc 291 2006-05-12 08:08:45Z murrayc $ */
/* $Id: streamiochannel.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -1,19 +1,19 @@
// -*- c++ -*-
/* $Id: streamiochannel.h 17 2003-01-22 12:09:02Z murrayc $ */
/* $Id: streamiochannel.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -1,19 +1,19 @@
// -*- c++ -*-
/* $Id: stringutils.cc 291 2006-05-12 08:08:45Z murrayc $ */
/* $Id: stringutils.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -2,21 +2,21 @@
#ifndef _GLIBMM_STRINGUTILS_H
#define _GLIBMM_STRINGUTILS_H
/* $Id: stringutils.h 116 2004-06-07 17:26:39Z daniel $ */
/* $Id: stringutils.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -10,16 +10,16 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -9,22 +9,22 @@
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gthread.h>
#include <glib.h>
#include <cstddef>
#include <sigc++/sigc++.h>
@ -215,6 +215,7 @@ class Thread
public:
class Exit;
//See http://bugzilla.gnome.org/show_bug.cgi?id=512348 about the sigc::trackable issue.
/** Creates a new thread with the priority <tt>THREAD_PRIORITY_NORMAL</tt>.
* If @a joinable is @c true, you can wait for this thread's termination by
* calling join(). Otherwise the thread will just disappear, when ready.
@ -223,6 +224,10 @@ public:
* pass additional arguments using sigc::bind(). If the thread was created
* successfully, it is returned, otherwise a ThreadError exception is thrown.
*
* Because sigc::trackable is not thread safe, if the slot represents a
* non-static class method (that is, it is created by sigc::mem_fun()), the
* class concerned should not derive from sigc::trackable.
*
* @param slot A slot to execute in the new thread.
* @param joinable Should this thread be joinable?
* @return The new Thread* on success.
@ -230,6 +235,7 @@ public:
*/
static Thread* create(const sigc::slot<void>& slot, bool joinable);
//See http://bugzilla.gnome.org/show_bug.cgi?id=512348 about the sigc::trackable issue.
/** Creates a new thread with the priority @a priority. The stack gets the
* size @a stack_size or the default value for the current platform, if
* @a stack_size is <tt>0</tt>.
@ -245,6 +251,10 @@ public:
* pass additional arguments using sigc::bind(). If the thread was created
* successfully, it is returned.
*
* Because sigc::trackable is not thread safe, if the slot represents a
* non-static class method (that is, it is created by sigc::mem_fun()), the
* class concerned should not derive from sigc::trackable.
*
* @note It is not guaranteed, that threads with different priorities really
* behave accordingly. On some systems (e.g. Linux) only root can increase
* priorities. On other systems (e.g. Solaris) there doesn't seem to be

View file

@ -1,19 +1,19 @@
// -*- c++ -*-
/* $Id: threadpool.cc 291 2006-05-12 08:08:45Z murrayc $ */
/* $Id: threadpool.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -2,21 +2,21 @@
#ifndef _GLIBMM_THREADPOOL_H
#define _GLIBMM_THREADPOOL_H
/* $Id: threadpool.h 72 2004-02-10 14:26:07Z murrayc $ */
/* $Id: threadpool.h 779 2009-01-19 17:58:50Z murrayc $ */
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -1,26 +1,26 @@
// -*- c++ -*-
/* $Id: timer.cc 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: timer.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* timer.cc
*
* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gtimer.h>
#include <glib.h>
#include <glibmm/timer.h>

View file

@ -2,23 +2,23 @@
#ifndef _GLIBMM_TIMER_H
#define _GLIBMM_TIMER_H
/* $Id: timer.h 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: timer.h 779 2009-01-19 17:58:50Z murrayc $ */
/* timer.h
*
* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

View file

@ -1,29 +1,25 @@
// -*- c++ -*-
/* $Id: timeval.cc 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: timeval.cc 779 2009-01-19 17:58:50Z murrayc $ */
/* timeval.cc
*
* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gmain.h>
#include <glib.h>
#include <glib/gtimer.h>
#include <glibmm/timeval.h>

View file

@ -2,29 +2,28 @@
#ifndef _GLIBMM_TIMEVAL_H
#define _GLIBMM_TIMEVAL_H
/* $Id: timeval.h 2 2003-01-07 16:59:16Z murrayc $ */
/* $Id: timeval.h 779 2009-01-19 17:58:50Z murrayc $ */
/* timeval.h
*
* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glib/gtypes.h>
#include <glib/gtimer.h>
#include <glib.h>
namespace Glib
{

Some files were not shown because too many files have changed in this diff Show more