]> git.sur5r.net Git - glabels/commitdiff
2006-01-19 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Fri, 20 Jan 2006 03:38:08 +0000 (03:38 +0000)
committerJim Evins <evins@snaught.com>
Fri, 20 Jan 2006 03:38:08 +0000 (03:38 +0000)
* src/merge-evolution.c: (gl_merge_evolution_get_key_list):
Initialize key_list to NULL.  Only lucky that this worked at all -- will
probably crash for many people.
* data/glade/object-editor.glade:
* src/Makefile.am:
* src/color.c:
* src/color.h:
* src/label-object.c:
* src/label-object.h:
* src/object-editor-fill-page.c:
* src/object-editor-private.h:
* src/object-editor.c:
* src/object-editor.h:
* src/xml-label.c:
Created infrastructure for shadow support.
* src/view-box.c:
* src/print.c:
Initial shadow support in box object only.

git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@581 f5e0f49d-192f-0410-a22d-a8d8700d0965

15 files changed:
glabels2/ChangeLog
glabels2/data/glade/object-editor.glade
glabels2/src/Makefile.am
glabels2/src/color.c
glabels2/src/color.h
glabels2/src/label-object.c
glabels2/src/label-object.h
glabels2/src/merge-evolution.c
glabels2/src/object-editor-fill-page.c
glabels2/src/object-editor-private.h
glabels2/src/object-editor.c
glabels2/src/object-editor.h
glabels2/src/print.c
glabels2/src/view-box.c
glabels2/src/xml-label.c

index e345e10f51f8dab1406531069f533d6cff6e611b..a8f2997c6806eaa5da6999b13a20507a8132b118 100644 (file)
@@ -1,3 +1,23 @@
+2006-01-19  Jim Evins  <evins@snaught.com>
+
+       * src/merge-evolution.c: (gl_merge_evolution_get_key_list):
+               Initialize key_list to NULL.
+       * data/glade/object-editor.glade:
+       * src/Makefile.am:
+       * src/color.c:
+       * src/color.h:
+       * src/label-object.c:
+       * src/label-object.h:
+       * src/object-editor-fill-page.c:
+       * src/object-editor-private.h:
+       * src/object-editor.c:
+       * src/object-editor.h:
+       * src/xml-label.c:
+               Created infrastructure for shadow support.
+       * src/view-box.c:
+       * src/print.c:
+               Initial shadow support in box object only.
+       
 2006-01-05  Jim Evins  <evins@snaught.com>
 
        * src/merge-properties-dialog.c: (src_changed_cb):
index 386e96fd85bf3bfb69475cdbc563d7c360ddeca0..4b93983fb94f17cd55aa181d01d4b6ece75e5acd 100644 (file)
                  <property name="type">tab</property>
                </packing>
              </child>
+
+             <child>
+               <widget class="GtkVBox" id="shadow_page_vbox">
+                 <property name="border_width">12</property>
+                 <property name="visible">True</property>
+                 <property name="homogeneous">False</property>
+                 <property name="spacing">12</property>
+
+                 <child>
+                   <widget class="GtkCheckButton" id="shadow_enable_check">
+                     <property name="visible">True</property>
+                     <property name="can_focus">True</property>
+                     <property name="label" translatable="yes">Enable shadow</property>
+                     <property name="use_underline">True</property>
+                     <property name="relief">GTK_RELIEF_NORMAL</property>
+                     <property name="focus_on_click">True</property>
+                     <property name="active">False</property>
+                     <property name="inconsistent">False</property>
+                     <property name="draw_indicator">True</property>
+                   </widget>
+                   <packing>
+                     <property name="padding">0</property>
+                     <property name="expand">False</property>
+                     <property name="fill">False</property>
+                   </packing>
+                 </child>
+
+                 <child>
+                   <widget class="GtkTable" id="shadow_controls_table">
+                     <property name="visible">True</property>
+                     <property name="sensitive">False</property>
+                     <property name="n_rows">4</property>
+                     <property name="n_columns">2</property>
+                     <property name="homogeneous">False</property>
+                     <property name="row_spacing">12</property>
+                     <property name="column_spacing">12</property>
+
+                     <child>
+                       <widget class="GtkLabel" id="label40">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">X Offset:</property>
+                         <property name="use_underline">False</property>
+                         <property name="use_markup">False</property>
+                         <property name="justify">GTK_JUSTIFY_LEFT</property>
+                         <property name="wrap">False</property>
+                         <property name="selectable">False</property>
+                         <property name="xalign">0</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                         <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                         <property name="width_chars">-1</property>
+                         <property name="single_line_mode">False</property>
+                         <property name="angle">0</property>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">0</property>
+                         <property name="right_attach">1</property>
+                         <property name="top_attach">0</property>
+                         <property name="bottom_attach">1</property>
+                         <property name="x_options">fill</property>
+                         <property name="y_options"></property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkLabel" id="label41">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">Y Offset:</property>
+                         <property name="use_underline">False</property>
+                         <property name="use_markup">False</property>
+                         <property name="justify">GTK_JUSTIFY_LEFT</property>
+                         <property name="wrap">False</property>
+                         <property name="selectable">False</property>
+                         <property name="xalign">0</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                         <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                         <property name="width_chars">-1</property>
+                         <property name="single_line_mode">False</property>
+                         <property name="angle">0</property>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">0</property>
+                         <property name="right_attach">1</property>
+                         <property name="top_attach">1</property>
+                         <property name="bottom_attach">2</property>
+                         <property name="x_options">fill</property>
+                         <property name="y_options"></property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkLabel" id="label46">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">Opacity:</property>
+                         <property name="use_underline">False</property>
+                         <property name="use_markup">False</property>
+                         <property name="justify">GTK_JUSTIFY_LEFT</property>
+                         <property name="wrap">False</property>
+                         <property name="selectable">False</property>
+                         <property name="xalign">0</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                         <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                         <property name="width_chars">-1</property>
+                         <property name="single_line_mode">False</property>
+                         <property name="angle">0</property>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">0</property>
+                         <property name="right_attach">1</property>
+                         <property name="top_attach">3</property>
+                         <property name="bottom_attach">4</property>
+                         <property name="x_options">fill</property>
+                         <property name="y_options"></property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkHBox" id="hbox55">
+                         <property name="visible">True</property>
+                         <property name="homogeneous">False</property>
+                         <property name="spacing">12</property>
+
+                         <child>
+                           <widget class="GtkSpinButton" id="shadow_y_spin">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="climb_rate">0.00999999977648</property>
+                             <property name="digits">2</property>
+                             <property name="numeric">True</property>
+                             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                             <property name="snap_to_ticks">True</property>
+                             <property name="wrap">False</property>
+                             <property name="adjustment">0 0 100 0.00999999977648 10 10</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">True</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkLabel" id="shadow_y_units_label">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">inches</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0.5</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                             <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                             <property name="width_chars">-1</property>
+                             <property name="single_line_mode">False</property>
+                             <property name="angle">0</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">1</property>
+                         <property name="right_attach">2</property>
+                         <property name="top_attach">1</property>
+                         <property name="bottom_attach">2</property>
+                         <property name="x_options">fill</property>
+                         <property name="y_options">fill</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkHBox" id="hbox56">
+                         <property name="visible">True</property>
+                         <property name="homogeneous">False</property>
+                         <property name="spacing">12</property>
+
+                         <child>
+                           <widget class="GtkSpinButton" id="shadow_opacity_spin">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="climb_rate">1</property>
+                             <property name="digits">0</property>
+                             <property name="numeric">False</property>
+                             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                             <property name="snap_to_ticks">False</property>
+                             <property name="wrap">False</property>
+                             <property name="adjustment">1 0 100 1 10 10</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">True</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkLabel" id="label47">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">%</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0.5</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                             <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                             <property name="width_chars">-1</property>
+                             <property name="single_line_mode">False</property>
+                             <property name="angle">0</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">1</property>
+                         <property name="right_attach">2</property>
+                         <property name="top_attach">3</property>
+                         <property name="bottom_attach">4</property>
+                         <property name="x_options">fill</property>
+                         <property name="y_options">fill</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkLabel" id="label45">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">Color:</property>
+                         <property name="use_underline">False</property>
+                         <property name="use_markup">False</property>
+                         <property name="justify">GTK_JUSTIFY_LEFT</property>
+                         <property name="wrap">False</property>
+                         <property name="selectable">False</property>
+                         <property name="xalign">0</property>
+                         <property name="yalign">0.140000000596</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                         <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                         <property name="width_chars">-1</property>
+                         <property name="single_line_mode">False</property>
+                         <property name="angle">0</property>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">0</property>
+                         <property name="right_attach">1</property>
+                         <property name="top_attach">2</property>
+                         <property name="bottom_attach">3</property>
+                         <property name="x_options">fill</property>
+                         <property name="y_options">fill</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkVBox" id="vbox7">
+                         <property name="visible">True</property>
+                         <property name="homogeneous">False</property>
+                         <property name="spacing">6</property>
+
+                         <child>
+                           <widget class="GtkHBox" id="hbox57">
+                             <property name="visible">True</property>
+                             <property name="homogeneous">False</property>
+                             <property name="spacing">6</property>
+
+                             <child>
+                               <widget class="GtkRadioButton" id="shadow_color_radio">
+                                 <property name="visible">True</property>
+                                 <property name="can_focus">True</property>
+                                 <property name="label" translatable="yes"></property>
+                                 <property name="use_underline">True</property>
+                                 <property name="relief">GTK_RELIEF_NORMAL</property>
+                                 <property name="focus_on_click">True</property>
+                                 <property name="active">False</property>
+                                 <property name="inconsistent">False</property>
+                                 <property name="draw_indicator">True</property>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">False</property>
+                                 <property name="fill">False</property>
+                               </packing>
+                             </child>
+
+                             <child>
+                               <widget class="GtkHBox" id="hbox58">
+                                 <property name="visible">True</property>
+                                 <property name="homogeneous">False</property>
+                                 <property name="spacing">12</property>
+
+                                 <child>
+                                   <widget class="Custom" id="shadow_color_combo">
+                                     <property name="visible">True</property>
+                                     <property name="creation_function">gl_object_editor_construct_color_combo</property>
+                                     <property name="int1">2</property>
+                                     <property name="int2">0</property>
+                                     <property name="last_modification_time">Sun, 16 Nov 2003 06:52:23 GMT</property>
+                                   </widget>
+                                   <packing>
+                                     <property name="padding">0</property>
+                                     <property name="expand">False</property>
+                                     <property name="fill">False</property>
+                                   </packing>
+                                 </child>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">True</property>
+                                 <property name="fill">True</property>
+                               </packing>
+                             </child>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">True</property>
+                             <property name="fill">True</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkHBox" id="hbox59">
+                             <property name="visible">True</property>
+                             <property name="homogeneous">False</property>
+                             <property name="spacing">6</property>
+
+                             <child>
+                               <widget class="GtkRadioButton" id="shadow_key_radio">
+                                 <property name="visible">True</property>
+                                 <property name="can_focus">True</property>
+                                 <property name="label" translatable="yes">Key:</property>
+                                 <property name="use_underline">True</property>
+                                 <property name="relief">GTK_RELIEF_NORMAL</property>
+                                 <property name="focus_on_click">True</property>
+                                 <property name="active">False</property>
+                                 <property name="inconsistent">False</property>
+                                 <property name="draw_indicator">True</property>
+                                 <property name="group">shadow_color_radio</property>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">False</property>
+                                 <property name="fill">False</property>
+                               </packing>
+                             </child>
+
+                             <child>
+                               <widget class="GtkHBox" id="hbox60">
+                                 <property name="visible">True</property>
+                                 <property name="homogeneous">False</property>
+                                 <property name="spacing">12</property>
+
+                                 <child>
+                                   <widget class="GtkComboBox" id="shadow_key_combo">
+                                     <property name="visible">True</property>
+                                     <property name="add_tearoffs">False</property>
+                                     <property name="focus_on_click">True</property>
+                                   </widget>
+                                   <packing>
+                                     <property name="padding">0</property>
+                                     <property name="expand">True</property>
+                                     <property name="fill">True</property>
+                                   </packing>
+                                 </child>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">True</property>
+                                 <property name="fill">True</property>
+                               </packing>
+                             </child>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">True</property>
+                             <property name="fill">True</property>
+                           </packing>
+                         </child>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">1</property>
+                         <property name="right_attach">2</property>
+                         <property name="top_attach">2</property>
+                         <property name="bottom_attach">3</property>
+                         <property name="y_options">fill</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkHBox" id="hbox54">
+                         <property name="visible">True</property>
+                         <property name="homogeneous">False</property>
+                         <property name="spacing">12</property>
+
+                         <child>
+                           <widget class="GtkSpinButton" id="shadow_x_spin">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="climb_rate">0.00999999977648</property>
+                             <property name="digits">2</property>
+                             <property name="numeric">True</property>
+                             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                             <property name="snap_to_ticks">True</property>
+                             <property name="wrap">False</property>
+                             <property name="adjustment">0 0 100 0.00999999977648 10 10</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">True</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkLabel" id="shadow_x_units_label">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">inches</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0.5</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                             <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                             <property name="width_chars">-1</property>
+                             <property name="single_line_mode">False</property>
+                             <property name="angle">0</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">1</property>
+                         <property name="right_attach">2</property>
+                         <property name="top_attach">0</property>
+                         <property name="bottom_attach">1</property>
+                         <property name="x_options">fill</property>
+                         <property name="y_options">fill</property>
+                       </packing>
+                     </child>
+                   </widget>
+                   <packing>
+                     <property name="padding">0</property>
+                     <property name="expand">True</property>
+                     <property name="fill">True</property>
+                   </packing>
+                 </child>
+               </widget>
+               <packing>
+                 <property name="tab_expand">False</property>
+                 <property name="tab_fill">True</property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="shadow_tab_label">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes">Shadow</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0.5</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="type">tab</property>
+               </packing>
+             </child>
            </widget>
            <packing>
              <property name="padding">0</property>
index 23b729fad683a70057c52aa913a48714ac7d73e3..33fd13cea218d4a44d5315dcd3183c5bd5668e41 100644 (file)
@@ -105,6 +105,7 @@ glabels_SOURCES =                   \
        object-editor-edit-page.c       \
        object-editor-bc-page.c         \
        object-editor-data-page.c       \
+       object-editor-shadow-page.c     \
        print.c                         \
        print.h                         \
        print-dialog.c                  \
index 7004fef289b96d76580ddbb522229872052b474d..38d40a95a243f64c495ef22ece088bf823b11c01 100644 (file)
@@ -69,6 +69,22 @@ gl_color_from_gdk_color (GdkColor *gdk_color)
        return color;
 }
 
+/*****************************************************************************/
+/* Resolve actual shadow color by adjusting opacity.                         */
+/*****************************************************************************/
+guint
+gl_color_shadow (guint   base_color,
+                gdouble opacity,
+                guint   object_color)
+{
+       guint color;
+
+       color = gl_color_set_opacity (base_color,
+                                     opacity * GL_COLOR_F_ALPHA (object_color));
+
+       return color;
+}
+
 /****************************************************************************/
 /* Create a single color node with default color.                           */
 /****************************************************************************/
index 65f8b0272d5a195a65ecc69553731c6eea714f6d..9fa55df0e03b94334803490721f393ce6a5fac14 100644 (file)
@@ -37,9 +37,10 @@ typedef struct {
 #define GL_COLOR(r,g,b)     GNOME_CANVAS_COLOR(r,g,b)
 #define GL_COLOR_A(r,g,b,a) GNOME_CANVAS_COLOR_A(r,g,b,a)
 
-#define GL_COLOR_NONE GL_COLOR_A(0,0,0,0)
-#define GL_COLOR_FILL_MERGE_DEFAULT GL_COLOR_A(255,255,255,128)
-#define GL_COLOR_MERGE_DEFAULT      GL_COLOR_A(0,0,0,128)
+#define GL_COLOR_NONE                  GL_COLOR_A(0,0,0,0)
+#define GL_COLOR_FILL_MERGE_DEFAULT    GL_COLOR_A(255,255,255,128)
+#define GL_COLOR_MERGE_DEFAULT         GL_COLOR_A(0,0,0,128)
+#define GL_COLOR_SHADOW_MERGE_DEFAULT  GL_COLOR_A(0,0,0,255)
 
 #define GL_COLOR_I_RED(x)   (((x)>>24) & 0xff)
 #define GL_COLOR_I_GREEN(x) (((x)>>16) & 0xff)
@@ -56,6 +57,10 @@ guint     gl_color_set_opacity (guint color, gdouble opacity);
 GdkColor *gl_color_to_gdk_color   (guint     color);
 guint     gl_color_from_gdk_color (GdkColor *gdk_color);
 
+guint     gl_color_shadow (guint   base_color,
+                          gdouble opacity,
+                          guint   object_color);
+
 glColorNode *gl_color_node_new_default    ();
 
 glColorNode *gl_color_node_dup            (glColorNode     *color_node);
index 36076652ae15a6cfce2be5f97f9676459350df11..f091213a742d219f545197482a798df6cf64f59c 100644 (file)
 
 #include "debug.h"
 
+
+/*========================================================*/
+/* Private defines.                                       */
+/*========================================================*/
+
+#define DEFAULT_SHADOW_X_OFFSET (5.0)
+#define DEFAULT_SHADOW_Y_OFFSET (5.0)
+#define DEFAULT_SHADOW_OPACITY  (0.5)
+
 /*========================================================*/
 /* Private types.                                         */
 /*========================================================*/
@@ -43,6 +52,12 @@ struct _glLabelObjectPrivate {
        gdouble            affine[6];
 
        gdouble            aspect_ratio;
+
+       gboolean           shadow_state;
+       gdouble            shadow_x;
+       gdouble            shadow_y;
+       glColorNode       *shadow_color_node;
+       gdouble            shadow_opacity;
 };
 
 enum {
@@ -190,6 +205,12 @@ gl_label_object_instance_init (glLabelObject *object)
 
        art_affine_identity (object->private->affine);
 
+       object->private->shadow_state = FALSE;
+       object->private->shadow_x = DEFAULT_SHADOW_X_OFFSET;
+       object->private->shadow_y = DEFAULT_SHADOW_Y_OFFSET;
+       object->private->shadow_color_node = gl_color_node_new_default ();
+       object->private->shadow_opacity = DEFAULT_SHADOW_OPACITY;
+
        gl_debug (DEBUG_LABEL, "END");
 }
 
@@ -242,6 +263,10 @@ gl_label_object_dup (glLabelObject *src_object,
        glLabelObject    *dst_object;
        gdouble           x, y, w, h;
        gdouble           affine[6];
+       gboolean          shadow_state;
+       gdouble           shadow_x, shadow_y;
+       glColorNode      *shadow_color_node;
+       gdouble           shadow_opacity;
 
        gl_debug (DEBUG_LABEL, "START");
 
@@ -251,13 +276,23 @@ gl_label_object_dup (glLabelObject *src_object,
 
        gl_label_object_set_parent (dst_object, label);
 
-       gl_label_object_get_position (src_object, &x, &y);
-       gl_label_object_get_size     (src_object, &w, &h);
-       gl_label_object_get_affine   (src_object, affine);
+       gl_label_object_get_position      (src_object, &x, &y);
+       gl_label_object_get_size          (src_object, &w, &h);
+       gl_label_object_get_affine        (src_object, affine);
+       gl_label_object_get_shadow_offset (src_object, &shadow_x, &shadow_y);
+       shadow_color_node = gl_label_object_get_shadow_color   (src_object);
+       shadow_opacity    = gl_label_object_get_shadow_opacity (src_object);
+       shadow_state      = gl_label_object_get_shadow_state   (src_object);
 
        gl_label_object_set_position (dst_object, x, y);
        gl_label_object_set_size     (dst_object, w, h);
        gl_label_object_set_affine   (dst_object, affine);
+       gl_label_object_set_shadow_offset  (dst_object, shadow_x, shadow_y);
+       gl_label_object_set_shadow_color   (dst_object, shadow_color_node);
+       gl_label_object_set_shadow_opacity (dst_object, shadow_opacity);
+       gl_label_object_set_shadow_state   (dst_object, shadow_state);
+
+       gl_color_node_free (&shadow_color_node);
 
        if ( GL_LABEL_OBJECT_GET_CLASS(src_object)->copy != NULL ) {
 
@@ -1143,6 +1178,147 @@ gl_label_object_get_line_width (glLabelObject     *object)
        return ret;
 }
 
+/****************************************************************************/
+/* Set shadow state of object.                                              */
+/****************************************************************************/
+void
+gl_label_object_set_shadow_state (glLabelObject     *object,
+                                 gboolean           state)
+{
+       gl_debug (DEBUG_LABEL, "START");
+
+       g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
+
+       if (object->private->shadow_state != state)
+       {
+               object->private->shadow_state = state;
+               gl_label_object_emit_changed (object);
+       }
+
+       gl_debug (DEBUG_LABEL, "END");
+}
+
+/****************************************************************************/
+/* Get shadow state of object.                                              */
+/****************************************************************************/
+gboolean
+gl_label_object_get_shadow_state (glLabelObject     *object)
+{
+       gl_debug (DEBUG_LABEL, "");
+
+       g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE);
+
+       return object->private->shadow_state;
+}
+
+/****************************************************************************/
+/* Set offset of object's shadow.                                           */
+/****************************************************************************/
+void
+gl_label_object_set_shadow_offset (glLabelObject     *object,
+                                  gdouble            x,
+                                  gdouble            y)
+{
+       gl_debug (DEBUG_LABEL, "START");
+
+       g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
+
+       if ( (x != object->private->shadow_x) || (y != object->private->shadow_y) )
+       {
+               object->private->shadow_x = x;
+               object->private->shadow_y = y;
+
+               gl_label_object_emit_changed (object);
+       }
+
+       gl_debug (DEBUG_LABEL, "END");
+}
+
+/****************************************************************************/
+/* Get offset of object's shadow.                                           */
+/****************************************************************************/
+void
+gl_label_object_get_shadow_offset (glLabelObject     *object,
+                                  gdouble           *x,
+                                  gdouble           *y)
+{
+       gl_debug (DEBUG_LABEL, "START");
+
+       g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
+
+       *x = object->private->shadow_x;
+       *y = object->private->shadow_y;
+
+       gl_debug (DEBUG_LABEL, "END");
+}
+
+/****************************************************************************/
+/* Set color of object's shadow.                                            */
+/****************************************************************************/
+void
+gl_label_object_set_shadow_color (glLabelObject     *object,
+                                 glColorNode       *color_node)
+{
+       gl_debug (DEBUG_LABEL, "START");
+
+       g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
+
+       if ( !gl_color_node_equal (object->private->shadow_color_node, color_node ))
+       {
+               gl_color_node_free (&(object->private->shadow_color_node));
+               object->private->shadow_color_node = gl_color_node_dup (color_node);
+               gl_label_object_emit_changed (GL_LABEL_OBJECT(object));
+       }
+
+       gl_debug (DEBUG_LABEL, "END");
+}
+
+/****************************************************************************/
+/* Get color of object's shadow.                                            */
+/****************************************************************************/
+glColorNode*
+gl_label_object_get_shadow_color (glLabelObject     *object)
+{
+       gl_debug (DEBUG_LABEL, "");
+
+       g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), NULL);
+
+       return gl_color_node_dup (object->private->shadow_color_node);
+}
+
+/****************************************************************************/
+/* Set opacity of object's shadow.                                          */
+/****************************************************************************/
+void
+gl_label_object_set_shadow_opacity (glLabelObject     *object,
+                                   gdouble            alpha)
+{
+       gl_debug (DEBUG_LABEL, "START");
+
+       g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
+
+       if (object->private->shadow_opacity != alpha)
+       {
+               object->private->shadow_opacity = alpha;
+               gl_label_object_emit_changed (object);
+       }
+
+       gl_debug (DEBUG_LABEL, "END");
+}
+
+/****************************************************************************/
+/* Get opacity of object's shadow.                                          */
+/****************************************************************************/
+gdouble
+gl_label_object_get_shadow_opacity (glLabelObject     *object)
+{
+       gl_debug (DEBUG_LABEL, "");
+
+       g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE);
+
+       return object->private->shadow_opacity;
+}
+
 /****************************************************************************/
 /* Flip object horizontally.                                                */
 /****************************************************************************/
index 810f6bd7ce5507738b31b6a0c88360799eee2013..8464118e6a933502d142553ca47ed4170889e900 100644 (file)
@@ -293,6 +293,30 @@ void           gl_label_object_get_i2w_affine        (glLabelObject     *object,
 void           gl_label_object_get_w2i_affine        (glLabelObject     *object,
                                                      gdouble           affine[6]);
 
+void           gl_label_object_set_shadow_state      (glLabelObject     *object,
+                                                     gboolean           state);
+
+void           gl_label_object_set_shadow_offset     (glLabelObject     *object,
+                                                     gdouble            x,
+                                                     gdouble            y);
+
+void           gl_label_object_set_shadow_color      (glLabelObject     *object,
+                                                     glColorNode       *color_node);
+
+void           gl_label_object_set_shadow_opacity    (glLabelObject     *object,
+                                                     gdouble            alpha);
+
+gboolean       gl_label_object_get_shadow_state      (glLabelObject     *object);
+
+void           gl_label_object_get_shadow_offset     (glLabelObject     *object,
+                                                     gdouble           *x,
+                                                     gdouble           *y);
+
+glColorNode*   gl_label_object_get_shadow_color      (glLabelObject     *object);
+
+gdouble        gl_label_object_get_shadow_opacity    (glLabelObject     *object);
+
+
 G_END_DECLS
 
 #endif /* __LABEL_OBJECT_H__ */
index a8c31c27f72dd7fbdf2443149d1d2b5cf68d8d89..30efb8975679326de7b501a308981d7007773878 100644 (file)
@@ -253,7 +253,8 @@ static GList *
 gl_merge_evolution_get_key_list (glMerge *merge)
 {
         glMergeEvolution   *merge_evolution;
-        GList              *key_list, *iter;
+        GList              *key_list = NULL;
+        GList              *iter;
         
         gl_debug (DEBUG_MERGE, "BEGIN");
 
index a09532b153191bddac36b823e89962b401e71c21..52a38b647ec334d9c5b86ced7a49ef8cc995608f 100644 (file)
@@ -83,7 +83,7 @@ gl_object_editor_prepare_fill_page (glObjectEditor *editor)
        /* Modify widgets based on configuration */
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->fill_color_radio), TRUE);
        gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE);
-    gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE);
+       gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE);
        gdk_color = gl_color_to_gdk_color (gl_prefs->default_fill_color);
        color_combo_set_color (COLOR_COMBO(editor->priv->fill_color_combo), gdk_color);
        g_free (gdk_color);
index acb5045cf2b9e7e91adacdeddf9ba8978a1d899d..a927bc2c68ddbd9bf65424b57b9222b49711daaf 100644 (file)
@@ -131,6 +131,24 @@ struct _glObjectEditorPrivate {
        GtkWidget  *data_digits_label;
        GtkWidget  *data_digits_spin;
        gboolean    data_format_fixed_flag;
+
+       GtkWidget  *shadow_page_vbox;
+       GtkWidget  *shadow_enable_check;
+       GtkWidget  *shadow_controls_table;
+       GtkWidget  *shadow_x_spin;
+       GtkWidget  *shadow_y_spin;
+       GtkWidget  *shadow_x_units_label;
+       GtkWidget  *shadow_y_units_label;
+       GtkWidget  *shadow_color_radio;
+       GtkWidget  *shadow_key_radio;
+       GtkWidget  *shadow_color_combo;
+       GtkWidget  *shadow_key_combo;
+       GtkWidget  *shadow_opacity_spin;
+       gdouble     shadow_x;
+       gdouble     shadow_y;
+       gdouble     shadow_x_max;
+       gdouble     shadow_y_max;
+
 };
 
 enum {
index 2290d764bb750a97bbbe7ea02e94a380587b470e..ca82cf204330f78a1e370f578e96890a18597696 100644 (file)
@@ -325,6 +325,11 @@ gl_object_notebook_construct_valist (glObjectEditor       *editor,
                        pages++;
                        break;
 
+               case GL_OBJECT_EDITOR_SHADOW_PAGE:
+                       gl_object_editor_prepare_shadow_page (editor);
+                       pages++;
+                       break;
+
                default:
                        g_message ("option = %d", option);
                        g_assert_not_reached ();
@@ -380,6 +385,7 @@ gl_object_editor_set_key_names (glObjectEditor      *editor,
         GList     *keys;
        GtkWidget *combo;
        gboolean   fixed_flag;
+       gboolean   state;
  
         gl_debug (DEBUG_EDITOR, "START");
 
@@ -396,18 +402,21 @@ gl_object_editor_set_key_names (glObjectEditor      *editor,
                                          merge != NULL);
        }
  
-       if (editor->priv->text_color_key_combo) {
-               gtk_widget_set_sensitive (editor->priv->text_color_key_combo, merge != NULL);
-       }
-       if (editor->priv->text_color_key_radio) {
+       if (editor->priv->text_page_vbox) {
                gtk_widget_set_sensitive (editor->priv->text_color_key_radio, merge != NULL);
                if (merge == NULL) {
                        gtk_toggle_button_set_active (
                                GTK_TOGGLE_BUTTON(editor->priv->text_color_radio), TRUE);
+                       gtk_widget_set_sensitive (editor->priv->text_color_combo, TRUE);
+                       gtk_widget_set_sensitive (editor->priv->text_color_key_combo, FALSE);
+               } else {
+                       state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->text_color_key_radio));
+                       gtk_widget_set_sensitive (editor->priv->text_color_combo, !state);
+                       gtk_widget_set_sensitive (editor->priv->text_color_key_combo, state);
+                                                 
                }
-       }       
-       
+       }
+
        if (editor->priv->edit_insert_field_button) {
                gtk_widget_set_sensitive (editor->priv->edit_insert_field_button,
                                          merge != NULL);
@@ -455,122 +464,112 @@ gl_object_editor_set_key_names (glObjectEditor      *editor,
                                          (merge != NULL) && !fixed_flag);
        }
 
-       if (editor->priv->fill_key_combo) {
-               gtk_widget_set_sensitive (editor->priv->fill_key_combo, merge != NULL);
-       }
-       if (editor->priv->fill_key_radio) {
+       if (editor->priv->fill_page_vbox) {
                gtk_widget_set_sensitive (editor->priv->fill_key_radio, merge != NULL);
                if (merge == NULL) {
                        gtk_toggle_button_set_active (
                                GTK_TOGGLE_BUTTON(editor->priv->fill_color_radio), TRUE);
+                       gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE);
+                       gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE);
+               } else {
+                       state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->fill_key_radio));
+                       gtk_widget_set_sensitive (editor->priv->fill_color_combo, !state);
+                       gtk_widget_set_sensitive (editor->priv->fill_key_combo, state);
+                                                 
                }
        }
-       
-       if (editor->priv->line_key_combo) {
-               gtk_widget_set_sensitive (editor->priv->line_key_combo, merge != NULL);
-       }
-       if (editor->priv->line_key_radio) {
+
+       if (editor->priv->line_page_vbox) {
                gtk_widget_set_sensitive (editor->priv->line_key_radio, merge != NULL);
                if (merge == NULL) {
                        gtk_toggle_button_set_active (
                                GTK_TOGGLE_BUTTON(editor->priv->line_color_radio), TRUE);
+                       gtk_widget_set_sensitive (editor->priv->line_color_combo, TRUE);
+                       gtk_widget_set_sensitive (editor->priv->line_key_combo, FALSE);
+               } else {
+                       state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->line_key_radio));
+                       gtk_widget_set_sensitive (editor->priv->line_color_combo, !state);
+                       gtk_widget_set_sensitive (editor->priv->line_key_combo, state);
+                                                 
                }
        }
-       
-       if (editor->priv->bc_key_combo) {
-               gtk_widget_set_sensitive (editor->priv->bc_key_combo, merge != NULL);
-       }
-       if (editor->priv->bc_key_radio) {
+
+       if (editor->priv->bc_page_vbox) {
                gtk_widget_set_sensitive (editor->priv->bc_key_radio, merge != NULL);
                if (merge == NULL) {
                        gtk_toggle_button_set_active (
                                GTK_TOGGLE_BUTTON(editor->priv->bc_color_radio), TRUE);
+                       gtk_widget_set_sensitive (editor->priv->bc_color_combo, TRUE);
+                       gtk_widget_set_sensitive (editor->priv->bc_key_combo, FALSE);
+               } else {
+                       state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->bc_key_radio));
+                       gtk_widget_set_sensitive (editor->priv->bc_color_combo, !state);
+                       gtk_widget_set_sensitive (editor->priv->bc_key_combo, state);
+                                                 
                }
-       }       
-       
-        keys = gl_merge_get_key_list (merge);
-        if ( keys != NULL ) {
+       }
 
-               combo = editor->priv->img_key_combo;
-               if (combo) {
-                       gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
+       if (editor->priv->shadow_page_vbox) {
+               gtk_widget_set_sensitive (editor->priv->shadow_key_radio, merge != NULL);
+               if (merge == NULL) {
+                       gtk_toggle_button_set_active (
+                               GTK_TOGGLE_BUTTON(editor->priv->shadow_color_radio), TRUE);
+                       gtk_widget_set_sensitive (editor->priv->shadow_color_combo, TRUE);
+                       gtk_widget_set_sensitive (editor->priv->shadow_key_combo, FALSE);
+               } else {
+                       state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->shadow_key_radio));
+                       gtk_widget_set_sensitive (editor->priv->shadow_color_combo, !state);
+                       gtk_widget_set_sensitive (editor->priv->shadow_key_combo, state);
+                                                 
                }
+       }
 
-               combo = editor->priv->edit_key_combo;
-               if (combo) {
-                       gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
-               }
+        keys = gl_merge_get_key_list (merge);
+        if ( keys == NULL ) {
+                keys = g_list_append (keys, "");
+       }
 
-               combo = editor->priv->data_key_combo;
-               if (combo) {
-                       gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
-               }
-               
-               combo = editor->priv->fill_key_combo;
-               if (combo) {
-                       gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
-               }
+       combo = editor->priv->img_key_combo;
+       if (combo) {
+               gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
+       }
 
-               combo = editor->priv->text_color_key_combo;
-               if (combo) {
-                       gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
-               }
+       combo = editor->priv->edit_key_combo;
+       if (combo) {
+               gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
+       }
 
-               combo = editor->priv->line_key_combo;
-               if (combo) {
-                       gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
-               }
-               
-               combo = editor->priv->bc_key_combo;
-               if (combo) {
-                       gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
-               }
+       combo = editor->priv->data_key_combo;
+       if (combo) {
+               gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
+       }
                
-                gl_merge_free_key_list (&keys);
-        } else {
-
-                keys = g_list_append (keys, "");
+       combo = editor->priv->fill_key_combo;
+       if (combo) {
+               gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
+       }
 
-               combo = editor->priv->img_key_combo;
-               if (combo) {
-                       gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
-               }
+       combo = editor->priv->text_color_key_combo;
+       if (combo) {
+               gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
+       }
 
-               combo = editor->priv->edit_key_combo;
-               if (combo) {
-                       gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
-               }
-               
-               combo = editor->priv->data_key_combo;
-               if (combo) {
-                       gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
-               }
+       combo = editor->priv->line_key_combo;
+       if (combo) {
+               gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
+       }
                
-               combo = editor->priv->fill_key_combo;
-               if (combo) {
-                       gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
-               }
+       combo = editor->priv->bc_key_combo;
+       if (combo) {
+               gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
+       }
                
-               combo = editor->priv->text_color_key_combo;
-               if (combo) {
-                       gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
-               }
+       combo = editor->priv->shadow_key_combo;
+       if (combo) {
+               gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
+       }
 
-               combo = editor->priv->line_key_combo;
-               if (combo) {
-                       gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
-               }
-               
-               combo = editor->priv->bc_key_combo;
-               if (combo) {
-                       gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
-               }
-               
-                g_list_free (keys);
-        }
+       gl_merge_free_key_list (&keys);
  
         gl_debug (DEBUG_EDITOR, "END");
 }
@@ -664,5 +663,9 @@ prefs_changed_cb (glObjectEditor *editor)
                position_prefs_changed_cb (editor);
        }
 
+       if (editor->priv->shadow_x_spin) {
+               shadow_prefs_changed_cb (editor);
+       }
+
        gl_debug (DEBUG_EDITOR, "END");
 }
index d95bb63e6e0d44a899bd3c3eb5036a659454c7e7..a67a652e64aab178af280e5872d2597ddeb01f72 100644 (file)
@@ -47,6 +47,7 @@ typedef enum {
        GL_OBJECT_EDITOR_EDIT_PAGE,
        GL_OBJECT_EDITOR_BC_PAGE,
        GL_OBJECT_EDITOR_DATA_PAGE,
+       GL_OBJECT_EDITOR_SHADOW_PAGE,
 } glObjectEditorOption;
 
 #define GL_TYPE_OBJECT_EDITOR            (gl_object_editor_get_type ())
@@ -260,6 +261,39 @@ void        gl_object_editor_set_data             (glObjectEditor      *editor,
 glTextNode *gl_object_editor_get_data             (glObjectEditor      *editor);
 
 
+/*
+ * Shadow Page
+ */
+void        gl_object_editor_set_shadow_state     (glObjectEditor      *editor,
+                                                  gboolean             state);
+
+void        gl_object_editor_set_shadow_offset    (glObjectEditor      *editor,
+                                                  gdouble              x,
+                                                  gdouble              y);
+
+void        gl_object_editor_set_shadow_color     (glObjectEditor      *editor,
+                                                  gboolean             merge_flag,
+                                                  glColorNode         *color_node);
+
+void        gl_object_editor_set_shadow_opacity   (glObjectEditor      *editor,
+                                                  gdouble              alpha);
+
+void        gl_object_editor_set_max_shadow_offset(glObjectEditor      *editor,
+                                                  gdouble              x_max,
+                                                  gdouble              y_max);
+
+
+gboolean    gl_object_editor_get_shadow_state     (glObjectEditor      *editor);
+
+void        gl_object_editor_get_shadow_offset    (glObjectEditor      *editor,
+                                                  gdouble             *x,
+                                                  gdouble             *y);
+
+glColorNode* gl_object_editor_get_shadow_color    (glObjectEditor      *editor);
+
+gdouble     gl_object_editor_get_shadow_opacity   (glObjectEditor      *editor);
+
+
 
 G_END_DECLS
 
index 5f22ba41621a7b4dfca842f7320269f0af161062..eef6ec974b5be7e37e822ccc677a1a3482a7610e 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
 /*
  *  (GLABELS) Label and Business Card Creation program for GNOME
  *
@@ -111,15 +113,15 @@ static void       draw_text_object            (PrintInfo        *pi,
 
 static void       draw_box_object             (PrintInfo        *pi,
                                               glLabelBox       *object,
-                                                  glMergeRecord  *record);
+                                              glMergeRecord    *record);
 
 static void       draw_line_object            (PrintInfo        *pi,
                                               glLabelLine      *object,
-                                                  glMergeRecord  *record);                                                
+                                              glMergeRecord    *record);                                                  
 
 static void       draw_ellipse_object         (PrintInfo        *pi,
                                               glLabelEllipse   *object,
-                                                  glMergeRecord  *record);
+                                              glMergeRecord    *record);
 
 static void       draw_image_object           (PrintInfo        *pi,
                                               glLabelImage     *object,
@@ -891,6 +893,12 @@ draw_box_object (PrintInfo  *pi,
        glColorNode *line_color_node;
        glColorNode *fill_color_node;
        guint        fill_color;
+       gboolean     shadow_state;
+       gdouble      shadow_x, shadow_y;
+       glColorNode *shadow_color_node;
+       gdouble      shadow_opacity;
+       guint        shadow_line_color;
+       guint        shadow_fill_color;
 
        gl_debug (DEBUG_PRINT, "START");
 
@@ -903,7 +911,41 @@ draw_box_object (PrintInfo  *pi,
        fill_color = gl_color_node_expand (fill_color_node, record);
        gl_color_node_free (&line_color_node);
        gl_color_node_free (&fill_color_node);
+
+       shadow_state = gl_label_object_get_shadow_state (GL_LABEL_OBJECT (object));
+       gl_label_object_get_shadow_offset (GL_LABEL_OBJECT (object), &shadow_x, &shadow_y);
+       shadow_color_node = gl_label_object_get_shadow_color (GL_LABEL_OBJECT (object));
+       if (shadow_color_node->field_flag)
+       {
+               shadow_color_node->color = GL_COLOR_SHADOW_MERGE_DEFAULT;
+       }
+       shadow_opacity = gl_label_object_get_shadow_opacity (GL_LABEL_OBJECT (object));
+       shadow_line_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, line_color);
+       shadow_fill_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, fill_color);
+       gl_color_node_free (&shadow_color_node);
        
+       if (shadow_state)
+       {
+               /* Draw fill shadow */
+               create_rectangle_path (pi->pc, shadow_x, shadow_y, w, h);
+               gnome_print_setrgbcolor (pi->pc,
+                                        GL_COLOR_F_RED (shadow_fill_color),
+                                        GL_COLOR_F_GREEN (shadow_fill_color),
+                                        GL_COLOR_F_BLUE (shadow_fill_color));
+               gnome_print_setopacity (pi->pc, GL_COLOR_F_ALPHA (shadow_fill_color));
+               gnome_print_fill (pi->pc);
+
+               /* Draw outline shadow */
+               create_rectangle_path (pi->pc, shadow_x, shadow_y, w, h);
+               gnome_print_setrgbcolor (pi->pc,
+                                        GL_COLOR_F_RED (shadow_line_color),
+                                        GL_COLOR_F_GREEN (shadow_line_color),
+                                        GL_COLOR_F_BLUE (shadow_line_color));
+               gnome_print_setopacity (pi->pc, GL_COLOR_F_ALPHA (shadow_line_color));
+               gnome_print_setlinewidth (pi->pc, line_width);
+               gnome_print_stroke (pi->pc);
+       }
+
        /* Paint fill color */
        create_rectangle_path (pi->pc, 0.0, 0.0, w, h);
        gnome_print_setrgbcolor (pi->pc,
index dac1450b0af469f0e3b6a269ff634eeb00467665..ebab30d9a16dc3624d12602ccd1de42885bbb2d6 100644 (file)
@@ -47,7 +47,8 @@
 /*========================================================*/
 
 struct _glViewBoxPrivate {
-       GnomeCanvasItem       *item;
+       GnomeCanvasItem       *object_item;
+       GnomeCanvasItem       *shadow_item;
 };
 
 /*========================================================*/
@@ -168,6 +169,12 @@ gl_view_box_new (glLabelBox *object,
        glColorNode       *line_color_node;
        gdouble            w, h;
        glColorNode       *fill_color_node;
+       gboolean           shadow_state;
+       gdouble            shadow_x, shadow_y;
+       glColorNode       *shadow_color_node;
+       gdouble            shadow_opacity;
+       guint              shadow_line_color;
+       guint              shadow_fill_color;
 
        gl_debug (DEBUG_VIEW, "START");
        g_return_if_fail (object && GL_IS_LABEL_BOX (object));
@@ -193,9 +200,36 @@ gl_view_box_new (glLabelBox *object,
        {
                fill_color_node->color = GL_COLOR_FILL_MERGE_DEFAULT;
        }
+       shadow_state = gl_label_object_get_shadow_state (GL_LABEL_OBJECT (object));
+       gl_label_object_get_shadow_offset (GL_LABEL_OBJECT (object), &shadow_x, &shadow_y);
+       shadow_color_node = gl_label_object_get_shadow_color (GL_LABEL_OBJECT (object));
+       if (shadow_color_node->field_flag)
+       {
+               shadow_color_node->color = GL_COLOR_SHADOW_MERGE_DEFAULT;
+       }
+       shadow_opacity = gl_label_object_get_shadow_opacity (GL_LABEL_OBJECT (object));
+       shadow_line_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, line_color_node->color);
+       shadow_fill_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, fill_color_node->color);
+
+       /* Create analogous canvas items. */
+       view_box->private->shadow_item =
+               gl_view_object_item_new (GL_VIEW_OBJECT(view_box),
+                                        gnome_canvas_rect_get_type (),
+                                        "x1", shadow_x,
+                                        "y1", shadow_y,
+                                        "x2", shadow_x + w + DELTA,
+                                        "y2", shadow_y + h + DELTA,
+                                        "width_units", line_width,
+                                        "outline_color_rgba", shadow_line_color,
+                                        "fill_color_rgba", shadow_fill_color,
+                                        NULL);
 
-       /* Create analogous canvas item. */
-       view_box->private->item =
+       if (!shadow_state)
+       {
+               gnome_canvas_item_hide (view_box->private->shadow_item);
+       }
+
+       view_box->private->object_item =
                gl_view_object_item_new (GL_VIEW_OBJECT(view_box),
                                         gnome_canvas_rect_get_type (),
                                         "x1", 0.0,
@@ -209,6 +243,7 @@ gl_view_box_new (glLabelBox *object,
 
        gl_color_node_free (&line_color_node);
        gl_color_node_free (&fill_color_node);
+       gl_color_node_free (&shadow_color_node);
        
        g_signal_connect (G_OBJECT (object), "changed",
                          G_CALLBACK (update_canvas_item_from_object_cb), view_box);
@@ -238,6 +273,7 @@ construct_properties_editor (glViewObject *view_object)
                                       GL_OBJECT_EDITOR_SIZE_PAGE,
                                       GL_OBJECT_EDITOR_FILL_PAGE,
                                       GL_OBJECT_EDITOR_LINE_PAGE,
+                                      GL_OBJECT_EDITOR_SHADOW_PAGE,
                                       0);
        
        /* Update */
@@ -273,6 +309,12 @@ update_canvas_item_from_object_cb (glLabelObject *object,
        glColorNode       *line_color_node;
        gdouble            w, h;
        glColorNode       *fill_color_node;
+       gboolean           shadow_state;
+       gdouble            shadow_x, shadow_y;
+       glColorNode       *shadow_color_node;
+       gdouble            shadow_opacity;
+       guint              shadow_line_color;
+       guint              shadow_fill_color;
 
        gl_debug (DEBUG_VIEW, "START");
 
@@ -289,9 +331,38 @@ update_canvas_item_from_object_cb (glLabelObject *object,
        {
                fill_color_node->color = GL_COLOR_FILL_MERGE_DEFAULT;
        }
+       shadow_state = gl_label_object_get_shadow_state (GL_LABEL_OBJECT (object));
+       gl_label_object_get_shadow_offset (GL_LABEL_OBJECT (object), &shadow_x, &shadow_y);
+       shadow_color_node = gl_label_object_get_shadow_color (GL_LABEL_OBJECT (object));
+       if (shadow_color_node->field_flag)
+       {
+               shadow_color_node->color = GL_COLOR_SHADOW_MERGE_DEFAULT;
+       }
+       shadow_opacity = gl_label_object_get_shadow_opacity (GL_LABEL_OBJECT (object));
+       shadow_line_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, line_color_node->color);
+       shadow_fill_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, fill_color_node->color);
+
+       /* Adjust appearance of analogous canvas items. */
+       gnome_canvas_item_set (view_box->private->shadow_item,
+                                        "x1", shadow_x,
+                                        "y1", shadow_y,
+                                        "x2", shadow_x + w + DELTA,
+                                        "y2", shadow_y + h + DELTA,
+                                        "width_units", line_width,
+                                        "outline_color_rgba", shadow_line_color,
+                                        "fill_color_rgba", shadow_fill_color,
+                                        NULL);
 
-       /* Adjust appearance of analogous canvas item. */
-       gnome_canvas_item_set (view_box->private->item,
+       if (shadow_state)
+       {
+               gnome_canvas_item_show (view_box->private->shadow_item);
+       }
+       else
+       {
+               gnome_canvas_item_hide (view_box->private->shadow_item);
+       }
+
+       gnome_canvas_item_set (view_box->private->object_item,
                               "x2", w + DELTA,
                               "y2", h + DELTA,
                               "width_units", line_width,
@@ -301,6 +372,7 @@ update_canvas_item_from_object_cb (glLabelObject *object,
        
        gl_color_node_free (&line_color_node);
        gl_color_node_free (&fill_color_node);
+       gl_color_node_free (&shadow_color_node);
 
        gl_debug (DEBUG_VIEW, "END");
 }
@@ -316,6 +388,11 @@ update_object_from_editor_cb (glObjectEditor *editor,
        glColorNode       *line_color_node;
        gdouble            line_width;
        glColorNode       *fill_color_node;
+       gboolean           shadow_state;
+       gdouble            shadow_x, shadow_y;
+       glColorNode       *shadow_color_node;
+       gdouble            shadow_opacity;
+       
 
        gl_debug (DEBUG_VIEW, "START");
 
@@ -343,6 +420,18 @@ update_object_from_editor_cb (glObjectEditor *editor,
        line_width = gl_object_editor_get_line_width (editor);
        gl_label_object_set_line_width (object, line_width);
 
+       shadow_state = gl_object_editor_get_shadow_state (editor);
+       gl_label_object_set_shadow_state (object, shadow_state);
+
+       gl_object_editor_get_shadow_offset (editor, &shadow_x, &shadow_y);
+       gl_label_object_set_shadow_offset (object, shadow_x, shadow_y);
+
+       shadow_color_node = gl_object_editor_get_shadow_color (editor);
+       gl_label_object_set_shadow_color (object, shadow_color_node);
+       gl_color_node_free (&shadow_color_node);
+
+       shadow_opacity = gl_object_editor_get_shadow_opacity (editor);
+       gl_label_object_set_shadow_opacity (object, shadow_opacity);
 
        g_signal_handlers_unblock_by_func (G_OBJECT(object),
                                           update_editor_from_object_cb,
@@ -365,6 +454,10 @@ update_editor_from_object_cb (glLabelObject  *object,
        glColorNode       *line_color_node;
        gdouble            line_width;
        glColorNode       *fill_color_node;
+       gboolean           shadow_state;
+       gdouble            shadow_x, shadow_y;
+       glColorNode       *shadow_color_node;
+       gdouble            shadow_opacity;
        glMerge           *merge;
 
        gl_debug (DEBUG_VIEW, "START");
@@ -384,6 +477,19 @@ update_editor_from_object_cb (glLabelObject  *object,
        line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object));
        gl_object_editor_set_line_width (editor, line_width);
 
+       shadow_state = gl_label_object_get_shadow_state (object);
+       gl_object_editor_set_shadow_state (editor, shadow_state);
+
+       gl_label_object_get_shadow_offset (object, &shadow_x, &shadow_y);
+       gl_object_editor_set_shadow_offset (editor, shadow_x, shadow_y);
+
+       shadow_color_node = gl_label_object_get_shadow_color (object);
+       gl_object_editor_set_shadow_color (editor, (merge != NULL), shadow_color_node);
+       gl_color_node_free (&shadow_color_node);
+
+       shadow_opacity = gl_label_object_get_shadow_opacity (object);
+       gl_object_editor_set_shadow_opacity (editor, shadow_opacity);
+
        gl_debug (DEBUG_VIEW, "END");
 }
 
index 3176df4081b23af3ca0af5fdd116b9530319d41c..71ce6ba8b91c093c5bf6dfc69a575b8555ab697f 100644 (file)
@@ -105,6 +105,11 @@ static void           xml_parse_pixdata        (xmlNodePtr        node,
 static void           xml_parse_toplevel_span  (xmlNodePtr        node,
                                                glLabelObject    *object);
 
+static void           xml_parse_affine_attrs   (xmlNodePtr        node,
+                                               glLabelObject    *object);
+
+static void           xml_parse_shadow_attrs   (xmlNodePtr        node,
+                                               glLabelObject    *object);
 
 static xmlDocPtr      xml_label_to_doc         (glLabel          *label,
                                                glXMLLabelStatus *status);
@@ -154,6 +159,12 @@ static void           xml_create_toplevel_span (xmlNodePtr        node,
                                                xmlNsPtr          ns,
                                                glLabelText      *object_text);
 
+static void           xml_create_affine_attrs  (xmlNodePtr        node,
+                                               glLabelObject    *object);
+
+static void           xml_create_shadow_attrs  (xmlNodePtr        node,
+                                               glLabelObject    *object);
+
 
 /****************************************************************************/
 /* Open and read label from xml file.                                       */
@@ -412,7 +423,6 @@ xml_parse_object_text (xmlNodePtr  node,
        gchar            *string;
        GtkJustification  just;
        gboolean          auto_shrink;
-       gdouble           affine[6];
        xmlNodePtr        child;
 
        gl_debug (DEBUG_XML, "START");
@@ -440,13 +450,10 @@ xml_parse_object_text (xmlNodePtr  node,
        gl_label_text_set_auto_shrink (GL_LABEL_TEXT(object), auto_shrink);
 
        /* affine attrs */
-       affine[0] = gl_xml_get_prop_double (node, "a0", 0.0);
-       affine[1] = gl_xml_get_prop_double (node, "a1", 0.0);
-       affine[2] = gl_xml_get_prop_double (node, "a2", 0.0);
-       affine[3] = gl_xml_get_prop_double (node, "a3", 0.0);
-       affine[4] = gl_xml_get_prop_double (node, "a4", 0.0);
-       affine[5] = gl_xml_get_prop_double (node, "a5", 0.0);
-       gl_label_object_set_affine (GL_LABEL_OBJECT(object), affine);
+       xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object));
+
+       /* shadow attrs */
+       xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object));
 
        /* Process children */
        for (child = node->xmlChildrenNode; child != NULL; child = child->next) {
@@ -476,7 +483,6 @@ xml_parse_object_box (xmlNodePtr  node,
        gdouble       w, h;
        gdouble       line_width;
        glColorNode  *line_color_node;
-       gdouble       affine[6];
        gchar        *string;
        glColorNode  *fill_color_node;
 
@@ -523,13 +529,10 @@ xml_parse_object_box (xmlNodePtr  node,
        gl_color_node_free (&fill_color_node);
        
        /* affine attrs */
-       affine[0] = gl_xml_get_prop_double (node, "a0", 0.0);
-       affine[1] = gl_xml_get_prop_double (node, "a1", 0.0);
-       affine[2] = gl_xml_get_prop_double (node, "a2", 0.0);
-       affine[3] = gl_xml_get_prop_double (node, "a3", 0.0);
-       affine[4] = gl_xml_get_prop_double (node, "a4", 0.0);
-       affine[5] = gl_xml_get_prop_double (node, "a5", 0.0);
-       gl_label_object_set_affine (GL_LABEL_OBJECT(object), affine);
+       xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object));
+
+       /* shadow attrs */
+       xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object));
 
        gl_debug (DEBUG_XML, "END");
 }
@@ -546,7 +549,6 @@ xml_parse_object_ellipse (xmlNodePtr  node,
        gdouble      w, h;
        gdouble      line_width;
        glColorNode *line_color_node;
-       gdouble      affine[6];
        gchar       *string;
        glColorNode *fill_color_node;
 
@@ -593,13 +595,10 @@ xml_parse_object_ellipse (xmlNodePtr  node,
        gl_color_node_free (&fill_color_node);
 
        /* affine attrs */
-       affine[0] = gl_xml_get_prop_double (node, "a0", 0.0);
-       affine[1] = gl_xml_get_prop_double (node, "a1", 0.0);
-       affine[2] = gl_xml_get_prop_double (node, "a2", 0.0);
-       affine[3] = gl_xml_get_prop_double (node, "a3", 0.0);
-       affine[4] = gl_xml_get_prop_double (node, "a4", 0.0);
-       affine[5] = gl_xml_get_prop_double (node, "a5", 0.0);
-       gl_label_object_set_affine (GL_LABEL_OBJECT(object), affine);
+       xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object));
+
+       /* shadow attrs */
+       xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object));
 
        gl_debug (DEBUG_XML, "END");
 }
@@ -616,7 +615,6 @@ xml_parse_object_line (xmlNodePtr  node,
        gdouble      dx, dy;
        gdouble      line_width;
        glColorNode *line_color_node;
-       gdouble      affine[6];
        gchar       *string;
 
        gl_debug (DEBUG_XML, "START");
@@ -649,13 +647,10 @@ xml_parse_object_line (xmlNodePtr  node,
        gl_color_node_free (&line_color_node);
 
        /* affine attrs */
-       affine[0] = gl_xml_get_prop_double (node, "a0", 0.0);
-       affine[1] = gl_xml_get_prop_double (node, "a1", 0.0);
-       affine[2] = gl_xml_get_prop_double (node, "a2", 0.0);
-       affine[3] = gl_xml_get_prop_double (node, "a3", 0.0);
-       affine[4] = gl_xml_get_prop_double (node, "a4", 0.0);
-       affine[5] = gl_xml_get_prop_double (node, "a5", 0.0);
-       gl_label_object_set_affine (GL_LABEL_OBJECT(object), affine);
+       xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object));
+
+       /* shadow attrs */
+       xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object));
 
        gl_debug (DEBUG_XML, "END");
 }
@@ -672,7 +667,6 @@ xml_parse_object_image (xmlNodePtr  node,
        gdouble       w, h;
        gchar        *string;
        glTextNode   *filename;
-       gdouble       affine[6];
 
        gl_debug (DEBUG_XML, "START");
 
@@ -712,13 +706,10 @@ xml_parse_object_image (xmlNodePtr  node,
        gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h);
 
        /* affine attrs */
-       affine[0] = gl_xml_get_prop_double (node, "a0", 0.0);
-       affine[1] = gl_xml_get_prop_double (node, "a1", 0.0);
-       affine[2] = gl_xml_get_prop_double (node, "a2", 0.0);
-       affine[3] = gl_xml_get_prop_double (node, "a3", 0.0);
-       affine[4] = gl_xml_get_prop_double (node, "a4", 0.0);
-       affine[5] = gl_xml_get_prop_double (node, "a5", 0.0);
-       gl_label_object_set_affine (GL_LABEL_OBJECT(object), affine);
+       xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object));
+
+       /* shadow attrs */
+       xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object));
 
        gl_debug (DEBUG_XML, "END");
 }
@@ -740,7 +731,6 @@ xml_parse_object_barcode (xmlNodePtr  node,
        gboolean            checksum_flag;
        glColorNode        *color_node;
        guint               format_digits;
-       gdouble             affine[6];
 
        gl_debug (DEBUG_XML, "START");
 
@@ -798,13 +788,10 @@ xml_parse_object_barcode (xmlNodePtr  node,
        }
 
        /* affine attrs */
-       affine[0] = gl_xml_get_prop_double (node, "a0", 0.0);
-       affine[1] = gl_xml_get_prop_double (node, "a1", 0.0);
-       affine[2] = gl_xml_get_prop_double (node, "a2", 0.0);
-       affine[3] = gl_xml_get_prop_double (node, "a3", 0.0);
-       affine[4] = gl_xml_get_prop_double (node, "a4", 0.0);
-       affine[5] = gl_xml_get_prop_double (node, "a5", 0.0);
-       gl_label_object_set_affine (GL_LABEL_OBJECT(object), affine);
+       xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object));
+
+       /* shadow attrs */
+       xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object));
 
        gl_debug (DEBUG_XML, "END");
 }
@@ -1012,6 +999,64 @@ xml_parse_toplevel_span  (xmlNodePtr        node,
        gl_debug (DEBUG_XML, "END");
 }
 
+/*--------------------------------------------------------------------------*/
+/* PRIVATE.  Parse affine attributes.                                       */
+/*--------------------------------------------------------------------------*/
+static void
+xml_parse_affine_attrs (xmlNodePtr        node,
+                       glLabelObject    *object)
+{
+       gdouble           affine[6];
+
+       affine[0] = gl_xml_get_prop_double (node, "a0", 0.0);
+       affine[1] = gl_xml_get_prop_double (node, "a1", 0.0);
+       affine[2] = gl_xml_get_prop_double (node, "a2", 0.0);
+       affine[3] = gl_xml_get_prop_double (node, "a3", 0.0);
+       affine[4] = gl_xml_get_prop_double (node, "a4", 0.0);
+       affine[5] = gl_xml_get_prop_double (node, "a5", 0.0);
+
+       gl_label_object_set_affine (object, affine);
+}
+
+/*--------------------------------------------------------------------------*/
+/* PRIVATE.  Parse shadow attributes.                                       */
+/*--------------------------------------------------------------------------*/
+static void
+xml_parse_shadow_attrs (xmlNodePtr        node,
+                       glLabelObject    *object)
+{
+       gboolean         shadow_state;
+       gdouble          shadow_x;
+       gdouble          shadow_y;
+       glColorNode     *shadow_color_node;
+       gdouble          shadow_opacity;
+       gchar           *string;
+
+       shadow_state = gl_xml_get_prop_boolean (node, "shadow", FALSE);
+       gl_label_object_set_shadow_state (object, shadow_state);
+
+       if (shadow_state)
+       {
+               shadow_x = gl_xml_get_prop_length (node, "shadow_x", 0.0);
+               shadow_y = gl_xml_get_prop_length (node, "shadow_y", 0.0);
+               gl_label_object_set_shadow_offset (object, shadow_x, shadow_y);
+               
+               shadow_color_node = gl_color_node_new_default ();
+               string = gl_xml_get_prop_string (node, "shadow_color_field", NULL);
+               if ( string ) {
+                       shadow_color_node->field_flag = TRUE;
+                       shadow_color_node->key = string;
+               } else {
+                       shadow_color_node->color = gl_xml_get_prop_uint (node, "shadow_color", 0);              
+               }
+               gl_label_object_set_shadow_color (object, shadow_color_node);
+               gl_color_node_free (&shadow_color_node);
+
+               shadow_opacity = gl_xml_get_prop_double (node, "shadow_opacity", 1.0);
+               gl_label_object_set_shadow_opacity (object, shadow_opacity);
+       }
+}
+
 /****************************************************************************/
 /* Save label to xml label file.                                            */
 /****************************************************************************/
@@ -1178,7 +1223,6 @@ xml_create_object_text (xmlNodePtr     root,
        gdouble           w, h;
        GtkJustification  just;
        gboolean          auto_shrink;
-       gdouble           affine[6];
 
        gl_debug (DEBUG_XML, "START");
 
@@ -1203,13 +1247,10 @@ xml_create_object_text (xmlNodePtr     root,
        gl_xml_set_prop_boolean (node, "auto_shrink", auto_shrink);
 
        /* affine attrs */
-       gl_label_object_get_affine (object, affine);
-       gl_xml_set_prop_double (node, "a0", affine[0]);
-       gl_xml_set_prop_double (node, "a1", affine[1]);
-       gl_xml_set_prop_double (node, "a2", affine[2]);
-       gl_xml_set_prop_double (node, "a3", affine[3]);
-       gl_xml_set_prop_double (node, "a4", affine[4]);
-       gl_xml_set_prop_double (node, "a5", affine[5]);
+       xml_create_affine_attrs (node, object);
+
+       /* shadow attrs */
+       xml_create_shadow_attrs (node, object);
 
        /* Add children */
        xml_create_toplevel_span (node, ns, GL_LABEL_TEXT(object));
@@ -1230,7 +1271,6 @@ xml_create_object_box (xmlNodePtr     root,
        gdouble           w, h;
        gdouble           line_width;
        glColorNode      *line_color_node;
-       gdouble           affine[6];
        glColorNode *fill_color_node;
 
        gl_debug (DEBUG_XML, "START");
@@ -1275,13 +1315,10 @@ xml_create_object_box (xmlNodePtr     root,
        gl_color_node_free (&fill_color_node);
 
        /* affine attrs */
-       gl_label_object_get_affine (object, affine);
-       gl_xml_set_prop_double (node, "a0", affine[0]);
-       gl_xml_set_prop_double (node, "a1", affine[1]);
-       gl_xml_set_prop_double (node, "a2", affine[2]);
-       gl_xml_set_prop_double (node, "a3", affine[3]);
-       gl_xml_set_prop_double (node, "a4", affine[4]);
-       gl_xml_set_prop_double (node, "a5", affine[5]);
+       xml_create_affine_attrs (node, object);
+
+       /* shadow attrs */
+       xml_create_shadow_attrs (node, object);
 
        gl_debug (DEBUG_XML, "END");
 }
@@ -1299,7 +1336,6 @@ xml_create_object_ellipse (xmlNodePtr     root,
        gdouble           w, h;
        gdouble           line_width;
        glColorNode      *line_color_node;
-       gdouble           affine[6];
        glColorNode *fill_color_node;
 
        gl_debug (DEBUG_XML, "START");
@@ -1345,13 +1381,10 @@ xml_create_object_ellipse (xmlNodePtr     root,
        gl_color_node_free (&fill_color_node);
 
        /* affine attrs */
-       gl_label_object_get_affine (object, affine);
-       gl_xml_set_prop_double (node, "a0", affine[0]);
-       gl_xml_set_prop_double (node, "a1", affine[1]);
-       gl_xml_set_prop_double (node, "a2", affine[2]);
-       gl_xml_set_prop_double (node, "a3", affine[3]);
-       gl_xml_set_prop_double (node, "a4", affine[4]);
-       gl_xml_set_prop_double (node, "a5", affine[5]);
+       xml_create_affine_attrs (node, object);
+
+       /* shadow attrs */
+       xml_create_shadow_attrs (node, object);
 
        gl_debug (DEBUG_XML, "END");
 }
@@ -1369,7 +1402,6 @@ xml_create_object_line (xmlNodePtr     root,
        gdouble           dx, dy;
        gdouble           line_width;
        glColorNode      *line_color_node;
-       gdouble           affine[6];
 
        gl_debug (DEBUG_XML, "START");
 
@@ -1402,13 +1434,10 @@ xml_create_object_line (xmlNodePtr     root,
 
 
        /* affine attrs */
-       gl_label_object_get_affine (object, affine);
-       gl_xml_set_prop_double (node, "a0", affine[0]);
-       gl_xml_set_prop_double (node, "a1", affine[1]);
-       gl_xml_set_prop_double (node, "a2", affine[2]);
-       gl_xml_set_prop_double (node, "a3", affine[3]);
-       gl_xml_set_prop_double (node, "a4", affine[4]);
-       gl_xml_set_prop_double (node, "a5", affine[5]);
+       xml_create_affine_attrs (node, object);
+
+       /* shadow attrs */
+       xml_create_shadow_attrs (node, object);
 
        gl_debug (DEBUG_XML, "END");
 }
@@ -1425,7 +1454,6 @@ xml_create_object_image (xmlNodePtr     root,
        gdouble           x, y;
        gdouble           w, h;
        glTextNode       *filename;
-       gdouble           affine[6];
 
        gl_debug (DEBUG_XML, "START");
 
@@ -1451,13 +1479,10 @@ xml_create_object_image (xmlNodePtr     root,
        gl_text_node_free (&filename);
 
        /* affine attrs */
-       gl_label_object_get_affine (object, affine);
-       gl_xml_set_prop_double (node, "a0", affine[0]);
-       gl_xml_set_prop_double (node, "a1", affine[1]);
-       gl_xml_set_prop_double (node, "a2", affine[2]);
-       gl_xml_set_prop_double (node, "a3", affine[3]);
-       gl_xml_set_prop_double (node, "a4", affine[4]);
-       gl_xml_set_prop_double (node, "a5", affine[5]);
+       xml_create_affine_attrs (node, object);
+
+       /* shadow attrs */
+       xml_create_shadow_attrs (node, object);
 
        gl_debug (DEBUG_XML, "END");
 }
@@ -1479,7 +1504,6 @@ xml_create_object_barcode (xmlNodePtr     root,
        gboolean          checksum_flag;
        glColorNode      *color_node;
        guint             format_digits;
-       gdouble           affine[6];
 
        gl_debug (DEBUG_XML, "START");
 
@@ -1527,13 +1551,10 @@ xml_create_object_barcode (xmlNodePtr     root,
        gl_text_node_free (&text_node);
 
        /* affine attrs */
-       gl_label_object_get_affine (object, affine);
-       gl_xml_set_prop_double (node, "a0", affine[0]);
-       gl_xml_set_prop_double (node, "a1", affine[1]);
-       gl_xml_set_prop_double (node, "a2", affine[2]);
-       gl_xml_set_prop_double (node, "a3", affine[3]);
-       gl_xml_set_prop_double (node, "a4", affine[4]);
-       gl_xml_set_prop_double (node, "a5", affine[5]);
+       xml_create_affine_attrs (node, object);
+
+       /* shadow attrs */
+       xml_create_shadow_attrs (node, object);
 
        gl_debug (DEBUG_XML, "END");
 }
@@ -1718,3 +1739,63 @@ xml_create_toplevel_span (xmlNodePtr        root,
        g_free (font_family);
 
 }
+
+/*--------------------------------------------------------------------------*/
+/* PRIVATE.  Create affine attributes.                                      */
+/*--------------------------------------------------------------------------*/
+static void
+xml_create_affine_attrs (xmlNodePtr        node,
+                        glLabelObject    *object)
+{
+       gdouble           affine[6];
+
+       gl_label_object_get_affine (object, affine);
+
+       gl_xml_set_prop_double (node, "a0", affine[0]);
+       gl_xml_set_prop_double (node, "a1", affine[1]);
+       gl_xml_set_prop_double (node, "a2", affine[2]);
+       gl_xml_set_prop_double (node, "a3", affine[3]);
+       gl_xml_set_prop_double (node, "a4", affine[4]);
+       gl_xml_set_prop_double (node, "a5", affine[5]);
+}
+
+/*--------------------------------------------------------------------------*/
+/* PRIVATE.  Create shadow attributes.                                      */
+/*--------------------------------------------------------------------------*/
+static void
+xml_create_shadow_attrs (xmlNodePtr        node,
+                        glLabelObject    *object)
+{
+       gboolean          shadow_state;
+       gdouble           shadow_x;
+       gdouble           shadow_y;
+       glColorNode      *shadow_color_node;
+       gdouble           shadow_opacity;
+
+       shadow_state = gl_label_object_get_shadow_state (object);
+
+       if (shadow_state)
+       {
+               gl_xml_set_prop_boolean (node, "shadow", shadow_state);
+
+               gl_label_object_get_shadow_offset (object, &shadow_x, &shadow_y);
+               gl_xml_set_prop_length (node, "shadow_x", shadow_x);
+               gl_xml_set_prop_length (node, "shadow_y", shadow_y);
+               
+               shadow_color_node = gl_label_object_get_shadow_color (object);
+               if (shadow_color_node->field_flag)
+               {
+                       gl_xml_set_prop_string (node, "shadow_color_field", shadow_color_node->key);
+               }
+               else
+               {
+                       gl_xml_set_prop_uint_hex (node, "shadow_color", shadow_color_node->color);
+               }
+               gl_color_node_free (&shadow_color_node);
+
+               shadow_opacity = gl_label_object_get_shadow_opacity (object);
+               gl_xml_set_prop_double (node, "shadow_opacity", shadow_opacity);
+       }
+}
+
+