[nemiver/gtk2-branch] Add a GSettings implementation for IConfMgr
- From: Dodji Seketeli <dodji src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nemiver/gtk2-branch] Add a GSettings implementation for IConfMgr
- Date: Mon, 4 Apr 2011 14:50:10 +0000 (UTC)
commit ff60ac67b390d8ce82345e1a7c299522ec8c8efd
Author: Fabien Parent <parent f gmail com>
Date: Thu Mar 31 17:13:42 2011 +0200
Add a GSettings implementation for IConfMgr
* configure.ac: Auto-detect gsettings dependencies. Add a
--enable-gsettings. By default, switch to gsettings if all its
dependencies are present; switch to gconf otherwise. Define
preprocessor macros WITH_GSETTINGS and CONFIG_MGR_MODULE_NAME.
* data/Makefile.am: Declare a new schema sub-directory.
* data/schemas/gconf/Makefile.am: New file.
* data/schemas/gconf/nemiver-dbgperspective.schemas: Moved
src/persp/dbgperspective/schemas/nemiver-dbgperspective.schemas
into this.
* data/schemas/gconf/nemiver-workbench.schemas: Moved
src/workbench/schemas/nemiver-workbench.schemas into this.
* data/schemas/gsettings/Makefile.am: New file.
* data/schemas/gsettings/org.nemiver.gschema.xml: Likewise.
* src/confmgr/Makefile.am: Build either the gsettings backend or
the gconf one.
* src/confmgr/gsettingsmgr.conf.in: New file.
* src/confmgr/nmv-conf-keys.h (CONF_NAMESPACE_NEMIVER)
(CONF_NAMESPACE_DESKTOP_INTERFACE): Declare new keys.
(CONF_KEY_NEMIVER_CALLSTACK_EXPANSION_CHUNK): Moved this here from
nmv-call-stack.cc.
(CONF_KEY_NEMIVER_WINDOW_WIDTH)
(CONF_KEY_NEMIVER_WINDOW_HEIGHT)
(CONF_KEY_NEMIVER_WINDOW_POSITION_X)
(CONF_KEY_NEMIVER_WINDOW_POSITION_Y)
(CONF_KEY_NEMIVER_WINDOW_MAXIMIZED)
(CONF_KEY_NEMIVER_WINDOW_MINIMUM_WIDTH)
(CONF_KEY_NEMIVER_WINDOW_MINIMUM_HEIGHT): Move these declarations
here from nmv-workbench.cc.
* src/confmgr/nmv-gconf-keys-defs.cc: Renamed this from
src/confmgr/nmv-conf-keys.cc.
(CONF_NAMESPACE_NEMIVER)
(CONF_NAMESPACE_DESKTOP_INTERFACE): Define these new keys.
(CONF_KEY_NEMIVER_WINDOW_WIDTH)
(CONF_KEY_NEMIVER_WINDOW_HEIGHT)
(CONF_KEY_NEMIVER_WINDOW_POSITION_X)
(CONF_KEY_NEMIVER_WINDOW_POSITION_Y)
(CONF_KEY_NEMIVER_WINDOW_MAXIMIZED)
(CONF_KEY_NEMIVER_WINDOW_MINIMUM_WIDTH)
(CONF_KEY_NEMIVER_WINDOW_MINIMUM_HEIGHT): Move these definitions
here from nmv-workbench.cc.
* src/confmgr/nmv-gconf-mgr.cc: Include nmv-conf-keys.h.
(GConfMgr::m_value_changed_signal): Adjust the type of this signal.
(GConfMgr::set_key_dir_to_notify, GConfMgr::add_key_to_notify):
Remove.
(GConfMgr::get_default_namespace, GConfMgr::register_namespace):
New functions.
(GConfMgr::{set,get}_key_value): Add a namespace parameter.
(GConfMgr::value_changed_signal): Remove the Value parameter. Add
a namespace parameter. Ignore the namespace parameter in the
definition.
(client_notify_func): Don't pass any value argument to
GConfMgr::value_change_signal anymore.
* src/confmgr/nmv-gsettings-keys-defs.cc: New file.
* src/confmgr/nmv-gsettings-mgr.cc: Likewise.
* src/confmgr/nmv-i-conf-mgr.h: Include config.h.
(IConfMgr::Value): Remove typedef.
(IConfMgr::set_key_dir_to_notify, IConfMgr::add_key_to_notify):
Remove functions.
(IConfMgr::get_default_namespace): New function.
(IConfMgr::{get,set}_key_value): Add a namespace parameter, with a
default argument "".
(load_iface_and_confmgr): New function template.
* src/dbgengine/nmv-debugger-utils.cc
(load_debugger_iface_with_confmgr): Renamed
load_debugger_iface_with_gconf into this. Use the new
load_iface_and_confmgr instead of loading the gconf backend of
IConfMgr systematically. Use the new
IConfMgr::register_namespace.
* src/dbgengine/nmv-debugger-utils.h
(load_debugger_iface_with_confmgr): Renamed
load_debugger_iface_with_gconf into this.
* src/dbgengine/nmv-gdb-engine.cc
(GDBEngine::Priv::on_conf_key_changed_signal): Adjust signature.
Get the configuration value from the conf_mgr as it's not passed
by parameter anymore.
* src/main.cc: Include nmv-i-conf-mgr.h
(main): Use the new load_iface_and_confmgr to load the workbench.
* src/persp/dbgperspective/Makefile.am: There is no more schema
sub-directory to take care about as it got moved under data/.
* src/persp/dbgperspective/nmv-call-stack.cc: Include
nmv-conf-keys.h.
(CONF_KEY_NEMIVER_CALLSTACK_EXPANSION_CHUNK): Moved declaration into
into nmv-conf-keys.h and the definition into the IConfMgr
backends.
(CallStack::Priv::conf_mgr): New member to cache the conf mgr
here.
(CallStack::Priv::init_conf): Cache the conf mgr into the new
memver conf_mgr. Don't call conf_mgr->add_key_to_notify anymore.
(CallStack::Priv::on_config_value_changed_signal): Adjust
signature. Get the key from conf_mgr as it's no more passed as a
parameter.
* src/persp/dbgperspective/nmv-dbg-perspective.cc
(DBGPerspective::on_conf_key_changed_signal): Likewise.
(DBGPerspective::read_default_config): Pass
CONF_NAMESPACE_DESKTOP_INTERFACE argument to the namespace of
IConfMgr::get_key_value as necessary.
* src/persp/dbgperspective/schemas/Makefile.am: Moved to under data/.
* src/persp/dbgperspective/schemas/nemiver-dbgperspective.schemas: Likewise.
* src/workbench/Makefile.am: Don't handle schema (un)install as
schemas got moved under data/
* src/workbench/nmv-workbench.cc: Include nmv-conf-keys.h.
(Workbench::get_configuration_manager): Use
DynamicModuleManager::load_iface_with_default_manager to load the
conf mgr. Use the new IConfMgr::register_namespace API instead of
the former IConfMgr::set_key_dir_to_notify and IConfMgr::add_key_to_notify.
* src/workbench/schemas/Makefile.am: Moved under data/.
* src/workbench/schemas/nemiver-workbench.schemas: Likewise.
* tests/test-breakpoint.cc (test_main): Use the new
debugger_utils::load_debugger_iface_with_confmgr
* tests/test-cpptrait.cc: Likewise.
* tests/test-deref.cc: Likewise.
* tests/test-disassemble.cc: Likewise.
* tests/test-global-variables.cc: Likewise.
* tests/test-local-vars-list.cc: Likewise.
* tests/test-overloads.cc: Likewise.
* tests/test-types.cc: Likewise:
* tests/test-var-list.cc: Likewise.
* tests/test-var-path-expr.cc: Likewise.
* tests/test-var-walker.cc: Likewise.
* tests/test-varobj-walker.cc: Likewise.
* tests/test-vars.cc: Likewise.
* tests/test-watchpoint.cc: Likewise.
INSTALL | 199 ++++++++++--
configure.ac | 66 ++++-
data/Makefile.am | 2 +-
data/schemas/Makefile.am | 5 +
.../schemas => data/schemas/gconf}/Makefile.am | 29 +-
.../schemas/gconf}/nemiver-dbgperspective.schemas | 0
.../schemas/gconf}/nemiver-workbench.schemas | 0
data/schemas/gsettings/Makefile.am | 16 +
data/schemas/gsettings/org.nemiver.gschema.xml | 191 +++++++++++
src/confmgr/Makefile.am | 44 ++-
src/confmgr/gsettingsmgr.conf.in | 10 +
src/confmgr/nmv-conf-keys.h | 16 +-
.../{nmv-conf-keys.cc => nmv-gconf-keys-defs.cc} | 48 +++-
src/confmgr/nmv-gconf-mgr.cc | 150 +++++----
src/confmgr/nmv-gsettings-mgr.cc | 335 ++++++++++++++++++++
src/confmgr/nmv-i-conf-mgr.h | 83 ++++-
src/dbgengine/nmv-debugger-utils.cc | 29 +-
src/dbgengine/nmv-debugger-utils.h | 2 +-
src/dbgengine/nmv-gdb-engine.cc | 6 +-
src/main.cc | 8 +-
src/persp/dbgperspective/Makefile.am | 12 +-
src/persp/dbgperspective/nmv-call-stack.cc | 21 +-
src/persp/dbgperspective/nmv-dbg-perspective.cc | 59 +++-
src/workbench/Makefile.am | 12 -
src/workbench/nmv-workbench.cc | 37 +--
src/workbench/schemas/Makefile.am | 28 --
tests/test-breakpoint.cc | 2 +-
tests/test-cpptrait.cc | 2 +-
tests/test-deref.cc | 2 +-
tests/test-disassemble.cc | 2 +-
tests/test-global-variables.cc | 7 +-
tests/test-local-vars-list.cc | 2 +-
tests/test-overloads.cc | 5 +-
tests/test-types.cc | 2 +-
tests/test-var-list.cc | 2 +-
tests/test-var-path-expr.cc | 2 +-
tests/test-var-walker.cc | 2 +-
tests/test-varobj-walker.cc | 2 +-
tests/test-vars.cc | 5 +-
tests/test-watchpoint.cc | 2 +-
40 files changed, 1134 insertions(+), 313 deletions(-)
---
diff --git a/INSTALL b/INSTALL
index 5458714..7d1c323 100644
--- a/INSTALL
+++ b/INSTALL
@@ -2,18 +2,24 @@ Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
+ Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved. This file is offered as-is,
+without warranty of any kind.
Basic Installation
==================
-Briefly, the shell commands `./configure; make; make install' should
+ Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
-instructions specific to this package.
+instructions specific to this package. Some packages provide this
+`INSTALL' file but do not implement all of the features documented
+below. The lack of an optional feature in a given package is not
+necessarily a bug. More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
@@ -42,7 +48,7 @@ may remove or edit it.
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
-The simplest way to compile this package is:
+ The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
@@ -53,12 +59,22 @@ The simplest way to compile this package is:
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
- the package.
+ the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
+ documentation. When installing into a prefix owned by root, it is
+ recommended that the package be configured and built as a regular
+ user, and only the `make install' phase executed with root
+ privileges.
+
+ 5. Optionally, type `make installcheck' to repeat any self-tests, but
+ this time using the binaries in their final installed location.
+ This target does not install anything. Running this target as a
+ regular user, particularly if the prior `make install' required
+ root privileges, verifies that the installation completed
+ correctly.
+
+ 6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
@@ -67,12 +83,22 @@ The simplest way to compile this package is:
all sorts of other programs in order to regenerate files that came
with the distribution.
+ 7. Often, you can also type `make uninstall' to remove the installed
+ files again. In practice, not all packages have tested that
+ uninstallation works correctly, even though it is required by the
+ GNU Coding Standards.
+
+ 8. Some packages, particularly those that use Automake, provide `make
+ distcheck', which can by used by developers to test that all other
+ targets like `make install' and `make uninstall' work correctly.
+ This target is generally not run by end users.
+
Compilers and Options
=====================
-Some systems require unusual options for compilation or linking that the
-`configure' script does not know about. Run `./configure --help' for
-details on some of the pertinent environment variables.
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
@@ -85,25 +111,41 @@ is an example:
Compiling For Multiple Architectures
====================================
-You can compile the package for more than one kind of computer at the
+ You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
+source code in the directory that `configure' is in and in `..'. This
+is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
+ On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor. Like
+this:
+
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CPP="gcc -E" CXXCPP="g++ -E"
+
+ This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
Installation Names
==================
-By default, `make install' installs the package's commands under
+ By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX'.
+`configure' the option `--prefix=PREFIX', where PREFIX must be an
+absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
@@ -114,16 +156,47 @@ Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
+you can set and what kinds of files go in them. In general, the
+default for these options is expressed in terms of `${prefix}', so that
+specifying just `--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+ The most portable way to affect installation locations is to pass the
+correct locations to `configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+`make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+ The first method involves providing an override variable for each
+affected directory. For example, `make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+`${prefix}'. Any directories that were specified during `configure',
+but not in terms of `${prefix}', must each be overridden at install
+time for the entire installation to be relocated. The approach of
+makefile variable overrides for each directory variable is required by
+the GNU Coding Standards, and ideally causes no recompilation.
+However, some platforms have known limitations with the semantics of
+shared libraries that end up requiring recompilation when using this
+method, particularly noticeable in packages that use GNU Libtool.
+
+ The second method involves providing the `DESTDIR' variable. For
+example, `make install DESTDIR=/alternate/directory' will prepend
+`/alternate/directory' before all installation names. The approach of
+`DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters. On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of `${prefix}'
+at `configure' time.
+
+Optional Features
+=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-Optional Features
-=================
-
-Some packages pay attention to `--enable-FEATURE' options to
+ Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
@@ -135,14 +208,53 @@ find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
+ Some packages offer the ability to configure how verbose the
+execution of `make' will be. For these packages, running `./configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with `make V=1'; while running `./configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with `make V=0'.
+
+Particular systems
+==================
+
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file. The option `-nodtk' can be used as
+a workaround. If GNU CC is not installed, it is therefore recommended
+to try
+
+ ./configure CC="cc"
+
+and if that doesn't work, try
+
+ ./configure CC="cc -nodtk"
+
+ On Solaris, don't put `/usr/ucb' early in your `PATH'. This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+ On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'. It is recommended to use the following options:
+
+ ./configure --prefix=/boot/common
+
Specifying the System Type
==========================
-There may be some features `configure' cannot figure out automatically,
-but needs to determine by the type of machine the package will run on.
-Usually, assuming the package is built to be run on the _same_
-architectures, `configure' can figure that out, but if it prints a
-message saying it cannot guess the machine type, give it the
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
@@ -150,7 +262,8 @@ type, such as `sun4', or a canonical name which has the form:
where SYSTEM can have one of these forms:
- OS KERNEL-OS
+ OS
+ KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
@@ -168,9 +281,9 @@ eventually be run) with `--host=TYPE'.
Sharing Defaults
================
-If you want to set default values for `configure' scripts to share, you
-can create a site shell script called `config.site' that gives default
-values for variables like `CC', `cache_file', and `prefix'.
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
@@ -179,7 +292,7 @@ A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
-Variables not defined in a site shell script can be set in the
+ Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
@@ -198,11 +311,19 @@ an Autoconf bug. Until the bug is fixed you can use this workaround:
`configure' Invocation
======================
-`configure' recognizes the following options to control how it operates.
+ `configure' recognizes the following options to control how it
+operates.
`--help'
`-h'
- Print a summary of the options to `configure', and exit.
+ Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+ Print a summary of the options unique to this package's
+ `configure', and exit. The `short' variant lists options used
+ only in the top level, while the `recursive' variant lists options
+ also present in any nested packages.
`--version'
`-V'
@@ -229,6 +350,16 @@ an Autoconf bug. Until the bug is fixed you can use this workaround:
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
+`--prefix=DIR'
+ Use DIR as the installation prefix. *note Installation Names::
+ for more details, including other options available for fine-tuning
+ the installation locations.
+
+`--no-create'
+`-n'
+ Run the configure checks, but stop before creating any output
+ files.
+
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
diff --git a/configure.ac b/configure.ac
index aa7f8df..bbb313a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,6 +66,10 @@ CPPUNIT_VERSION=1.10.0
AC_SUBST([CPPUNIT_VERSION])
GTKHEX_VERSION=2.21.4
AC_SUBST([GTKHEX_VERSION])
+LIBGIOMM_WITH_GSETTINGS_VERSION=2.25.1
+AC_SUBST([GIOMM_WITH_GSETTINGS_VERSION])
+GSETTINGS_DESKTOP_SCHEMAS=0.0.1
+AC_SUBST([GSETTINGS_DESKTOP_SCHEMAS])
dnl *********************
dnl Checks for programs.
@@ -232,6 +236,29 @@ AC_ARG_ENABLE(symsvis,
ENABLE_GCC_SYMBOLS_VISIBILITY=$enableval,
ENABLE_GCC_SYMBOLS_VISIBILITY=no)
+
+ENABLE_GSETTINGS=auto
+AC_ARG_ENABLE(gsettings,
+ AS_HELP_STRING([--enable-gsettings=yes|no],
+ [use gsettings instead of gconf (default is auto)]),
+ ENABLE_GSETTINGS=$enableval,
+ AC_CHECK_PROG([HAS_DCONF], [dconf], [yes], [no])
+ [PKG_CHECK_EXISTS([giomm-2.4 >= $LIBGIOMM_WITH_GSETTINGS_VERSION gsettings-desktop-schemas >= $GSETTINGS_DESKTOP_SCHEMAS], [HAS_GSETTINGS=yes], [HAS_GSETTINGS=no])])
+if test x$ENABLE_GSETTINGS = xyes || (test x$ENABLE_GSETTINGS = xauto \
+ && test x$HAS_GSETTINGS = xyes \
+ && test x$HAS_DCONF = xyes \
+ && test x$ENABLE_GIO != xno); then
+ AC_DEFINE([WITH_GSETTINGS], 1, [build with gsettings instead of gconf])
+ AC_DEFINE([CONFIG_MGR_MODULE_NAME], ["gsettingsmgr"], [configuration manager to use])
+ CONF_MGR=gsettings
+ ENABLE_GSETTINGS=yes
+else
+ AC_DEFINE([CONFIG_MGR_MODULE_NAME], ["gconfmgr"], [configuration manager to use])
+ CONF_MGR=gconf
+ ENABLE_GSETTINGS=no
+fi
+AM_CONDITIONAL(BUILD_GSETTINGS, test x$ENABLE_GSETTINGS = xyes)
+
dnl *******************************
dnl checking for libraries we use
dnl *******************************
@@ -243,7 +270,6 @@ AC_CHECK_HEADERS([boost/variant.hpp],
#dnl checking for non-aggregated lib
PKG_CHECK_MODULES(SQLITE3, [sqlite3 >= $SQLITE3_VERSION])
-PKG_CHECK_MODULES(GCONF,[gconf-2.0 >= $GCONF_VERSION])
#######################################################
#boost build system sucks no end.
@@ -279,11 +305,32 @@ if test x$ENABLE_MEMORYVIEW = xyes ; then
fi
dnl *******************
-dnl gconf
+dnl Configuration Manager
dnl *******************
-AC_PATH_PROG(GCONFTOOL, gconftool-2)
-AM_GCONF_SOURCE_2
-AC_SUBST(GCONFTOOL)
+if test x$CONF_MGR = xgsettings ; then
+ AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL],[0])
+
+ dnl library dependencies for the nemiver gsettings plugin
+ DEP_GSETTINGS="giomm-2.4 >= $LIBGIOMM_WITH_GSETTINGS_VERSION \
+ gsettings-desktop-schemas >= $GSETTINGS_DESKTOP_SCHEMAS"
+
+ PKG_CHECK_MODULES(NEMIVERGSETTINGS, $DEP_GSETTINGS)
+
+ AC_SUBST(NEMIVERGSETTINGS_LIBS)
+ AC_SUBST(NEMIVERGSETTINGS_CFLAGS)
+
+ GLIB_GSETTINGS
+elif test x$CONF_MGR = xgconf ; then
+ PKG_CHECK_MODULES(GCONF,[gconf-2.0 >= $GCONF_VERSION])
+
+ AC_PATH_PROG(GCONFTOOL, gconftool-2)
+ AC_SUBST(GCONFTOOL)
+
+ AM_GCONF_SOURCE_2
+ AC_SUBST(gsettingsschemadir, [dummy])
+else
+ AC_MSG_ERROR([Configuration Manager undetermined. Abort...])
+fi
dnl library dependencies for libnemivercommon and the IDebugger libraries
DEP_COMMON="gmodule-2.0 >= $LIBGMODULE_VERSION \
@@ -431,10 +478,10 @@ src/Makefile
src/dbgengine/varlistwalker.conf
src/confmgr/Makefile
src/confmgr/gconfmgr.conf
+ src/confmgr/gsettingsmgr.conf
src/uicommon/Makefile
src/workbench/Makefile
src/workbench/workbench.conf
- src/workbench/schemas/Makefile
src/persp/Makefile
src/persp/dbgperspective/Makefile
src/persp/dbgperspective/dbgperspective.conf
@@ -443,7 +490,6 @@ src/Makefile
src/persp/dbgperspective/icons/Makefile
src/persp/dbgperspective/sqlscripts/Makefile
src/persp/dbgperspective/sqlscripts/sqlite/Makefile
- src/persp/dbgperspective/schemas/Makefile
data/Makefile
data/icons/Makefile
data/icons/16x16/Makefile
@@ -452,6 +498,9 @@ data/Makefile
data/icons/32x32/Makefile
data/icons/48x48/Makefile
data/icons/scalable/Makefile
+ data/schemas/Makefile
+ data/schemas/gconf/Makefile
+ data/schemas/gsettings/Makefile
ui/Makefile
menus/Makefile
tests/Makefile
@@ -483,8 +532,9 @@ AC_MSG_NOTICE([
Enable verbose debug messages : ${ENABLE_DEBUG}
Enable workbench : ${ENABLE_WORKBENCH}
Enable memory view : ${ENABLE_MEMORYVIEW} (requires gtkhex > $GTKHEX_VERSION)
- gtksourceviewmm version : ${LIBGTKSOURCEVIEWMM_PKG}
+ gtksourceviewmm version : ${LIBGTKSOURCEVIEWMM_PKG}
VFS library : ${VFS_PKG}
+ Configuration Manager : ${CONF_MGR}
Enable symbols visibility ctrl : ${ENABLE_GCC_SYMBOLS_VISIBILITY}
Maintainer mode : ${USER_MAINTAINER_MODE}
diff --git a/data/Makefile.am b/data/Makefile.am
index 624c153..eff2565 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS=icons
+SUBDIRS=icons schemas
desktopdir = $(datadir)/applications
desktop_in_files = nemiver.desktop.in
diff --git a/data/schemas/Makefile.am b/data/schemas/Makefile.am
new file mode 100644
index 0000000..e34f4b2
--- /dev/null
+++ b/data/schemas/Makefile.am
@@ -0,0 +1,5 @@
+if BUILD_GSETTINGS
+ SUBDIRS=gsettings
+else
+ SUBDIRS=gconf
+endif
diff --git a/src/persp/dbgperspective/schemas/Makefile.am b/data/schemas/gconf/Makefile.am
similarity index 50%
rename from src/persp/dbgperspective/schemas/Makefile.am
rename to data/schemas/gconf/Makefile.am
index 0074a40..d4c2d8d 100644
--- a/src/persp/dbgperspective/schemas/Makefile.am
+++ b/data/schemas/gconf/Makefile.am
@@ -1,34 +1,35 @@
-files=nemiver-dbgperspective.schemas
-
+files=nemiver-dbgperspective.schemas nemiver-workbench.schemas
schemasdir = $(GCONF_SCHEMA_FILE_DIR)
schemas_DATA = $(files)
GCONFTOOL= GCONFTOOL@
-
export GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE)
+
export files
+install-data-local: install-schemas
+
+uninstall-local: uninstall-schemas
+
install-schemas:
if GCONF_SCHEMAS_INSTALL
if test -z "$(DESTDIR)" ; then \
- for s in `echo $$files | tr ' ' '\n'` ; do \
- $(GCONFTOOL) --makefile-install-rule $(top_srcdir)/src/persp/dbgperspective/schemas/$$s ; \
- done ; \
- gconfpid=`pidof gconfd-2` ; \
- if test x$$gconfpid != x ; then \
+ for s in `echo $$files | tr ' ' '\n'` ; do \
+ $(GCONFTOOL) --makefile-install-rule $(top_srcdir)/data/schemas/gconf/$$s ; \
+ done ; \
+ gconfpid=`pidof gconfd-2` ; \
+ if test x$$gconfpid != x ; then \
kill -HUP $$gconfpid ; \
echo "gconf $$gconfpid reloaded its config" ;\
- fi \
+ fi \
fi
-endif
-
+endif # GCONF_SCHEMAS_INSTALL
uninstall-schemas:
if GCONF_SCHEMAS_INSTALL
if test -z "$(DESTDIR)" ; then \
- for s in `echo $$files | tr ' ' '\n'` ; do $(GCONFTOOL) --makefile-uninstall-rule $(top_srcdir)/src/persp/dbgperspective/schemas/$$s ; done \
+ for s in `echo $$files | tr ' ' '\n'` ; do $(GCONFTOOL) --makefile-uninstall-rule $(top_srcdir)/data/schemas/gconf/$$s ; done \
fi
-endif
+endif # GCONF_SCHEMAS_INSTALL
EXTRA_DIST=$(files)
-
diff --git a/src/persp/dbgperspective/schemas/nemiver-dbgperspective.schemas b/data/schemas/gconf/nemiver-dbgperspective.schemas
similarity index 100%
rename from src/persp/dbgperspective/schemas/nemiver-dbgperspective.schemas
rename to data/schemas/gconf/nemiver-dbgperspective.schemas
diff --git a/src/workbench/schemas/nemiver-workbench.schemas b/data/schemas/gconf/nemiver-workbench.schemas
similarity index 100%
rename from src/workbench/schemas/nemiver-workbench.schemas
rename to data/schemas/gconf/nemiver-workbench.schemas
diff --git a/data/schemas/gsettings/Makefile.am b/data/schemas/gsettings/Makefile.am
new file mode 100644
index 0000000..c6c14c5
--- /dev/null
+++ b/data/schemas/gsettings/Makefile.am
@@ -0,0 +1,16 @@
+files=org.nemiver.gschema.xml
+gsettingsschema_DATA = $(files)
+
+export files
+
+install-data-local: install-schemas
+
+uninstall-local: uninstall-schemas
+
+install-schemas: install-gsettingsschemaDATA
+ $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
+
+uninstall-schemas: uninstall-gsettingsschemaDATA
+ $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
+
+EXTRA_DIST=$(files)
diff --git a/data/schemas/gsettings/org.nemiver.gschema.xml b/data/schemas/gsettings/org.nemiver.gschema.xml
new file mode 100644
index 0000000..870d364
--- /dev/null
+++ b/data/schemas/gsettings/org.nemiver.gschema.xml
@@ -0,0 +1,191 @@
+<schemalist>
+ <schema id="org.nemiver" path="/apps/nemiver/">
+ <key name="source-search-dirs" type="s">
+ <default>'.'</default>
+ <summary>source directory dirs</summary>
+ <description>The list of directories where to search for source files.
+ This is used only when there is not enough information in the binary to
+ locate the file.</description>
+ </key>
+
+ <key name="show-dbg-error-dialogs" type="b">
+ <default>false</default>
+ <summary>Show or don't show errors coming from the debugger engine</summary>
+ <description>If set to yes, popups error message dialogs showing errors
+ coming from the underlying debugger engine.</description>
+ </key>
+
+ <key name="show-source-line-numbers" type="b">
+ <default>true</default>
+ <summary>Show or don't show source lines numbers</summary>
+ <description>If set to yes, show the source code line number on the left
+ hand side of each line.</description>
+ </key>
+
+ <key name="confirm-before-reload-source" type="b">
+ <default>true</default>
+ <summary>Ask the user before reloading a source file</summary>
+ <description>When a source file needs to be reloaded, if this key is set
+ to yes, ask the user before reloading.</description>
+ </key>
+
+ <key name="allow-auto-reload-source" type="b">
+ <default>true</default>
+ <summary>Do not automatically reload the source file</summary>
+ <description>If the user chooses not to be asked about re-loading changed
+ source files and if this key is set to true, re-load the source file
+ automatically.</description>
+ </key>
+
+ <key name="highlight-source-code" type="b">
+ <default>true</default>
+ <summary>Highlight source code</summary>
+ <description>If set to yes, highlight source code.</description>
+ </key>
+
+ <key name="use-system-font" type="b">
+ <default>true</default>
+ <summary>Whether to use the system font for the source editor</summary>
+ <description>Whether to use the system font for the source editor.</description>
+ </key>
+
+ <key name="custom-font-name" type="s">
+ <default>'monospace 12'</default>
+ <summary>The custom font to use if we're not using the system font</summary>
+ <description>The custom font to use for the source editor if we're not
+ using the system font.</description>
+ </key>
+
+ <key name="use-launch-terminal" type="b">
+ <default>false</default>
+ <summary>Whether to use the terminal we were launched from</summary>
+ <description>Whether to use the terminal we were launched from as
+ the debuggee's terminal, or to use our own embedded terminal.</description>
+ </key>
+
+ <key name="editor-style-scheme" type="s">
+ <default>'classic'</default>
+ <summary>The style of the source editor</summary>
+ <description>The name of the source editor color scheme.</description>
+ </key>
+
+ <key name="status-widget-minimum-width" type="i">
+ <default>100</default>
+ <summary>The minimum width of the status widget</summary>
+ <description>The minimum width of the status widget.</description>
+ </key>
+
+ <key name="status-widget-minimum-height" type="i">
+ <default>70</default>
+ <summary>The minimum height of the status widget</summary>
+ <description>The minimum height of the status widget.</description>
+ </key>
+
+ <key name="status-pane-location" type="i">
+ <default>-1</default>
+ <summary>The location of the status pane</summary>
+ <description>The location of the status pane.</description>
+ </key>
+
+ <key name="debugger-engine-dynmod" type="s">
+ <default>'gdbengine'</default>
+ <summary>The underlying debugger engine management module</summary>
+ <description>The name of the debugger engine management module used.</description>
+ </key>
+
+ <key name="gdb-binary" type="s">
+ <default>'default-gdb-binary'</default>
+ <summary>The underlying debugger engine</summary>
+ <description>The name of the debugger engine management module used.</description>
+ </key>
+
+ <key name="asm-style-pure" type="b">
+ <default>false</default>
+ <summary>Show the assembly in pure form</summary>
+ <description>If set to yes, pure assembly code is shown when switching
+ to assembly view. Otherwise, source code mixed with assembly code is
+ shown.</description>
+ </key>
+
+ <key name="default-num-asm-instrs" type="i">
+ <default>25</default>
+ <summary>The number of assembly instructions to show by default</summary>
+ <description>The number of instructions that are disassembled by default.</description>
+ </key>
+
+ <key name="context-pane-location" type="i">
+ <default>-1</default>
+ <summary>The position of the splitter in the debug context tab</summary>
+ <description>The position of the splitter in the debug context tab.
+ This is saved by the UI automatically.</description>
+ </key>
+
+ <key name="follow-fork-mode" type="s">
+ <default>'parent'</default>
+ <summary>Which process to follow upon a fork</summary>
+ <description>If a fork happen, follow the parent parent process if the
+ key is set to 'parent', or follow the child process if the key is set to
+ 'child'.</description>
+ </key>
+
+ <key name="callstack-expansion-chunk" type="i">
+ <default>25</default>
+ <summary>The size of the call stack to display</summary>
+ <description>Do not automatically display call stack wider than this
+ value.</description>
+ </key>
+
+ <key name="source-file-encoding-list" type="as">
+ <default>['UTF-8','ISO-8859','ISO-8859-1','ISO-8859-15']</default>
+ <summary>The list of of file encodings supported by nemiver</summary>
+ <description>When nemiver opens a file, it will assume the encoding of the
+ file is one of the encodings listed here. Please bear in mind that
+ Nemiver works internally with files in the UTF-8 encoding. So when it
+ loads a file, it must convert the file encoding into UTF-8. Therefore,
+ Nemiver needs to know the possible set of encodings of the source files
+ it has to open.</description>
+ </key>
+
+ <key name="window-width" type="i">
+ <default>800</default>
+ <summary>window width</summary>
+ <description>The width of the workbench window.</description>
+ </key>
+
+ <key name="window-height" type="i">
+ <default>600</default>
+ <summary>window height</summary>
+ <description>The height of the workbench window.</description>
+ </key>
+
+ <key name="window-position-x" type="i">
+ <default>10</default>
+ <summary>window x position</summary>
+ <description>The X coordinate of the workbench window.</description>
+ </key>
+
+ <key name="window-position-y" type="i">
+ <default>10</default>
+ <summary>window y position</summary>
+ <description>The Y coordinate of the workbench window.</description>
+ </key>
+
+ <key name="window-maximized" type="b">
+ <default>false</default>
+ <summary>window maximization</summary>
+ <description>Whether the workbench window is maximized.</description>
+ </key>
+
+ <key name="window-minimum-width" type="i">
+ <default>700</default>
+ <summary>window minim width</summary>
+ <description>The workbench main window minium width.</description>
+ </key>
+
+ <key name="window-minimum-height" type="i">
+ <default>500</default>
+ <summary>window minimum height</summary>
+ <description>The workbench main window minium height.</description>
+ </key>
+ </schema>
+</schemalist>
diff --git a/src/confmgr/Makefile.am b/src/confmgr/Makefile.am
index 84a739a..0b9dbc7 100644
--- a/src/confmgr/Makefile.am
+++ b/src/confmgr/Makefile.am
@@ -1,29 +1,41 @@
-gconfmgrmod_LTLIBRARIES=libgconfmgrmod.la
-gconfmgrmoddir= NEMIVER_MODULES_DIR@
-
h=$(abs_srcdir)
public_headers=$(h)/nmv-i-conf-mgr.h
private_headers=$(h)/nmv-conf-keys.h
headers= $(public_headers) $(private_headers)
-libgconfmgrmod_la_SOURCES= \
-$(headers) \
-$(h)/nmv-gconf-mgr.cc \
-$(h)/nmv-conf-keys.cc
-
publicheaders_DATA=$(public_headers)
publicheadersdir=$(NEMIVER_INCLUDE_DIR)/dynmods
-libgconfmgrmod_la_LDFLAGS=-module -avoid-version -Wl,--as-needed
-libgconfmgrmod_la_LIBADD= NEMIVERCOMMON_LIBS@ @GCONF_LIBS@ \
- $(abs_top_builddir)/src/common/libnemivercommon.la
-
-config_DATA=gconfmgr.conf
configdir= NEMIVER_SYSTEM_CONFIG_DIR@
-INCLUDES= NEMIVERCOMMON_CFLAGS@ @GCONF_CFLAGS@ -DENABLE_NLS=1 -DDATADIR=\"${datadir}\" \
+INCLUDES= NEMIVERCOMMON_CFLAGS@ -DENABLE_NLS=1 -DDATADIR=\"${datadir}\" \
-I$(abs_top_srcdir)/src
-EXTRA_DIST=gconfmgr.conf.in
-
+if BUILD_GSETTINGS
+ libgsettingsmgrmod_la_SOURCES=$(headers) $(h)/nmv-gsettings-mgr.cc\
+ $(h)/nmv-gsettings-keys-defs.cc
+ libgsettingsmgrmod_la_LDFLAGS=-module -avoid-version -Wl,--as-needed
+ libgsettingsmgrmod_la_LIBADD= NEMIVERCOMMON_LIBS@ @NEMIVERGSETTINGS_LIBS@ \
+ $(abs_top_builddir)/src/common/libnemivercommon.la
+
+ gsettingsmgrmod_LTLIBRARIES=libgsettingsmgrmod.la
+ gsettingsmgrmoddir= NEMIVER_MODULES_DIR@
+
+ config_DATA=gsettingsmgr.conf
+ INCLUDES+= @NEMIVERGSETTINGS_CFLAGS@
+else
+ libgconfmgrmod_la_SOURCES=$(headers) $(h)/nmv-gconf-mgr.cc\
+ $(h)/nmv-gconf-keys-defs.cc
+ libgconfmgrmod_la_LDFLAGS=-module -avoid-version -Wl,--as-needed
+ libgconfmgrmod_la_LIBADD= NEMIVERCOMMON_LIBS@ @GCONF_LIBS@ \
+ $(abs_top_builddir)/src/common/libnemivercommon.la
+
+ gconfmgrmod_LTLIBRARIES=libgconfmgrmod.la
+ gconfmgrmoddir= NEMIVER_MODULES_DIR@
+
+ config_DATA=gconfmgr.conf
+ INCLUDES+= @GCONF_CFLAGS@
+endif
+
+EXTRA_DIST=gconfmgr.conf.in gsettingsmgr.conf.in
diff --git a/src/confmgr/gsettingsmgr.conf.in b/src/confmgr/gsettingsmgr.conf.in
new file mode 100644
index 0000000..87c7525
--- /dev/null
+++ b/src/confmgr/gsettingsmgr.conf.in
@@ -0,0 +1,10 @@
+<moduleconfig>
+ <module>
+ <name>gsettingsmgr</name>
+ <!-- Remember, Interface name is IConfMgr-->
+ <libraryname>gsettingsmgrmod</libraryname>
+ </module>
+ <customsearchpaths>
+ <path>@NEMIVER_LIBDIR@/nemiver/modules</path>
+ </customsearchpaths>
+</moduleconfig>
diff --git a/src/confmgr/nmv-conf-keys.h b/src/confmgr/nmv-conf-keys.h
index 68c29cb..7e38f98 100644
--- a/src/confmgr/nmv-conf-keys.h
+++ b/src/confmgr/nmv-conf-keys.h
@@ -30,6 +30,12 @@
NEMIVER_BEGIN_NAMESPACE (nemiver)
+extern const char* CONF_NAMESPACE_NEMIVER;
+
+extern const char* CONF_NAMESPACE_DESKTOP_INTERFACE;
+
+extern const char* CONF_KEY_SYSTEM_FONT_NAME;
+
extern const char* CONF_KEY_NEMIVER_SOURCE_DIRS;
extern const char* CONF_KEY_SHOW_DBG_ERROR_DIALOGS;
extern const char* CONF_KEY_SHOW_SOURCE_LINE_NUMBERS;
@@ -39,7 +45,6 @@ extern const char* CONF_KEY_HIGHLIGHT_SOURCE_CODE;
extern const char* CONF_KEY_SOURCE_FILE_ENCODING_LIST;
extern const char* CONF_KEY_USE_SYSTEM_FONT;
extern const char* CONF_KEY_CUSTOM_FONT_NAME;
-extern const char* CONF_KEY_SYSTEM_FONT_NAME;
extern const char* CONF_KEY_USE_LAUNCH_TERMINAL;
extern const char* CONF_KEY_STATUS_WIDGET_MINIMUM_WIDTH;
extern const char* CONF_KEY_STATUS_WIDGET_MINIMUM_HEIGHT;
@@ -51,6 +56,15 @@ extern const char* CONF_KEY_GDB_BINARY;
extern const char* CONF_KEY_DEFAULT_NUM_ASM_INSTRS;
extern const char* CONF_KEY_FOLLOW_FORK_MODE;
extern const char* CONF_KEY_CONTEXT_PANE_LOCATION;
+extern const char* CONF_KEY_NEMIVER_CALLSTACK_EXPANSION_CHUNK;
+
+extern const char* CONF_KEY_NEMIVER_WINDOW_WIDTH;
+extern const char* CONF_KEY_NEMIVER_WINDOW_HEIGHT;
+extern const char* CONF_KEY_NEMIVER_WINDOW_POSITION_X;
+extern const char* CONF_KEY_NEMIVER_WINDOW_POSITION_Y;
+extern const char* CONF_KEY_NEMIVER_WINDOW_MAXIMIZED;
+extern const char* CONF_KEY_NEMIVER_WINDOW_MINIMUM_WIDTH;
+extern const char* CONF_KEY_NEMIVER_WINDOW_MINIMUM_HEIGHT;
NEMIVER_END_NAMESPACE (nemiver)
diff --git a/src/confmgr/nmv-conf-keys.cc b/src/confmgr/nmv-gconf-keys-defs.cc
similarity index 65%
rename from src/confmgr/nmv-conf-keys.cc
rename to src/confmgr/nmv-gconf-keys-defs.cc
index b3f13b5..167de6c 100644
--- a/src/confmgr/nmv-conf-keys.cc
+++ b/src/confmgr/nmv-gconf-keys-defs.cc
@@ -1,4 +1,4 @@
-// Author: Dodji Seketeli
+// Author: Fabien Parent
/*
*This file is part of the Nemiver project
*
@@ -27,6 +27,15 @@
NEMIVER_BEGIN_NAMESPACE (nemiver)
+
+const char* CONF_NAMESPACE_NEMIVER = "/apps/nemiver";
+
+const char* CONF_NAMESPACE_DESKTOP_INTERFACE = "/desktop/gnome/interface";
+
+const char* CONF_KEY_SYSTEM_FONT_NAME =
+ "/desktop/gnome/interface/monospace_font_name";
+
+/* dbgperspective */
const char* CONF_KEY_NEMIVER_SOURCE_DIRS =
"/apps/nemiver/dbgperspective/source-search-dirs";
const char* CONF_KEY_SHOW_DBG_ERROR_DIALOGS =
@@ -43,17 +52,15 @@ const char* CONF_KEY_SOURCE_FILE_ENCODING_LIST =
"/apps/nemiver/dbgperspective/source-file-encoding-list";
const char* CONF_KEY_USE_SYSTEM_FONT =
"/apps/nemiver/dbgperspective/use-system-font";
-const char* CONF_KEY_CUSTOM_FONT_NAME=
+const char* CONF_KEY_CUSTOM_FONT_NAME =
"/apps/nemiver/dbgperspective/custom-font-name";
-const char* CONF_KEY_SYSTEM_FONT_NAME=
- "/desktop/gnome/interface/monospace_font_name";
const char* CONF_KEY_USE_LAUNCH_TERMINAL =
"/apps/nemiver/dbgperspective/use-launch-terminal";
-const char* CONF_KEY_STATUS_WIDGET_MINIMUM_WIDTH=
+const char* CONF_KEY_STATUS_WIDGET_MINIMUM_WIDTH =
"/apps/nemiver/dbgperspective/status-widget-minimum-width";
-const char* CONF_KEY_STATUS_WIDGET_MINIMUM_HEIGHT=
+const char* CONF_KEY_STATUS_WIDGET_MINIMUM_HEIGHT =
"/apps/nemiver/dbgperspective/status-widget-minimum-height";
-const char* CONF_KEY_STATUS_PANE_LOCATION=
+const char* CONF_KEY_STATUS_PANE_LOCATION =
"/apps/nemiver/dbgperspective/status-pane-location";
const char* CONF_KEY_DEBUGGER_ENGINE_DYNMOD_NAME =
"/apps/nemiver/dbgperspective/debugger-engine-dynmod";
@@ -63,9 +70,30 @@ const char* CONF_KEY_ASM_STYLE_PURE =
"/apps/nemiver/dbgperspective/asm-style-pure";
const char* CONF_KEY_DEFAULT_NUM_ASM_INSTRS =
"/apps/nemiver/dbgperspective/default-num-asm-instrs";
-const char *CONF_KEY_GDB_BINARY = "/apps/nemiver/dbgperspective/gdb-binary";
-const char *CONF_KEY_FOLLOW_FORK_MODE = "/apps/nemiver/dbgperspective"
- "/follow-fork-mode";
+const char* CONF_KEY_GDB_BINARY =
+ "/apps/nemiver/dbgperspective/gdb-binary";
+const char* CONF_KEY_FOLLOW_FORK_MODE =
+ "/apps/nemiver/dbgperspective/follow-fork-mode";
const char* CONF_KEY_CONTEXT_PANE_LOCATION =
"/apps/nemiver/dbgperspective/context-pane-location";
+const char* CONF_KEY_NEMIVER_CALLSTACK_EXPANSION_CHUNK =
+ "/apps/nemiver/dbgperspective/callstack-expansion-chunk";
+
+
+/* Workbench */
+const char* CONF_KEY_NEMIVER_WINDOW_WIDTH =
+ "/apps/nemiver/workbench/window-width";
+const char* CONF_KEY_NEMIVER_WINDOW_HEIGHT =
+ "/apps/nemiver/workbench/window-height";
+const char* CONF_KEY_NEMIVER_WINDOW_POSITION_X =
+ "/apps/nemiver/workbench/window-position-x";
+const char* CONF_KEY_NEMIVER_WINDOW_POSITION_Y =
+ "/apps/nemiver/workbench/window-position-y";
+const char* CONF_KEY_NEMIVER_WINDOW_MAXIMIZED =
+ "/apps/nemiver/workbench/window-maximized";
+const char* CONF_KEY_NEMIVER_WINDOW_MINIMUM_WIDTH =
+ "/apps/nemiver/workbench/window-minimum-width";
+const char* CONF_KEY_NEMIVER_WINDOW_MINIMUM_HEIGHT =
+ "/apps/nemiver/workbench/window-minimum-height";
+
NEMIVER_END_NAMESPACE (nemiver)
diff --git a/src/confmgr/nmv-gconf-mgr.cc b/src/confmgr/nmv-gconf-mgr.cc
index eee2aa0..ffa3c6f 100644
--- a/src/confmgr/nmv-gconf-mgr.cc
+++ b/src/confmgr/nmv-gconf-mgr.cc
@@ -27,6 +27,7 @@
#include "common/nmv-ustring.h"
#include "common/nmv-exception.h"
#include "common/nmv-safe-ptr-utils.h"
+#include "nmv-conf-keys.h"
NEMIVER_BEGIN_NAMESPACE (nemiver)
@@ -37,34 +38,55 @@ class GConfMgr : public IConfMgr {
GConfMgr& operator= (const GConfMgr &);
GConfClient *m_gconf_client;
- sigc::signal<void, const UString&, IConfMgr::Value&> m_value_changed_signal;
+ sigc::signal<void, const UString&, const UString&> m_value_changed_signal;
public:
GConfMgr (DynamicModule *a_dynmod);
virtual ~GConfMgr ();
- void set_key_dir_to_notify (const UString &a_key_dir);
- void add_key_to_notify (const UString &a_key);
+ const UString& get_default_namespace () const;
- bool get_key_value (const UString &a_key, UString &a_value);
- void set_key_value (const UString &a_key, const UString &a_value);
+ void register_namespace (const UString &a_name);
- bool get_key_value (const UString &a_key, bool &a_value);
- void set_key_value (const UString &a_key, bool a_value);
+ bool get_key_value (const UString &a_key,
+ UString &a_value,
+ const UString &a_namespace);
+ void set_key_value (const UString &a_key,
+ const UString &a_value,
+ const UString &a_namespace);
- bool get_key_value (const UString &a_key, int &a_value);
- void set_key_value (const UString &a_key, int a_value);
+ bool get_key_value (const UString &a_key,
+ bool &a_value,
+ const UString &a_namespace);
+ void set_key_value (const UString &a_key,
+ bool a_value,
+ const UString &a_namespace);
- bool get_key_value (const UString &a_key, double &a_value);
- void set_key_value (const UString &a_key, double a_value);
+ bool get_key_value (const UString &a_key,
+ int &a_value,
+ const UString &a_namespace);
+ void set_key_value (const UString &a_key,
+ int a_value,
+ const UString &a_namespace);
+
+ bool get_key_value (const UString &a_key,
+ double &a_value,
+ const UString &a_namespace);
+ void set_key_value (const UString &a_key,
+ double a_value,
+ const UString &a_namespace);
bool get_key_value (const UString &a_key,
- std::list<UString> &a_value);
+ std::list<UString> &a_value,
+ const UString &a_namespace);
void set_key_value (const UString &a_key,
- const std::list<UString> &a_value);
+ const std::list<UString> &a_value,
+ const UString &a_namespace);
- sigc::signal<void, const UString&, IConfMgr::Value&>& value_changed_signal ();
+ sigc::signal<void,
+ const UString&,
+ const UString&>& value_changed_signal ();
};//end class GCongMgr
@@ -95,32 +117,7 @@ client_notify_func (GConfClient *a_client,
LOG_DD ("key changed: '" << a_key << "'");
-
- IConfMgr::Value value;
- switch (a_value->type) {
- case GCONF_VALUE_STRING:
- value = UString (gconf_value_get_string (a_value));
- LOG_DD ("key value is: '" << boost::get<UString> (value) << "'");
- break;
- case GCONF_VALUE_INT:
- value = gconf_value_get_int (a_value);
- LOG_DD ("key value is: '" << boost::get<int> (value) << "'");
- break;
- case GCONF_VALUE_FLOAT:
- value = gconf_value_get_float (a_value);
- LOG_DD ("key value is: '" << boost::get<double> (value) << "'");
- break;
- case GCONF_VALUE_BOOL:
- value = (bool) gconf_value_get_bool (a_value);
- LOG_DD ("key value is: '" << boost::get<bool> (value) << "'");
- break;
- default:
- LOG_ERROR ("unsupported key type '"
- << (int)a_value->type
- << "'");
- return;
- }
- a_conf_mgr->value_changed_signal ().emit (a_key, value);
+ a_conf_mgr->value_changed_signal ().emit (a_key, "");
NEMIVER_CATCH_NOX
}
@@ -142,34 +139,43 @@ client_notify_add_func (GConfClient *a_client,
a_conf_mgr);
}
+const UString&
+GConfMgr::get_default_namespace () const
+{
+ static UString s_default_ns = CONF_NAMESPACE_NEMIVER;
+ return s_default_ns;
+}
+
void
-GConfMgr::set_key_dir_to_notify (const UString &a_key_dir)
+GConfMgr::register_namespace (const UString &a_name)
{
THROW_IF_FAIL (m_gconf_client);
GError *err=0;
+
+ UString name = a_name;
+ if (name.empty ())
+ name = get_default_namespace ();
+
+ if (name.empty ())
+ return;
+
gconf_client_add_dir (m_gconf_client,
- a_key_dir.c_str (),
+ name.c_str (),
GCONF_CLIENT_PRELOAD_NONE,
&err);
GErrorSafePtr error (err);
THROW_IF_FAIL2 (!error, error->message);
- LOG_DD ("watching key for notification: '" << a_key_dir << "'");
-}
-void
-GConfMgr::add_key_to_notify (const UString &a_key)
-{
- THROW_IF_FAIL (m_gconf_client);
- GError *err=0;
gconf_client_notify_add (m_gconf_client,
- a_key.c_str (),
+ name.c_str (),
(GConfClientNotifyFunc) client_notify_add_func,
this,
NULL,
&err);
- GErrorSafePtr error (err);
+ error.reset (err);
THROW_IF_FAIL2 (!error, error->message);
- LOG_DD ("watching key for notification: '" << a_key << "'");
+
+ LOG_DD ("watching key for notification: '" << name << "'");
}
GConfMgr::GConfMgr (DynamicModule *a_dynmod) :
@@ -190,7 +196,9 @@ GConfMgr::~GConfMgr ()
}
bool
-GConfMgr::get_key_value (const UString &a_key, UString &a_value)
+GConfMgr::get_key_value (const UString &a_key,
+ UString &a_value,
+ const UString &)
{
THROW_IF_FAIL (m_gconf_client);
@@ -208,7 +216,9 @@ GConfMgr::get_key_value (const UString &a_key, UString &a_value)
}
void
-GConfMgr::set_key_value (const UString &a_key, const UString &a_value)
+GConfMgr::set_key_value (const UString &a_key,
+ const UString &a_value,
+ const UString &)
{
THROW_IF_FAIL (m_gconf_client);
GError *err=NULL;
@@ -224,7 +234,9 @@ GConfMgr::set_key_value (const UString &a_key, const UString &a_value)
}
bool
-GConfMgr::get_key_value (const UString &a_key, bool &a_value)
+GConfMgr::get_key_value (const UString &a_key,
+ bool &a_value,
+ const UString &)
{
THROW_IF_FAIL (m_gconf_client);
@@ -242,7 +254,9 @@ GConfMgr::get_key_value (const UString &a_key, bool &a_value)
}
void
-GConfMgr::set_key_value (const UString &a_key, bool a_value)
+GConfMgr::set_key_value (const UString &a_key,
+ bool a_value,
+ const UString &)
{
THROW_IF_FAIL (m_gconf_client);
GError *err=NULL;
@@ -258,7 +272,9 @@ GConfMgr::set_key_value (const UString &a_key, bool a_value)
}
bool
-GConfMgr::get_key_value (const UString &a_key, int &a_value)
+GConfMgr::get_key_value (const UString &a_key,
+ int &a_value,
+ const UString &)
{
THROW_IF_FAIL (m_gconf_client);
@@ -276,7 +292,9 @@ GConfMgr::get_key_value (const UString &a_key, int &a_value)
}
void
-GConfMgr::set_key_value (const UString &a_key, int a_value)
+GConfMgr::set_key_value (const UString &a_key,
+ int a_value,
+ const UString &)
{
THROW_IF_FAIL (m_gconf_client);
GError *err=NULL;
@@ -292,7 +310,9 @@ GConfMgr::set_key_value (const UString &a_key, int a_value)
}
bool
-GConfMgr::get_key_value (const UString &a_key, double &a_value)
+GConfMgr::get_key_value (const UString &a_key,
+ double &a_value,
+ const UString &)
{
THROW_IF_FAIL (m_gconf_client);
@@ -310,7 +330,9 @@ GConfMgr::get_key_value (const UString &a_key, double &a_value)
}
void
-GConfMgr::set_key_value (const UString &a_key, double a_value)
+GConfMgr::set_key_value (const UString &a_key,
+ double a_value,
+ const UString &)
{
THROW_IF_FAIL (m_gconf_client);
GError *err=NULL;
@@ -327,7 +349,8 @@ GConfMgr::set_key_value (const UString &a_key, double a_value)
bool
GConfMgr::get_key_value (const UString &a_key,
- std::list<UString> &a_value)
+ std::list<UString> &a_value,
+ const UString &)
{
bool result=false;
THROW_IF_FAIL (m_gconf_client);
@@ -361,7 +384,8 @@ out:
void
GConfMgr::set_key_value (const UString &a_key,
- const std::list<UString> &a_value)
+ const std::list<UString> &a_value,
+ const UString &)
{
if (a_value.empty ())
return;
@@ -390,7 +414,7 @@ GConfMgr::set_key_value (const UString &a_key,
}
}
-sigc::signal<void, const UString&, IConfMgr::Value&>&
+sigc::signal<void, const UString&, const UString&>&
GConfMgr::value_changed_signal ()
{
return m_value_changed_signal;
diff --git a/src/confmgr/nmv-gsettings-mgr.cc b/src/confmgr/nmv-gsettings-mgr.cc
new file mode 100644
index 0000000..ca664c4
--- /dev/null
+++ b/src/confmgr/nmv-gsettings-mgr.cc
@@ -0,0 +1,335 @@
+// Author: Fabien Parent
+/*
+ *This file is part of the Nemiver project
+ *
+ *Nemiver is free software; you can redistribute
+ *it and/or modify it under the terms of
+ *the GNU General Public License as published by the
+ *Free Software Foundation; either version 2,
+ *or (at your option) any later version.
+ *
+ *Nemiver 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 General Public License for more details.
+ *
+ *You should have received a copy of the
+ *GNU General Public License along with Nemiver;
+ *see the file COPYING.
+ *If not, write to the Free Software Foundation,
+ *Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *See COPYRIGHT file copyright information.
+ */
+#include <giomm/settings.h>
+#include "nmv-i-conf-mgr.h"
+#include "nmv-conf-keys.h"
+
+NEMIVER_BEGIN_NAMESPACE (nemiver)
+
+class GSettingsMgr : public IConfMgr {
+ GSettingsMgr (const GSettingsMgr &);
+ GSettingsMgr& operator= (const GSettingsMgr &);
+
+ typedef std::map<const Glib::ustring, Glib::RefPtr<Gio::Settings> > Settings;
+
+ Settings m_settings;
+ sigc::signal<void, const UString&, const UString&> m_value_changed_signal;
+
+public:
+
+ GSettingsMgr (DynamicModule *a_dynmod);
+ virtual ~GSettingsMgr ();
+
+ const UString& get_default_namespace () const;
+
+ void register_namespace (const UString &a_name);
+
+ bool get_key_value (const UString &a_key,
+ UString &a_value,
+ const UString &a_schema);
+ void set_key_value (const UString &a_key,
+ const UString &a_value,
+ const UString &a_schema);
+
+ bool get_key_value (const UString &a_key,
+ bool &a_value,
+ const UString &a_schema);
+ void set_key_value (const UString &a_key,
+ bool a_value,
+ const UString &a_schema);
+
+ bool get_key_value (const UString &a_key,
+ int &a_value,
+ const UString &a_schema);
+ void set_key_value (const UString &a_key,
+ int a_value,
+ const UString &a_schema);
+
+ bool get_key_value (const UString &a_key,
+ double &a_value,
+ const UString &a_schema);
+ void set_key_value (const UString &a_key,
+ double a_value,
+ const UString &a_schema);
+
+ bool get_key_value (const UString &a_key,
+ std::list<UString> &a_value,
+ const UString &a_schema);
+ void set_key_value (const UString &a_key,
+ const std::list<UString> &a_value,
+ const UString &a_schema);
+
+ sigc::signal<void,
+ const UString&,
+ const UString&>& value_changed_signal ();
+
+};//end class GSettingsMgr
+
+GSettingsMgr::GSettingsMgr (DynamicModule *a_dynmod) :
+ IConfMgr (a_dynmod)
+{
+}
+
+GSettingsMgr::~GSettingsMgr ()
+{
+ LOG_D ("delete", "destructor-domain");
+}
+
+
+const UString&
+GSettingsMgr::get_default_namespace () const
+{
+ static UString s_default_schema_name = CONF_NAMESPACE_NEMIVER;
+ return s_default_schema_name;
+}
+
+void
+GSettingsMgr::register_namespace (const UString &a_name)
+{
+ UString name = a_name;
+ if (name.empty ())
+ name = get_default_namespace ();
+
+ if (name.empty ())
+ return;
+
+ if (m_settings.find (name) != m_settings.end ())
+ // We already have this schema
+ return;
+
+ Glib::RefPtr<Gio::Settings> settings =
+ Gio::Settings::create (name);
+ THROW_IF_FAIL (settings);
+
+ settings->signal_changed ().connect (sigc::bind<const UString&> (
+ sigc::mem_fun (m_value_changed_signal,
+ &sigc::signal<void,
+ const UString&,
+ const UString&>::emit), name));
+
+ THROW_IF_FAIL (m_settings.count (name) == 0);
+ m_settings[name] = settings;
+}
+
+#define ENSURE_NAMESPACE_NOT_EMPTY(ns) \
+ if (ns.empty ()) \
+ ns = get_default_namespace (); \
+ THROW_IF_FAIL (!ns.empty ());
+
+
+bool
+GSettingsMgr::get_key_value (const UString &a_key,
+ UString &a_value,
+ const UString &a_namespace)
+{
+ UString ns = a_namespace;
+ ENSURE_NAMESPACE_NOT_EMPTY (ns);
+
+ Glib::RefPtr<Gio::Settings> settings = m_settings[ns];
+ THROW_IF_FAIL (settings);
+
+ a_value = settings->get_string (a_key);
+ return true;
+}
+
+void
+GSettingsMgr::set_key_value (const UString &a_key,
+ const UString &a_value,
+ const UString &a_namespace)
+{
+ UString ns = a_namespace;
+ ENSURE_NAMESPACE_NOT_EMPTY (ns);
+
+ Glib::RefPtr<Gio::Settings> settings = m_settings[ns];
+ THROW_IF_FAIL (settings);
+
+ settings->set_string (a_key, a_value);
+}
+
+bool
+GSettingsMgr::get_key_value (const UString &a_key,
+ bool &a_value,
+ const UString &a_namespace)
+{
+ UString ns = a_namespace;
+ ENSURE_NAMESPACE_NOT_EMPTY (ns);
+
+ Glib::RefPtr<Gio::Settings> settings = m_settings[ns];
+ THROW_IF_FAIL (settings);
+
+ a_value = settings->get_boolean (a_key);
+ return true;
+}
+
+void
+GSettingsMgr::set_key_value (const UString &a_key,
+ bool a_value,
+ const UString &a_namespace)
+{
+ UString ns = a_namespace;
+ ENSURE_NAMESPACE_NOT_EMPTY (ns);
+
+ Glib::RefPtr<Gio::Settings> settings = m_settings[ns];
+ THROW_IF_FAIL (settings);
+
+ settings->set_boolean (a_key, a_value);
+}
+
+bool
+GSettingsMgr::get_key_value (const UString &a_key,
+ int &a_value,
+ const UString &a_namespace)
+{
+ UString ns = a_namespace;
+ ENSURE_NAMESPACE_NOT_EMPTY (ns);
+
+ Glib::RefPtr<Gio::Settings> settings = m_settings[ns];
+ THROW_IF_FAIL (settings);
+
+ a_value = settings->get_int (a_key);
+ return true;
+}
+
+void
+GSettingsMgr::set_key_value (const UString &a_key,
+ int a_value,
+ const UString &a_namespace)
+{
+ UString ns = a_namespace;
+ ENSURE_NAMESPACE_NOT_EMPTY (ns);
+
+ Glib::RefPtr<Gio::Settings> settings = m_settings[a_namespace];
+ THROW_IF_FAIL (settings);
+
+ settings->set_int (a_key, a_value);
+}
+
+bool
+GSettingsMgr::get_key_value (const UString &a_key,
+ double &a_value,
+ const UString &a_namespace)
+{
+ UString ns = a_namespace;
+ ENSURE_NAMESPACE_NOT_EMPTY (ns);
+
+ Glib::RefPtr<Gio::Settings> settings = m_settings[ns];
+ THROW_IF_FAIL (settings);
+
+ a_value = settings->get_double (a_key);
+ return true;
+}
+
+void
+GSettingsMgr::set_key_value (const UString &a_key,
+ double a_value,
+ const UString &a_namespace)
+{
+ UString ns = a_namespace;
+ ENSURE_NAMESPACE_NOT_EMPTY (ns);
+
+ Glib::RefPtr<Gio::Settings> settings = m_settings[ns];
+ THROW_IF_FAIL (settings);
+
+ settings->set_double (a_key, a_value);
+}
+
+bool
+GSettingsMgr::get_key_value (const UString &a_key,
+ std::list<UString> &a_value,
+ const UString &a_namespace)
+{
+ UString ns = a_namespace;
+ ENSURE_NAMESPACE_NOT_EMPTY (ns);
+
+ Glib::RefPtr<Gio::Settings> settings = m_settings[ns];
+ THROW_IF_FAIL (settings);
+
+ a_value = settings->get_string_array (a_key);
+ return true;
+}
+
+void
+GSettingsMgr::set_key_value (const UString &a_key,
+ const std::list<UString> &a_value,
+ const UString &a_namespace)
+{
+ UString ns = a_namespace;
+ ENSURE_NAMESPACE_NOT_EMPTY (ns);
+
+ if (a_value.empty ())
+ return;
+
+ Glib::RefPtr<Gio::Settings> settings = m_settings[ns];
+ THROW_IF_FAIL (settings);
+
+ settings->set_string_array (a_key, a_value);
+}
+
+sigc::signal<void, const UString&, const UString&>&
+GSettingsMgr::value_changed_signal ()
+{
+ return m_value_changed_signal;
+}
+
+using nemiver::common::DynModIfaceSafePtr;
+class GSettingsMgrModule : public DynamicModule {
+
+public:
+ void get_info (Info &a_info) const
+ {
+ a_info.module_name = "GSettingsMgr";
+ a_info.module_description =
+ "A GSettings implementation of the IConfMgr interface";
+ a_info.module_version = "1.0";
+ }
+
+ /// \brief module init routinr
+ void do_init ()
+ {
+ }
+
+ bool lookup_interface (const std::string &a_iface_name,
+ DynModIfaceSafePtr &a_iface)
+ {
+ if (a_iface_name == "IConfMgr") {
+ a_iface.reset (new GSettingsMgr (this));
+ } else {
+ return false;
+ }
+ return true;
+ }
+};//end class GSettingsMgrModule
+
+NEMIVER_END_NAMESPACE (nemiver)
+
+extern "C" {
+bool
+NEMIVER_API nemiver_common_create_dynamic_module_instance (void **a_new_instance)
+{
+ *a_new_instance = new nemiver::GSettingsMgrModule ();
+ return (*a_new_instance != 0);
+}
+
+}//end extern C
diff --git a/src/confmgr/nmv-i-conf-mgr.h b/src/confmgr/nmv-i-conf-mgr.h
index f7c9f06..e5b37a8 100644
--- a/src/confmgr/nmv-i-conf-mgr.h
+++ b/src/confmgr/nmv-i-conf-mgr.h
@@ -25,6 +25,7 @@
#ifndef __NMV_CONF_MGR_H__
#define __NMV_CONF_MGR_H__
+#include "config.h"
#include <boost/variant.hpp>
#include <list>
#include "common/nmv-dynamic-module.h"
@@ -56,35 +57,85 @@ protected:
public:
- typedef boost::variant<UString, bool, int, double> Value;
-
virtual ~IConfMgr () {}
- virtual void set_key_dir_to_notify (const UString &a_key_dir) = 0;
- virtual void add_key_to_notify (const UString &a_key) = 0;
+ virtual const UString& get_default_namespace () const = 0;
+
+ virtual void register_namespace
+ (const UString &a_namespace = /*default namespace*/"") = 0;
- virtual bool get_key_value (const UString &a_key, UString &a_value) = 0;
- virtual void set_key_value (const UString &a_key, const UString &a_value) = 0;
+ virtual bool get_key_value (const UString &a_key,
+ UString &a_value,
+ const UString &a_namespace = "") = 0;
+ virtual void set_key_value (const UString &a_key,
+ const UString &a_value,
+ const UString &a_namespace = "") = 0;
- virtual bool get_key_value (const UString &a_key, bool &a_value) = 0;
- virtual void set_key_value (const UString &a_key, bool a_value) = 0;
+ virtual bool get_key_value (const UString &a_key,
+ bool &a_value,
+ const UString &a_namespace = "") = 0;
+ virtual void set_key_value (const UString &a_key,
+ bool a_value,
+ const UString &a_namespace = "") = 0;
- virtual bool get_key_value (const UString &a_key, int &a_value) = 0;
- virtual void set_key_value (const UString &a_key, int a_value) = 0;
+ virtual bool get_key_value (const UString &a_key,
+ int &a_value,
+ const UString &a_namespace = "") = 0;
+ virtual void set_key_value (const UString &a_key,
+ int a_value,
+ const UString &a_namespace = "") = 0;
- virtual bool get_key_value (const UString &a_key, double &a_value) = 0;
- virtual void set_key_value (const UString &a_key, double a_value) = 0;
+ virtual bool get_key_value (const UString &a_key,
+ double &a_value,
+ const UString &a_namespace = "") = 0;
+ virtual void set_key_value (const UString &a_key,
+ double a_value,
+ const UString &a_namespace = "") = 0;
virtual bool get_key_value (const UString &a_key,
- std::list<UString> &a_value) = 0;
+ std::list<UString> &a_value,
+ const UString &a_namespace = "") = 0;
virtual void set_key_value (const UString &a_key,
- const std::list<UString> &a_value) = 0;
+ const std::list<UString> &a_value,
+ const UString &a_namespace = "") = 0;
- virtual sigc::signal<void, const UString&, IConfMgr::Value&>&
- value_changed_signal () = 0;
+ virtual sigc::signal<void,
+ const UString&,
+ const UString&>& value_changed_signal () = 0;
};//end class IConfMgr
+template<class T>
+SafePtr<T, ObjectRef, ObjectUnref>
+load_iface_and_confmgr (const UString &a_dynmod_name,
+ const UString &a_iface_name,
+ IConfMgrSafePtr &a_confmgr)
+{
+ typedef SafePtr<T, ObjectRef, ObjectUnref> TSafePtr;
+
+ // Load the confmgr interface
+ a_confmgr =
+ common::DynamicModuleManager::load_iface_with_default_manager<IConfMgr>
+ (CONFIG_MGR_MODULE_NAME, "IConfMgr");
+
+ //Load the IDebugger iterface
+ TSafePtr iface =
+ common::DynamicModuleManager::load_iface_with_default_manager<T>
+ (a_dynmod_name, a_iface_name);
+ THROW_IF_FAIL (iface);
+ return iface;
+}
+
+template<class T>
+SafePtr<T, ObjectRef, ObjectUnref>
+load_iface_and_confmgr (const UString &a_dynmod_name,
+ const UString &a_iface_name)
+{
+ IConfMgrSafePtr m;
+ return load_iface_and_confmgr<T> (a_dynmod_name, a_iface_name, m);
+}
+
+
NEMIVER_END_NAMESPACE(nemiver)
#endif //__NMV_CONF_MGR_H__
diff --git a/src/dbgengine/nmv-debugger-utils.cc b/src/dbgengine/nmv-debugger-utils.cc
index d036060..4e78dd1 100644
--- a/src/dbgengine/nmv-debugger-utils.cc
+++ b/src/dbgengine/nmv-debugger-utils.cc
@@ -126,26 +126,21 @@ dump_variable_value (IDebugger::VariableSafePtr a_var,
}
/// Load the debugger interface using the default
-/// DynamicModuleManager, and initialize it with the gconf
-/// based IConfMgr.
+/// DynamicModuleManager, and initialize it with the configuration
+/// manager.
+///
/// \return the IDebuggerSafePtr
IDebuggerSafePtr
-load_debugger_iface_with_gconf ()
+load_debugger_iface_with_confmgr ()
{
-
- // Load the confmgr interface
- IConfMgrSafePtr conf_mgr =
- common::DynamicModuleManager::load_iface_with_default_manager<IConfMgr>
- ("gconfmgr", "IConfMgr");
-
- // load the IDebugger interface
- IDebuggerSafePtr debugger =
- common::DynamicModuleManager::load_iface_with_default_manager<IDebugger>
- ("gdbengine", "IDebugger");
-
- // Initialize the debugger interface.
- debugger->do_init (conf_mgr);
-
+ IConfMgrSafePtr confmgr;
+
+ IDebuggerSafePtr debugger =
+ load_iface_and_confmgr<IDebugger> ("gdbengine",
+ "IDebugger",
+ confmgr);
+ confmgr->register_namespace (/* default nemiver namespace */);
+ debugger->do_init (confmgr);
return debugger;
}
diff --git a/src/dbgengine/nmv-debugger-utils.h b/src/dbgengine/nmv-debugger-utils.h
index 2ab7814..75026d7 100644
--- a/src/dbgengine/nmv-debugger-utils.h
+++ b/src/dbgengine/nmv-debugger-utils.h
@@ -51,7 +51,7 @@ void dump_variable_value (IDebugger::VariableSafePtr a_var,
int a_indent_num,
std::string &a_out_str);
-IDebuggerSafePtr load_debugger_iface_with_gconf ();
+IDebuggerSafePtr load_debugger_iface_with_confmgr ();
NEMIVER_END_NAMESPACE (debugger_utils)
NEMIVER_END_NAMESPACE (nemiver)
diff --git a/src/dbgengine/nmv-gdb-engine.cc b/src/dbgengine/nmv-gdb-engine.cc
index a9d1326..3f7b184 100644
--- a/src/dbgengine/nmv-gdb-engine.cc
+++ b/src/dbgengine/nmv-gdb-engine.cc
@@ -1057,12 +1057,12 @@ public:
}
void on_conf_key_changed_signal (const UString &a_key,
- IConfMgr::Value &a_value)
+ const UString &a_namespace)
{
NEMIVER_TRY
- if (a_key == CONF_KEY_FOLLOW_FORK_MODE) {
- follow_fork_mode = boost::get<UString> (a_value).raw ();
+ if (a_key == CONF_KEY_FOLLOW_FORK_MODE
+ && conf_mgr->get_key_value (a_key, follow_fork_mode, a_namespace)) {
set_debugger_parameter ("follow-fork-mode", follow_fork_mode);
}
diff --git a/src/main.cc b/src/main.cc
index 305a9d0..ec09d2e 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -22,6 +22,7 @@
*
*See COPYRIGHT file copyright information.
*/
+#include "config.h"
#include <signal.h>
#include <unistd.h>
#include <iostream>
@@ -35,9 +36,10 @@
#include "nmv-proc-mgr.h"
#include "nmv-env.h"
#include "nmv-dbg-perspective.h"
-#include "config.h"
+#include "nmv-i-conf-mgr.h"
using namespace std;
+using nemiver::IConfMgr;
using nemiver::common::DynamicModuleManager;
using nemiver::common::Initializer;
using nemiver::IWorkbench;
@@ -606,9 +608,9 @@ main (int a_argc, char *a_argv[])
//********************************************
//load and init the workbench dynamic module
//********************************************
- DynamicModuleManager module_manager;
IWorkbenchSafePtr workbench =
- module_manager.load_iface<IWorkbench> ("workbench", "IWorkbench");
+ nemiver::load_iface_and_confmgr<IWorkbench> ("workbench",
+ "IWorkbench");
s_workbench = workbench.get ();
THROW_IF_FAIL (s_workbench);
LOG_D ("workbench refcount: " << (int) s_workbench->get_refcount (),
diff --git a/src/persp/dbgperspective/Makefile.am b/src/persp/dbgperspective/Makefile.am
index 12bf939..75f7690 100644
--- a/src/persp/dbgperspective/Makefile.am
+++ b/src/persp/dbgperspective/Makefile.am
@@ -1,14 +1,4 @@
-SUBDIRS=ui menus icons sqlscripts schemas
-
-install-data-local: install-schemas
-
-uninstall-local: uninstall-schemas
-
-install-schemas:
- $(MAKE) -C schemas $(AM_MAKEFLAGS) install-schemas
-
-uninstall-schemas:
- $(MAKE) -C schemas $(AM_MAKEFLAGS) uninstall-schemas
+SUBDIRS=ui menus icons sqlscripts
h=$(abs_srcdir)
diff --git a/src/persp/dbgperspective/nmv-call-stack.cc b/src/persp/dbgperspective/nmv-call-stack.cc
index aa9e429..e8ef2d4 100644
--- a/src/persp/dbgperspective/nmv-call-stack.cc
+++ b/src/persp/dbgperspective/nmv-call-stack.cc
@@ -32,6 +32,7 @@
#include "nmv-ui-utils.h"
#include "nmv-i-workbench.h"
#include "nmv-i-perspective.h"
+#include "nmv-conf-keys.h"
namespace nemiver {
@@ -97,8 +98,6 @@ columns ()
return s_cols;
}
-static const char* CONF_KEY_NEMIVER_CALLSTACK_EXPANSION_CHUNK =
- "/apps/nemiver/dbgperspective/callstack-expansion-chunk";
static const char* COOKIE_CALL_STACK_IN_FRAME_PAGING_TRANS =
"cookie-call-stack-in-frame-paging-trans";
@@ -107,6 +106,7 @@ typedef map<int, list<IDebugger::VariableSafePtr> > FrameArgsMap;
typedef map<int, IDebugger::Frame> LevelFrameMap;
struct CallStack::Priv {
IDebuggerSafePtr debugger;
+ IConfMgrSafePtr conf_mgr;
IWorkbench& workbench;
IPerspective& perspective;
FrameArray frames;
@@ -131,6 +131,7 @@ struct CallStack::Priv {
IWorkbench& a_workbench,
IPerspective& a_perspective) :
debugger (a_dbg),
+ conf_mgr (0),
workbench (a_workbench),
perspective (a_perspective),
callstack_menu (0),
@@ -149,7 +150,7 @@ struct CallStack::Priv {
void init_conf ()
{
- IConfMgrSafePtr conf_mgr = workbench.get_configuration_manager ();
+ conf_mgr = workbench.get_configuration_manager ();
if (!conf_mgr)
return;
@@ -159,8 +160,6 @@ struct CallStack::Priv {
if (chunk) {
nb_frames_expansion_chunk = chunk;
}
- conf_mgr->add_key_to_notify
- (CONF_KEY_NEMIVER_CALLSTACK_EXPANSION_CHUNK);
conf_mgr->value_changed_signal ().connect
(sigc::mem_fun (*this, &Priv::on_config_value_changed_signal));
}
@@ -439,13 +438,21 @@ struct CallStack::Priv {
}
void on_config_value_changed_signal (const UString &a_key,
- IConfMgr::Value &a_val)
+ const UString &a_namespace)
{
LOG_FUNCTION_SCOPE_NORMAL_DD;
+ if (!conf_mgr) {
+ return;
+ }
+
LOG_DD ("key " << a_key << " changed");
if (a_key == CONF_KEY_NEMIVER_CALLSTACK_EXPANSION_CHUNK) {
- nb_frames_expansion_chunk = boost::get<int> (a_val);
+ int chunk = 0;
+ conf_mgr->get_key_value (a_key, chunk, a_namespace);
+ if (chunk) {
+ nb_frames_expansion_chunk = chunk;
+ }
}
}
diff --git a/src/persp/dbgperspective/nmv-dbg-perspective.cc b/src/persp/dbgperspective/nmv-dbg-perspective.cc
index c4b2538..88ef7d0 100644
--- a/src/persp/dbgperspective/nmv-dbg-perspective.cc
+++ b/src/persp/dbgperspective/nmv-dbg-perspective.cc
@@ -308,7 +308,7 @@ private:
void on_show_log_view_changed_signal (bool);
void on_conf_key_changed_signal (const UString &a_key,
- IConfMgr::Value &a_value);
+ const UString &a_namespace);
void on_debugger_connected_to_remote_target_signal ();
@@ -2304,31 +2304,46 @@ DBGPerspective::on_show_log_view_changed_signal (bool a_show)
void
DBGPerspective::on_conf_key_changed_signal (const UString &a_key,
- IConfMgr::Value &a_value)
+ const UString &a_namespace)
{
LOG_FUNCTION_SCOPE_NORMAL_DD;
- NEMIVER_TRY
+
+ NEMIVER_TRY;
+
+
+ IConfMgr &conf_mgr = get_conf_mgr ();
+
if (a_key == CONF_KEY_NEMIVER_SOURCE_DIRS) {
LOG_DD ("updated key source-dirs");
- m_priv->global_search_paths = boost::get<UString> (a_value).split_to_list (":");
+ UString global_search_paths;
+ conf_mgr.get_key_value (a_key, global_search_paths, a_namespace);
+ m_priv->global_search_paths = global_search_paths.split_to_list (":");
} else if (a_key == CONF_KEY_SHOW_DBG_ERROR_DIALOGS) {
- m_priv->show_dbg_errors = boost::get<bool> (a_value);
+ conf_mgr.get_key_value (a_key, m_priv->show_dbg_errors, a_namespace);
} else if (a_key == CONF_KEY_SHOW_SOURCE_LINE_NUMBERS) {
map<int, SourceEditor*>::iterator it;
+ bool show_line_numbers = false;
+ conf_mgr.get_key_value (a_key, show_line_numbers, a_namespace);
for (it = m_priv->pagenum_2_source_editor_map.begin ();
it != m_priv->pagenum_2_source_editor_map.end ();
++it) {
if (it->second) {
it->second->source_view ().set_show_line_numbers
- (boost::get<bool> (a_value));
+ (show_line_numbers);
}
}
} else if (a_key == CONF_KEY_CONFIRM_BEFORE_RELOAD_SOURCE) {
- m_priv->confirm_before_reload_source = boost::get<bool> (a_value);
+ conf_mgr.get_key_value (a_key,
+ m_priv->confirm_before_reload_source,
+ a_namespace);
} else if (a_key == CONF_KEY_ALLOW_AUTO_RELOAD_SOURCE) {
- m_priv->allow_auto_reload_source = boost::get<bool> (a_value);
+ conf_mgr.get_key_value (a_key,
+ m_priv->allow_auto_reload_source,
+ a_namespace);
} else if (a_key == CONF_KEY_HIGHLIGHT_SOURCE_CODE) {
map<int, SourceEditor*>::iterator it;
+ bool highlight = false;
+ conf_mgr.get_key_value (a_key, highlight, a_namespace);
for (it = m_priv->pagenum_2_source_editor_map.begin ();
it != m_priv->pagenum_2_source_editor_map.end ();
++it) {
@@ -2339,11 +2354,11 @@ DBGPerspective::on_conf_key_changed_signal (const UString &a_key,
#else
it->second->source_view ().get_source_buffer ()->set_highlight
#endif // WITH_SOURCEVIEWMM2
- (boost::get<bool> (a_value));
+ (highlight);
}
}
} else if (a_key == CONF_KEY_USE_SYSTEM_FONT) {
- m_priv->use_system_font = boost::get<bool> (a_value);
+ conf_mgr.get_key_value (a_key, m_priv->use_system_font, a_namespace);
UString font_name;
if (m_priv->use_system_font) {
font_name = m_priv->system_font_name;
@@ -2353,24 +2368,27 @@ DBGPerspective::on_conf_key_changed_signal (const UString &a_key,
if (!font_name.empty ())
m_priv->modify_source_editor_fonts (font_name);
} else if (a_key == CONF_KEY_CUSTOM_FONT_NAME) {
- m_priv->custom_font_name = boost::get<UString> (a_value);
+ conf_mgr.get_key_value (a_key, m_priv->custom_font_name, a_namespace);
if (!m_priv->use_system_font && !m_priv->custom_font_name.empty ()) {
m_priv->modify_source_editor_fonts (m_priv->custom_font_name);
}
} else if (a_key == CONF_KEY_SYSTEM_FONT_NAME) {
// keep a cached copy of the system fixed-width font
- m_priv->system_font_name = boost::get<UString> (a_value);
+ conf_mgr.get_key_value (a_key, m_priv->system_font_name, a_namespace);
if (m_priv->use_system_font && !m_priv->system_font_name.empty ()) {
m_priv->modify_source_editor_fonts (m_priv->system_font_name);
}
} else if (a_key == CONF_KEY_USE_LAUNCH_TERMINAL) {
- m_priv->use_launch_terminal = boost::get<bool> (a_value);
+ conf_mgr.get_key_value (a_key,
+ m_priv->use_launch_terminal,
+ a_namespace);
if (m_priv->debugger_engine_alive) {
debugger ()->set_tty_path (get_terminal_name ());
}
#ifdef WITH_SOURCEVIEWMM2
} else if (a_key == CONF_KEY_EDITOR_STYLE_SCHEME) {
- UString style_id = boost::get<UString> (a_value);
+ UString style_id;
+ conf_mgr.get_key_value (a_key, style_id, a_namespace);
if (!style_id.empty ()) {
m_priv->editor_style =
gtksourceview::SourceStyleSchemeManager::get_default
@@ -2381,13 +2399,17 @@ DBGPerspective::on_conf_key_changed_signal (const UString &a_key,
#endif // WITH_SOURCEVIEWMM2
else if (a_key == CONF_KEY_DEFAULT_NUM_ASM_INSTRS) {
// m_priv->num_instr_to_disassemble must never be NULL!
- int val = boost::get<int> (a_value);
+ int val = 0;
+ conf_mgr.get_key_value (a_key, val, a_namespace);
if (val != 0)
m_priv->num_instr_to_disassemble = val;
} else if (a_key == CONF_KEY_ASM_STYLE_PURE) {
- m_priv->asm_style_pure = boost::get<bool> (a_value);
+ conf_mgr.get_key_value (a_key,
+ m_priv->asm_style_pure,
+ a_namespace);
}
- NEMIVER_CATCH
+
+ NEMIVER_CATCH;
}
void
@@ -4942,7 +4964,8 @@ DBGPerspective::read_default_config ()
conf_mgr.get_key_value (CONF_KEY_CUSTOM_FONT_NAME,
m_priv->custom_font_name);
conf_mgr.get_key_value (CONF_KEY_SYSTEM_FONT_NAME,
- m_priv->system_font_name);
+ m_priv->system_font_name,
+ CONF_NAMESPACE_DESKTOP_INTERFACE);
conf_mgr.get_key_value (CONF_KEY_USE_LAUNCH_TERMINAL,
m_priv->use_launch_terminal);
conf_mgr.get_key_value (CONF_KEY_DEFAULT_NUM_ASM_INSTRS,
diff --git a/src/workbench/Makefile.am b/src/workbench/Makefile.am
index 73689ca..a2b308a 100644
--- a/src/workbench/Makefile.am
+++ b/src/workbench/Makefile.am
@@ -1,15 +1,3 @@
-SUBDIRS=schemas
-
-install-data-local: install-schemas
-
-uninstall-local: uninstall-schemas
-
-install-schemas:
- $(MAKE) -C schemas $(AM_MAKEFLAGS) install-schemas
-
-uninstall-schemas:
- $(MAKE) -C schemas $(AM_MAKEFLAGS) uninstall-schemas
-
workbenchmod_LTLIBRARIES=libworkbenchmod.la
workbenchmoddir= NEMIVER_MODULES_DIR@
diff --git a/src/workbench/nmv-workbench.cc b/src/workbench/nmv-workbench.cc
index 733d6a6..b0d9755 100644
--- a/src/workbench/nmv-workbench.cc
+++ b/src/workbench/nmv-workbench.cc
@@ -41,6 +41,7 @@
#include "nmv-i-workbench.h"
#include "nmv-i-perspective.h"
#include "nmv-i-conf-mgr.h"
+#include "nmv-conf-keys.h"
using namespace std;
using namespace nemiver;
@@ -53,22 +54,6 @@ using namespace nemiver::common;
NEMIVER_BEGIN_NAMESPACE (nemiver)
-static const UString CONF_KEY_NEMIVER_WINDOW_WIDTH =
- "/apps/nemiver/workbench/window-width";
-static const UString CONF_KEY_NEMIVER_WINDOW_HEIGHT =
- "/apps/nemiver/workbench/window-height";
-static const UString CONF_KEY_NEMIVER_WINDOW_POSITION_X =
- "/apps/nemiver/workbench/window-position-x";
-static const UString CONF_KEY_NEMIVER_WINDOW_POSITION_Y =
- "/apps/nemiver/workbench/window-position-y";
-static const UString CONF_KEY_NEMIVER_WINDOW_MAXIMIZED =
- "/apps/nemiver/workbench/window-maximized";
-static const UString CONF_KEY_NEMIVER_WINDOW_MINIMUM_WIDTH=
- "/apps/nemiver/workbench/window-minimum-width";
-static const UString CONF_KEY_NEMIVER_WINDOW_MINIMUM_HEIGHT=
- "/apps/nemiver/workbench/window-minimum-height";
-
-
class WorkbenchStaticInit {
WorkbenchStaticInit ()
{
@@ -532,23 +517,17 @@ Workbench::get_configuration_manager ()
{
THROW_IF_FAIL (m_priv);
if (!m_priv->conf_mgr) {
- DynamicModule::Loader *loader =
- get_dynamic_module ().get_module_loader ();
- THROW_IF_FAIL (loader);
- DynamicModuleManager *dynmod_manager =
- loader->get_dynamic_module_manager ();
- THROW_IF_FAIL (dynmod_manager);
+ m_priv->conf_mgr =
+ DynamicModuleManager::load_iface_with_default_manager<IConfMgr>
+ (CONFIG_MGR_MODULE_NAME, "IConfMgr");
- m_priv->conf_mgr = dynmod_manager->load_iface <IConfMgr> ("gconfmgr",
- "IConfMgr");
- NEMIVER_TRY
+ NEMIVER_TRY;
- m_priv->conf_mgr->set_key_dir_to_notify ("/apps/nemiver");
- m_priv->conf_mgr->add_key_to_notify (
- "/desktop/gnome/interface/monospace_font_name");
+ m_priv->conf_mgr->register_namespace (/*default nemiver namespace*/);
+ m_priv->conf_mgr->register_namespace (CONF_NAMESPACE_DESKTOP_INTERFACE);
- NEMIVER_CATCH_NOX
+ NEMIVER_CATCH_NOX;
}
THROW_IF_FAIL (m_priv->conf_mgr);
return m_priv->conf_mgr;
diff --git a/tests/test-breakpoint.cc b/tests/test-breakpoint.cc
index 2ad77c0..43d6b1e 100644
--- a/tests/test-breakpoint.cc
+++ b/tests/test-breakpoint.cc
@@ -202,7 +202,7 @@ test_main (int argc, char *argv[])
THROW_IF_FAIL (loop);
IDebuggerSafePtr debugger =
- debugger_utils::load_debugger_iface_with_gconf ();
+ debugger_utils::load_debugger_iface_with_confmgr ();
debugger->set_event_loop_context (loop->get_context ());
diff --git a/tests/test-cpptrait.cc b/tests/test-cpptrait.cc
index 24aeaa8..ad3157f 100644
--- a/tests/test-cpptrait.cc
+++ b/tests/test-cpptrait.cc
@@ -46,7 +46,7 @@ void test_debugger ()
using nemiver::IDebugger;
using nemiver::IDebuggerSafePtr;
IDebuggerSafePtr debugger =
- nemiver::debugger_utils::load_debugger_iface_with_gconf ();
+ nemiver::debugger_utils::load_debugger_iface_with_confmgr ();
BOOST_REQUIRE (debugger);
ILangTrait &trait = debugger->get_language_trait ();
BOOST_REQUIRE (trait.get_name () == "cpptrait");
diff --git a/tests/test-deref.cc b/tests/test-deref.cc
index 2edbcc3..42bed9e 100644
--- a/tests/test-deref.cc
+++ b/tests/test-deref.cc
@@ -136,7 +136,7 @@ test_main (int argc, char **argv)
BOOST_REQUIRE (loop);
IDebuggerSafePtr debugger =
- debugger_utils::load_debugger_iface_with_gconf ();
+ debugger_utils::load_debugger_iface_with_confmgr ();
//setup the debugger with the glib mainloop
debugger->set_event_loop_context (Glib::MainContext::get_default ());
diff --git a/tests/test-disassemble.cc b/tests/test-disassemble.cc
index e21e507..5e605a9 100644
--- a/tests/test-disassemble.cc
+++ b/tests/test-disassemble.cc
@@ -139,7 +139,7 @@ test_main (int, char**)
THROW_IF_FAIL (loop);
- debugger = debugger_utils::load_debugger_iface_with_gconf ();
+ debugger = debugger_utils::load_debugger_iface_with_confmgr ();
debugger->set_event_loop_context (loop->get_context ());
diff --git a/tests/test-global-variables.cc b/tests/test-global-variables.cc
index c832626..0d686c9 100644
--- a/tests/test-global-variables.cc
+++ b/tests/test-global-variables.cc
@@ -6,6 +6,7 @@
#include "common/nmv-initializer.h"
#include "common/nmv-exception.h"
#include "nmv-i-var-list-walker.h"
+#include "nmv-debugger-utils.h"
using namespace nemiver;
using namespace nemiver::common;
@@ -201,12 +202,10 @@ test_main (int argc, char **argv)
Initializer::do_init ();
-
//load the IDebugger interface
IDebuggerSafePtr debugger =
- DynamicModuleManager::load_iface_with_default_manager<IDebugger>
- ("gdbengine",
- "IDebugger");
+ debugger_utils::load_debugger_iface_with_confmgr ();
+
//setup the debugger with the glib mainloop
debugger->set_event_loop_context (Glib::MainContext::get_default ());
diff --git a/tests/test-local-vars-list.cc b/tests/test-local-vars-list.cc
index faf185d..33b613f 100644
--- a/tests/test-local-vars-list.cc
+++ b/tests/test-local-vars-list.cc
@@ -133,7 +133,7 @@ test_main (int argc, char **argv)
//load the IDebugger interface
debugger =
- debugger_utils::load_debugger_iface_with_gconf ();
+ debugger_utils::load_debugger_iface_with_confmgr ();
//setup the debugger with the glib mainloop
debugger->set_event_loop_context (Glib::MainContext::get_default ());
diff --git a/tests/test-overloads.cc b/tests/test-overloads.cc
index 7cc81da..1636e07 100644
--- a/tests/test-overloads.cc
+++ b/tests/test-overloads.cc
@@ -3,7 +3,7 @@
#include <glibmm.h>
#include "common/nmv-initializer.h"
#include "common/nmv-safe-ptr-utils.h"
-#include "nmv-i-debugger.h"
+#include "nmv-debugger-utils.h"
using namespace nemiver;
using namespace nemiver::common;
@@ -113,9 +113,8 @@ test_main (int argc, char *argv[])
THROW_IF_FAIL (loop);
- DynamicModuleManager module_manager;
IDebuggerSafePtr debugger =
- module_manager.load_iface<IDebugger> ("gdbengine", "IDebugger");
+ debugger_utils::load_debugger_iface_with_confmgr ();
debugger->set_event_loop_context (loop->get_context ());
diff --git a/tests/test-types.cc b/tests/test-types.cc
index 0e0d0be..b2876ac 100644
--- a/tests/test-types.cc
+++ b/tests/test-types.cc
@@ -79,7 +79,7 @@ test_main (int, char **)
THROW_IF_FAIL (loop);
IDebuggerSafePtr debugger =
- debugger_utils::load_debugger_iface_with_gconf ();
+ debugger_utils::load_debugger_iface_with_confmgr ();
debugger->set_event_loop_context (loop->get_context ());
diff --git a/tests/test-var-list.cc b/tests/test-var-list.cc
index 5e9ac13..adf905c 100644
--- a/tests/test-var-list.cc
+++ b/tests/test-var-list.cc
@@ -199,7 +199,7 @@ test_main (int argc, char **argv)
//load the IDebugger interface
IDebuggerSafePtr debugger =
- debugger_utils::load_debugger_iface_with_gconf ();
+ debugger_utils::load_debugger_iface_with_confmgr ();
//setup the debugger with the glib mainloop
debugger->set_event_loop_context (Glib::MainContext::get_default ());
diff --git a/tests/test-var-path-expr.cc b/tests/test-var-path-expr.cc
index 870d694..df84727 100644
--- a/tests/test-var-path-expr.cc
+++ b/tests/test-var-path-expr.cc
@@ -120,7 +120,7 @@ test_main (int argc, char *argv[])
THROW_IF_FAIL (loop);
IDebuggerSafePtr debugger =
- debugger_utils::load_debugger_iface_with_gconf ();
+ debugger_utils::load_debugger_iface_with_confmgr ();
debugger->set_event_loop_context (loop->get_context ());
diff --git a/tests/test-var-walker.cc b/tests/test-var-walker.cc
index 22c91a0..8c52996 100644
--- a/tests/test-var-walker.cc
+++ b/tests/test-var-walker.cc
@@ -187,7 +187,7 @@ test_main (int argc, char **argv)
//load the IDebugger interface
IDebuggerSafePtr debugger =
- debugger_utils::load_debugger_iface_with_gconf ();
+ debugger_utils::load_debugger_iface_with_confmgr ();
//setup the debugger with the glib mainloop
debugger->set_event_loop_context (Glib::MainContext::get_default ());
diff --git a/tests/test-varobj-walker.cc b/tests/test-varobj-walker.cc
index 05724a8..0b64caa 100644
--- a/tests/test-varobj-walker.cc
+++ b/tests/test-varobj-walker.cc
@@ -153,7 +153,7 @@ test_main (int, char **)
// load the IDebugger interface
IDebuggerSafePtr debugger =
- debugger_utils::load_debugger_iface_with_gconf ();
+ debugger_utils::load_debugger_iface_with_confmgr ();
// setup the debugger with the glib mainloop
debugger->set_event_loop_context (Glib::MainContext::get_default ());
diff --git a/tests/test-vars.cc b/tests/test-vars.cc
index 11e1285..a45e312 100644
--- a/tests/test-vars.cc
+++ b/tests/test-vars.cc
@@ -242,15 +242,14 @@ on_stopped_signal (IDebugger::StopReason /*a_reason*/,
}
NEMIVER_API int
-test_main (int argc __attribute__((unused)),
- char **argv __attribute__ ((unused)))
+test_main (int, char **)
{
NEMIVER_TRY;
Initializer::do_init ();
IDebuggerSafePtr debugger =
- debugger_utils::load_debugger_iface_with_gconf ();
+ debugger_utils::load_debugger_iface_with_confmgr ();
// setup the debugger with the glib mainloop
debugger->set_event_loop_context (Glib::MainContext::get_default ());
diff --git a/tests/test-watchpoint.cc b/tests/test-watchpoint.cc
index c3e8785..845c620 100644
--- a/tests/test-watchpoint.cc
+++ b/tests/test-watchpoint.cc
@@ -82,7 +82,7 @@ test_main (int, char **)
THROW_IF_FAIL (loop);
IDebuggerSafePtr debugger =
- debugger_utils::load_debugger_iface_with_gconf ();
+ debugger_utils::load_debugger_iface_with_confmgr ();
debugger->set_event_loop_context (loop->get_context ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]