glabels_batch_SOURCES = \
glabels-batch.c \
- prefs.c \
- prefs.h \
print.c \
print.h \
bc.c \
{
guint new_color;
- new_color = (color & 0xFFFFFF00) | ((guint)(255.0*opacity) & 0xFF);
+ new_color = (color & 0xFFFFFF00) | (((guint)(255.0*opacity)) & 0xFF);
+
+ return new_color;
}
#include "wdgt-bc-props.h"
#include "wdgt-bc-style.h"
#include "wdgt-position.h"
+#include "color.h"
+#include "prefs.h"
#include "pixmaps/cursor_barcode.xbm"
#include "pixmaps/cursor_barcode_mask.xbm"
gl_label_barcode_set_props (GL_LABEL_BARCODE(object),
GL_BARCODE_STYLE_POSTNET,
FALSE,
- GNOME_CANVAS_COLOR_A (0,0,0,255),
+ gl_color_set_opacity (gl_prefs->default_line_color, 0.5),
1.0);
view_barcode = gl_view_barcode_new (GL_LABEL_BARCODE(object),
view);
event->button.y, &x, &y);
gl_label_object_set_position (GL_LABEL_OBJECT(object),
x, y);
+ gl_label_barcode_set_props (GL_LABEL_BARCODE(object),
+ GL_BARCODE_STYLE_POSTNET,
+ FALSE,
+ gl_prefs->default_line_color,
+ 1.0);
gl_view_unselect_all (view);
gl_view_object_select (GL_VIEW_OBJECT(view_barcode));
gl_view_arrow_mode (view);
#include "wdgt-fill.h"
#include "wdgt-size.h"
#include "wdgt-position.h"
+#include "color.h"
+#include "prefs.h"
#include "pixmaps/cursor_box.xbm"
#include "pixmaps/cursor_box_mask.xbm"
/*========================================================*/
/* Private macros and constants. */
/*========================================================*/
-#define CREATE_LINE_COLOR GNOME_CANVAS_COLOR_A (0, 0, 0, 192)
-#define CREATE_FILL_COLOR GNOME_CANVAS_COLOR_A (0, 255, 0, 192)
-
-#define DEFAULT_LINE_COLOR GNOME_CANVAS_COLOR_A (0, 0, 0, 255)
-#define DEFAULT_FILL_COLOR GNOME_CANVAS_COLOR_A (0, 255, 0, 255)
#define DELTA 0.01
static gboolean dragging = FALSE;
static glViewObject *view_box;
static GObject *object;
- gdouble line_width;
guint line_color, fill_color;
gdouble x, y, w, h;
gnome_canvas_window_to_world (canvas,
event->button.x,
event->button.y, &x, &y);
- gl_debug (DEBUG_VIEW, "BUTTON_PRESS (%f, %f) -> (%f, %f)", event->button.x, event->button.y, x, y);
object = gl_label_box_new (view->label);
gl_label_object_set_position (GL_LABEL_OBJECT(object),
x, y);
gl_label_object_set_size (GL_LABEL_OBJECT(object),
0.0, 0.0);
- line_width = 1.0;
- line_color = CREATE_LINE_COLOR;
- fill_color = CREATE_FILL_COLOR;
+ line_color = gl_color_set_opacity (gl_prefs->default_line_color, 0.5);
+ fill_color = gl_color_set_opacity (gl_prefs->default_fill_color, 0.5);
gl_label_box_set_line_width (GL_LABEL_BOX(object),
- line_width);
+ gl_prefs->default_line_width);
gl_label_box_set_line_color (GL_LABEL_BOX(object),
line_color);
gl_label_box_set_fill_color (GL_LABEL_BOX(object),
gnome_canvas_window_to_world (canvas,
event->button.x,
event->button.y, &x, &y);
- gl_debug (DEBUG_VIEW, "BUTTON_RELEASE (%f, %f) -> (%f, %f)", event->button.x, event->button.y, x, y);
if ((x0 == x) && (y0 == y)) {
x = x0 + 36.0;
y = y0 + 36.0;
h = MAX (y, y0) - MIN (y, y0);
gl_label_object_set_size (GL_LABEL_OBJECT(object),
w, h);
- line_color = DEFAULT_LINE_COLOR;
- fill_color = DEFAULT_FILL_COLOR;
gl_label_box_set_line_color (GL_LABEL_BOX(object),
- line_color);
+ gl_prefs->default_line_color);
gl_label_box_set_fill_color (GL_LABEL_BOX(object),
- fill_color);
+ gl_prefs->default_fill_color);
gl_view_unselect_all (view);
gl_view_object_select (GL_VIEW_OBJECT(view_box));
gl_view_arrow_mode (view);
event->motion.y, &x, &y);
gl_label_object_set_position (GL_LABEL_OBJECT(object),
MIN (x, x0), MIN (y, y0));
- gl_debug (DEBUG_VIEW, "BUTTON_MOTION (%f, %f) -> (%f, %f)", event->button.x, event->button.y, x, y);
w = MAX (x, x0) - MIN (x, x0);
h = MAX (y, y0) - MIN (y, y0);
gl_label_object_set_size (GL_LABEL_OBJECT(object),
#include "wdgt-fill.h"
#include "wdgt-size.h"
#include "wdgt-position.h"
+#include "color.h"
+#include "prefs.h"
#include "pixmaps/cursor_ellipse.xbm"
#include "pixmaps/cursor_ellipse_mask.xbm"
/*========================================================*/
/* Private macros and constants. */
/*========================================================*/
-#define CREATE_LINE_COLOR GNOME_CANVAS_COLOR_A (0, 0, 0, 192)
-#define CREATE_FILL_COLOR GNOME_CANVAS_COLOR_A (0, 255, 0, 192)
-
-#define DEFAULT_LINE_COLOR GNOME_CANVAS_COLOR_A (0, 0, 0, 255)
-#define DEFAULT_FILL_COLOR GNOME_CANVAS_COLOR_A (0, 255, 0, 255)
#define DELTA 0.01
}
/*****************************************************************************/
-/* Canvas event handler for creating ellipse objects. */
+/* Canvas event handler for creating ellipse objects. */
/*****************************************************************************/
int
gl_view_ellipse_create_event_handler (GnomeCanvas *canvas,
static gboolean dragging = FALSE;
static glViewObject *view_ellipse;
static GObject *object;
- gdouble line_width;
guint line_color, fill_color;
gdouble x, y, w, h;
x, y);
gl_label_object_set_size (GL_LABEL_OBJECT(object),
0.0, 0.0);
- line_width = 1.0;
- line_color = CREATE_LINE_COLOR;
- fill_color = CREATE_FILL_COLOR;
+ line_color = gl_color_set_opacity (gl_prefs->default_line_color, 0.5);
+ fill_color = gl_color_set_opacity (gl_prefs->default_fill_color, 0.5);
gl_label_ellipse_set_line_width (GL_LABEL_ELLIPSE(object),
- line_width);
- gl_label_ellipse_set_line_color (GL_LABEL_ELLIPSE(object),
+ gl_prefs->default_line_width); gl_label_ellipse_set_line_color (GL_LABEL_ELLIPSE(object),
line_color);
gl_label_ellipse_set_fill_color (GL_LABEL_ELLIPSE(object),
fill_color);
h = MAX (y, y0) - MIN (y, y0);
gl_label_object_set_size (GL_LABEL_OBJECT(object),
w, h);
- line_color = DEFAULT_LINE_COLOR;
- fill_color = DEFAULT_FILL_COLOR;
gl_label_ellipse_set_line_color (GL_LABEL_ELLIPSE(object),
- line_color);
+ gl_prefs->default_line_color);
gl_label_ellipse_set_fill_color (GL_LABEL_ELLIPSE(object),
- fill_color);
+ gl_prefs->default_fill_color);
gl_view_unselect_all (view);
gl_view_object_select (GL_VIEW_OBJECT(view_ellipse));
gl_view_arrow_mode (view);
}
/*****************************************************************************/
-/* Canvas event handler for creating image objects. */
+/* Canvas event handler for creating image objects. */
/*****************************************************************************/
int
gl_view_image_create_event_handler (GnomeCanvas *canvas,
gl_label_object_set_size (GL_LABEL_OBJECT(object),
0.0, 0.0);
view_image = gl_view_image_new (GL_LABEL_IMAGE(object),
- view);
+ view);
x0 = x;
y0 = y;
return TRUE;
#include "wdgt-line.h"
#include "wdgt-vector.h"
#include "wdgt-position.h"
+#include "color.h"
+#include "prefs.h"
#include "pixmaps/cursor_line.xbm"
#include "pixmaps/cursor_line_mask.xbm"
/*========================================================*/
/* Private macros and constants. */
/*========================================================*/
-#define CREATE_LINE_COLOR GNOME_CANVAS_COLOR_A (0, 0, 0, 192)
-
-#define DEFAULT_LINE_COLOR GNOME_CANVAS_COLOR_A (0, 0, 0, 255)
/*========================================================*/
/* Private types. */
static gboolean dragging = FALSE;
static glViewObject *view_line;
static GObject *object;
- gdouble line_width;
- guint line_color;
gdouble x, y, w, h;
gl_debug (DEBUG_VIEW, "");
x, y);
gl_label_object_set_size (GL_LABEL_OBJECT(object),
0.0, 0.0);
- line_width = 1.0;
- line_color = CREATE_LINE_COLOR;
gl_label_line_set_line_width (GL_LABEL_LINE(object),
- line_width);
+ gl_prefs->default_line_width);
gl_label_line_set_line_color (GL_LABEL_LINE(object),
- line_color);
+ gl_color_set_opacity (gl_prefs->default_line_color, 0.5));
view_line = gl_view_line_new (GL_LABEL_LINE(object),
view);
x0 = x;
h = y - y0;
gl_label_object_set_size (GL_LABEL_OBJECT(object),
w, h);
- line_color = DEFAULT_LINE_COLOR;
gl_label_line_set_line_color (GL_LABEL_LINE(object),
- line_color);
+ gl_prefs->default_line_color);
gl_view_unselect_all (view);
gl_view_object_select (GL_VIEW_OBJECT(view_line));
gl_view_arrow_mode (view);
#include "wdgt-text-entry.h"
#include "wdgt-text-props.h"
#include "wdgt-position.h"
+#include "color.h"
+#include "prefs.h"
#include "pixmaps/cursor_text.xbm"
#include "pixmaps/cursor_text_mask.xbm"
object = gl_label_text_new (view->label);
gl_label_object_set_position (GL_LABEL_OBJECT(object),
x, y);
+ gl_label_text_set_props (GL_LABEL_TEXT(object),
+ gl_prefs->default_font_family,
+ gl_prefs->default_font_size,
+ gl_prefs->default_font_weight,
+ gl_prefs->default_font_italic_flag,
+ gl_color_set_opacity (gl_prefs->default_text_color, 0.5),
+ gl_prefs->default_text_alignment);
lines = gl_text_node_lines_new_from_text (_("Text"));
gl_label_text_set_lines (GL_LABEL_TEXT(object), lines);
view_text = gl_view_text_new (GL_LABEL_TEXT(object),
event->button.y, &x, &y);
gl_label_object_set_position (GL_LABEL_OBJECT(object),
x, y);
+ gl_label_text_set_props (GL_LABEL_TEXT(object),
+ gl_prefs->default_font_family,
+ gl_prefs->default_font_size,
+ gl_prefs->default_font_weight,
+ gl_prefs->default_font_italic_flag,
+ gl_prefs->default_text_color,
+ gl_prefs->default_text_alignment);
gl_view_unselect_all (view);
gl_view_object_select (GL_VIEW_OBJECT(view_text));
gl_view_arrow_mode (view);