From: Jim Evins Date: Wed, 12 Aug 2009 18:59:13 +0000 (+0000) Subject: 2009-08-12 Jim Evins X-Git-Tag: glabels-2_3_0~212 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6f7963a0bf6a6e0c6dac3d94475cd56c71b220bf;p=glabels 2009-08-12 Jim Evins * src/label-text.c: (buffer_changed_cb), (draw_object), (draw_shadow), (draw_text_real): * src/label-text.h: Moved common code from draw_object() and draw_shadow() to draw_text_real(). Also cleaned up formatting and updated license notification to GPL3+. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@858 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index 8dcfd4de..8eed80b2 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,12 @@ +2009-08-12 Jim Evins + + * src/label-text.c: (buffer_changed_cb), (draw_object), + (draw_shadow), (draw_text_real): + * src/label-text.h: + Moved common code from draw_object() and draw_shadow() to + draw_text_real(). Also cleaned up formatting and updated + license notification to GPL3+. + 2009-07-29 Alexandre Prokoudine * po/ru.po: Updated and fixed Russian translation diff --git a/glabels2/src/label-text.c b/glabels2/src/label-text.c index 9a4d59a1..9335ab9d 100644 --- a/glabels2/src/label-text.c +++ b/glabels2/src/label-text.c @@ -1,27 +1,25 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - /* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_text.c: GLabels label text object + * label-text.c + * Copyright (C) 2001-2009 Jim Evins . * - * Copyright (C) 2001-2007 Jim Evins . + * This file is part of gLabels. * - * This program is free software; you can redistribute it and/or modify + * gLabels is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * gLabels 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 General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * along with gLabels. If not, see . */ +#include + #include "label-text.h" #include @@ -34,6 +32,7 @@ #include "debug.h" + /*========================================================*/ /* Private macros and constants. */ /*========================================================*/ @@ -49,6 +48,7 @@ #define FONT_SCALE (72.0/96.0) + /*========================================================*/ /* Private types. */ /*========================================================*/ @@ -71,10 +71,12 @@ struct _glLabelTextPrivate { gdouble h; }; + /*========================================================*/ /* Private globals. */ /*========================================================*/ + /*========================================================*/ /* Private function prototypes. */ /*========================================================*/ @@ -136,6 +138,12 @@ static void draw_shadow (glLabelObject *object, gboolean screen_flag, glMergeRecord *record); +static void draw_text_real (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record, + guint color); + static gdouble auto_shrink_font_size (cairo_t *cr, gchar *family, gdouble size, @@ -145,12 +153,15 @@ static gdouble auto_shrink_font_size (cairo_t *cr, gdouble width); - /*****************************************************************************/ -/* Boilerplate object stuff. */ +/* Object infrastructure. */ /*****************************************************************************/ G_DEFINE_TYPE (glLabelText, gl_label_text, GL_TYPE_LABEL_OBJECT); + +/*****************************************************************************/ +/* Class Init Function. */ +/*****************************************************************************/ static void gl_label_text_class_init (glLabelTextClass *class) { @@ -183,6 +194,10 @@ gl_label_text_class_init (glLabelTextClass *class) object_class->finalize = gl_label_text_finalize; } + +/*****************************************************************************/ +/* Object Instance Init Function. */ +/*****************************************************************************/ static void gl_label_text_init (glLabelText *ltext) { @@ -207,6 +222,10 @@ gl_label_text_init (glLabelText *ltext) G_CALLBACK(buffer_changed_cb), ltext); } + +/*****************************************************************************/ +/* Finalize Method. */ +/*****************************************************************************/ static void gl_label_text_finalize (GObject *object) { @@ -223,8 +242,9 @@ gl_label_text_finalize (GObject *object) G_OBJECT_CLASS (gl_label_text_parent_class)->finalize (object); } + /*****************************************************************************/ -/* NEW label "text" object. */ +/** New Object Generator. */ /*****************************************************************************/ GObject * gl_label_text_new (glLabel *label) @@ -238,6 +258,7 @@ gl_label_text_new (glLabel *label) return G_OBJECT (ltext); } + /*****************************************************************************/ /* Copy object contents. */ /*****************************************************************************/ @@ -312,6 +333,7 @@ gl_label_text_get_buffer (glLabelText *ltext) return ltext->priv->buffer; } + GList * gl_label_text_get_lines (glLabelText *ltext) { @@ -330,20 +352,23 @@ gl_label_text_get_lines (glLabelText *ltext) return lines; } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. text buffer "changed" callback. */ -/*---------------------------------------------------------------------------*/ -void buffer_changed_cb (GtkTextBuffer *textbuffer, - glLabelText *ltext) + +/*****************************************************************************/ +/* Text buffer "changed" callback. */ +/*****************************************************************************/ +static void +buffer_changed_cb (GtkTextBuffer *textbuffer, + glLabelText *ltext) { ltext->priv->size_changed = TRUE; gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get object size method. */ -/*---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Get object size method. */ +/*****************************************************************************/ static void get_size (glLabelObject *object, gdouble *w, @@ -424,9 +449,10 @@ get_size (glLabelObject *object, gl_debug (DEBUG_LABEL, "END"); } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. set font family method. */ -/*---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Set font family method. */ +/*****************************************************************************/ static void set_font_family (glLabelObject *object, const gchar *font_family) @@ -471,9 +497,10 @@ set_font_family (glLabelObject *object, gl_debug (DEBUG_LABEL, "END"); } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. set font size method. */ -/*---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Set font size method. */ +/*****************************************************************************/ static void set_font_size (glLabelObject *object, gdouble font_size) @@ -496,9 +523,10 @@ set_font_size (glLabelObject *object, gl_debug (DEBUG_LABEL, "END"); } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. set font weight method. */ -/*---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Set font weight method. */ +/*****************************************************************************/ static void set_font_weight (glLabelObject *object, PangoWeight font_weight) @@ -521,9 +549,10 @@ set_font_weight (glLabelObject *object, gl_debug (DEBUG_LABEL, "END"); } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. set font italic flag method. */ -/*---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Set font italic flag method. */ +/*****************************************************************************/ static void set_font_italic_flag (glLabelObject *object, gboolean font_italic_flag) @@ -546,9 +575,10 @@ set_font_italic_flag (glLabelObject *object, gl_debug (DEBUG_LABEL, "END"); } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. set text alignment method. */ -/*---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Set text alignment method. */ +/*****************************************************************************/ static void set_text_alignment (glLabelObject *object, PangoAlignment text_alignment) @@ -571,9 +601,10 @@ set_text_alignment (glLabelObject *object, gl_debug (DEBUG_LABEL, "END"); } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. set text line spacing method. */ -/*---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Set text line spacing method. */ +/*****************************************************************************/ static void set_text_line_spacing (glLabelObject *object, gdouble line_spacing) @@ -596,9 +627,10 @@ set_text_line_spacing (glLabelObject *object, gl_debug (DEBUG_LABEL, "END"); } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. set text color method. */ -/*---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Set text color method. */ +/*****************************************************************************/ static void set_text_color (glLabelObject *object, glColorNode *text_color_node) @@ -621,9 +653,10 @@ set_text_color (glLabelObject *object, gl_debug (DEBUG_LABEL, "END"); } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get font family method. */ -/*---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Get font family method. */ +/*****************************************************************************/ static gchar * get_font_family (glLabelObject *object) { @@ -636,9 +669,10 @@ get_font_family (glLabelObject *object) return g_strdup (ltext->priv->font_family); } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get font size method. */ -/*---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Get font size method. */ +/*****************************************************************************/ static gdouble get_font_size (glLabelObject *object) { @@ -651,9 +685,10 @@ get_font_size (glLabelObject *object) return ltext->priv->font_size; } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get font weight method. */ -/*---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Get font weight method. */ +/*****************************************************************************/ static PangoWeight get_font_weight (glLabelObject *object) { @@ -666,9 +701,10 @@ get_font_weight (glLabelObject *object) return ltext->priv->font_weight; } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get font italic flag method. */ -/*---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Get font italic flag method. */ +/*****************************************************************************/ static gboolean get_font_italic_flag (glLabelObject *object) { @@ -681,9 +717,10 @@ get_font_italic_flag (glLabelObject *object) return ltext->priv->font_italic_flag; } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get text alignment method. */ -/*---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Get text alignment method. */ +/*****************************************************************************/ static PangoAlignment get_text_alignment (glLabelObject *object) { @@ -696,9 +733,10 @@ get_text_alignment (glLabelObject *object) return ltext->priv->align; } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get text line spacing method. */ -/*---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Get text line spacing method. */ +/*****************************************************************************/ static gdouble get_text_line_spacing (glLabelObject *object) { @@ -711,9 +749,10 @@ get_text_line_spacing (glLabelObject *object) return ltext->priv->line_spacing; } -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get text color method. */ -/*---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Get text color method. */ +/*****************************************************************************/ static glColorNode* get_text_color (glLabelObject *object) { @@ -726,6 +765,7 @@ get_text_color (glLabelObject *object) return gl_color_node_dup (ltext->priv->color_node); } + /*****************************************************************************/ /* Set auto shrink flag. */ /*****************************************************************************/ @@ -747,6 +787,7 @@ gl_label_text_set_auto_shrink (glLabelText *ltext, gl_debug (DEBUG_LABEL, "END"); } + /*****************************************************************************/ /* Query auto shrink flag. */ /*****************************************************************************/ @@ -760,6 +801,7 @@ gl_label_text_get_auto_shrink (glLabelText *ltext) return ltext->priv->auto_shrink; } + /*****************************************************************************/ /* Draw object method. */ /*****************************************************************************/ @@ -769,42 +811,11 @@ draw_object (glLabelObject *object, gboolean screen_flag, glMergeRecord *record) { - gdouble x0, y0; - cairo_matrix_t matrix; - gdouble object_w, object_h; - gdouble raw_w, raw_h; - gchar *text; - GList *lines; - gchar *font_family; - gdouble font_size; - PangoWeight font_weight; - gboolean font_italic_flag; glColorNode *color_node; - gboolean auto_shrink; guint color; - gdouble text_line_spacing; - PangoAlignment alignment; - PangoStyle style; - PangoLayout *layout; - PangoFontDescription *desc; - gdouble scale_x, scale_y; - cairo_font_options_t *font_options; - PangoContext *context; - gl_debug (DEBUG_LABEL, "START"); - gl_label_object_get_position (object, &x0, &y0); - gl_label_object_get_matrix (object, &matrix); - - gl_label_object_get_size (object, &object_w, &object_h); - gl_label_object_get_raw_size (object, &raw_w, &raw_h); - lines = gl_label_text_get_lines (GL_LABEL_TEXT (object)); - font_family = gl_label_object_get_font_family (object); - font_size = gl_label_object_get_font_size (object) * FONT_SCALE; - font_weight = gl_label_object_get_font_weight (object); - font_italic_flag = gl_label_object_get_font_italic_flag (object); - color_node = gl_label_object_get_text_color (object); color = gl_color_node_expand (color_node, record); if (color_node->field_flag && screen_flag) @@ -813,94 +824,61 @@ draw_object (glLabelObject *object, } gl_color_node_free (&color_node); - alignment = gl_label_object_get_text_alignment (object); - text_line_spacing = - gl_label_object_get_text_line_spacing (object); - auto_shrink = gl_label_text_get_auto_shrink (GL_LABEL_TEXT (object)); - - text = gl_text_node_lines_expand (lines, record); - - style = font_italic_flag ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL; - - - if (!screen_flag && record && auto_shrink && (raw_w != 0.0)) - { - font_size = auto_shrink_font_size (cr, - font_family, - font_size, - font_weight, - style, - text, - object_w); - g_print ("Autosize new size = %g\n", font_size); - } - + draw_text_real (object, cr, screen_flag, record, color); - /* - * Workaround for pango Bug#341481. - * Render font at device scale and scale font size accordingly. - */ - scale_x = 1.0; - scale_y = 1.0; - cairo_device_to_user_distance (cr, &scale_x, &scale_y); - scale_x = fabs (scale_x); - scale_y = fabs (scale_y); - cairo_save (cr); - cairo_scale (cr, scale_x, scale_y); + gl_debug (DEBUG_LABEL, "END"); +} - layout = pango_cairo_create_layout (cr); - font_options = cairo_font_options_create (); - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); - context = pango_layout_get_context (layout); - pango_cairo_context_set_font_options (context, font_options); - cairo_font_options_destroy (font_options); +/*****************************************************************************/ +/* Draw shadow method. */ +/*****************************************************************************/ +static void +draw_shadow (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record) +{ + glColorNode *color_node; + guint color; + glColorNode *shadow_color_node; + gdouble shadow_opacity; + guint shadow_color; - desc = pango_font_description_new (); - pango_font_description_set_family (desc, font_family); - pango_font_description_set_weight (desc, font_weight); - pango_font_description_set_style (desc, style); - pango_font_description_set_size (desc, font_size * PANGO_SCALE / scale_x); - pango_layout_set_font_description (layout, desc); - pango_font_description_free (desc); + gl_debug (DEBUG_LABEL, "START"); - pango_layout_set_text (layout, text, -1); - pango_layout_set_spacing (layout, font_size * (text_line_spacing-1) * PANGO_SCALE / scale_x); - if (raw_w == 0.0) - { - pango_layout_set_width (layout, -1); - } - else + color_node = gl_label_object_get_text_color (object); + color = gl_color_node_expand (color_node, record); + if (color_node->field_flag && screen_flag) { - pango_layout_set_width (layout, object_w * PANGO_SCALE / scale_x); + color = GL_COLOR_MERGE_DEFAULT; } - pango_layout_set_wrap (layout, PANGO_WRAP_CHAR); - pango_layout_set_alignment (layout, alignment); - - - cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (color)); - cairo_move_to (cr, GL_LABEL_TEXT_MARGIN/scale_x, 0); - pango_cairo_show_layout (cr, layout); - - cairo_restore (cr); - - g_object_unref (layout); - + gl_color_node_free (&color_node); + + shadow_color_node = gl_label_object_get_shadow_color (object); + if (shadow_color_node->field_flag) + { + shadow_color_node->color = GL_COLOR_SHADOW_MERGE_DEFAULT; + } + shadow_opacity = gl_label_object_get_shadow_opacity (object); + shadow_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, color); + gl_color_node_free (&shadow_color_node); - gl_text_node_lines_free (&lines); - g_free (font_family); + draw_text_real (object, cr, screen_flag, record, shadow_color); gl_debug (DEBUG_LABEL, "END"); } + /*****************************************************************************/ -/* Draw shadow method. */ +/* Draw text. */ /*****************************************************************************/ static void -draw_shadow (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record) +draw_text_real (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record, + guint color) { gdouble x0, y0; cairo_matrix_t matrix; @@ -913,12 +891,7 @@ draw_shadow (glLabelObject *object, PangoWeight font_weight; gboolean font_italic_flag; gboolean auto_shrink; - guint color; - glColorNode *color_node; gdouble text_line_spacing; - glColorNode *shadow_color_node; - gdouble shadow_opacity; - guint shadow_color; PangoAlignment alignment; PangoStyle style; PangoLayout *layout; @@ -941,24 +914,11 @@ draw_shadow (glLabelObject *object, font_weight = gl_label_object_get_font_weight (object); font_italic_flag = gl_label_object_get_font_italic_flag (object); - color_node = gl_label_object_get_text_color (object); - color = gl_color_node_expand (color_node, record); - gl_color_node_free (&color_node); - alignment = gl_label_object_get_text_alignment (object); text_line_spacing = gl_label_object_get_text_line_spacing (object); auto_shrink = gl_label_text_get_auto_shrink (GL_LABEL_TEXT (object)); - shadow_color_node = gl_label_object_get_shadow_color (object); - if (shadow_color_node->field_flag) - { - shadow_color_node->color = GL_COLOR_SHADOW_MERGE_DEFAULT; - } - shadow_opacity = gl_label_object_get_shadow_opacity (object); - shadow_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, color); - gl_color_node_free (&shadow_color_node); - text = gl_text_node_lines_expand (lines, record); style = font_italic_flag ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL; @@ -1017,21 +977,23 @@ draw_shadow (glLabelObject *object, pango_layout_set_wrap (layout, PANGO_WRAP_CHAR); pango_layout_set_alignment (layout, alignment); - cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (shadow_color)); + + cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (color)); cairo_move_to (cr, GL_LABEL_TEXT_MARGIN/scale_x, 0); pango_cairo_show_layout (cr, layout); - cairo_restore (cr); g_object_unref (layout); + gl_text_node_lines_free (&lines); g_free (font_family); gl_debug (DEBUG_LABEL, "END"); } + /*****************************************************************************/ /* Automatically shrink text size to fit within horizontal width. */ /*****************************************************************************/ @@ -1092,3 +1054,13 @@ auto_shrink_font_size (cairo_t *cr, return new_size; } + + +/* + * Local Variables: -- emacs + * mode: C -- emacs + * c-basic-offset: 8 -- emacs + * tab-width: 8 -- emacs + * indent-tabs-mode: nil -- emacs + * End: -- emacs + */ diff --git a/glabels2/src/label-text.h b/glabels2/src/label-text.h index 95c46230..59eae915 100644 --- a/glabels2/src/label-text.h +++ b/glabels2/src/label-text.h @@ -1,25 +1,21 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - /* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_text.h: GLabels label text object + * label-text.h + * Copyright (C) 2008 Jim Evins . * - * Copyright (C) 2001-2002 Jim Evins . + * This file is part of gLabels. * - * This program is free software; you can redistribute it and/or modify + * gLabels is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * gLabels 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 General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * along with gLabels. If not, see . */ #ifndef __LABEL_TEXT_H__ @@ -34,16 +30,18 @@ G_BEGIN_DECLS #define GL_LABEL_TEXT_MARGIN 3.0 -#define GL_TYPE_LABEL_TEXT (gl_label_text_get_type ()) -#define GL_LABEL_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_TEXT, glLabelText)) -#define GL_LABEL_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_TEXT, glLabelTextClass)) -#define GL_IS_LABEL_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_TEXT)) -#define GL_IS_LABEL_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_TEXT)) +#define GL_TYPE_LABEL_TEXT (gl_label_text_get_type ()) +#define GL_LABEL_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_TEXT, glLabelText)) +#define GL_LABEL_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_TEXT, glLabelTextClass)) +#define GL_IS_LABEL_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_TEXT)) +#define GL_IS_LABEL_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_TEXT)) +#define GL_COLOR_COMBO_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_LABEL_TEXT, glLabelTextClass)) + typedef struct _glLabelText glLabelText; +typedef struct _glLabelTextPrivate glLabelTextPrivate; typedef struct _glLabelTextClass glLabelTextClass; -typedef struct _glLabelTextPrivate glLabelTextPrivate; struct _glLabelText { glLabelObject object; @@ -55,20 +53,35 @@ struct _glLabelTextClass { glLabelObjectClass parent_class; }; -GType gl_label_text_get_type (void) G_GNUC_CONST; -GObject *gl_label_text_new (glLabel *label); +GType gl_label_text_get_type (void) G_GNUC_CONST; + +GObject *gl_label_text_new (glLabel *label); + +void gl_label_text_set_lines (glLabelText *ltext, + GList *lines); -void gl_label_text_set_lines (glLabelText *ltext, - GList *lines); -GtkTextBuffer *gl_label_text_get_buffer (glLabelText *ltext); -GList *gl_label_text_get_lines (glLabelText *ltext); +GtkTextBuffer *gl_label_text_get_buffer (glLabelText *ltext); + +GList *gl_label_text_get_lines (glLabelText *ltext); void gl_label_text_set_auto_shrink (glLabelText *ltext, gboolean auto_shrink); + gboolean gl_label_text_get_auto_shrink (glLabelText *ltext); G_END_DECLS #endif /* __LABEL_TEXT_H__ */ + + + +/* + * Local Variables: -- emacs + * mode: C -- emacs + * c-basic-offset: 8 -- emacs + * tab-width: 8 -- emacs + * indent-tabs-mode: nil -- emacs + * End: -- emacs + */