this->priv = g_new0 (glColorComboButtonPrivate, 1);
- this->priv->button_vbox = gtk_vbox_new (FALSE, 0);
+ this->priv->button_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
this->priv->button = gtk_toggle_button_new ();
gtk_container_add (GTK_CONTAINER (this->priv->button), this->priv->button_vbox);
/*
* Size of menu.
*/
- gtk_widget_size_request (this->priv->menu, &menu_requisition);
+ gtk_widget_get_preferred_size (this->priv->menu, NULL, &menu_requisition);
h_menu = menu_requisition.height;
w_menu = menu_requisition.width;
this->priv = g_new0 (glColorComboPrivate, 1);
- hbox = gtk_hbox_new (FALSE, 3);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
gtk_container_add (GTK_CONTAINER (this), hbox);
this->priv->swatch = gl_color_swatch_new (IMAGE_W, IMAGE_H, GL_COLOR_NONE);
/*
* Size of menu.
*/
- gtk_widget_size_request (this->priv->menu, &menu_requisition);
+ gtk_widget_get_preferred_size (this->priv->menu, NULL, &menu_requisition);
h_menu = menu_requisition.height;
w_menu = menu_requisition.width;
this->priv = g_new0 (glFieldButtonPrivate, 1);
- hbox = gtk_hbox_new (FALSE, 3);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
gtk_container_add (GTK_CONTAINER (this), hbox);
this->priv->label = gtk_label_new ("");
/*
* Size of menu.
*/
- gtk_widget_size_request (this->priv->menu, &menu_requisition);
+ gtk_widget_get_preferred_size (this->priv->menu, NULL, &menu_requisition);
h_menu = menu_requisition.height;
w_menu = menu_requisition.width;
this->priv->font_family = g_strdup (font_family);
- hbox = gtk_hbox_new (FALSE, 6);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_container_add (GTK_CONTAINER (this), hbox);
sample = gl_font_sample_new (SAMPLE_W, SAMPLE_H, short_sample_text, font_family);
this->priv = g_new0 (glFontComboPrivate, 1);
- hbox = gtk_hbox_new (FALSE, 3);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
gtk_container_add (GTK_CONTAINER (this), hbox);
this->priv->label = gtk_label_new ("");
/*
* Size of menu.
*/
- gtk_widget_size_request (this->priv->menu, &menu_requisition);
+ gtk_widget_get_preferred_size (this->priv->menu, NULL, &menu_requisition);
h_menu = menu_requisition.height;
w_menu = menu_requisition.width;
if ( !list )
{
fontmap = pango_cairo_font_map_new ();
- context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
+ context = pango_font_map_create_context (PANGO_FONT_MAP (fontmap));
pango_context_list_families (context, &families, &n);
if ( !list )
{
fontmap = pango_cairo_font_map_new ();
- context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
+ context = pango_font_map_create_context (PANGO_FONT_MAP (fontmap));
pango_context_list_families (context, &families, &n);
if ( !list )
{
fontmap = pango_cairo_font_map_new ();
- context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
+ context = pango_font_map_create_context (PANGO_FONT_MAP (fontmap));
pango_context_list_families (context, &families, &n);
#include <glib.h>
#include <gdk/gdk.h>
#include <librsvg/rsvg.h>
-#include <librsvg/rsvg-cairo.h>
#include "pixbuf-util.h"
#include "file-util.h"
gdouble y,
gboolean checkpoint)
{
- gdouble dx, dy;
-
gl_debug (DEBUG_LABEL, "START");
g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
gl_label_checkpoint (object->priv->parent, _("Move"));
}
- dx = x - object->priv->x;
- dy = y - object->priv->y;
-
object->priv->x = x;
object->priv->y = y;
fontmap = pango_cairo_font_map_new ();
- context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
+ context = pango_font_map_create_context (PANGO_FONT_MAP (fontmap));
options = cairo_font_options_create ();
cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_NONE);
cairo_font_options_set_hint_metrics (options, CAIRO_HINT_METRICS_OFF);
void gl_label_set_selection_text_alignment (glLabel *label,
PangoAlignment text_alignment);
+void gl_label_set_selection_text_valignment (glLabel *label,
+ glValignment text_valignment);
+
void gl_label_set_selection_text_line_spacing (glLabel *label,
gdouble text_line_spacing);
static GList *parse_line (FILE *fp,
gchar delim);
-static gchar *parse_field (gchar *raw_field);
static void free_fields (GList **fields);
switch (param_id) {
case ARG_DELIM:
- merge_text->priv->delim = g_value_get_char (value);
+ merge_text->priv->delim = g_value_get_schar (value);
gl_debug (DEBUG_MERGE, "ARG \"delim\" = \"%c\"",
merge_text->priv->delim);
break;
switch (param_id) {
case ARG_DELIM:
- g_value_set_char (value, merge_text->priv->delim);
+ g_value_set_schar (value, merge_text->priv->delim);
break;
case ARG_LINE1_HAS_KEYS:
glMiniPreview *this = GL_MINI_PREVIEW (widget);
GdkWindow *window;
cairo_t *cr;
- gdouble scale;
gdouble x, y;
gint i;
cr = gdk_cairo_create (window);
- scale = set_transform_and_get_scale (this, cr);
+ set_transform_and_get_scale (this, cr);
x = event->x;
y = event->y;
glMiniPreview *this = GL_MINI_PREVIEW (widget);
GdkWindow *window;
cairo_t *cr;
- gdouble scale;
gdouble x, y;
gint i;
cr = gdk_cairo_create (window);
- scale = set_transform_and_get_scale (this, cr);
+ set_transform_and_get_scale (this, cr);
x = event->x;
y = event->y;
lglTemplateOrigin *origins;
GtkStyle *style;
guint base_color;
- guint highlight_color, paper_color, outline_color;
+ guint highlight_color, outline_color;
gl_debug (DEBUG_MINI_PREVIEW, "START");
style = gtk_widget_get_style (GTK_WIDGET(this));
base_color = gl_color_from_gdk_color (&style->base[GTK_STATE_SELECTED]);
- paper_color = gl_color_from_gdk_color (&style->light[GTK_STATE_NORMAL]);
highlight_color = gl_color_set_opacity (base_color, 0.10);
if (this->priv->label)
{
#include <glib.h>
#include <pango/pango.h>
+#include "label-object.h"
+
G_BEGIN_DECLS
const gchar *gl_str_util_align_to_string (PangoAlignment align);
PangoAlignment gl_str_util_string_to_align (const gchar *string);
+const gchar *gl_str_util_valign_to_string (glValignment valign);
+glValignment gl_str_util_string_to_valign (const gchar *string);
+
const gchar *gl_str_util_weight_to_string (PangoWeight weight);
PangoWeight gl_str_util_string_to_weight (const gchar *string);
#include <gtk/gtk.h>
#include <string.h>
+#include "label.h"
#include "builder-util.h"
#include "font-combo.h"
#include "color-combo-button.h"
gl_debug (DEBUG_VIEW, "START");
- hadjustment = gtk_layout_get_hadjustment(GTK_LAYOUT (view->canvas));
- vadjustment = gtk_layout_get_vadjustment(GTK_LAYOUT (view->canvas));
+ hadjustment = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE (view->canvas));
+ vadjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE (view->canvas));
gtk_adjustment_set_page_size( hadjustment, allocation->width);
gtk_adjustment_set_page_increment( hadjustment, allocation->width / 2);
gl_debug (DEBUG_VIEW, "START");
- hadjustment = gtk_layout_get_hadjustment(GTK_LAYOUT (view->canvas));
- vadjustment = gtk_layout_get_vadjustment(GTK_LAYOUT (view->canvas));
+ hadjustment = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE (view->canvas));
+ vadjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE (view->canvas));
g_signal_emit_by_name (hadjustment, "changed");
g_signal_emit_by_name (vadjustment, "changed");
cursor = gdk_cursor_new (GDK_LEFT_PTR);
gdk_window_set_cursor (window, cursor);
- gdk_cursor_unref (cursor);
+ g_object_unref (G_OBJECT (cursor));
view->mode = GL_VIEW_MODE_ARROW;
view->state = GL_VIEW_IDLE;
}
gdk_window_set_cursor (window, cursor);
- gdk_cursor_unref (cursor);
+ g_object_unref (G_OBJECT (cursor));
view->mode = GL_VIEW_MODE_OBJECT_CREATE;
view->state = GL_VIEW_IDLE;
cursor = gdk_cursor_new (GDK_LEFT_PTR);
}
gdk_window_set_cursor (window, cursor);
- gdk_cursor_unref (cursor);
+ g_object_unref (G_OBJECT (cursor));
break;
case GL_VIEW_ARROW_SELECT_REGION:
view->state = GL_VIEW_IDLE;
cursor = gdk_cursor_new (GDK_LEFT_PTR);
gdk_window_set_cursor (window, cursor);
- gdk_cursor_unref (cursor);
+ g_object_unref (G_OBJECT (cursor));
gl_label_select_object (view->label, view->create_object);
break;
gl_label_delete_selection (view->label);
cursor = gdk_cursor_new (GDK_LEFT_PTR);
gdk_window_set_cursor (window, cursor);
- gdk_cursor_unref (cursor);
+ g_object_unref (G_OBJECT (cursor));
break;
default:
return FALSE;
gl_debug (DEBUG_WINDOW, "START");
- vbox1 = gtk_vbox_new (FALSE, 0);
+ vbox1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), vbox1);
window->ui = ui = gl_ui_new (window);
gtk_ui_manager_get_widget (ui, "/DrawingToolBar"),
FALSE, FALSE, 0);
- window->hbox = gtk_hbox_new (FALSE, 0);
+ window->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (vbox1), window->hbox, TRUE, TRUE, 0);
window->sidebar = GL_UI_SIDEBAR (gl_ui_sidebar_new ());
window->property_bar = GL_UI_PROPERTY_BAR (gl_ui_property_bar_new ());
gtk_box_pack_start (GTK_BOX (vbox1), GTK_WIDGET (window->property_bar), FALSE, FALSE, 0);
- status_hbox = gtk_hbox_new (FALSE, 0);
+ status_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (vbox1), status_hbox, FALSE, FALSE, 0);
window->status_bar = gtk_statusbar_new ();
PangoWeight font_weight;
gboolean font_italic_flag;
glColorNode *color_node;
- PangoAlignment align;
gdouble text_line_spacing;
GList *lines, *p_line, *p_node;
glTextNode *text_node;
}
gl_color_node_free (&color_node);
- align = gl_label_object_get_text_alignment (GL_LABEL_OBJECT(object_text));
lgl_xml_set_prop_string (node, "font_family", font_family);
lgl_xml_set_prop_double (node, "font_size", font_size);
lgl_xml_set_prop_string (node, "font_weight", gl_str_util_weight_to_string (font_weight));