[gtkmm] Add class Gtk::CssSection and enum Gtk::CssSectionType
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Add class Gtk::CssSection and enum Gtk::CssSectionType
- Date: Sun, 7 Dec 2014 11:07:45 +0000 (UTC)
commit 1a314bdbb87652df0561e3b93a986d88a85b1548
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Sun Dec 7 10:52:41 2014 +0100
Add class Gtk::CssSection and enum Gtk::CssSectionType
* .gitignore: Add csssection.[h|cc].
* gtk/gtkmm.h: Add csssection.h.
* gtk/src/filelist.am: Add csssection.hg.
* gtk/src/gtk_extra_objects.defs: Add GtkCssSection.
* gtk/src/csssection.[hg|ccg]: New files.
* tools/m4/convert_gtk.m4: Add conversions for CssSection and CssSectionType.
.gitignore | 2 +
gtk/gtkmm.h | 1 +
gtk/src/csssection.ccg | 17 ++++++++++++
gtk/src/csssection.hg | 56 ++++++++++++++++++++++++++++++++++++++++
gtk/src/filelist.am | 1 +
gtk/src/gtk_extra_objects.defs | 6 ++++
tools/m4/convert_gtk.m4 | 2 +
7 files changed, 85 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index c6789c6..75ac6a5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -211,6 +211,8 @@ gtk/gtkmm/container.cc
gtk/gtkmm/container.h
gtk/gtkmm/cssprovider.cc
gtk/gtkmm/cssprovider.h
+gtk/gtkmm/csssection.cc
+gtk/gtkmm/csssection.h
gtk/gtkmm/dialog.cc
gtk/gtkmm/dialog.h
gtk/gtkmm/drawingarea.cc
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index 8fed08b..102b9c9 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -142,6 +142,7 @@ extern const int gtkmm_micro_version;
#include <gtkmm/comboboxtext.h>
#include <gtkmm/container.h>
#include <gtkmm/cssprovider.h>
+#include <gtkmm/csssection.h>
#include <gtkmm/dialog.h>
#include <gtkmm/drawingarea.h>
#include <gtkmm/editable.h>
diff --git a/gtk/src/csssection.ccg b/gtk/src/csssection.ccg
new file mode 100644
index 0000000..1738356
--- /dev/null
+++ b/gtk/src/csssection.ccg
@@ -0,0 +1,17 @@
+/* Copyright (C) 2014 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>
diff --git a/gtk/src/csssection.hg b/gtk/src/csssection.hg
new file mode 100644
index 0000000..ee44910
--- /dev/null
+++ b/gtk/src/csssection.hg
@@ -0,0 +1,56 @@
+/* Copyright (C) 2014 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 <glibmm/refptr.h>
+#include <giomm/file.h>
+
+_DEFS(gtkmm,gtk)
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+typedef struct _GtkCssSection GtkCssSection;
+#endif
+
+namespace Gtk
+{
+_WRAP_ENUM(CssSectionType, GtkCssSectionType)
+
+/** Defines a part of a CSS document.
+ * Because sections are nested into one another, you can use get_parent()
+ * to get the containing region.
+ *
+ * There is no public method that creates a CssSection, but it is input data to
+ * a Gtk::CssProvider::signal_parsing_error() handler.
+ *
+ * @newin{3,16}
+ */
+class CssSection
+{
+ _CLASS_OPAQUE_REFCOUNTED(CssSection, GtkCssSection, NONE, gtk_css_section_ref, gtk_css_section_unref)
+ _IGNORE(gtk_css_section_ref, gtk_css_section_unref)
+
+public:
+ _WRAP_METHOD(CssSectionType get_section_type() const, gtk_css_section_get_section_type)
+ _WRAP_METHOD(Glib::RefPtr<CssSection> get_parent(), gtk_css_section_get_parent, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const CssSection> get_parent() const, gtk_css_section_get_parent, refreturn,
constversion)
+ _WRAP_METHOD(Glib::RefPtr<Gio::File> get_file(), gtk_css_section_get_file, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const Gio::File> get_file() const, gtk_css_section_get_file, refreturn,
constversion)
+ _WRAP_METHOD(unsigned int get_start_line() const, gtk_css_section_get_start_line)
+ _WRAP_METHOD(unsigned int get_start_position() const, gtk_css_section_get_start_position)
+ _WRAP_METHOD(unsigned int get_end_line() const, gtk_css_section_get_end_line)
+ _WRAP_METHOD(unsigned int get_end_position() const, gtk_css_section_get_end_position)
+};
+
+} // namespace Gtk
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 00fe08e..2b54f8d 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -62,6 +62,7 @@ gtkmm_files_any_hg = \
comboboxtext.hg \
container.hg \
cssprovider.hg \
+ csssection.hg \
dialog.hg \
drawingarea.hg \
editable.hg \
diff --git a/gtk/src/gtk_extra_objects.defs b/gtk/src/gtk_extra_objects.defs
index 9280917..220d473 100644
--- a/gtk/src/gtk_extra_objects.defs
+++ b/gtk/src/gtk_extra_objects.defs
@@ -36,6 +36,12 @@
(gtype-id "GTK_TYPE_COLOR_CHOOSER")
)
+(define-object CssSection
+ (in-module "Gtk")
+ (c-name "GtkCssSection")
+ (gtype-id "GTK_TYPE_CSS_SECTION")
+)
+
(define-object Editable
(in-module "Gtk")
(c-name "GtkEditable")
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 802be80..4fcd8a8 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -75,6 +75,7 @@ _CONV_ENUM(Gtk,CalendarDisplayOptions)
_CONV_ENUM(Gtk,CellRendererMode)
_CONV_ENUM(Gtk,CellRendererState)
_CONV_ENUM(Gtk,CornerType)
+_CONV_ENUM(Gtk,CssSectionType)
_CONV_ENUM(Gtk,CurveType)
_CONV_ENUM(Gtk,DeleteType)
_CONV_ENUM(Gtk,DestDefaults)
@@ -225,6 +226,7 @@ _CONVERSION(`GtkStyleProvider*',`Glib::RefPtr<StyleProvider>',`Glib::wrap($3)')
_CONVERSION(`const Glib::RefPtr<StyleProvider>&',`GtkStyleProvider*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`GtkCssProvider*',`Glib::RefPtr<CssProvider>',`Glib::wrap($3)')
+_CONVERSION(`GtkCssSection*',`Glib::RefPtr<CssSection>',`Glib::wrap($3)')
# AccelGroup:
_CONVERSION(`GtkAccelGroup*',`Glib::RefPtr<AccelGroup>',`Glib::wrap($3)')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]