pangomm r14 - in trunk: . pango/src tools/m4



Author: murrayc
Date: Tue Aug 12 07:51:38 2008
New Revision: 14
URL: http://svn.gnome.org/viewvc/pangomm?rev=14&view=rev

Log:
2008-08-12  Murray Cumming  <murrayc murrayc com>

* pango/src/layoutrun.hg: Typedef this to GlyphItem, because 
that is what it is (and is documented as) in Pango.
Added splt() and letter() space to LayoutRun, wrapping PangoGlyphItem 
functions. 
* tools/m4/convert_pango.m4:
* pango/src/renderer.hg: Added draw_glyph_item().

* pango/src/cairofontmap.hg: Added set_default().

Modified:
   trunk/ChangeLog
   trunk/pango/src/cairofontmap.hg
   trunk/pango/src/layoutrun.hg
   trunk/pango/src/renderer.hg
   trunk/tools/m4/convert_pango.m4

Modified: trunk/pango/src/cairofontmap.hg
==============================================================================
--- trunk/pango/src/cairofontmap.hg	(original)
+++ trunk/pango/src/cairofontmap.hg	Tue Aug 12 07:51:38 2008
@@ -43,6 +43,7 @@
 
 public:
   //_WRAP_METHOD(static Glib::RefPtr<PangoFontMap> get_default(), pango_cairo_font_map_get_default) //TODO: ref this?
+  _WRAP_METHOD(void set_default(), pango_cairo_font_map_set_default)
 
 #m4 _CONVERSION(`cairo_font_type_t',`Cairo::FontType',`static_cast<Cairo::FontType>($3)')
   _WRAP_METHOD(Cairo::FontType get_font_type() const, pango_cairo_font_map_get_font_type)

Modified: trunk/pango/src/layoutrun.hg
==============================================================================
--- trunk/pango/src/layoutrun.hg	(original)
+++ trunk/pango/src/layoutrun.hg	Tue Aug 12 07:51:38 2008
@@ -17,6 +17,7 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <pangomm/attributes.h> //For LogAttr.
 #include <pango/pango-layout.h>
 
 _DEFS(pangomm,pango)
@@ -26,6 +27,11 @@
 
 class Item;
 class GlyphString;
+class LayoutRun;
+
+typedef LayoutRun GlyphItem;
+
+//TODO: The Pango docs now say "it is simply an alternate name for PangoGlyphItem. See the PangoGlyphItem docs for details on the fields. "
 
 /** A Pango::LayoutRun represents a single run within a PangoLayoutLine.
  */
@@ -39,6 +45,11 @@
 public:
   explicit LayoutRun(const PangoLayoutRun* src);
 
+  _WRAP_METHOD(GlyphItem split(const Glib::ustring& text, int split_index), pango_glyph_item_split)
+
+  //This takes ownership of the GlyphItem, which is strange: _WRAP_METHOD(GSList* apply_attrs(const Glib::ustring& text, const AttrList& list), pango_glyph_item_apply_attrs)
+  _WRAP_METHOD(void letter_space(const Glib::ustring& text, const LogAttr& log_attrs, int letter_spacing = 0), pango_glyph_item_letter_space)
+
   /** Gets the Pango::Item object that provides information about the segment of text in this run.
    * @return A Pango::Item object.
    */

Modified: trunk/pango/src/renderer.hg
==============================================================================
--- trunk/pango/src/renderer.hg	(original)
+++ trunk/pango/src/renderer.hg	Tue Aug 12 07:51:38 2008
@@ -22,6 +22,7 @@
 
 #include <glibmm/object.h>
 #include <pangomm/context.h>
+#include <pangomm/layoutrun.h> //Has a typedef for GlyphItem
 #include <pangomm/glyphstring.h>
 #include <pangomm/layout.h>
 #include <pangomm/layoutline.h>
@@ -51,6 +52,7 @@
   _WRAP_METHOD(void draw_layout(const Glib::RefPtr<Layout>& layout, int x, int y), pango_renderer_draw_layout)
   _WRAP_METHOD(void draw_layout_line(const Glib::RefPtr<LayoutLine>& line, int x, int y), pango_renderer_draw_layout_line)
   _WRAP_METHOD(void draw_glyphs(const Glib::RefPtr<Font>& font, const GlyphString& glyphs, int x, int y), pango_renderer_draw_glyphs)
+  _WRAP_METHOD(void draw_glyph_item(const Glib::ustring& text, const GlyphItem& glyph_item, int x, int y), pango_renderer_draw_glyph_item)
   _WRAP_METHOD(void draw_rectangle(RenderPart part, int x, int y, int width, int height), pango_renderer_draw_rectangle)
   _WRAP_METHOD(void draw_error_underline(int x, int y, int width, int height), pango_renderer_draw_error_underline)
   _WRAP_METHOD(void draw_trapezoid(RenderPart part, double y1, double x11, double x21, double y2, double x12, double x22), pango_renderer_draw_trapezoid)
@@ -67,6 +69,8 @@
   _WRAP_METHOD(Color get_color(RenderPart part) const, pango_renderer_get_color)
 
   _WRAP_METHOD(void set_matrix(const Matrix& matrix), pango_renderer_set_matrix)
+
+  //TODO: Documentation:
   Matrix get_matrix() const;
   _IGNORE(pango_renderer_get_matrix)
 

Modified: trunk/tools/m4/convert_pango.m4
==============================================================================
--- trunk/tools/m4/convert_pango.m4	(original)
+++ trunk/tools/m4/convert_pango.m4	Tue Aug 12 07:51:38 2008
@@ -84,6 +84,9 @@
 _CONVERSION(`const Pango::GlyphString&',`PangoGlyphString*',const_cast<PangoGlyphString*>($3.gobj()))
 _CONVERSION(`const GlyphString&',`PangoGlyphString*',const_cast<PangoGlyphString*>($3.gobj()))
 
+_CONVERSION(`PangoGlyphItem*',`GlyphItem',`GlyphItem(($3))')
+_CONVERSION(`const GlyphItme&',`PangoGlyphItem*',const_cast<PangoGlyphItem*>($3.gobj()))
+
 _CONVERSION(`PangoFont*',`Glib::RefPtr<Font>',Glib::wrap($3))
 _CONVERSION(`PangoFont*',`Glib::RefPtr<Pango::Font>',Glib::wrap($3))
 _CONVERSION(`PangoFont*',`Glib::RefPtr<const Font>',Glib::wrap($3))
@@ -160,3 +163,6 @@
 
 _CONVERSION(`const Cairo::FontOptions&',`const cairo_font_options_t*',`($3).cobj()')
 
+_CONVERSION(`const LogAttr&',`PangoLogAttr*',&(const_cast<LogAttr&>($3)))
+
+



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