[Xfce4-commits] <xfce4-mm:master> Added libxfce4ui-mm library.
Jens Luedicke
noreply at xfce.org
Mon Jan 17 01:18:04 CET 2011
Updating branch refs/heads/master
to 47fd6a57e5c494b1e5cc446647d342dd5efe60b4 (commit)
from 7ef624f56e82b07867748a6d9f321d84b61e7b13 (commit)
commit 47fd6a57e5c494b1e5cc446647d342dd5efe60b4
Author: Jens Luedicke <perldude at xfce.org>
Date: Sun Jan 16 23:18:43 2011 +0100
Added libxfce4ui-mm library.
CMakeLists.txt | 4 +
libxfce4ui-mm/CMakeLists.txt | 21 +++
libxfce4ui-mm/dialogs.cpp | 90 +++++++++++
.../utf8-utils.cpp => libxfce4ui-mm/dialogs.h | 61 ++++----
.../gdk-extensions.cpp | 27 ++--
.../gdk-extensions.h | 27 ++--
libxfce4ui-mm/gtk-extensions.cpp | 74 +++++++++
.../kiosk.cpp => libxfce4ui-mm/gtk-extensions.h | 50 +++----
libxfce4ui-mm/libxfce4ui-mm-1.0.pc.in | 11 ++
libxfce4ui-mm/titled-dialog.cpp | 160 ++++++++++++++++++++
libxfce4ui-mm/titled-dialog.h | 94 ++++++++++++
11 files changed, 536 insertions(+), 83 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 480f1a2..c9584a3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,11 +6,15 @@ include(FindPkgConfig)
pkg_check_modules(GLIB2MM glibmm-2.4)
pkg_check_modules(GTK2MM gtkmm-2.4)
pkg_check_modules(LIBXFCE4UTIL libxfce4util-1.0)
+pkg_check_modules(LIBXFCE4UI libxfce4ui-1)
include_directories(${GLIB2MM_INCLUDE_DIRS})
include_directories(${GTK2MM_INCLUDE_DIRS})
include_directories(${LIBXFCE4UTIL_INCLUDE_DIRS})
+include_directories(${LIBXFCE4UI_INCLUDE_DIRS})
set(CMAKE_CXX_FLAGS "-g -Wall")
+
add_subdirectory(libxfce4util-mm)
+add_subdirectory(libxfce4ui-mm)
diff --git a/libxfce4ui-mm/CMakeLists.txt b/libxfce4ui-mm/CMakeLists.txt
new file mode 100644
index 0000000..0bfd46f
--- /dev/null
+++ b/libxfce4ui-mm/CMakeLists.txt
@@ -0,0 +1,21 @@
+cmake_minimum_required(VERSION 2.6)
+project(libxfce4ui-mm)
+
+set (libxfce4ui-mm_VERSION_MAJOR 0)
+set (libxfce4ui-mm_VERSION_MINOR 1)
+
+include_directories(${xfce4-mm_SOURCE_DIR}/libxfce4ui-mm)
+
+add_library(xfce4ui-mm SHARED dialogs.cpp gdk-extensions.cpp gtk-extensions.cpp titled-dialog.cpp)
+
+target_link_libraries(xfce4ui-mm ${GLIB2MM_LDFLAGS} ${GTK2MM_LDFLAGS} ${LIBXFCE4UI_LDFLAGS})
+
+install (TARGETS xfce4ui-mm DESTINATION lib)
+
+install (FILES "${libxfce4util-mm_SOURCE_DIR}/dialogs.h" DESTINATION "include/libxfce4ui-mm")
+install (FILES "${libxfce4util-mm_SOURCE_DIR}/gdk-extensions.h" DESTINATION "include/libxfce4ui-mm")
+install (FILES "${libxfce4util-mm_SOURCE_DIR}/gtk-extensions.h" DESTINATION "include/libxfce4ui-mm")
+install (FILES "${libxfce4util-mm_SOURCE_DIR}/titled-dialog.h" DESTINATION "include/libxfce4ui-mm")
+
+configure_file(${libxfce4ui-mm_SOURCE_DIR}/libxfce4ui-mm-1.0.pc.in ${libxfce4ui-mm_BINARY_DIR}/libxfce4ui-mm-1.0.pc @ONLY)
+install(FILES ${libxfce4ui-mm_BINARY_DIR}/libxfce4ui-mm-1.0.pc DESTINATION lib/pkgconfig)
diff --git a/libxfce4ui-mm/dialogs.cpp b/libxfce4ui-mm/dialogs.cpp
new file mode 100644
index 0000000..ee20bb5
--- /dev/null
+++ b/libxfce4ui-mm/dialogs.cpp
@@ -0,0 +1,90 @@
+/* $Id$ */
+/** \file dialogs.cpp
+ * \author Jens Luedicke <jens.luedicke at gmail.com>
+ * \date 2009
+ *
+ * libxfce4gui-mm - C++ wrapper library for libxfce4ui.
+ *
+ * Copyright (c) 2009 Jens Luedicke <jens.luedicke at gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "dialogs.h"
+
+#include <glibmm/ustring.h>
+#include <gtkmm/window.h>
+#include <gtkmm/stockitem.h>
+
+#include <libxfce4ui/libxfce4ui.h>
+
+namespace Xfce4 {
+namespace Gui {
+
+void showErrorDialog(Gtk::Window *window, Glib::Error *error, const gchar *format, ...)
+{
+ va_list args;
+
+ va_start(args, format);
+
+ xfce_dialog_show_error(window->gobj(), error->gobj(), format, args);
+
+ va_end(args);
+}
+
+void showWarningDialog(Gtk::Window *window, const Glib::ustring &text, const gchar *format, ...)
+{
+ va_list args;
+
+ va_start(args, format);
+
+ xfce_dialog_show_warning(window->gobj(), text.c_str(), format, args);
+
+ va_end(args);
+}
+
+void showInformationDialog(Gtk::Window *window, const Glib::ustring &text, const gchar *format, ...)
+{
+ va_list args;
+
+ va_start(args, format);
+
+ xfce_dialog_show_info(window->gobj(), text.c_str(), format, args);
+
+ va_end(args);
+}
+
+bool showConfirmationDialog(Gtk::Window *window,
+ Gtk::StockItem *stockItem,
+ const Glib::ustring &text,
+ const Glib::ustring &stock_id,
+ const Glib::ustring &action)
+{
+ gboolean result = xfce_dialog_confirm(window->gobj(),
+ stockItem->get_stock_id().get_c_str(),
+ text.c_str(),
+ stock_id.c_str(),
+ action.c_str());
+
+ return static_cast<bool>(result);
+}
+
+}
+}
diff --git a/libxfce4util-mm/utf8-utils.cpp b/libxfce4ui-mm/dialogs.h
similarity index 53%
copy from libxfce4util-mm/utf8-utils.cpp
copy to libxfce4ui-mm/dialogs.h
index c9b2cc4..ae49085 100644
--- a/libxfce4util-mm/utf8-utils.cpp
+++ b/libxfce4ui-mm/dialogs.h
@@ -1,9 +1,9 @@
/* $Id$ */
-/** \file utf8-utils.cpp
+/** \file dialogs.h
* \author Jens Luedicke <jens.luedicke at gmail.com>
* \date 2009
*
- * libxfce4util-mm - C++ wrapper library for libxfce4util.
+ * libxfce4gui-mm - C++ wrapper library for libxfcegui4.
*
* Copyright (c) 2009 Jens Luedicke <jens.luedicke at gmail.com>
*
@@ -23,42 +23,43 @@
* Boston, MA 02111-1307, USA.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#ifndef _XFCE_DIALOGS_H_
+#define _XFCE_DIALOGS_H_
-#include "utf8-utils.h"
+#include <glib.h>
-#include <libxfce4util/libxfce4util.h>
+namespace Glib {
+ class Error;
+ class ustring;
+}
-namespace Xfce4 {
-namespace Util {
-namespace Utf8 {
+namespace Gtk {
+ class Window;
+ class StockItem;
+}
-Glib::ustring remove_controls(Glib::ustring &str, gssize max_len, const Glib::ustring &end)
-{
- gchar *result = xfce_utf8_remove_controls(const_cast<gchar*>(str.c_str()), max_len, end.c_str());
+namespace Xfce4 {
+namespace Gui {
- Glib::ustring new_string;
+void showErrorDialog(Gtk::Window *window,
+ Glib::Error *error,
+ const gchar *format, ...);
- if (result != 0) {
- new_string = result;
- }
-
- return new_string;
-}
+void showWarnningDialog(Gtk::Window *window,
+ const Glib::ustring &text,
+ const gchar *format, ...);
-Glib::ustring strndup(const Glib::ustring &src, gssize max_len)
-{
- gchar *result = xfce_utf8_strndup(src.c_str(), max_len);
+void showInformationDialog(Gtk::Window *window,
+ const Glib::ustring &text,
+ const gchar *format, ...);
- Glib::ustring new_string(result);
-
- g_free(result);
-
- return new_string;
-}
+bool showConfirmationDialog(Gtk::Window *window,
+ Gtk::StockItem *stockItem,
+ const Glib::ustring &text,
+ const Glib::ustring &stock_id,
+ const Glib::ustring &action);
}
}
-}
+
+#endif /* _XFCE_DIALOGS_H_ */
diff --git a/libxfce4util-mm/utf8-utils.h b/libxfce4ui-mm/gdk-extensions.cpp
similarity index 70%
copy from libxfce4util-mm/utf8-utils.h
copy to libxfce4ui-mm/gdk-extensions.cpp
index 4034a5e..6dcb2cb 100644
--- a/libxfce4util-mm/utf8-utils.h
+++ b/libxfce4ui-mm/gdk-extensions.cpp
@@ -1,9 +1,9 @@
/* $Id$ */
-/** \file utf8-utils.h
+/** \file gdk-extensions.cpp
* \author Jens Luedicke <jens.luedicke at gmail.com>
* \date 2009
*
- * libxfce4util-mm - C++ wrapper library for libxfce4util.
+ * libxfce4gui-mm - C++ wrapper library for libxfce4ui.
*
* Copyright (c) 2009 Jens Luedicke <jens.luedicke at gmail.com>
*
@@ -23,20 +23,25 @@
* Boston, MA 02111-1307, USA.
*/
-#ifndef _XFCE_UTF8_UTILS_H_
-#define _XFCE_UTF8_UTILS_H_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
-#include <glibmm/ustring.h>
+#include "gdk-extensions.h"
+
+#include <gdkmm/screen.h>
+
+#include <libxfce4ui/libxfce4ui.h>
namespace Xfce4 {
-namespace Util {
-namespace Utf8 {
+namespace Gui {
-Glib::ustring remove_controls(Glib::ustring &str, gssize max_len, const Glib::ustring &end);
-Glib::ustring strndup(const Glib::ustring &src, gssize max_len);
+Glib::RefPtr<Gdk::Screen> getActive(gint *monitor_return)
+{
+ GdkScreen *screen = xfce_gdk_screen_get_active(monitor_return);
+ return Glib::wrap(screen);
}
+
}
}
-
-#endif /* _XFCE_UTF8_UTILS_H_ */
diff --git a/libxfce4util-mm/resource-enum.h b/libxfce4ui-mm/gdk-extensions.h
similarity index 72%
copy from libxfce4util-mm/resource-enum.h
copy to libxfce4ui-mm/gdk-extensions.h
index eecfaca..46cd275 100644
--- a/libxfce4util-mm/resource-enum.h
+++ b/libxfce4ui-mm/gdk-extensions.h
@@ -1,9 +1,9 @@
/* $Id$ */
-/** \file resource-enum.h
+/** \file gdk-extensions.h
* \author Jens Luedicke <jens.luedicke at gmail.com>
* \date 2009
*
- * libxfce4util-mm - C++ wrapper library for libxfce4util.
+ * libxfce4gui-mm - C++ wrapper library for libxfcegui4.
*
* Copyright (c) 2009 Jens Luedicke <jens.luedicke at gmail.com>
*
@@ -23,23 +23,20 @@
* Boston, MA 02111-1307, USA.
*/
-#ifndef _XFCE_RESOURCE_ENUM_H_
-#define _XFCE_RESOURCE_ENUM_H_
+#ifndef _XFCE_GDK_EXTENSIONS_H_
+#define _XFCE_GDK_EXTENSIONS_H_
+
+#include <glib.h>
+#include <glibmm/refptr.h>
+#include <gdkmm/screen.h>
namespace Xfce4 {
-namespace Util {
-namespace Resource {
+namespace Gui {
-enum ResourceType {
- RESOURCE_DATA = 0,
- RESOURCE_CONFIG = 1,
- RESOURCE_CACHE = 2,
- RESOURCE_ICONS = 3,
- RESOURCE_THEMES = 4,
-};
+ Glib::RefPtr<Gdk::Screen> getActive(gint *monitor_return);
}
}
-}
-#endif /* _XFCE_RESOURCE_ENUM_H_ */
+#endif /* _XFCE_GDK_EXTENSIONS_H_ */
+
diff --git a/libxfce4ui-mm/gtk-extensions.cpp b/libxfce4ui-mm/gtk-extensions.cpp
new file mode 100644
index 0000000..ec548db
--- /dev/null
+++ b/libxfce4ui-mm/gtk-extensions.cpp
@@ -0,0 +1,74 @@
+/* $Id$ */
+/** \file gtk-extensions.cpp
+ * \author Jens Luedicke <jens.luedicke at gmail.com>
+ * \date 2009
+ *
+ * libxfce4gui-mm - C++ wrapper library for libxfce4ui.
+ *
+ * Copyright (c) 2009 Jens Luedicke <jens.luedicke at gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "gtk-extensions.h"
+
+#include <glibmm/ustring.h>
+#include <gtkmm/stockitem.h>
+#include <gtkmm/widget.h>
+#include <gtkmm/window.h>
+
+#include <libxfce4ui/libxfce4ui.h>
+
+namespace Xfce4 {
+namespace Gui {
+
+Gtk::Widget* newMixedButton(Gtk::StockItem *stockItem,
+ const Glib::ustring &label) {
+
+ GtkWidget *widget = xfce_gtk_button_new_mixed(stockItem->get_stock_id().get_c_str(),
+ label.c_str());
+
+ return Glib::wrap(widget);
+
+}
+
+Gtk::Widget* newFrameBox(const Glib::ustring &label,
+ Gtk::Widget **container_return) {
+
+ GtkWidget *ptr = (*container_return)->gobj();
+ GtkWidget *widget = xfce_gtk_frame_box_new(label.c_str(), &ptr);
+
+ return Glib::wrap(widget);
+}
+
+Gtk::Widget* newFrameBoxWithContent(const Glib::ustring &label,
+ Gtk::Widget *content) {
+
+ GtkWidget *widget = xfce_gtk_frame_box_new_with_content(label.c_str(), content->gobj());
+
+ return Glib::wrap(widget);
+}
+
+void centerOnActiveScreen(Gtk::Window *window) {
+ xfce_gtk_window_center_on_active_screen(window->gobj());
+}
+
+}
+}
diff --git a/libxfce4util-mm/kiosk.cpp b/libxfce4ui-mm/gtk-extensions.h
similarity index 59%
copy from libxfce4util-mm/kiosk.cpp
copy to libxfce4ui-mm/gtk-extensions.h
index a0aca2d..e96eaf3 100644
--- a/libxfce4util-mm/kiosk.cpp
+++ b/libxfce4ui-mm/gtk-extensions.h
@@ -1,9 +1,9 @@
/* $Id$ */
-/** \file kiosk.cpp
+/** \file gtk-extensions.h
* \author Jens Luedicke <jens.luedicke at gmail.com>
* \date 2009
*
- * libxfce4util-mm - C++ wrapper library for libxfce4util.
+ * libxfce4gui-mm - C++ wrapper library for libxfcegui4.
*
* Copyright (c) 2009 Jens Luedicke <jens.luedicke at gmail.com>
*
@@ -23,39 +23,35 @@
* Boston, MA 02111-1307, USA.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#ifndef _XFCE_GTK_EXTENSIONS_H_
+#define _XFCE_GTK_EXTENSIONS_H_
-#include "kiosk.h"
+namespace Glib {
+ class ustring;
+}
-#include <libxfce4util/libxfce4util.h>
+namespace Gtk {
+ class StockItem;
+ class Widget;
+ class Window;
+}
namespace Xfce4 {
-namespace Util {
+namespace Gui {
-class KioskPrivate {
-public:
- XfceKiosk *kiosk;
-};
-
-Kiosk::Kiosk(const Glib::ustring &module)
-: d(new KioskPrivate)
-{
- d->kiosk = xfce_kiosk_new(module.c_str());
-}
+ Gtk::Widget* newMixedButton(Gtk::StockItem *sockItem,
+ const Glib::ustring &label);
-Kiosk::~Kiosk()
-{
- xfce_kiosk_free(d->kiosk);
-}
+ Gtk::Widget* newFrameBox(const Glib::ustring &label,
+ Gtk::Widget **container_return);
-bool Kiosk::query(const Glib::ustring &capability) const
-{
- gboolean result = xfce_kiosk_query(d->kiosk, capability.c_str());
+ Gtk::Widget* newFrameBoxWithContent(const Glib::ustring &label,
+ Gtk::Widget *content);
- return static_cast<bool>(result);
-}
+ void centerOnActiveScreen(Gtk::Window *window);
}
}
+
+#endif /* _XFCE_GTK_EXTENSIONS_H_ */
+
diff --git a/libxfce4ui-mm/libxfce4ui-mm-1.0.pc.in b/libxfce4ui-mm/libxfce4ui-mm-1.0.pc.in
new file mode 100644
index 0000000..130c42c
--- /dev/null
+++ b/libxfce4ui-mm/libxfce4ui-mm-1.0.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@CMAKE_INSTALL_PREFIX@/bin
+libdir=@CMAKE_INSTALL_PREFIX@/lib
+includedir=@CMAKE_INSTALL_PREFIX@/include
+
+Name: libxfce4ui-mm
+Description: C++ wrapper library for libxfce4ui
+Requires: libxfce4ui-1
+Version: @VERSION@
+Libs: -L${libdir} -lxfce4gui-mm
+Cflags: -I${includedir}/xfce4/libxfce4gui-mm
diff --git a/libxfce4ui-mm/titled-dialog.cpp b/libxfce4ui-mm/titled-dialog.cpp
new file mode 100644
index 0000000..781b611
--- /dev/null
+++ b/libxfce4ui-mm/titled-dialog.cpp
@@ -0,0 +1,160 @@
+/* $Id$ */
+/** \file titled-dialog.cpp
+ * \author Jens Luedicke <jens.luedicke at gmail.com>
+ * \date 2009
+ *
+ * libxfce4gui-mm - C++ wrapper library for libxfce4ui.
+ *
+ * Copyright (c) 2009 Jens Luedicke <jens.luedicke at gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "titled-dialog.h"
+
+#include <gtkmm/private/dialog_p.h>
+
+#include <libxfce4ui/libxfce4ui.h>
+
+namespace Xfce4 {
+namespace Gui {
+
+class TitledDialog_Class : public Glib::Class {
+public:
+ typedef TitledDialog CppObjectType;
+ typedef XfceTitledDialog BaseObjectType;
+ typedef XfceTitledDialogClass BaseClassType;
+ typedef Gtk::Dialog_Class CppClassParent;
+ typedef GtkDialogClass BaseClassParent;
+
+ friend class TitledDialog;
+
+ const Glib::Class& init();
+
+ static void class_init_function(void* g_class, void* class_data);
+
+ static Glib::ObjectBase* wrap_new(GObject*);
+};
+
+const Glib::Class& TitledDialog_Class::init()
+{
+ TRACE("entering");
+
+ if (!gtype_) { // create the GType if necessary
+ // Glib::Class has to know the class init function to clone custom types.
+ class_init_func_ = &TitledDialog_Class::class_init_function;
+
+ // This is actually just optimized away, apparently with no harm.
+ // Make sure that the parent type has been created.
+ //CppClassParent::CppObjectType::get_type();
+
+ // Create the wrapper type, with the same class/instance size as the base type.
+ register_derived_type(xfce_titled_dialog_get_type());
+
+ // Add derived versions of interfaces, if the C type implements any interfaces:
+ }
+
+ TRACE("leaving");
+
+ return *this;
+}
+
+void TitledDialog_Class::class_init_function(void* g_class, void* class_data)
+{
+ TRACE("entering");
+
+ BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
+ CppClassParent::class_init_function(klass, class_data);
+
+ TRACE("leaving");
+}
+
+Glib::ObjectBase* TitledDialog_Class::wrap_new(GObject* o)
+{
+ TRACE("entering");
+
+ return manage(new TitledDialog((XfceTitledDialog*)(o)));
+}
+
+
+
+TitledDialog::CppClassType TitledDialog::titled_dialog_class_; // initialize static member
+
+GType TitledDialog::get_type()
+{
+ TRACE("entering");
+
+ return titled_dialog_class_.init().get_type();
+}
+
+GType TitledDialog::get_base_type()
+{
+ TRACE("entering");
+
+ return xfce_titled_dialog_get_type();
+}
+
+TitledDialog::TitledDialog()
+ : Glib::ObjectBase(0),
+ Gtk::Dialog(Glib::ConstructParams(titled_dialog_class_.init()))
+{
+}
+
+TitledDialog::~TitledDialog()
+{
+ // _destroy();
+}
+
+TitledDialog::TitledDialog(const Glib::ConstructParams& construct_params)
+ : Glib::ObjectBase(0),
+ Gtk::Dialog(construct_params)
+{
+}
+
+TitledDialog::TitledDialog(XfceTitledDialog* castitem)
+ : Glib::ObjectBase(0),
+ Gtk::Dialog(reinterpret_cast<GtkDialog*>(castitem))
+{
+}
+
+
+const Glib::ustring TitledDialog::get_subtitle()
+{
+ const gchar *result = xfce_titled_dialog_get_subtitle(gobj());
+
+ return Glib::ustring(result);
+}
+
+void TitledDialog::set_subtitle(const Glib::ustring &subtitle)
+{
+ xfce_titled_dialog_set_subtitle(gobj(), subtitle.c_str());
+}
+
+}
+}
+
+namespace Glib {
+
+Xfce4::Gui::TitledDialog* wrap(XfceTitledDialog* object, bool take_copy)
+{
+ return dynamic_cast<Xfce4::Gui::TitledDialog *> (Glib::wrap_auto ((GObject*)(object), take_copy));
+}
+
+}
diff --git a/libxfce4ui-mm/titled-dialog.h b/libxfce4ui-mm/titled-dialog.h
new file mode 100644
index 0000000..b94bb30
--- /dev/null
+++ b/libxfce4ui-mm/titled-dialog.h
@@ -0,0 +1,94 @@
+/** \file titled-dialog.h
+ * \author Jens Luedicke <jens.luedicke at gmail.com>
+ * \date 2009
+ *
+ * libxfce4gui-mm - C++ wrapper library for libxfcegui4.
+ *
+ * Copyright (c) 2009 Jens Luedicke <jens.luedicke at gmail.com>
+ *
+ * This program 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 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _XFCE_TITLED_DIALOG_H_
+#define _XFCE_TITLED_DIALOG_H_
+
+#include <glibmm/refptr.h>
+#include <glibmm/ustring.h>
+#include <gtkmm/dialog.h>
+
+typedef struct _XfceTitledDialog XfceTitledDialog;
+typedef struct _XfceTitledDialogClass XfceTitledDialogClass;
+
+namespace Xfce4 {
+namespace Gui {
+
+class TitledDialog_Class;
+
+class TitledDialog : public Gtk::Dialog {
+public:
+ typedef TitledDialog CppObjectType;
+ typedef TitledDialog_Class CppClassType;
+ typedef XfceTitledDialog BaseObjectType;
+ typedef XfceTitledDialogClass BaseClassType;
+
+ static GType get_type() G_GNUC_CONST;
+ static GType get_base_type() G_GNUC_CONST;
+
+ XfceTitledDialog* gobj() { return reinterpret_cast<XfceTitledDialog*>(gobject_); }
+ const XfceTitledDialog* gobj() const { return reinterpret_cast<XfceTitledDialog*>(gobject_); }
+
+ TitledDialog();
+
+#if 0
+ TitledDialog(const Glib::ustring &title,
+ Gtk::Window &parent,
+ const gchar* first_button_text,
+ ...);
+#endif
+
+ virtual ~TitledDialog();
+
+ const Glib::ustring get_subtitle();
+ void set_subtitle(const Glib::ustring &subtitle);
+
+protected:
+ explicit TitledDialog(const Glib::ConstructParams& construct_params);
+ explicit TitledDialog(XfceTitledDialog* castitem);
+
+private:
+ friend class TitledDialog_Class;
+ static CppClassType titled_dialog_class_;
+
+ // noncopyable
+ TitledDialog(const TitledDialog&);
+ TitledDialog& operator=(const TitledDialog&);
+};
+
+}
+}
+
+namespace Glib {
+ /** A Glib::wrap() method for this object.
+ *
+ * @param object The C instance.
+ * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
+ * @result A C++ instance that wraps this C instance.
+ *
+ * @relates Xfce4::Gui::TitledDialog
+ */
+ Xfce4::Gui::TitledDialog* wrap(XfceTitledDialog* object, bool take_copy = false);
+}
+
+#endif /* _XFCE_TITLED_DIALOG_H_ */
More information about the Xfce4-commits
mailing list