]> saetta.ns0.it Git - reptool/greptool/commitdiff
Continued ObjectProperties. master
authorAndrea Zagli <azagli@libero.it>
Sat, 7 Jun 2008 16:37:23 +0000 (16:37 +0000)
committerAndrea Zagli <azagli@libero.it>
Sat, 7 Jun 2008 16:37:23 +0000 (16:37 +0000)
Migration to other server.

git-svn-id: svn+ssh://saetta.homelinux.org/svn/greptool/trunk@15 76169498-11ee-428b-941f-28d7a79d5cb2

data/greptool/glade/greptool.glade
src/canvasimage.c
src/canvastext.c
src/object_properties.c

index b9f630ed86aae9131c2fa6e89db1a873705d77cd..e17dd90e72873cb66b7e783f8e7c2810752bd182 100644 (file)
           </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>
@@ -1554,9 +1583,6 @@ Custom</property>
                   <placeholder/>
                 </child>
               </widget>
-              <packing>
-                <property name="tab_expand">False</property>
-              </packing>
             </child>
             <child>
               <widget class="GtkLabel" id="label21">
@@ -1566,7 +1592,6 @@ Custom</property>
               </widget>
               <packing>
                 <property name="type">tab</property>
-                <property name="tab_expand">False</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
@@ -1967,7 +1992,6 @@ Custom</property>
               </widget>
               <packing>
                 <property name="position">1</property>
-                <property name="tab_expand">False</property>
               </packing>
             </child>
             <child>
@@ -1979,7 +2003,6 @@ Custom</property>
               <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>
@@ -2632,9 +2655,6 @@ Custom</property>
                   </packing>
                 </child>
               </widget>
-              <packing>
-                <property name="tab_expand">False</property>
-              </packing>
             </child>
             <child>
               <widget class="GtkLabel" id="label51">
@@ -2644,7 +2664,6 @@ Custom</property>
               </widget>
               <packing>
                 <property name="type">tab</property>
-                <property name="tab_expand">False</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
@@ -2746,7 +2765,6 @@ Custom</property>
               </widget>
               <packing>
                 <property name="position">1</property>
-                <property name="tab_expand">False</property>
               </packing>
             </child>
             <child>
@@ -2758,7 +2776,6 @@ Custom</property>
               <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>
@@ -3146,7 +3163,6 @@ Custom</property>
               </widget>
               <packing>
                 <property name="position">2</property>
-                <property name="tab_expand">False</property>
               </packing>
             </child>
             <child>
@@ -3158,7 +3174,6 @@ Custom</property>
               <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>
@@ -3312,7 +3327,7 @@ Custom</property>
                       <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>
index ac3942a3c2d2ce43ed317df378db4bcab74bdfdd..4396d4657cfdf80333e261f4f477e67625fb8625 100644 (file)
@@ -130,6 +130,99 @@ GRptCanvasItem
        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)
 {
@@ -138,7 +231,7 @@ grpt_canvas_image_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanv
        RptRotation *rotation = NULL;
        RptBorder *border = NULL;
        gchar *filename = NULL;
-       gchar *adapt = NULL;
+       guint adapt;
        gint w;
        gint h;
 
@@ -166,15 +259,6 @@ grpt_canvas_image_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanv
                        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)
                {
@@ -194,19 +278,21 @@ grpt_canvas_image_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanv
                }
 
        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);
@@ -218,10 +304,10 @@ grpt_canvas_image_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanv
        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
index ccc4dd725c338619540ef5e7822266f6c06c8905..19d5ea4a95e69c0402542566220aea8bb388d9aa 100644 (file)
@@ -132,6 +132,99 @@ GRptCanvasItem
        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)
 {
@@ -251,7 +344,7 @@ grpt_canvas_text_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanva
        if (font != NULL && font->strike)
                {
                        PangoAttribute *pattr;
-               
+
                        pattr = pango_attr_strikethrough_new (TRUE);
                        pattr->start_index = 0;
                        pattr->end_index = strlen (text) + 1;
@@ -277,7 +370,7 @@ grpt_canvas_text_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanva
                }
 
        /* 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)
index 235c517d7901bf2a44572a1dae8aaf640dc19bba..5c9f37c747c00de79efbe316d29ccd187e30e44c 100644 (file)
@@ -109,6 +109,8 @@ static void on_cbtn_image_border_color_bottom_color_set (GtkColorButton *widget,
                                                          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);
@@ -227,6 +229,8 @@ struct _GRptObjectPropertiesPrivate
                RptFont *font;
                RptStroke *stroke;
                RptColor *color;
+               RptAlign *align;
+               guint adapt;
        };
 
 GType
@@ -506,7 +510,7 @@ GRptObjectProperties
        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), 
@@ -551,6 +555,9 @@ GRptObjectProperties
        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;
@@ -689,7 +696,7 @@ on_spn_text_border_width_top_value_changed (GtkSpinButton *spin_button,
 
        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));
        
@@ -709,7 +716,7 @@ on_spn_text_border_width_right_value_changed (GtkSpinButton *spin_button,
 
        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));
        
@@ -729,7 +736,7 @@ on_spn_text_border_width_bottom_value_changed (GtkSpinButton *spin_button,
 
        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));
        
@@ -749,7 +756,7 @@ on_spn_text_border_width_left_value_changed (GtkSpinButton *spin_button,
 
        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));
        
@@ -775,7 +782,7 @@ on_cbtn_text_border_color_top_color_set (GtkColorButton *widget,
 
        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);
 
@@ -790,18 +797,78 @@ static void
 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
@@ -879,7 +946,6 @@ on_cb_text_alignment_h_changed (GtkComboBox *widget,
                                 gpointer user_data)
 {
        GtkTreeIter iter;
-       RptAlign *align = NULL;
        gint ialign;
 
        GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
@@ -888,20 +954,17 @@ on_cb_text_alignment_h_changed (GtkComboBox *widget,
        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);
@@ -913,7 +976,6 @@ on_cb_text_alignment_v_changed (GtkComboBox *widget,
                                 gpointer user_data)
 {
        GtkTreeIter iter;
-       RptAlign *align = NULL;
        gint ialign;
 
        GRptObjectProperties *grpt_object_properties = (GRptObjectProperties *)user_data;
@@ -922,20 +984,17 @@ on_cb_text_alignment_v_changed (GtkComboBox *widget,
        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);
@@ -1208,48 +1267,208 @@ static void
 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
@@ -1401,7 +1620,6 @@ grpt_object_properties_load_common (GRptObjectProperties *grpt_object_properties
 static void
 grpt_object_properties_load_text (GRptObjectProperties *grpt_object_properties)
 {
-       RptAlign *align = NULL;
        gchar *source = NULL;
        RptColor *background_color = NULL;
        gdouble padding_top;
@@ -1415,14 +1633,16 @@ grpt_object_properties_load_text (GRptObjectProperties *grpt_object_properties)
 
        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,
@@ -1506,8 +1726,12 @@ grpt_object_properties_load_text (GRptObjectProperties *grpt_object_properties)
                                }
                }
 
-       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)
@@ -1642,7 +1866,6 @@ static void
 grpt_object_properties_load_image (GRptObjectProperties *grpt_object_properties)
 {
        gchar *source;
-       guint adapt;
 
        GdkColor *gdk_color;
 
@@ -1651,11 +1874,12 @@ grpt_object_properties_load_image (GRptObjectProperties *grpt_object_properties)
        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)
@@ -1755,6 +1979,7 @@ grpt_object_properties_set_signal_active (GRptObjectProperties *grpt_object_prop
                        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
                {
@@ -1798,5 +2023,6 @@ grpt_object_properties_set_signal_active (GRptObjectProperties *grpt_object_prop
                        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);
                }
 }