[nemiver] Add a GSettings implementation for IConfMgr
- From: Dodji Seketeli <dodji src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nemiver] Add a GSettings implementation for IConfMgr
- Date: Mon, 4 Apr 2011 12:55:01 +0000 (UTC)
commit f3b5b0275fbe00b958bb7c2bb29ab71ae53383d4
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.
configure.ac | 62 ++++-
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-keys-defs.cc | 73 +++++
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 | 50 ++-
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, 1032 insertions(+), 276 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index bdd0928..c1e78b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,6 +64,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.
@@ -195,6 +199,28 @@ 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); 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 *******************************
@@ -206,7 +232,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.
@@ -242,11 +267,31 @@ 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
+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 \
@@ -395,10 +440,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
@@ -407,7 +452,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
@@ -416,6 +460,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
@@ -447,6 +494,7 @@ AC_MSG_NOTICE([
Enable verbose debug messages : ${ENABLE_DEBUG}
Enable workbench : ${ENABLE_WORKBENCH}
Enable memory view : ${ENABLE_MEMORYVIEW} (requires gtkhex > $GTKHEX_VERSION)
+ 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-keys-defs.cc b/src/confmgr/nmv-gsettings-keys-defs.cc
new file mode 100644
index 0000000..6017f5f
--- /dev/null
+++ b/src/confmgr/nmv-gsettings-keys-defs.cc
@@ -0,0 +1,73 @@
+// 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 "config.h"
+#include "nmv-conf-keys.h"
+
+NEMIVER_BEGIN_NAMESPACE (nemiver)
+
+const char* CONF_NAMESPACE_NEMIVER = "org.nemiver";
+
+const char* CONF_NAMESPACE_DESKTOP_INTERFACE = "org.gnome.desktop.interface";
+
+const char* CONF_KEY_SYSTEM_FONT_NAME = "monospace-font-name";
+
+/* dbgperspective */
+const char* CONF_KEY_NEMIVER_SOURCE_DIRS = "source-search-dirs";
+const char* CONF_KEY_SHOW_DBG_ERROR_DIALOGS = "show-dbg-error-dialogs";
+const char* CONF_KEY_SHOW_SOURCE_LINE_NUMBERS = "show-source-line-numbers";
+const char* CONF_KEY_CONFIRM_BEFORE_RELOAD_SOURCE =
+ "confirm-before-reload-source";
+const char* CONF_KEY_ALLOW_AUTO_RELOAD_SOURCE = "allow-auto-reload-source";
+const char* CONF_KEY_HIGHLIGHT_SOURCE_CODE = "highlight-source-code";
+const char* CONF_KEY_SOURCE_FILE_ENCODING_LIST = "source-file-encoding-list";
+const char* CONF_KEY_USE_SYSTEM_FONT = "use-system-font";
+const char* CONF_KEY_CUSTOM_FONT_NAME = "custom-font-name";
+const char* CONF_KEY_USE_LAUNCH_TERMINAL = "use-launch-terminal";
+const char* CONF_KEY_STATUS_WIDGET_MINIMUM_WIDTH =
+ "status-widget-minimum-width";
+const char* CONF_KEY_STATUS_WIDGET_MINIMUM_HEIGHT =
+ "status-widget-minimum-height";
+const char* CONF_KEY_STATUS_PANE_LOCATION = "status-pane-location";
+const char* CONF_KEY_DEBUGGER_ENGINE_DYNMOD_NAME = "debugger-engine-dynmod";
+const char* CONF_KEY_EDITOR_STYLE_SCHEME = "editor-style-scheme";
+const char* CONF_KEY_ASM_STYLE_PURE = "asm-style-pure";
+const char* CONF_KEY_DEFAULT_NUM_ASM_INSTRS = "default-num-asm-instrs";
+const char* CONF_KEY_GDB_BINARY = "gdb-binary";
+const char* CONF_KEY_FOLLOW_FORK_MODE = "follow-fork-mode";
+const char* CONF_KEY_CONTEXT_PANE_LOCATION = "context-pane-location";
+const char* CONF_KEY_NEMIVER_CALLSTACK_EXPANSION_CHUNK =
+ "callstack-expansion-chunk";
+
+
+/* Workbench */
+const char* CONF_KEY_NEMIVER_WINDOW_WIDTH = "window-width";
+const char* CONF_KEY_NEMIVER_WINDOW_HEIGHT = "window-height";
+const char* CONF_KEY_NEMIVER_WINDOW_POSITION_X = "window-position-x";
+const char* CONF_KEY_NEMIVER_WINDOW_POSITION_Y = "window-position-y";
+const char* CONF_KEY_NEMIVER_WINDOW_MAXIMIZED = "window-maximized";
+const char* CONF_KEY_NEMIVER_WINDOW_MINIMUM_WIDTH = "window-minimum-width";
+const char* CONF_KEY_NEMIVER_WINDOW_MINIMUM_HEIGHT = "window-minimum-height";
+
+NEMIVER_END_NAMESPACE (nemiver)
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 a934bc3..d2729df 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 bcbda7e..a9ffc58 100644
--- a/src/persp/dbgperspective/nmv-dbg-perspective.cc
+++ b/src/persp/dbgperspective/nmv-dbg-perspective.cc
@@ -278,7 +278,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 ();
@@ -2218,42 +2218,55 @@ 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
+
+ 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) {
if (it->second && it->second->source_view ().get_buffer ()) {
it->second->source_view ().get_source_buffer
()->set_highlight_syntax
- (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;
@@ -2263,23 +2276,24 @@ 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 ());
}
} 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
@@ -2288,11 +2302,14 @@ DBGPerspective::on_conf_key_changed_signal (const UString &a_key,
}
} 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
}
@@ -4819,7 +4836,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 73444ba..85354c4 100644
--- a/src/workbench/nmv-workbench.cc
+++ b/src/workbench/nmv-workbench.cc
@@ -37,6 +37,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;
@@ -49,22 +50,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 ()
{
@@ -521,23 +506,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]