[Xfce4-commits] r30376 - in xfc/trunk: . debian docs/reference examples/ui/printing libXFCcore/xfc/glib libXFCde libXFCde/xfc libXFCde/xfc/panel libXFCde/xfc/ui libXFCde/xfc/utils
Bo Lorentsen
bl at xfce.org
Wed Jul 22 10:13:16 CEST 2009
Author: bl
Date: 2009-07-22 08:13:15 +0000 (Wed, 22 Jul 2009)
New Revision: 30376
Added:
xfc/trunk/libXFCde/Makefile.am
xfc/trunk/libXFCde/xfc/Makefile.am
xfc/trunk/libXFCde/xfc/panel/Makefile.am
xfc/trunk/libXFCde/xfc/ui/
xfc/trunk/libXFCde/xfc/ui/Makefile.am
xfc/trunk/libXFCde/xfc/utils/
xfc/trunk/libXFCde/xfc/utils/Makefile.am
xfc/trunk/libXFCde/xfc/utils/config.cc
xfc/trunk/libXFCde/xfc/utils/config.hh
xfc/trunk/libXFCde/xfcde-4.3.pc.in
Removed:
xfc/trunk/examples/ui/printing/Makefile
Modified:
xfc/trunk/Makefile.am
xfc/trunk/configure.ac
xfc/trunk/debian/control
xfc/trunk/docs/reference/Doxyfile.in
xfc/trunk/libXFCcore/xfc/glib/error.cc
xfc/trunk/libXFCcore/xfc/glib/error.hh
xfc/trunk/xfc-config.h.in
Log:
first xfconf atempt
Modified: xfc/trunk/Makefile.am
===================================================================
--- xfc/trunk/Makefile.am 2009-07-21 23:41:16 UTC (rev 30375)
+++ xfc/trunk/Makefile.am 2009-07-22 08:13:15 UTC (rev 30376)
@@ -1,8 +1,8 @@
## top directory
-SUBDIRS = @DOCS_SUBDIR@ libXFCcore libXFCui @SOURCEVIEW_SUBDIR@ @GLADE_SUBDIR@ @DEMOS_SUBDIR@ @EXAMPLES_SUBDIR@
+SUBDIRS = @DOCS_SUBDIR@ libXFCcore libXFCui @SOURCEVIEW_SUBDIR@ @GLADE_SUBDIR@ @DEMOS_SUBDIR@ @EXAMPLES_SUBDIR@ @DE_SUBDIR@
-DIST_SUBDIRS = docs libXFCcore libXFCui libXFCglade libXFCsourceview demos examples
+DIST_SUBDIRS = docs libXFCcore libXFCui libXFCglade libXFCsourceview libXFCde demos examples
EXTRA_DIST = autogen.sh xfc.spec xfc-config.h.in
@@ -23,4 +23,4 @@
DISTCHECK_CONFIGURE_FLAGS = \
--disable-debug \
- --enable-docs
\ No newline at end of file
+ --enable-docs
Modified: xfc/trunk/configure.ac
===================================================================
--- xfc/trunk/configure.ac 2009-07-21 23:41:16 UTC (rev 30375)
+++ xfc/trunk/configure.ac 2009-07-22 08:13:15 UTC (rev 30376)
@@ -26,9 +26,11 @@
m4_define([unixprint_required_version], [2.10.0])
m4_define([glade_required_version], [2.4.0])
m4_define([gtksourceview_required_version], [0.21.0])
+m4_define([xfcegui_required_version], [4.6.0])
+m4_define([xfcepanel_required_version], [4.6.0])
+m4_define([xfceutil_required_version], [4.6.0])
+m4_define([xfceconf_required_version], [4.6.0])
-m4_define([xfce_panel_required_version], [0.22])
-
dnl --------------------------------------------------------------
dnl Initialization macros.
dnl --------------------------------------------------------------
@@ -54,6 +56,7 @@
XFC_UI_LIBRARY_NAME=xfcui
XFC_GLADE_LIBRARY_NAME=xfcglade
XFC_SOURCEVIEW_LIBRARY_NAME=xfcsourceview
+XFC_DE_LIBRARY_NAME=xfcde
XFC_API_VERSION=xfc_api_version
@@ -91,6 +94,7 @@
AC_SUBST(XFC_UI_LIBRARY_NAME)
AC_SUBST(XFC_GLADE_LIBRARY_NAME)
AC_SUBST(XFC_SOURCEVIEW_LIBRARY_NAME)
+AC_SUBST(XFC_DE_LIBRARY_NAME)
AC_SUBST(XFC_API_VERSION)
@@ -194,6 +198,38 @@
AC_DEFINE( XFC_SOURCEVIEW, 1, ["Defined if sourceview widget is defined"] )
fi
+# Xfce setup
+PKG_CHECK_MODULES(XFC_DE_PANEL, libxcfe4panel-1.0 >= xfcepanel_required_version,
+ [DE_PANEL_FOUND="yes"],
+ [DE_PANEL_FOUND="no"])
+AC_SUBST(XFC_DE_PANEL_CFLAGS)
+AC_SUBST(XFC_DE_PANEL_LIBS)
+
+PKG_CHECK_MODULES(XFC_DE_UI, libxfcegui4-1.0 >= xfcegui_required_version,
+ [DE_UI_FOUND="yes"],
+ [DE_UI_FOUND="no"])
+AC_SUBST(XFC_DE_UI_CFLAGS)
+AC_SUBST(XFC_DE_UI_LIBS)
+
+PKG_CHECK_MODULES(XFC_DE_CONF, libxfconf-0 >= xfceconf_required_version,
+ [DE_CONF_FOUND="yes"],
+ [DE_CONF_FOUND="no"])
+AC_SUBST(XFC_DE_CONF_CFLAGS)
+AC_SUBST(XFC_DE_CONF_LIBS)
+
+PKG_CHECK_MODULES(XFC_DE_UTIL, libxfce4util-1.0 >= xfceutil_required_version,
+ [DE_SUBDIR="libXFCde"; DE_EXAMPLEDIR="de"; DE_FOUND="yes"],
+ [DE_SUBDIR=""; DE_EXAMPLE_DIR=""; DE_FOUND="no"] )
+AC_SUBST(XFC_DE_UTIL_CFLAGS)
+AC_SUBST(XFC_DE_UTIL_LIBS)
+
+AC_SUBST(DE_SUBDIR)
+AC_SUBST(DE_EXAMPLEDIR)
+
+if test "x$XFC_DE_UTIL_FOUND"=="xyes" -a "x$XFC_DE_CONF"=="xyes" -a "x$XFC_DE_UI"=="xyes" -a "x$XFC_DE_PANEL"=="xyes"; then
+ AC_DEFINE( XFC_DE, 1, ["Defined if XFC support added"] )
+fi
+
XFC_CORE_CFLAGS="$XFC_SIGC_CFLAGS $XFC_GLIB_CFLAGS"
XFC_CORE_LIBS="$XFC_SIGC_LIBS $XFC_GLIB_LIBS"
AC_SUBST(XFC_CORE_CFLAGS)
@@ -223,8 +259,6 @@
AC_SUBST(XFC_GTK_CFLAGS)
AC_SUBST(XFC_GTK_LIBS)
-PKG_CHECK_MODULES(XFCE_PANEL, libxfce4panel-1.0 >= xfce_panel_required_version)
-
PKG_CHECK_MODULES(XFC_GLADE, libglade-2.0 >= glade_required_version,
[GLADE_SUBDIR="libXFCglade"; GLADE_EXAMPLESDIR="glade"; GLADE_FOUND="yes"],
[GLADE_SUBDIR=""; GLADE_EXAMPLESDIR=""; GLADE_FOUND="no"])
@@ -359,6 +393,12 @@
libXFCsourceview/xfc/Makefile \
libXFCsourceview/xfc/sourceview/Makefile \
libXFCsourceview/xfc/sourceview/private/Makefile \
+ libXFCde/Makefile \
+ libXFCde/xfcde-4.3.pc \
+ libXFCde/xfc/Makefile \
+ libXFCde/xfc/utils/Makefile \
+ libXFCde/xfc/panel/Makefile \
+ libXFCde/xfc/ui/Makefile \
demos/Makefile \
demos/xfc-demo/Makefile \
examples/Makefile \
@@ -448,5 +488,6 @@
echo "Compiling XFC with libcairo support: $CAIRO_FOUND"
echo "Compiling XFC with gtksourceview support: $SOURCEVIEW_FOUND"
echo "Compiling XFC with gtk unix printing support: $UNIXPRINT_FOUND"
+echo "Compiling XFC with Xfce desktop environment: $DE_FOUND"
echo
Modified: xfc/trunk/debian/control
===================================================================
--- xfc/trunk/debian/control 2009-07-21 23:41:16 UTC (rev 30375)
+++ xfc/trunk/debian/control 2009-07-22 08:13:15 UTC (rev 30376)
@@ -61,6 +61,20 @@
Description: XFC sourceview library
XFC sourceview GUI library
+Package: libxfcde-dev
+Section: libdevel
+Architecture: any
+Depends: libxfconf-0-dev (>= 4.6.0), libxfccore (= ${Source-Version}), xfce4-util-dev (>= 4.6.0), libxfce4-panel-dev (>= 4.6.0), libxfconf-0-dev (>= 4.6.0)
+Description: Xfce4 desktop environment development files
+ Xfce desktop environment development files
+
+Package: libxfcde
+Section: libs
+Architecture: any
+Depends: libxfccore (=${Source-Version}), xfce4-util (>= 4.6.0), libxfce4-panel (>= 4.6.0), libxfconf-0-2 (>= 4.6.0)
+Description: Xfce4 desktop environment
+ Xfce4 desktop environment code
+
Package: xfc-demo
Section: app
Architecture: any
Modified: xfc/trunk/docs/reference/Doxyfile.in
===================================================================
--- xfc/trunk/docs/reference/Doxyfile.in 2009-07-21 23:41:16 UTC (rev 30375)
+++ xfc/trunk/docs/reference/Doxyfile.in 2009-07-22 08:13:15 UTC (rev 30376)
@@ -417,7 +417,7 @@
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = ../../libXFCcore/xfc ../../libXFCui/xfc ../../libXFCglade/xfc ../../libXFCsourceview/xfc
+INPUT = ../../libXFCcore/xfc ../../libXFCui/xfc ../../libXFCglade/xfc ../../libXFCsourceview/xfc ../../libXFCde/xfc
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
Modified: xfc/trunk/libXFCcore/xfc/glib/error.cc
===================================================================
--- xfc/trunk/libXFCcore/xfc/glib/error.cc 2009-07-21 23:41:16 UTC (rev 30375)
+++ xfc/trunk/libXFCcore/xfc/glib/error.cc 2009-07-22 08:13:15 UTC (rev 30376)
@@ -38,7 +38,6 @@
} // namespace
G::Error::Error()
-: error_(0)
{
}
@@ -68,7 +67,7 @@
{
}
-G::Error::~Error()
+G::Error::~Error() throw()
{
if (error_)
{
@@ -124,3 +123,8 @@
g_propagate_error(&error_, src.error_);
}
+const char * G::Error::what( void ) const throw()
+{
+ return error_->message;
+}
+
Modified: xfc/trunk/libXFCcore/xfc/glib/error.hh
===================================================================
--- xfc/trunk/libXFCcore/xfc/glib/error.hh 2009-07-21 23:41:16 UTC (rev 30375)
+++ xfc/trunk/libXFCcore/xfc/glib/error.hh 2009-07-22 08:13:15 UTC (rev 30376)
@@ -27,6 +27,8 @@
#ifndef XFC_G_ERROR_HH
#define XFC_G_ERROR_HH
+#include <exception>
+
#ifndef XFC_STACK_OBJECT_HH
#include <xfc/stackobject.hh>
#endif
@@ -60,6 +62,8 @@
/// the g_error() function should only be used for programming errors, it should not be used to print
/// any error reportable via G::Error.)
///
+/// This class can be thrown, as an std exception too.
+///
/// Examples of recoverable runtime errors are "file not found" or "failed to parse input". Runtime
/// errors should be handled or reported to the user, programming errors should be eliminated by
/// fixing the bug in the program. This is why most functions in XFC do not use the Error facility.
@@ -84,7 +88,7 @@
/// @endcode
/// <BR>Note that passing NULL for the error location ignores errors.
-class Error : public StackObject
+class Error : public StackObject, public std::exception
{
GError *error_;
@@ -118,7 +122,7 @@
Error(const Error& src);
///< Copy constructor.
- ~Error();
+ virtual ~Error() throw();
///< Destructor.
Error& operator=(const Error& src);
@@ -179,6 +183,9 @@
void clear();
///< Frees the associated GError object and sets the internal error pointer to null.
+ /// std C++ exception, that just return the human readable message part
+ const char *what( void ) const throw();
+
/// @}
};
Added: xfc/trunk/libXFCde/Makefile.am
===================================================================
--- xfc/trunk/libXFCde/Makefile.am (rev 0)
+++ xfc/trunk/libXFCde/Makefile.am 2009-07-22 08:13:15 UTC (rev 30376)
@@ -0,0 +1,8 @@
+## libXFCcore base directory
+
+SUBDIRS = xfc
+
+#EXTRA_DIST = xfcde-4.3.pc.in
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = $(XFC_DE_LIBRARY_NAME)-$(XFC_API_VERSION).pc
Added: xfc/trunk/libXFCde/xfc/Makefile.am
===================================================================
--- xfc/trunk/libXFCde/xfc/Makefile.am (rev 0)
+++ xfc/trunk/libXFCde/xfc/Makefile.am 2009-07-22 08:13:15 UTC (rev 30376)
@@ -0,0 +1,12 @@
+## libXFCsourceview source directory
+
+SUBDIRS = utils ui panel
+
+library_includedir=$(includedir)/$(XFCEDIR)/$(XFC_LIBRARY_NAME)
+
+lib_LTLIBRARIES = libXFCde-4.3.la
+
+libXFCde_4_3_la_SOURCES=
+libXFCde_4_3_la_LIBADD= $(XFC_DE_UTIL_LIBS) $(XFC_DE_CONF_LIBS) $(XFC_DE_PANEL_LIBS) $(XFC_DE_UI_LIBS)
+libXFCde_4_3_la_LDFLAGS= -version-info $(XFC_LIBRARY_VERSION)
+
Added: xfc/trunk/libXFCde/xfc/utils/Makefile.am
===================================================================
--- xfc/trunk/libXFCde/xfc/utils/Makefile.am (rev 0)
+++ xfc/trunk/libXFCde/xfc/utils/Makefile.am 2009-07-22 08:13:15 UTC (rev 30376)
@@ -0,0 +1,19 @@
+#SUBDIRS = private
+
+AM_CXXFLAGS = @CXXFLAGS@ @XFC_CORE_CFLAGS@ @XFC_DE_CONF_CFLAGS@ @XFC_DE_UTIL_CFLAGS@
+
+hh_sources =\
+ config.hh
+
+cc_sources =\
+ config.cc
+
+library_includedir=$(includedir)/$(XFCEDIR)/$(XFC_LIBRARY_NAME)/de/utils
+library_include_HEADERS = $(hh_sources)
+
+INCLUDES = -I$(top_builddir)/libXFCde \
+ -I$(top_builddir)/libXFCcore
+
+noinst_LTLIBRARIES= libde.la
+libde_la_SOURCES= $(hh_sources) $(cc_sources)
+
Added: xfc/trunk/libXFCde/xfc/utils/config.cc
===================================================================
--- xfc/trunk/libXFCde/xfc/utils/config.cc (rev 0)
+++ xfc/trunk/libXFCde/xfc/utils/config.cc 2009-07-22 08:13:15 UTC (rev 30376)
@@ -0,0 +1,66 @@
+/**
+ Impl. the xfconf client wrapper for XFC.
+*/
+#include "config.hh"
+#include <stdexcept>
+#include <sstream>
+#include <xfc/glib/error.hh>
+
+using namespace std;
+
+namespace Xfc {
+ namespace De {
+
+ Config::Config( const String &ch_name, bool no_create )
+ {
+ G::Error error;
+
+ if( !xfconf_init( error ))
+ throw error;
+
+ _channel = xfconf_channel_get( ch_name.c_str() );
+
+ if( _channel == NULL )
+ _channel = xfconf_channel_new( ch_name.c_str() );
+ }
+
+ Config::~Config()
+ {
+ xfconf_shutdown(); // xconf takes care of refcounting !
+ }
+
+ bool Config::set( const String &property, const G::Value &val )
+ {
+ return xfconf_channel_set_property( _channel, property.c_str(), val );
+ }
+
+ G::Value Config::get( const String &property ) const
+ {
+ G::Value val;
+
+ if( xfconf_channel_get_property( _channel, property.c_str(), val ))
+ return val;
+
+ ostringstream os;
+ os << "Can't get " << property << " from xconf";
+
+ throw invalid_argument( os.str() );
+ }
+
+ bool Config::has_a( const String &property ) const
+ {
+ return xfconf_channel_has_property( _channel, property.c_str() );
+ }
+
+ void Config::reset( const String &property, const String &property_base, bool recursive )
+ {
+ xfconf_channel_reset_property( _channel, property_base.c_str(), recursive );
+ }
+
+ bool Config::is_locked( const String &property ) const
+ {
+ return xfconf_channel_is_property_locked( _channel, property.c_str() );
+ }
+
+ }
+}
Added: xfc/trunk/libXFCde/xfc/utils/config.hh
===================================================================
--- xfc/trunk/libXFCde/xfc/utils/config.hh (rev 0)
+++ xfc/trunk/libXFCde/xfc/utils/config.hh 2009-07-22 08:13:15 UTC (rev 30376)
@@ -0,0 +1,32 @@
+#include <xfc/glib/value.hh>
+
+#include <xfconf/xfconf.h>
+
+// Needed in XFC !
+namespace Xfc {
+ namespace De { // Desktop env namespace
+ class Config {
+ XfconfChannel *_channel;
+ public:
+ /**
+ Opens up a xfconf channel if it exist, and create it if
+ it down not.
+ */
+ Config( const String &channel, bool no_create = false );
+ ~Config();
+
+ bool set( const String &property, const G::Value &val );
+ G::Value get( const String &property ) const;
+
+ bool has_a( const String &property ) const;
+ void reset( const String &property, const String &base_property = "/", bool recursive = true );
+ bool is_locked( const String &property ) const;
+
+ // Syntactic sugar
+ G::Value operator[]( const String &property ) const {return get( property );}
+
+ // The Xfce interface has a lot of helpers but is this really needed,
+ // when we have the G::Value wrapper ?
+ };
+ }
+}
Added: xfc/trunk/libXFCde/xfcde-4.3.pc.in
===================================================================
--- xfc/trunk/libXFCde/xfcde-4.3.pc.in (rev 0)
+++ xfc/trunk/libXFCde/xfcde-4.3.pc.in 2009-07-22 08:13:15 UTC (rev 30376)
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: Xfc-DesktopEnvironment
+Description: The Xfce Foundation Classes desktop environment library
+Version: @VERSION@
+Requires: glib-2.0 gobject-2.0 sigc++-2.0 gthread-2.0 libxfconf-0 libxfce4util-1.0 libxfce4panel-1.0 libxfcegui4-1.0
+Libs: -L${libdir} -lXFCcore- at XFC_API_VERSION@ -lXFCui- at XFC_API_VERSION@ -lXFCde- at XFC_API_VERSION@
+Cflags: -I${includedir}/@XFCEDIR@
+
Modified: xfc/trunk/xfc-config.h.in
===================================================================
--- xfc/trunk/xfc-config.h.in 2009-07-21 23:41:16 UTC (rev 30375)
+++ xfc/trunk/xfc-config.h.in 2009-07-22 08:13:15 UTC (rev 30376)
@@ -70,6 +70,9 @@
/* "Define if cairo vector drawing system is enabled" */
#undef XFC_CAIRO
+/* "Defined if XFC support added" */
+#undef XFC_DE
+
/* Define major version */
#undef XFC_MAJOR_VERSION
More information about the Xfce4-commits
mailing list