</packing>
</child>
<child>
- <placeholder/>
+ <widget class="GtkHPaned" id="hpaned1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <widget class="GtkVPaned" id="vpaned1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">3</property>
+ </packing>
</child>
<child>
<widget class="GtkStatusbar" id="statusbar1">
</widget>
<widget class="GtkAboutDialog" id="diag_about">
<property name="visible">True</property>
+ <property name="title" translatable="yes">About GRepTool</property>
+ <property name="modal">True</property>
<property name="destroy_with_parent">True</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="transient_for">w_main</property>
- <property name="name">GRepTool</property>
+ <property name="program_name">GRepTool</property>
<property name="version">0.0.1</property>
<property name="copyright" translatable="yes">Copyright (C) 2007 Andrea Zagli</property>
<property name="comments" translatable="yes">Creates and manages RepTool report's definition files</property>
<placeholder/>
</child>
</widget>
- <packing>
- <property name="tab_expand">False</property>
- </packing>
</child>
<child>
<widget class="GtkLabel" id="label21">
</widget>
<packing>
<property name="type">tab</property>
- <property name="tab_expand">False</property>
<property name="tab_fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
- <property name="tab_expand">False</property>
</packing>
</child>
<child>
<packing>
<property name="type">tab</property>
<property name="position">1</property>
- <property name="tab_expand">False</property>
<property name="tab_fill">False</property>
</packing>
</child>
</packing>
</child>
</widget>
- <packing>
- <property name="tab_expand">False</property>
- </packing>
</child>
<child>
<widget class="GtkLabel" id="label51">
</widget>
<packing>
<property name="type">tab</property>
- <property name="tab_expand">False</property>
<property name="tab_fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
- <property name="tab_expand">False</property>
</packing>
</child>
<child>
<packing>
<property name="type">tab</property>
<property name="position">1</property>
- <property name="tab_expand">False</property>
<property name="tab_fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="position">2</property>
- <property name="tab_expand">False</property>
</packing>
</child>
<child>
<packing>
<property name="type">tab</property>
<property name="position">2</property>
- <property name="tab_expand">False</property>
<property name="tab_fill">False</property>
</packing>
</child>
<placeholder/>
</child>
<child>
- <widget class="GtkColorButton" id="ctbn_rect_stroke_color">
+ <widget class="GtkColorButton" id="cbtn_rect_stroke_color">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
return item;
}
+static void
+grpt_canvas_image_print_line (cairo_t *cr, const RptPoint *from_p, const RptPoint *to_p, const RptStroke *stroke)
+{
+ if (from_p == NULL || to_p == NULL) return;
+
+ if (stroke != NULL)
+ {
+ /* TO DO */
+ /*cairo_set_line_width (priv->cr, stroke.width);*/
+ if (stroke->color != NULL)
+ {
+ cairo_set_source_rgba (cr, stroke->color->r, stroke->color->g, stroke->color->b, stroke->color->a);
+ }
+ else
+ {
+ cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
+ }
+ if (stroke->style != NULL)
+ {
+ gdouble *dash = rpt_common_style_to_array (stroke->style);
+ cairo_set_dash (cr, dash, stroke->style->len, 0.0);
+ }
+ }
+ else
+ {
+ cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
+ }
+
+ cairo_move_to (cr, from_p->x, from_p->y);
+ cairo_line_to (cr, to_p->x, to_p->y);
+ cairo_stroke (cr);
+
+ if (stroke != NULL && stroke->style != NULL)
+ {
+ cairo_set_dash (cr, NULL, 0, 0.0);
+ }
+}
+
+static void
+grpt_canvas_image_print_border (cairo_t *cr, const RptPoint *position, const RptSize *size, const RptBorder *border)
+{
+ if (position == NULL || size == NULL || border == NULL) return;
+
+ RptPoint *from_p = (RptPoint *)g_malloc0 (sizeof (RptPoint));
+ RptPoint *to_p = (RptPoint *)g_malloc0 (sizeof (RptPoint));
+ RptStroke *stroke = (RptStroke *)g_malloc0 (sizeof (RptStroke));
+
+ if (border->top_width != 0.0)
+ {
+ from_p->x = position->x;
+ from_p->y = position->y;
+ to_p->x = position->x + size->width;
+ to_p->y = position->y;
+ stroke->width = border->top_width;
+ stroke->color = border->top_color;
+ stroke->style = border->top_style;
+ grpt_canvas_image_print_line (cr, from_p, to_p, stroke);
+ }
+ if (border->right_width != 0.0)
+ {
+ from_p->x = position->x + size->width;
+ from_p->y = position->y;
+ to_p->x = position->x + size->width;
+ to_p->y = position->y + size->height;
+ stroke->width = border->right_width;
+ stroke->color = border->right_color;
+ stroke->style = border->right_style;
+ grpt_canvas_image_print_line (cr, from_p, to_p, stroke);
+ }
+ if (border->bottom_width != 0.0)
+ {
+ from_p->x = position->x;
+ from_p->y = position->y + size->height;
+ to_p->x = position->x + size->width;
+ to_p->y = position->y + size->height;
+ stroke->width = border->bottom_width;
+ stroke->color = border->bottom_color;
+ stroke->style = border->bottom_style;
+ grpt_canvas_image_print_line (cr, from_p, to_p, stroke);
+ }
+ if (border->left_width != 0.0)
+ {
+ from_p->x = position->x;
+ from_p->y = position->y;
+ to_p->x = position->x;
+ to_p->y = position->y + size->height;
+ stroke->width = border->left_width;
+ stroke->color = border->left_color;
+ stroke->style = border->left_style;
+ grpt_canvas_image_print_line (cr, from_p, to_p, stroke);
+ }
+}
+
static void
grpt_canvas_image_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds)
{
RptRotation *rotation = NULL;
RptBorder *border = NULL;
gchar *filename = NULL;
- gchar *adapt = NULL;
+ guint adapt;
gint w;
gint h;
filename = g_strdup (ICONSDIR "/image.png");
}
- if (adapt == NULL)
- {
- adapt = "none";
- }
- else
- {
- g_strstrip (adapt);
- }
-
image = cairo_image_surface_create_from_png (filename);
if (cairo_surface_status (image) != CAIRO_STATUS_SUCCESS)
{
}
cairo_matrix_init_identity (&matrix);
- if (strcmp (adapt, "none") != 0)
+ if (adapt != RPT_OBJ_IMAGE_ADAPT_NONE)
{
w = cairo_image_surface_get_width (image);
h = cairo_image_surface_get_height (image);
- if (strcmp (adapt, "to-box") == 0)
- {
- cairo_matrix_scale (&matrix, w / size->width, h / size->height);
- }
- else if (strcmp (adapt, "to-image") == 0)
+ switch (adapt)
{
- size->width = (gdouble)w;
- size->height = (gdouble)h;
+ case RPT_OBJ_IMAGE_ADAPT_TO_BOX:
+ cairo_matrix_scale (&matrix, w / size->width, h / size->height);
+ break;
+
+ case RPT_OBJ_IMAGE_ADAPT_TO_IMAGE:
+ size->width = (gdouble)w;
+ size->height = (gdouble)h;
+ break;
}
}
cairo_matrix_translate (&matrix, -position->x, -position->y);
cairo_fill (cr);
/* TO DO */
- /* border */
+ grpt_canvas_image_print_border (cr, position, size, border);
- /*cairo_pattern_destroy (pattern);
- cairo_surface_destroy (image);*/
+ /*cairo_pattern_destroy (pattern);*/
+ cairo_surface_destroy (image);
}
static RptObject
return item;
}
+static void
+grpt_canvas_text_print_line (cairo_t *cr, const RptPoint *from_p, const RptPoint *to_p, const RptStroke *stroke)
+{
+ if (from_p == NULL || to_p == NULL) return;
+
+ if (stroke != NULL)
+ {
+ /* TO DO */
+ /*cairo_set_line_width (priv->cr, stroke.width);*/
+ if (stroke->color != NULL)
+ {
+ cairo_set_source_rgba (cr, stroke->color->r, stroke->color->g, stroke->color->b, stroke->color->a);
+ }
+ else
+ {
+ cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
+ }
+ if (stroke->style != NULL)
+ {
+ gdouble *dash = rpt_common_style_to_array (stroke->style);
+ cairo_set_dash (cr, dash, stroke->style->len, 0.0);
+ }
+ }
+ else
+ {
+ cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
+ }
+
+ cairo_move_to (cr, from_p->x, from_p->y);
+ cairo_line_to (cr, to_p->x, to_p->y);
+ cairo_stroke (cr);
+
+ if (stroke != NULL && stroke->style != NULL)
+ {
+ cairo_set_dash (cr, NULL, 0, 0.0);
+ }
+}
+
+static void
+grpt_canvas_text_print_border (cairo_t *cr, const RptPoint *position, const RptSize *size, const RptBorder *border)
+{
+ if (position == NULL || size == NULL || border == NULL) return;
+
+ RptPoint *from_p = (RptPoint *)g_malloc0 (sizeof (RptPoint));
+ RptPoint *to_p = (RptPoint *)g_malloc0 (sizeof (RptPoint));
+ RptStroke *stroke = (RptStroke *)g_malloc0 (sizeof (RptStroke));
+
+ if (border->top_width != 0.0)
+ {
+ from_p->x = position->x;
+ from_p->y = position->y;
+ to_p->x = position->x + size->width;
+ to_p->y = position->y;
+ stroke->width = border->top_width;
+ stroke->color = border->top_color;
+ stroke->style = border->top_style;
+ grpt_canvas_text_print_line (cr, from_p, to_p, stroke);
+ }
+ if (border->right_width != 0.0)
+ {
+ from_p->x = position->x + size->width;
+ from_p->y = position->y;
+ to_p->x = position->x + size->width;
+ to_p->y = position->y + size->height;
+ stroke->width = border->right_width;
+ stroke->color = border->right_color;
+ stroke->style = border->right_style;
+ grpt_canvas_text_print_line (cr, from_p, to_p, stroke);
+ }
+ if (border->bottom_width != 0.0)
+ {
+ from_p->x = position->x;
+ from_p->y = position->y + size->height;
+ to_p->x = position->x + size->width;
+ to_p->y = position->y + size->height;
+ stroke->width = border->bottom_width;
+ stroke->color = border->bottom_color;
+ stroke->style = border->bottom_style;
+ grpt_canvas_text_print_line (cr, from_p, to_p, stroke);
+ }
+ if (border->left_width != 0.0)
+ {
+ from_p->x = position->x;
+ from_p->y = position->y;
+ to_p->x = position->x;
+ to_p->y = position->y + size->height;
+ stroke->width = border->left_width;
+ stroke->color = border->left_color;
+ stroke->style = border->left_style;
+ grpt_canvas_text_print_line (cr, from_p, to_p, stroke);
+ }
+}
+
static void
grpt_canvas_text_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds)
{
if (font != NULL && font->strike)
{
PangoAttribute *pattr;
-
+
pattr = pango_attr_strikethrough_new (TRUE);
pattr->start_index = 0;
pattr->end_index = strlen (text) + 1;
}
/* drawing border */
- /*rpt_print_border (rpt_print, position, size, border, rotation);*/
+ grpt_canvas_text_print_border (cr, position, size, border);
/* setting horizontal alignment */
if (align != NULL)
gpointer user_data);
static void on_cbtn_image_border_color_left_color_set (GtkColorButton *widget,
gpointer user_data);
+static void on_cb_image_adapt_on_changed (GtkComboBox *widget,
+ gpointer user_data);
static void grpt_object_properties_set_vbox (GRptObjectProperties *grpt_object_properties,
GtkWidget *vbox);
RptFont *font;
RptStroke *stroke;
RptColor *color;
+ RptAlign *align;
+ guint adapt;
};
GType
priv->cb_image_adapt = glade_xml_get_widget (gla_image, "cb_image_adapt");
priv->lstore_image_adapt = gtk_list_store_new (ADAPT_COLS,
- G_TYPE_INT,
+ G_TYPE_UINT,
G_TYPE_STRING);
gtk_combo_box_set_model (GTK_COMBO_BOX (priv->cb_image_adapt),
g_signal_connect (G_OBJECT (priv->cbtn_image_border_color_left), "color-set",
G_CALLBACK (on_cbtn_image_border_color_left_color_set), (gpointer)obj_prop);
+ g_signal_connect (G_OBJECT (priv->cb_image_adapt), "changed",
+ G_CALLBACK (on_cb_image_adapt_on_changed), (gpointer)obj_prop);
+
gtk_widget_show_all (priv->w);
return obj_prop;
if (priv->border == NULL)
{
- priv->border = (RptBorder *)g_malloc0 (sizeof (RptBorder));
+ priv->border = rpt_common_rptborder_new ();
}
priv->border->top_width = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->spn_text_border_width_top));
if (priv->border == NULL)
{
- priv->border = (RptBorder *)g_malloc0 (sizeof (RptBorder));
+ priv->border = rpt_common_rptborder_new ();
}
priv->border->right_width = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->spn_text_border_width_right));
if (priv->border == NULL)
{
- priv->border = (RptBorder *)g_malloc0 (sizeof (RptBorder));
+ priv->border = rpt_common_rptborder_new ();
}
priv->border->bottom_width = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->spn_text_border_width_bottom));
if (priv->border == NULL)
{
- priv->border = (RptBorder *)g_malloc0 (sizeof (RptBorder));
+ priv->border = rpt_common_rptborder_new ();
}
priv->border->left_width = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->spn_text_border_width_left));
if (priv->border == NULL)
{
- priv->border = (RptBorder *)g_malloc0 (sizeof (RptBorder));
+ priv->border = rpt_common_rptborder_new ();
}
priv->border->top_color = rpt_common_gdkcolor_to_rptcolor (&gdk_color, alpha);
on_cbtn_text_border_color_right_color_set (GtkColorButton *widget,
gpointer user_data)
{
+ GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
+ GRptObjectPropertiesPrivate *priv = GRPT_OBJECT_PROPERTIES_GET_PRIVATE (grpt_object_properties);
+
+ GdkColor gdk_color;
+ guint16 alpha;
+
+ gtk_color_button_get_color (GTK_COLOR_BUTTON (priv->cbtn_text_border_color_right), &gdk_color);
+ alpha = gtk_color_button_get_alpha (GTK_COLOR_BUTTON (priv->cbtn_text_border_color_right));
+
+ if (priv->border == NULL)
+ {
+ priv->border = rpt_common_rptborder_new ();
+ }
+ priv->border->right_color = rpt_common_gdkcolor_to_rptcolor (&gdk_color, alpha);
+
+ g_object_set (G_OBJECT (priv->rpt_obj),
+ "border", priv->border,
+ NULL);
+
+ goo_canvas_item_simple_changed ((GooCanvasItemSimple *)priv->grpt_canvas_item, TRUE);
}
static void
on_cbtn_text_border_color_bottom_color_set (GtkColorButton *widget,
gpointer user_data)
{
+ GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
+ GRptObjectPropertiesPrivate *priv = GRPT_OBJECT_PROPERTIES_GET_PRIVATE (grpt_object_properties);
+
+ GdkColor gdk_color;
+ guint16 alpha;
+
+ gtk_color_button_get_color (GTK_COLOR_BUTTON (priv->cbtn_text_border_color_bottom), &gdk_color);
+ alpha = gtk_color_button_get_alpha (GTK_COLOR_BUTTON (priv->cbtn_text_border_color_bottom));
+
+ if (priv->border == NULL)
+ {
+ priv->border = rpt_common_rptborder_new ();
+ }
+ priv->border->bottom_color = rpt_common_gdkcolor_to_rptcolor (&gdk_color, alpha);
+
+ g_object_set (G_OBJECT (priv->rpt_obj),
+ "border", priv->border,
+ NULL);
+
+ goo_canvas_item_simple_changed ((GooCanvasItemSimple *)priv->grpt_canvas_item, TRUE);
}
static void
on_cbtn_text_border_color_left_color_set (GtkColorButton *widget,
gpointer user_data)
{
+ GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
+ GRptObjectPropertiesPrivate *priv = GRPT_OBJECT_PROPERTIES_GET_PRIVATE (grpt_object_properties);
+
+ GdkColor gdk_color;
+ guint16 alpha;
+
+ gtk_color_button_get_color (GTK_COLOR_BUTTON (priv->cbtn_text_border_color_left), &gdk_color);
+ alpha = gtk_color_button_get_alpha (GTK_COLOR_BUTTON (priv->cbtn_text_border_color_left));
+
+ if (priv->border == NULL)
+ {
+ priv->border = rpt_common_rptborder_new ();
+ }
+ priv->border->left_color = rpt_common_gdkcolor_to_rptcolor (&gdk_color, alpha);
+
+ g_object_set (G_OBJECT (priv->rpt_obj),
+ "border", priv->border,
+ NULL);
+
+ goo_canvas_item_simple_changed ((GooCanvasItemSimple *)priv->grpt_canvas_item, TRUE);
}
static void
gpointer user_data)
{
GtkTreeIter iter;
- RptAlign *align = NULL;
gint ialign;
GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->cb_text_alignment_h),
&iter))
{
- g_object_get (G_OBJECT (priv->rpt_obj),
- "align", &align,
- NULL);
- if (align == NULL)
+ if (priv->align == NULL)
{
- align = rpt_common_rptalign_new ();
+ priv->align = rpt_common_rptalign_new ();
}
gtk_tree_model_get (GTK_TREE_MODEL (priv->lstore_text_alignment_h), &iter,
ALIGN_ALIGN, &ialign,
-1);
- align->h_align = ialign;
+ priv->align->h_align = ialign;
g_object_set (G_OBJECT (priv->rpt_obj),
- "align", align,
+ "align", priv->align,
NULL);
goo_canvas_item_simple_changed ((GooCanvasItemSimple *)priv->grpt_canvas_item, TRUE);
gpointer user_data)
{
GtkTreeIter iter;
- RptAlign *align = NULL;
gint ialign;
GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->cb_text_alignment_v),
&iter))
{
- g_object_get (G_OBJECT (priv->rpt_obj),
- "align", &align,
- NULL);
- if (align == NULL)
+ if (priv->align == NULL)
{
- align = rpt_common_rptalign_new ();
+ priv->align = rpt_common_rptalign_new ();
}
gtk_tree_model_get (GTK_TREE_MODEL (priv->lstore_text_alignment_v), &iter,
ALIGN_ALIGN, &ialign,
-1);
- align->v_align = ialign;
+ priv->align->v_align = ialign;
g_object_set (G_OBJECT (priv->rpt_obj),
- "align", align,
+ "align", priv->align,
NULL);
goo_canvas_item_simple_changed ((GooCanvasItemSimple *)priv->grpt_canvas_item, TRUE);
on_spn_image_border_width_top_value_changed (GtkSpinButton *spin_button,
gpointer user_data)
{
+ GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
+ GRptObjectPropertiesPrivate *priv = GRPT_OBJECT_PROPERTIES_GET_PRIVATE (grpt_object_properties);
+
+ if (priv->border == NULL)
+ {
+ priv->border = rpt_common_rptborder_new ();
+ }
+ priv->border->top_width = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->spn_image_border_width_top));
+
+ g_object_set (G_OBJECT (priv->rpt_obj),
+ "border", priv->border,
+ NULL);
+
+ goo_canvas_item_simple_changed ((GooCanvasItemSimple *)priv->grpt_canvas_item, TRUE);
}
static void
on_spn_image_border_width_right_value_changed (GtkSpinButton *spin_button,
gpointer user_data)
{
+ GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
+ GRptObjectPropertiesPrivate *priv = GRPT_OBJECT_PROPERTIES_GET_PRIVATE (grpt_object_properties);
+
+ if (priv->border == NULL)
+ {
+ priv->border = rpt_common_rptborder_new ();
+ }
+ priv->border->right_width = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->spn_image_border_width_right));
+
+ g_object_set (G_OBJECT (priv->rpt_obj),
+ "border", priv->border,
+ NULL);
+
+ goo_canvas_item_simple_changed ((GooCanvasItemSimple *)priv->grpt_canvas_item, TRUE);
}
static void
on_spn_image_border_width_bottom_value_changed (GtkSpinButton *spin_button,
gpointer user_data)
{
+ GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
+ GRptObjectPropertiesPrivate *priv = GRPT_OBJECT_PROPERTIES_GET_PRIVATE (grpt_object_properties);
+
+ if (priv->border == NULL)
+ {
+ priv->border = rpt_common_rptborder_new ();
+ }
+ priv->border->bottom_width = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->spn_image_border_width_bottom));
+
+ g_object_set (G_OBJECT (priv->rpt_obj),
+ "border", priv->border,
+ NULL);
+
+ goo_canvas_item_simple_changed ((GooCanvasItemSimple *)priv->grpt_canvas_item, TRUE);
}
static void
on_spn_image_border_width_left_value_changed (GtkSpinButton *spin_button,
gpointer user_data)
{
+ GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
+ GRptObjectPropertiesPrivate *priv = GRPT_OBJECT_PROPERTIES_GET_PRIVATE (grpt_object_properties);
+
+ if (priv->border == NULL)
+ {
+ priv->border = rpt_common_rptborder_new ();
+ }
+ priv->border->left_width = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->spn_image_border_width_left));
+
+ g_object_set (G_OBJECT (priv->rpt_obj),
+ "border", priv->border,
+ NULL);
+
+ goo_canvas_item_simple_changed ((GooCanvasItemSimple *)priv->grpt_canvas_item, TRUE);
}
static void
on_cbtn_image_border_color_top_color_set (GtkColorButton *widget,
gpointer user_data)
{
+ GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
+ GRptObjectPropertiesPrivate *priv = GRPT_OBJECT_PROPERTIES_GET_PRIVATE (grpt_object_properties);
+
+ GdkColor gdk_color;
+ guint16 alpha;
+
+ gtk_color_button_get_color (GTK_COLOR_BUTTON (priv->cbtn_image_border_color_top), &gdk_color);
+ alpha = gtk_color_button_get_alpha (GTK_COLOR_BUTTON (priv->cbtn_image_border_color_top));
+
+ if (priv->border == NULL)
+ {
+ priv->border = rpt_common_rptborder_new ();
+ }
+ priv->border->top_color = rpt_common_gdkcolor_to_rptcolor (&gdk_color, alpha);
+
+ g_object_set (G_OBJECT (priv->rpt_obj),
+ "border", priv->border,
+ NULL);
+
+ goo_canvas_item_simple_changed ((GooCanvasItemSimple *)priv->grpt_canvas_item, TRUE);
}
static void
on_cbtn_image_border_color_right_color_set (GtkColorButton *widget,
gpointer user_data)
{
+ GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
+ GRptObjectPropertiesPrivate *priv = GRPT_OBJECT_PROPERTIES_GET_PRIVATE (grpt_object_properties);
+
+ GdkColor gdk_color;
+ guint16 alpha;
+
+ gtk_color_button_get_color (GTK_COLOR_BUTTON (priv->cbtn_image_border_color_right), &gdk_color);
+ alpha = gtk_color_button_get_alpha (GTK_COLOR_BUTTON (priv->cbtn_image_border_color_right));
+
+ if (priv->border == NULL)
+ {
+ priv->border = rpt_common_rptborder_new ();
+ }
+ priv->border->right_color = rpt_common_gdkcolor_to_rptcolor (&gdk_color, alpha);
+
+ g_object_set (G_OBJECT (priv->rpt_obj),
+ "border", priv->border,
+ NULL);
+
+ goo_canvas_item_simple_changed ((GooCanvasItemSimple *)priv->grpt_canvas_item, TRUE);
}
static void
on_cbtn_image_border_color_bottom_color_set (GtkColorButton *widget,
gpointer user_data)
{
+ GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
+ GRptObjectPropertiesPrivate *priv = GRPT_OBJECT_PROPERTIES_GET_PRIVATE (grpt_object_properties);
+
+ GdkColor gdk_color;
+ guint16 alpha;
+
+ gtk_color_button_get_color (GTK_COLOR_BUTTON (priv->cbtn_image_border_color_bottom), &gdk_color);
+ alpha = gtk_color_button_get_alpha (GTK_COLOR_BUTTON (priv->cbtn_image_border_color_bottom));
+
+ if (priv->border == NULL)
+ {
+ priv->border = rpt_common_rptborder_new ();
+ }
+ priv->border->bottom_color = rpt_common_gdkcolor_to_rptcolor (&gdk_color, alpha);
+
+ g_object_set (G_OBJECT (priv->rpt_obj),
+ "border", priv->border,
+ NULL);
+
+ goo_canvas_item_simple_changed ((GooCanvasItemSimple *)priv->grpt_canvas_item, TRUE);
}
static void
on_cbtn_image_border_color_left_color_set (GtkColorButton *widget,
gpointer user_data)
{
+ GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
+ GRptObjectPropertiesPrivate *priv = GRPT_OBJECT_PROPERTIES_GET_PRIVATE (grpt_object_properties);
+
+ GdkColor gdk_color;
+ guint16 alpha;
+
+ gtk_color_button_get_color (GTK_COLOR_BUTTON (priv->cbtn_image_border_color_left), &gdk_color);
+ alpha = gtk_color_button_get_alpha (GTK_COLOR_BUTTON (priv->cbtn_image_border_color_left));
+
+ if (priv->border == NULL)
+ {
+ priv->border = rpt_common_rptborder_new ();
+ }
+ priv->border->left_color = rpt_common_gdkcolor_to_rptcolor (&gdk_color, alpha);
+
+ g_object_set (G_OBJECT (priv->rpt_obj),
+ "border", priv->border,
+ NULL);
+
+ goo_canvas_item_simple_changed ((GooCanvasItemSimple *)priv->grpt_canvas_item, TRUE);
+}
+
+static void
+on_cb_image_adapt_on_changed (GtkComboBox *widget,
+ gpointer user_data)
+{
+ GtkTreeIter iter;
+ guint iadapt;
+
+ GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
+ GRptObjectPropertiesPrivate *priv = GRPT_OBJECT_PROPERTIES_GET_PRIVATE (grpt_object_properties);
+
+ if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->cb_image_adapt),
+ &iter))
+ {
+ gtk_tree_model_get (GTK_TREE_MODEL (priv->lstore_image_adapt), &iter,
+ ADAPT_ADAPT, &iadapt,
+ -1);
+ g_object_set (G_OBJECT (priv->rpt_obj),
+ "adapt", iadapt,
+ NULL);
+
+ goo_canvas_item_simple_changed ((GooCanvasItemSimple *)priv->grpt_canvas_item, TRUE);
+ }
}
static void
static void
grpt_object_properties_load_text (GRptObjectProperties *grpt_object_properties)
{
- RptAlign *align = NULL;
gchar *source = NULL;
RptColor *background_color = NULL;
gdouble padding_top;
g_free (priv->border);
g_free (priv->font);
+ g_free (priv->align);
priv->border = NULL;
priv->font = NULL;
+ priv->align = NULL;
g_object_get (G_OBJECT (priv->rpt_obj),
"border", &priv->border,
"font", &priv->font,
- "align", &align,
+ "align", &priv->align,
"source", &source,
"background-color", &background_color,
"padding-top", &padding_top,
}
}
- if (align != NULL)
+ if (priv->align != NULL)
{
+ gtk_combo_box_set_active (GTK_COMBO_BOX (priv->cb_text_alignment_h),
+ priv->align->h_align);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (priv->cb_text_alignment_v),
+ priv->align->v_align);
}
if (source != NULL)
grpt_object_properties_load_image (GRptObjectProperties *grpt_object_properties)
{
gchar *source;
- guint adapt;
GdkColor *gdk_color;
g_free (priv->border);
priv->border = NULL;
+ priv->adapt = 0;
g_object_get (G_OBJECT (priv->rpt_obj),
"border", &priv->border,
"source", &source,
- "adapt", &adapt,
+ "adapt", &priv->adapt,
NULL);
if (priv->border != NULL)
g_signal_handlers_unblock_by_func (priv->cbtn_image_border_color_right, G_CALLBACK (on_cbtn_image_border_color_right_color_set), grpt_object_properties);
g_signal_handlers_unblock_by_func (priv->cbtn_image_border_color_bottom, G_CALLBACK (on_cbtn_image_border_color_bottom_color_set), grpt_object_properties);
g_signal_handlers_unblock_by_func (priv->cbtn_image_border_color_left, G_CALLBACK (on_cbtn_image_border_color_left_color_set), grpt_object_properties);
+ g_signal_handlers_unblock_by_func (priv->cb_image_adapt, G_CALLBACK (on_cb_image_adapt_on_changed), grpt_object_properties);
}
else
{
g_signal_handlers_block_by_func (priv->cbtn_image_border_color_right, G_CALLBACK (on_cbtn_image_border_color_right_color_set), grpt_object_properties);
g_signal_handlers_block_by_func (priv->cbtn_image_border_color_bottom, G_CALLBACK (on_cbtn_image_border_color_bottom_color_set), grpt_object_properties);
g_signal_handlers_block_by_func (priv->cbtn_image_border_color_left, G_CALLBACK (on_cbtn_image_border_color_left_color_set), grpt_object_properties);
+ g_signal_handlers_block_by_func (priv->cb_image_adapt, G_CALLBACK (on_cb_image_adapt_on_changed), grpt_object_properties);
}
}