[gtkmm] Added CssProvider.



commit 28634b4a52e13c213a241bb47ea2062c21e5d239
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Dec 7 14:46:17 2010 +0100

    Added CssProvider.
    
      * gtl/src/filelist.am:
    * gtk/src/cssprovider.[hg|ccg]: Added CssProvider, implementing StyleProvider.
      * gtk/gtkmm.h: Include the new header.

 ChangeLog               |    8 ++++++
 gtk/gtkmm.h             |    1 +
 gtk/src/cssprovider.ccg |   18 +++++++++++++++
 gtk/src/cssprovider.hg  |   55 +++++++++++++++++++++++++++++++++++++++++++++++
 gtk/src/filelist.am     |    1 +
 gtk/src/iconinfo.hg     |    5 +--
 tools/m4/convert_gtk.m4 |    2 +
 7 files changed, 87 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 499e22f..af3363d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2010-12-07  Murray Cumming  <murrayc murrayc com>
 
+	Added CssProvider.
+
+  * gtl/src/filelist.am:
+	* gtk/src/cssprovider.[hg|ccg]: Added CssProvider, implementing StyleProvider.
+  * gtk/gtkmm.h: Include the new header.
+  
+2010-12-07  Murray Cumming  <murrayc murrayc com>
+
 	Added signals/properties .defs for GtkStyleContext.
 
 	* tools/extra_defs_gen/generate_defs_gtk.cc: Added some new types.
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index 3ea518a..e3ad3eb 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -126,6 +126,7 @@ extern const int gtkmm_micro_version;
 #include <gtkmm/combobox.h>
 #include <gtkmm/comboboxtext.h>
 #include <gtkmm/container.h>
+#include <gtkmm/cssprovider.h>
 #include <gtkmm/dialog.h>
 #include <gtkmm/drawingarea.h>
 #include <gtkmm/editable.h>
diff --git a/gtk/src/cssprovider.ccg b/gtk/src/cssprovider.ccg
new file mode 100644
index 0000000..735bc9d
--- /dev/null
+++ b/gtk/src/cssprovider.ccg
@@ -0,0 +1,18 @@
+/* Copyright (C) 2010 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, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+ 
+#include <gtk/gtk.h>
diff --git a/gtk/src/cssprovider.hg b/gtk/src/cssprovider.hg
new file mode 100644
index 0000000..a02f99d
--- /dev/null
+++ b/gtk/src/cssprovider.hg
@@ -0,0 +1,55 @@
+/* Copyright (C) 2010 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, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gtkmm/styleprovider.h>
+#include <glibmm/object.h>
+#include <giomm/file.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(glibmm/private/object_p.h)
+
+
+namespace Gtk
+{
+
+/** TODO
+ */
+class CssProvider
+  : public Glib::Object,
+    public StyleProvider
+{
+  _CLASS_GOBJECT(CssProvider, GtkCssProvider, GTK_CSS_PROVIDER, Glib::Object, GObject)
+  _IMPLEMENTS_INTERFACE(StyleProvider)
+public:
+  _CTOR_DEFAULT()
+  _IGNORE(gtk_css_provider_new)
+  
+  _WRAP_METHOD(bool load_from_data(const std::string& data, gssize length), gtk_css_provider_load_from_data, errthrow)
+  
+  _WRAP_METHOD(bool load_from_file(const Glib::RefPtr<const Gio::File>& file), gtk_css_provider_load_from_file, errthrow)
+  _WRAP_METHOD(bool load_from_path(const std::string& path), gtk_css_provider_load_from_path, errthrow)
+
+  _WRAP_METHOD(static Glib::RefPtr<CssProvider> get_default(), gtk_css_provider_get_default)
+
+  _WRAP_METHOD(static Glib::RefPtr<CssProvider> get_named(const Glib::ustring& name, const Glib::ustring& variant), gtk_css_provider_get_named)
+
+
+  //There are no properties or signals.
+};
+
+} // namespace Gtk
+
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 569a938..fd79ebc 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -54,6 +54,7 @@ gtkmm_files_any_hg =		\
 	combobox.hg	\
 	comboboxtext.hg	\
 	container.hg		\
+	cssprovider.hg	\
 	dialog.hg		\
 	drawingarea.hg		\
 	editable.hg		\
diff --git a/gtk/src/iconinfo.hg b/gtk/src/iconinfo.hg
index c5cdfad..326299f 100644
--- a/gtk/src/iconinfo.hg
+++ b/gtk/src/iconinfo.hg
@@ -51,11 +51,10 @@ public:
   Glib::RefPtr<Gdk::Pixbuf> load_icon_symbolic(const Gdk::RGBA& fg, const Gdk::RGBA& success_color, const Gdk::RGBA& warning_color, const Gdk::RGBA& error_color, bool& was_symbolic) const;
   _IGNORE(gtk_icon_info_load_symbolic)
 
-/* TODO: Wrap gtk_icon_info_load_symbolic_for_context().
-  Glib::RefPtr<Gdk::Pixbuf> load_icon_symbolic(const Glib::RefPtr<Style>& style, StateType state, bool& was_symbolic) const;
-*/
   _IGNORE(gtk_icon_info_load_symbolic_for_style) //deprecated
 
+  //TODO: _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> load_symbolic(const Glib::RefPtr<StyleContext>& style, bool& was_symbolic), gtk_icon_info_load_symbolic_for_context, errthrow)
+                                                               
 
   _WRAP_METHOD(void set_raw_coordinates(bool raw_coordinates = true), gtk_icon_info_set_raw_coordinates)
   _WRAP_METHOD(bool get_embedded_rect(Gdk::Rectangle& rectangle) const, gtk_icon_info_get_embedded_rect)
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index aeb2d98..9566db0 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -209,6 +209,8 @@ _CONVERSION(`const Glib::RefPtr<StyleContext>&',`GtkStyleContext*',__CONVERT_REF
 _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)')
+
 # AccelGroup:
 _CONVERSION(`GtkAccelGroup*',`Glib::RefPtr<AccelGroup>',`Glib::wrap($3)')
 _CONVERSION(`GtkAccelGroup*',`Glib::RefPtr<const AccelGroup>',`Glib::wrap($3)')



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]