From b2b7c892f509e237c20c46d77186dad89cbef63e Mon Sep 17 00:00:00 2001 From: Dmitry Kalyanov Date: Sun, 15 Nov 2009 00:47:32 +0300 Subject: [PATCH] Finish Gdk/Drawing-primitives and add sever Pango types --- gdk/gdk.drawing-primitives.lisp | 65 +++++++++++++++++++++++---------------- gdk/gdk.objects.lisp | 2 +- pango/pango.lisp | 28 +++++++++++++++++ 3 files changed, 68 insertions(+), 27 deletions(-) diff --git a/gdk/gdk.drawing-primitives.lisp b/gdk/gdk.drawing-primitives.lisp index 6d32034..bdd09c9 100644 --- a/gdk/gdk.drawing-primitives.lisp +++ b/gdk/gdk.drawing-primitives.lisp @@ -130,32 +130,45 @@ (export 'draw-trapezoids) -;; TODO -;; void gdk_draw_glyphs (GdkDrawable *drawable, -;; GdkGC *gc, -;; PangoFont *font, -;; gint x, -;; gint y, -;; PangoGlyphString *glyphs); -;; void gdk_draw_glyphs_transformed (GdkDrawable *drawable, -;; GdkGC *gc, -;; const PangoMatrix *matrix, -;; PangoFont *font, -;; gint x, -;; gint y, -;; PangoGlyphString *glyphs); -;; void gdk_draw_layout_line (GdkDrawable *drawable, -;; GdkGC *gc, -;; gint x, -;; gint y, -;; PangoLayoutLine *line); -;; void gdk_draw_layout_line_with_colors (GdkDrawable *drawable, -;; GdkGC *gc, -;; gint x, -;; gint y, -;; PangoLayoutLine *line, -;; const GdkColor *foreground, -;; const GdkColor *background); +(defcfun (draw-glyphs "gdk_draw_glyphs") :void + (drawable (g-object drawable)) + (gc (g-object graphics-context)) + (font (g-object pango-font)) + (x :int) + (y :int) + (glyphs (g-boxed-foreign pango-glyph-string))) + +(export 'draw-glyphs) + +(defcfun (draw-glyphs-transformed "gdk_draw_glyphs_transformed") :void + (drawable (g-object drawable)) + (gc (g-object graphics-context)) + (matrix (g-boxed-foreign pango-matrix)) + (font (g-object pango-font)) + (x :int) + (y :int)) + +(export 'draw-glyphs-transformed) + +(defcfun (draw-layout-line "gdk_draw_layout_line") :void + (drawable (g-object drawable)) + (gc (g-object graphics-context)) + (x :int) + (y :int) + (line (g-boxed-foreign pango-layout-line))) + +(export 'draw-layout-line) + +(defcfun (draw-layout-line-with-colors "gdk_draw_layout_line_with_colors") :void + (drawable (g-object drawable)) + (gc (g-object graphics-context)) + (x :int) + (y :int) + (line (g-boxed-foreign pango-layout-line)) + (foreground (g-boxed-foreign color)) + (background (g-boxed-foreign color))) + +(export 'draw-layout-line-with-colors) (defcfun (draw-layout "gdk_draw_layout") :void (drawable (g-object drawable)) diff --git a/gdk/gdk.objects.lisp b/gdk/gdk.objects.lisp index 4e887a8..78774d5 100644 --- a/gdk/gdk.objects.lisp +++ b/gdk/gdk.objects.lisp @@ -1071,7 +1071,7 @@ nil "gdk_app_launch_context_set_screen") (:cffi desktop gdk-app-launch-context-desktop :int nil "gdk_app_launch_context_set_desktop") - (:cffi timestamp gdk-app-launch-context-timestamp :uin32 + (:cffi timestamp gdk-app-launch-context-timestamp :uint32 nil "gdk_app_launch_context_set_timestamp") (:cffi icon gdk-app-launch-context-icon g-object nil "gdk_app_launch_context_set_icon") diff --git a/pango/pango.lisp b/pango/pango.lisp index 2df572f..9be3323 100644 --- a/pango/pango.lisp +++ b/pango/pango.lisp @@ -70,3 +70,31 @@ (:background 1) (:underline 2) (:strikethrough 3)) + +(defcfun pango_glyph_string_new :pointer) + +(define-g-boxed-opaque pango-glyph-string "PangoGlyphString" + :alloc (pango_glyph_string_new)) + +(export (boxed-related-symbols 'pango-glyph-string)) + +(define-g-object-class "PangoFont" pango-font + (:superclass g-object :export t :interfaces + nil :type-initializer + "pango_font_get_type") + nil) + +(define-g-boxed-cstruct pango-matrix "PangoMatrix" + (xx :double :initform 0.0) + (xy :double :initform 0.0) + (yx :double :initform 0.0) + (yy :double :initform 0.0) + (x0 :double :initform 0.0) + (y0 :double :initform 0.0)) + +(export (boxed-related-symbols 'pango-matrix)) + +(define-g-boxed-opaque pango-layout-line "PangoLayoutLine" + :alloc (error "You do not create PangoLayoutLine yourself")) + +(export (boxed-related-symbols 'pango-layout-line)) -- 1.7.10.4