[gtkmm] Wrap GtkStackSidebar
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Wrap GtkStackSidebar
- Date: Thu, 19 Feb 2015 09:28:15 +0000 (UTC)
commit e7e73f94f290d2c4aa81a36fdc00d96b3c5ae2b4
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Thu Feb 19 10:19:33 2015 +0100
Wrap GtkStackSidebar
* .gitignore: Add gtk/gtkmm/stacksidebar.[cc|h] and windowgroup.[cc|h].
* gtk/gtkmm.h: Add stacksidebar.h.
* gtk/src/filelist.am: Add stacksidebar.hg.
* gtk/src/stack.hg: Mention StackSidebar in the class description.
* gtk/src/stacksidebar.[ccg|hg]: New files.
.gitignore | 4 +++
gtk/gtkmm.h | 1 +
gtk/src/filelist.am | 1 +
gtk/src/stack.hg | 5 +++-
gtk/src/stacksidebar.ccg | 27 +++++++++++++++++++
gtk/src/stacksidebar.hg | 64 ++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 101 insertions(+), 1 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 75ac6a5..e9b2b5c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -455,6 +455,8 @@ gtk/gtkmm/spinner.cc
gtk/gtkmm/spinner.h
gtk/gtkmm/stack.cc
gtk/gtkmm/stack.h
+gtk/gtkmm/stacksidebar.cc
+gtk/gtkmm/stacksidebar.h
gtk/gtkmm/stackswitcher.cc
gtk/gtkmm/stackswitcher.h
gtk/gtkmm/statusbar.cc
@@ -549,6 +551,8 @@ gtk/gtkmm/widgetpath.cc
gtk/gtkmm/widgetpath.h
gtk/gtkmm/window.cc
gtk/gtkmm/window.h
+gtk/gtkmm/windowgroup.cc
+gtk/gtkmm/windowgroup.h
gtk/gtkmm/wrap_init.cc
gtk/gtkmmconfig.h
gtk/stamp-h3
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index 102b9c9..6a51913 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -261,6 +261,7 @@ extern const int gtkmm_micro_version;
#include <gtkmm/spinbutton.h>
#include <gtkmm/spinner.h>
#include <gtkmm/stack.h>
+#include <gtkmm/stacksidebar.h>
#include <gtkmm/stackswitcher.h>
#include <gtkmm/statusbar.h>
#include <gtkmm/statusicon.h>
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 05f204a..109d353 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -166,6 +166,7 @@ gtkmm_files_any_hg = \
spinbutton.hg \
spinner.hg \
stack.hg \
+ stacksidebar.hg \
stackswitcher.hg \
statusbar.hg \
stylecontext.hg \
diff --git a/gtk/src/stack.hg b/gtk/src/stack.hg
index cd9c541..6dc7cb7 100644
--- a/gtk/src/stack.hg
+++ b/gtk/src/stack.hg
@@ -29,10 +29,11 @@ _CC_INCLUDE(gtk/gtk.h)
/** A container that shows only one child at a time.
*
* Gtk::Stack does not provide a means for users to change the visible
- * child. Instead, the Gtk::StackSwitcher widget can be used with
+ * child. Instead, the Gtk::StackSwitcher or Gtk::StackSidebar widget can be used with
* Gtk::Stack to provide this functionality.
*
* @ingroup Widgets
+ * @ingroup Containers
* @newin{3,10}
*/
class Stack
@@ -102,6 +103,8 @@ public:
_WRAP_CHILD_PROPERTY("icon-name", Glib::ustring)
_WRAP_CHILD_PROPERTY("position", int)
_WRAP_CHILD_PROPERTY("needs-attention", bool)
+
+ // There are no signals or vfuncs.
};
} //namespace Gtk
diff --git a/gtk/src/stacksidebar.ccg b/gtk/src/stacksidebar.ccg
new file mode 100644
index 0000000..31fe2e4
--- /dev/null
+++ b/gtk/src/stacksidebar.ccg
@@ -0,0 +1,27 @@
+/* Copyright (C) 2015 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtk/gtk.h>
+
+namespace Gtk
+{
+
+void StackSidebar::unset_stack()
+{
+ gtk_stack_sidebar_set_stack(gobj(), 0);
+}
+
+} //namespace Gtk
diff --git a/gtk/src/stacksidebar.hg b/gtk/src/stacksidebar.hg
new file mode 100644
index 0000000..173d544
--- /dev/null
+++ b/gtk/src/stacksidebar.hg
@@ -0,0 +1,64 @@
+/* Copyright (C) 2015 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtkmm/bin.h>
+#include <gtkmm/stack.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/bin_p.h)
+
+namespace Gtk
+{
+class Stack;
+
+// Gtk::StackSidebar is formally a container widget, but it's not included
+// in group Containers. A StackSidebar adds its children itself, when a Stack
+// is connected. Users of StackSidebar shall not call its inherited add() method.
+
+/** Sidebar widget that shows the pages of a Stack.
+ *
+ * A StackSidebar enables you to quickly and easily provide a
+ * consistent "sidebar" object for your user interface.
+ *
+ * In order to use a StackSidebar, you simply use a Stack to
+ * organize your UI flow, and add the sidebar to your sidebar area. You
+ * can use set_stack() to connect the StackSidebar to the Stack.
+ *
+ * @ingroup Widgets
+ * @newin{3,16}
+ */
+class StackSidebar : public Bin
+{
+ _CLASS_GTKOBJECT(StackSidebar,GtkStackSidebar,GTK_STACK_SIDEBAR,Gtk::Bin,GtkBin)
+public:
+ _CTOR_DEFAULT
+
+ _WRAP_METHOD(void set_stack(Stack& stack), gtk_stack_sidebar_set_stack)
+ /** Unsets the associated Stack.
+ * @see set_stack().
+ * @newin{3,16}
+ */
+ void unset_stack();
+
+ _WRAP_METHOD(Stack* get_stack(), gtk_stack_sidebar_get_stack)
+ _WRAP_METHOD(const Stack* get_stack() const, gtk_stack_sidebar_get_stack, constversion)
+
+ _WRAP_PROPERTY("stack", Stack*)
+
+ // There are no signals or vfuncs.
+};
+
+} //namespace Gtk
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]