"glabels/glabels-icon.png",\
FALSE, NULL)
-#define EX_1LAYOUT_PIXMAP gnome_program_locate_file (NULL,\
+#define EX_RECT_IMAGE gnome_program_locate_file (NULL,\
+ GNOME_FILE_DOMAIN_APP_PIXMAP,\
+ "glabels/ex-rect-size.png",\
+ FALSE, NULL)
+
+#define EX_ROUND_IMAGE gnome_program_locate_file (NULL,\
+ GNOME_FILE_DOMAIN_APP_PIXMAP,\
+ "glabels/ex-round-size.png",\
+ FALSE, NULL)
+
+#define EX_CD_IMAGE gnome_program_locate_file (NULL,\
+ GNOME_FILE_DOMAIN_APP_PIXMAP,\
+ "glabels/ex-cd-size.png",\
+ FALSE, NULL)
+
+#define EX_NLAYOUTS_IMAGE1 gnome_program_locate_file (NULL,\
GNOME_FILE_DOMAIN_APP_PIXMAP,\
"glabels/ex-1layout.png",\
FALSE, NULL)
-#define EX_2LAYOUTS_PIXMAP gnome_program_locate_file (NULL,\
+#define EX_NLAYOUTS_IMAGE2 gnome_program_locate_file (NULL,\
GNOME_FILE_DOMAIN_APP_PIXMAP,\
"glabels/ex-2layouts.png",\
FALSE, NULL)
+
+#define DEFAULT_MARGIN 9.0
+
+#define DEFAULT_RECT_W 252.0
+#define DEFAULT_RECT_H 144.0
+#define DEFAULT_RECT_R 0.0
+#define DEFAULT_RECT_WASTE 0.0 /* Should never exceed 1/2 the distance between items. */
+
+#define DEFAULT_ROUND_R 72.0
+#define DEFAULT_ROUND_WASTE 0.0 /* Should never exceed 1/2 the distance between items. */
+
+#define DEFAULT_CD_RADIUS 166.5
+#define DEFAULT_CD_HOLE 58.5
+#define DEFAULT_CD_WASTE 9.0 /* Should never exceed 1/2 the distance between items. */
+
#define CONTENTS_BG 0xF5F5F5FF
#define DELTA 0.01
#define MAX_PAGE_DIM_POINTS 5000.0
GtkWidget *shape_cd_radio;
/* Label size (rectangular) page controls */
+ GtkWidget *rect_image;
GtkWidget *rect_w_spin;
GtkWidget *rect_h_spin;
GtkWidget *rect_r_spin;
GtkWidget *rect_waste_spin;
+ GtkWidget *rect_margin_spin;
GtkWidget *rect_w_units_label;
GtkWidget *rect_h_units_label;
GtkWidget *rect_r_units_label;
GtkWidget *rect_waste_units_label;
+ GtkWidget *rect_margin_units_label;
/* Label size (round) page controls */
+ GtkWidget *round_image;
GtkWidget *round_r_spin;
GtkWidget *round_waste_spin;
+ GtkWidget *round_margin_spin;
GtkWidget *round_r_units_label;
GtkWidget *round_waste_units_label;
+ GtkWidget *round_margin_units_label;
/* Label size (cd) page controls */
+ GtkWidget *cd_image;
GtkWidget *cd_radius_spin;
GtkWidget *cd_hole_spin;
GtkWidget *cd_w_spin;
GtkWidget *cd_h_spin;
GtkWidget *cd_waste_spin;
+ GtkWidget *cd_margin_spin;
GtkWidget *cd_radius_units_label;
GtkWidget *cd_hole_units_label;
GtkWidget *cd_w_units_label;
GtkWidget *cd_h_units_label;
GtkWidget *cd_waste_units_label;
+ GtkWidget *cd_margin_units_label;
/* Number of layouts controls */
GtkWidget *nlayouts_image1;
construct_rect_size_page (glTemplateDesigner *dlg,
GdkPixbuf *logo)
{
+ GdkPixbuf *pixbuf;
+
dlg->priv->rect_size_page =
glade_xml_get_widget (dlg->priv->gui, "rect_size_page");
/* Rect Size Page Widgets */
+ dlg->priv->rect_image =
+ glade_xml_get_widget (dlg->priv->gui, "rect_image");
dlg->priv->rect_w_spin =
glade_xml_get_widget (dlg->priv->gui, "rect_w_spin");
dlg->priv->rect_h_spin =
glade_xml_get_widget (dlg->priv->gui, "rect_r_spin");
dlg->priv->rect_waste_spin =
glade_xml_get_widget (dlg->priv->gui, "rect_waste_spin");
+ dlg->priv->rect_margin_spin =
+ glade_xml_get_widget (dlg->priv->gui, "rect_margin_spin");
dlg->priv->rect_w_units_label =
glade_xml_get_widget (dlg->priv->gui, "rect_w_units_label");
dlg->priv->rect_h_units_label =
glade_xml_get_widget (dlg->priv->gui, "rect_r_units_label");
dlg->priv->rect_waste_units_label =
glade_xml_get_widget (dlg->priv->gui, "rect_waste_units_label");
+ dlg->priv->rect_margin_units_label =
+ glade_xml_get_widget (dlg->priv->gui, "rect_margin_units_label");
+
+ /* Initialize illustration. */
+ pixbuf = gdk_pixbuf_new_from_file (EX_RECT_IMAGE, NULL);
+ gtk_image_set_from_pixbuf (GTK_IMAGE(dlg->priv->rect_image), pixbuf);
/* Apply units to spinbuttons and units labels. */
gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin),
dlg->priv->climb_rate, 10.0*dlg->priv->climb_rate);
gtk_label_set_text (GTK_LABEL(dlg->priv->rect_waste_units_label),
dlg->priv->units_string);
+ gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin),
+ dlg->priv->digits);
+ gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin),
+ dlg->priv->climb_rate, 10.0*dlg->priv->climb_rate);
+ gtk_label_set_text (GTK_LABEL(dlg->priv->rect_margin_units_label),
+ dlg->priv->units_string);
+
+ /* Load some realistic defaults. */
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin),
+ DEFAULT_RECT_W * dlg->priv->units_per_point);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin),
+ DEFAULT_RECT_H * dlg->priv->units_per_point);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_r_spin),
+ DEFAULT_RECT_R * dlg->priv->units_per_point);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin),
+ DEFAULT_RECT_WASTE * dlg->priv->units_per_point);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin),
+ DEFAULT_MARGIN * dlg->priv->units_per_point);
/* Handler to prepare the page. */
g_signal_connect_data (G_OBJECT(dlg->priv->rect_size_page), "prepare",
construct_round_size_page (glTemplateDesigner *dlg,
GdkPixbuf *logo)
{
+ GdkPixbuf *pixbuf;
+
dlg->priv->round_size_page =
glade_xml_get_widget (dlg->priv->gui, "round_size_page");
/* Round Size Page Widgets */
+ dlg->priv->round_image =
+ glade_xml_get_widget (dlg->priv->gui, "round_image");
dlg->priv->round_r_spin =
glade_xml_get_widget (dlg->priv->gui, "round_r_spin");
dlg->priv->round_waste_spin =
glade_xml_get_widget (dlg->priv->gui, "round_waste_spin");
+ dlg->priv->round_margin_spin =
+ glade_xml_get_widget (dlg->priv->gui, "round_margin_spin");
dlg->priv->round_r_units_label =
glade_xml_get_widget (dlg->priv->gui, "round_r_units_label");
dlg->priv->round_waste_units_label =
glade_xml_get_widget (dlg->priv->gui, "round_waste_units_label");
+ dlg->priv->round_margin_units_label =
+ glade_xml_get_widget (dlg->priv->gui, "round_margin_units_label");
+
+ /* Initialize illustration. */
+ pixbuf = gdk_pixbuf_new_from_file (EX_ROUND_IMAGE, NULL);
+ gtk_image_set_from_pixbuf (GTK_IMAGE(dlg->priv->round_image), pixbuf);
/* Apply units to spinbuttons and units labels. */
gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->round_r_spin),
dlg->priv->climb_rate, 10.0*dlg->priv->climb_rate);
gtk_label_set_text (GTK_LABEL(dlg->priv->round_waste_units_label),
dlg->priv->units_string);
+ gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->round_margin_spin),
+ dlg->priv->digits);
+ gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dlg->priv->round_margin_spin),
+ dlg->priv->climb_rate, 10.0*dlg->priv->climb_rate);
+ gtk_label_set_text (GTK_LABEL(dlg->priv->round_margin_units_label),
+ dlg->priv->units_string);
+
+ /* Load some realistic defaults. */
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->round_r_spin),
+ DEFAULT_ROUND_R * dlg->priv->units_per_point);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->round_waste_spin),
+ DEFAULT_ROUND_WASTE * dlg->priv->units_per_point);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->round_margin_spin),
+ DEFAULT_MARGIN * dlg->priv->units_per_point);
/* Handler to prepare the page. */
g_signal_connect_data (G_OBJECT(dlg->priv->round_size_page), "prepare",
construct_cd_size_page (glTemplateDesigner *dlg,
GdkPixbuf *logo)
{
+ GdkPixbuf *pixbuf;
+
dlg->priv->cd_size_page =
glade_xml_get_widget (dlg->priv->gui, "cd_size_page");
/* Cd Size Page Widgets */
+ dlg->priv->cd_image =
+ glade_xml_get_widget (dlg->priv->gui, "cd_image");
dlg->priv->cd_radius_spin =
glade_xml_get_widget (dlg->priv->gui, "cd_radius_spin");
dlg->priv->cd_hole_spin =
glade_xml_get_widget (dlg->priv->gui, "cd_h_spin");
dlg->priv->cd_waste_spin =
glade_xml_get_widget (dlg->priv->gui, "cd_waste_spin");
+ dlg->priv->cd_margin_spin =
+ glade_xml_get_widget (dlg->priv->gui, "cd_margin_spin");
dlg->priv->cd_radius_units_label =
glade_xml_get_widget (dlg->priv->gui, "cd_radius_units_label");
dlg->priv->cd_hole_units_label =
glade_xml_get_widget (dlg->priv->gui, "cd_h_units_label");
dlg->priv->cd_waste_units_label =
glade_xml_get_widget (dlg->priv->gui, "cd_waste_units_label");
+ dlg->priv->cd_margin_units_label =
+ glade_xml_get_widget (dlg->priv->gui, "cd_margin_units_label");
+
+ /* Initialize illustration. */
+ pixbuf = gdk_pixbuf_new_from_file (EX_CD_IMAGE, NULL);
+ gtk_image_set_from_pixbuf (GTK_IMAGE(dlg->priv->cd_image), pixbuf);
/* Apply units to spinbuttons and units labels. */
gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->cd_radius_spin),
dlg->priv->climb_rate, 10.0*dlg->priv->climb_rate);
gtk_label_set_text (GTK_LABEL(dlg->priv->cd_waste_units_label),
dlg->priv->units_string);
+ gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->cd_margin_spin),
+ dlg->priv->digits);
+ gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dlg->priv->cd_margin_spin),
+ dlg->priv->climb_rate, 10.0*dlg->priv->climb_rate);
+ gtk_label_set_text (GTK_LABEL(dlg->priv->cd_margin_units_label),
+ dlg->priv->units_string);
+
+ /* Load some realistic defaults. */
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_radius_spin),
+ DEFAULT_CD_RADIUS * dlg->priv->units_per_point);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_hole_spin),
+ DEFAULT_CD_HOLE * dlg->priv->units_per_point);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_waste_spin),
+ DEFAULT_CD_WASTE * dlg->priv->units_per_point);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_margin_spin),
+ DEFAULT_MARGIN * dlg->priv->units_per_point);
/* Handler to prepare the page. */
g_signal_connect_data (G_OBJECT(dlg->priv->cd_size_page), "prepare",
glade_xml_get_widget (dlg->priv->gui, "nlayouts_spin");
/* Initialize illustrations. */
- pixbuf = gdk_pixbuf_new_from_file (EX_1LAYOUT_PIXMAP, NULL);
+ pixbuf = gdk_pixbuf_new_from_file (EX_NLAYOUTS_IMAGE1, NULL);
gtk_image_set_from_pixbuf (GTK_IMAGE(dlg->priv->nlayouts_image1), pixbuf);
- pixbuf = gdk_pixbuf_new_from_file (EX_2LAYOUTS_PIXMAP, NULL);
+ pixbuf = gdk_pixbuf_new_from_file (EX_NLAYOUTS_IMAGE2, NULL);
gtk_image_set_from_pixbuf (GTK_IMAGE(dlg->priv->nlayouts_image2), pixbuf);
construct_page_boilerplate (dlg,
rect_size_page_prepare_cb (glTemplateDesigner *dlg)
{
gdouble max_w, max_h;
- gdouble w, h, r, waste;
+ gdouble w, h, r, waste, margin;
/* Limit label size based on already chosen page size. */
max_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_w_spin));
w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin));
h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin));
r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_r_spin));
- waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin));
+ waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin));
+ margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin));
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->rect_w_spin),
dlg->priv->climb_rate, max_w);
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->rect_r_spin),
0.0, MIN(max_w, max_h)/2.0);
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->rect_waste_spin),
- 0.0, MIN(max_w, max_h)/2.0);
+ 0.0, MIN(max_w, max_h)/4.0);
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->rect_margin_spin),
+ 0.0, MIN(max_w, max_h)/4.0);
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin), w);
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin), h);
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_r_spin), r);
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin), waste);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin), margin);
}
round_size_page_prepare_cb (glTemplateDesigner *dlg)
{
gdouble max_w, max_h;
- gdouble r, waste;
+ gdouble r, waste, margin;
/* Limit label size based on already chosen page size. */
max_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_w_spin));
max_h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_h_spin));
r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_r_spin));
- waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_waste_spin));
+ waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_waste_spin));
+ margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_margin_spin));
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->round_r_spin),
dlg->priv->climb_rate, MIN(max_w, max_h)/2.0);
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->round_waste_spin),
- 0.0, MIN(max_w, max_h)/2.0);
+ 0.0, MIN(max_w, max_h)/4.0);
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->round_margin_spin),
+ 0.0, MIN(max_w, max_h)/4.0);
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->round_r_spin), r);
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->round_waste_spin), waste);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->round_margin_spin), margin);
}
cd_size_page_prepare_cb (glTemplateDesigner *dlg)
{
gdouble max_w, max_h;
- gdouble radius, hole, w, h, waste;
+ gdouble radius, hole, w, h, waste, margin;
/* Limit label size based on already chosen page size. */
max_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_w_spin));
hole = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_hole_spin));
w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_w_spin));
h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_h_spin));
- waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_waste_spin));
+ waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_waste_spin));
+ margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_margin_spin));
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->cd_radius_spin),
dlg->priv->climb_rate, MIN(max_w, max_h)/2.0);
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->cd_h_spin),
0.0, max_h);
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->cd_waste_spin),
- 0.0, MIN(max_w, max_h)/2.0);
+ 0.0, MIN(max_w, max_h)/4.0);
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->cd_margin_spin),
+ 0.0, MIN(max_w, max_h)/4.0);
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_radius_spin), radius);
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_hole_spin), hole);
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_w_spin), w);
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_h_spin), h);
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_waste_spin), waste);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_margin_spin), margin);
}
static void
layout_page_prepare_cb (glTemplateDesigner *dlg)
{
- gdouble min_x, min_y;
- gdouble max_x, max_y;
+ gdouble page_w, page_h;
+ gdouble w, h, waste;
gint max_nx, max_ny;
gint nlayouts;
gdouble nx_1, ny_1, x0_1, y0_1, dx_1, dy_1;
G_OBJECT(dlg));
/* Limit ranges based on already chosen page and label sizes. */
+ page_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_w_spin));
+ page_h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_h_spin));
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dlg->priv->shape_rect_radio))) {
- min_x = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin));
- min_y = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin));
+ w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin));
+ h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin));
+ waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin));
}
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dlg->priv->shape_round_radio))) {
- min_x = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_r_spin));
- min_y = 2*min_x;
+ w = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_r_spin));
+ h = w;
+ waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_waste_spin));
}
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dlg->priv->shape_cd_radio))) {
- min_x = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_radius_spin));
- min_y = 2*min_x;
+ w = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_radius_spin));
+ h = w;
+ waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_waste_spin));
}
- max_x = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_w_spin));
- max_y = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_h_spin));
- max_nx = MAX (floor (max_x/min_x + DELTA), 1.0);
- max_ny = MAX (floor (max_y/min_y + DELTA), 1.0);
+ max_nx = MAX (floor (page_w/(w + 2*waste) + DELTA), 1.0);
+ max_ny = MAX (floor (page_h/(h + 2*waste) + DELTA), 1.0);
nx_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->layout1_nx_spin));
ny_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->layout1_ny_spin));
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout1_ny_spin),
1, max_ny);
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout1_x0_spin),
- 0.0, max_x-min_x);
+ waste, page_w - w - waste);
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout1_y0_spin),
- 0.0, max_y-min_y);
+ waste, page_h - h - waste);
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout1_dx_spin),
- min_x, max_x);
+ w + 2*waste, page_w - w - 2*waste);
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout1_dy_spin),
- min_y, max_y);
+ h + 2*waste, page_h - h - 2*waste);
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_nx_spin),
1, max_nx);
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_ny_spin),
1, max_ny);
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_x0_spin),
- 0.0, max_x-min_x);
+ waste, page_w - w - waste);
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_y0_spin),
- 0.0, max_y-min_y);
+ waste, page_h - h - waste);
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_dx_spin),
- min_x, max_x);
+ w + 2*waste, page_w - w - 2*waste);
gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_dy_spin),
- min_y, max_y);
+ h + 2*waste, page_h - h - 2*waste);
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->layout1_nx_spin), nx_1);
gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->layout1_ny_spin), ny_1);
gchar *page_size_name;
glPaper *paper;
glTemplateLabelStyle shape;
- gdouble w, h, r, radius, hole, waste;
+ gdouble w, h, r, radius, hole, waste, margin;
gint nlayouts;
gdouble nx_1, ny_1, x0_1, y0_1, dx_1, dy_1;
gdouble nx_2, ny_2, x0_2, y0_2, dx_2, dy_2;
h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin));
r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_r_spin));
waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin));
+ margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin));
}
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dlg->priv->shape_round_radio))) {
shape = GL_TEMPLATE_STYLE_ROUND;
r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_r_spin));
waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_waste_spin));
+ margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_margin_spin));
}
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dlg->priv->shape_cd_radio))) {
w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_w_spin));
h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_h_spin));
waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_waste_spin));
+ margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_margin_spin));
}
nlayouts = gtk_spin_button_get_value (GTK_SPIN_BUTTON (dlg->priv->nlayouts_spin));
template->label.cd.waste = waste / dlg->priv->units_per_point;
break;
}
+ template->label.any.markups =
+ g_list_append (template->label.any.markups,
+ gl_template_markup_margin_new (margin / dlg->priv->units_per_point));
template->label.any.layouts =
g_list_append (template->label.any.layouts,
gl_template_layout_new (nx_1, ny_1,
<child>
<widget class="GtkTable" id="table4">
<property name="visible">True</property>
- <property name="n_rows">4</property>
+ <property name="n_rows">5</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">12</property>
<child>
<widget class="GtkLabel" id="label83">
<property name="visible">True</property>
- <property name="label" translatable="yes">Width:</property>
+ <property name="label" translatable="yes">1. Width:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<child>
<widget class="GtkLabel" id="label84">
<property name="visible">True</property>
- <property name="label" translatable="yes">Height:</property>
+ <property name="label" translatable="yes">2. Height:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<child>
<widget class="GtkLabel" id="label85">
<property name="visible">True</property>
- <property name="label" translatable="yes">Round (radius of corner):</property>
+ <property name="label" translatable="yes">3. Round (radius of corner):</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<child>
<widget class="GtkLabel" id="label86">
<property name="visible">True</property>
- <property name="label" translatable="yes">Waste (overprint allowed):</property>
+ <property name="label" translatable="yes">4. Waste (overprint allowed):</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="y_options"></property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkLabel" id="label101">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">5. Margin</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>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="rect_margin_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</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkSpinButton" id="rect_margin_spin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">0.01</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">0 0 100 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="padding">0</property>
<child>
<widget class="GtkTable" id="table8">
<property name="visible">True</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">12</property>
<child>
<widget class="GtkLabel" id="label91">
<property name="visible">True</property>
- <property name="label" translatable="yes">Radius:</property>
+ <property name="label" translatable="yes">1. Radius:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<child>
<widget class="GtkLabel" id="label92">
<property name="visible">True</property>
- <property name="label" translatable="yes">Waste (overprint allowed):</property>
+ <property name="label" translatable="yes">2. Waste (overprint allowed):</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="y_options"></property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkLabel" id="label103">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">3. Margin</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>
+ </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"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="round_margin_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</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkSpinButton" id="round_margin_spin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">0.01</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">0 0 100 1 10 10</property>
+ </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"></property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="padding">0</property>
<child>
<widget class="GtkTable" id="table7">
<property name="visible">True</property>
- <property name="n_rows">5</property>
+ <property name="n_rows">6</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">12</property>
<child>
<widget class="GtkLabel" id="label95">
<property name="visible">True</property>
- <property name="label" translatable="yes">Outer radius:</property>
+ <property name="label" translatable="yes">1. Outer radius:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<child>
<widget class="GtkLabel" id="label96">
<property name="visible">True</property>
- <property name="label" translatable="yes">Inner radius:</property>
+ <property name="label" translatable="yes">2. Inner radius:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<child>
<widget class="GtkLabel" id="label97">
<property name="visible">True</property>
- <property name="label" translatable="yes">Clipping width:</property>
+ <property name="label" translatable="yes">3. Clipping width:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<child>
<widget class="GtkLabel" id="label98">
<property name="visible">True</property>
- <property name="label" translatable="yes">Clipping height:</property>
+ <property name="label" translatable="yes">4. Clipping height:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<child>
<widget class="GtkLabel" id="label99">
<property name="visible">True</property>
- <property name="label" translatable="yes">Waste (overprint allowed):</property>
+ <property name="label" translatable="yes">5. Waste (overprint allowed):</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</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="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</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="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</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="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</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="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</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="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="y_options"></property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkLabel" id="label105">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">6. Margin</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>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="cd_margin_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</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkSpinButton" id="cd_margin_spin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">0.01</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">0 0 100 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="padding">0</property>