static void selection_clear_cb (GtkWidget *widget,
GdkEventSelection *event,
- gpointer data);
+ glView *view);
static void selection_get_cb (GtkWidget *widget,
GtkSelectionData *selection_data,
guint info,
guint time,
- gpointer data);
+ glView *view);
static void selection_received_cb (GtkWidget *widget,
GtkSelectionData *selection_data,
guint time,
- gpointer data);
+ glView *view);
\f
/****************************************************************************/
/* Boilerplate Object stuff. */
g_return_val_if_fail (label && GL_IS_LABEL (label), NULL);
- view = g_object_new (gl_view_get_type (), NULL);
+ view = g_object_new (GL_TYPE_VIEW, NULL);
view->label = label;
gl_view_construct (view);
static void
gl_view_construct (glView *view)
{
- GtkWidget *wvbox, *wscroll;
+ GtkWidget *wvbox;
+ GtkWidget *wscroll;
gl_debug (DEBUG_VIEW, "START");
gl_view_construct_canvas (glView *view)
{
glLabel *label;
- gdouble label_width, label_height;
+ gdouble label_width;
+ gdouble label_height;
GdkColor *bg_color;
gl_debug (DEBUG_VIEW, "START");
get_home_scale (glView *view)
{
GdkScreen *screen;
- gdouble screen_width_pixels, screen_width_mm;
- gdouble screen_height_pixels, screen_height_mm;
- gdouble x_pixels_per_mm, y_pixels_per_mm;
+ gdouble screen_width_pixels;
+ gdouble screen_width_mm;
+ gdouble screen_height_pixels;
+ gdouble screen_height_mm;
+ gdouble x_pixels_per_mm;
+ gdouble y_pixels_per_mm;
gdouble scale;
if (!gtk_widget_has_screen (GTK_WIDGET (view->canvas))) return 1.0;
/*---------------------------------------------------------------------------*/
static void
label_resized_cb (glLabel *label,
- glView *view)
+ glView *view)
{
- gdouble label_width, label_height;
+ gdouble label_width;
+ gdouble label_height;
g_return_if_fail (label && GL_IS_LABEL (label));
g_return_if_fail (view && GL_IS_VIEW (view));
draw_bg_fg_rect (glView *view)
{
glLabel *label;
- gdouble w, h;
+ gdouble w;
+ gdouble h;
GnomeCanvasItem *item;
gl_debug (DEBUG_VIEW, "START");
{
glLabel *label;
GnomeCanvasPoints *points;
- gint i_coords, i_theta;
+ gint i_coords;
+ gint i_theta;
glTemplate *template;
const glTemplateLabelType *label_type;
- gdouble r, w, h;
+ gdouble r;
+ gdouble w;
+ gdouble h;
GnomeCanvasItem *item;
gl_debug (DEBUG_VIEW, "START");
glLabel *label;
glTemplate *template;
const glTemplateLabelType *label_type;
- gdouble r1, r2;
+ gdouble r1;
+ gdouble r2;
GnomeCanvasItem *item;
gl_debug (DEBUG_VIEW, "START");
glTemplate *template;
const glTemplateLabelType *label_type;
GnomeCanvasPoints *points;
- gint i_coords, i_theta;
- gdouble theta1, theta2;
- gdouble x0, y0, w, h, r1, r2;
+ gint i_coords;
+ gint i_theta;
+ gdouble theta1;
+ gdouble theta2;
+ gdouble x0, y0;
+ gdouble w, h;
+ gdouble r1, r2;
GnomeCanvasItem *item;
gl_debug (DEBUG_VIEW, "START");
static void
draw_grid_layer (glView *view)
{
- gdouble w, h, x, y, x0, y0;
+ gdouble w, h;
+ gdouble x, y;
+ gdouble x0, y0;
GnomeCanvasPoints *points;
GnomeCanvasItem *item;
GnomeCanvasGroup *group;
glTemplate *template;
const glTemplateLabelType *label_type;
GnomeCanvasPoints *points;
- gint i_coords, i_theta;
+ gint i_coords;
+ gint i_theta;
gdouble r, w, h, m;
GnomeCanvasItem *item;
const glTemplateLabelType *label_type;
gdouble m, r1, r2;
GnomeCanvasPoints *points;
- gint i_coords, i_theta;
+ gint i_coords;
+ gint i_theta;
gdouble theta1, theta2;
- gdouble x0, y0, w, h, r;
+ gdouble x0, y0;
+ gdouble w, h, r;
GnomeCanvasItem *item;
gl_debug (DEBUG_VIEW, "START");
/*****************************************************************************/
/* Show grid. */
/*****************************************************************************/
-void gl_view_show_grid (glView *view)
+void
+gl_view_show_grid (glView *view)
{
g_return_if_fail (view && GL_IS_VIEW (view));
/*****************************************************************************/
/* Hide grid. */
/*****************************************************************************/
-void gl_view_hide_grid (glView *view)
+void
+gl_view_hide_grid (glView *view)
{
g_return_if_fail (view && GL_IS_VIEW (view));
/*****************************************************************************/
/* Set grid spacing. */
/*****************************************************************************/
-void gl_view_set_grid_spacing (glView *view,
- gdouble spacing)
+void
+gl_view_set_grid_spacing (glView *view,
+ gdouble spacing)
{
g_return_if_fail (view && GL_IS_VIEW (view));
/*****************************************************************************/
/* Show markup. */
/*****************************************************************************/
-void gl_view_show_markup (glView *view)
+void
+gl_view_show_markup (glView *view)
{
g_return_if_fail (view && GL_IS_VIEW (view));
/*****************************************************************************/
/* Hide markup. */
/*****************************************************************************/
-void gl_view_hide_markup (glView *view)
+void
+gl_view_hide_markup (glView *view)
{
g_return_if_fail (view && GL_IS_VIEW (view));
/*****************************************************************************/
void
gl_view_object_create_mode (glView *view,
- glLabelObjectType type)
+ glLabelObjectType type)
{
GdkCursor *cursor;
void
gl_view_unselect_all (glView *view)
{
- GList *p, *p_next;
+ GList *p;
+ GList *p_next;
gl_debug (DEBUG_VIEW, "START");
gdouble x2,
gdouble y2)
{
- GList *p;
- glViewObject *view_object;
+ GList *p;
+ glViewObject *view_object;
glLabelObject *object;
- gdouble i_x1, i_y1, i_x2, i_y2;
+ gdouble i_x1, i_y1;
+ gdouble i_x2, i_y2;
gl_debug (DEBUG_VIEW, "START");
gdouble x,
gdouble y)
{
- GnomeCanvasItem *item, *p_item;
- GList *p;
+ GnomeCanvasItem *item;
+ GList *p;
gl_debug (DEBUG_VIEW, "");
/*****************************************************************************/
gboolean
gl_view_is_object_selected (glView *view,
- glViewObject *view_object)
+ glViewObject *view_object)
{
gl_debug (DEBUG_VIEW, "");
void
gl_view_delete_selection (glView *view)
{
- GList *object_list, *p, *p_next;
+ GList *object_list;
+ GList *p;
+ GList *p_next;
gl_debug (DEBUG_VIEW, "START");
GList *p;
glViewObject *view_object;
glLabelObject *object;
- gdouble dx, x2max, x1, y1, x2, y2;
+ gdouble dx;
+ gdouble x1, y1;
+ gdouble x2, y2;
+ gdouble x2max;
gl_debug (DEBUG_VIEW, "START");
GList *p;
glViewObject *view_object;
glLabelObject *object;
- gdouble dx, dxmin, xsum, xavg, xcenter, x1, y1, x2, y2;
+ gdouble dx;
+ gdouble dxmin;
+ gdouble xsum, xavg;
+ gdouble x1, y1;
+ gdouble x2, y2;
+ gdouble xcenter;
gint n;
gl_debug (DEBUG_VIEW, "START");
GList *p;
glViewObject *view_object;
glLabelObject *object;
- gdouble dy, y1min, x1, y1, x2, y2;
+ gdouble dy;
+ gdouble x1, y1;
+ gdouble x2, y2;
+ gdouble y1min;
gl_debug (DEBUG_VIEW, "START");
GList *p;
glViewObject *view_object;
glLabelObject *object;
- gdouble dy, y2max, x1, y1, x2, y2;
+ gdouble dy;
+ gdouble x1, y1;
+ gdouble x2, y2;
+ gdouble y2max;
gl_debug (DEBUG_VIEW, "START");
GList *p;
glViewObject *view_object;
glLabelObject *object;
- gdouble dy, dymin, ysum, yavg, ycenter, x1, y1, x2, y2;
+ gdouble dy;
+ gdouble dymin;
+ gdouble ysum, yavg;
+ gdouble x1, y1;
+ gdouble x2, y2;
+ gdouble ycenter;
gint n;
gl_debug (DEBUG_VIEW, "START");
GList *p;
glViewObject *view_object;
glLabelObject *object;
- gdouble dx, x_label_center, x_obj_center, x1, y1, x2, y2, w, h;
+ gdouble dx;
+ gdouble x_label_center;
+ gdouble x_obj_center;
+ gdouble x1, y1;
+ gdouble x2, y2;
+ gdouble w, h;
gl_debug (DEBUG_VIEW, "START");
GList *p;
glViewObject *view_object;
glLabelObject *object;
- gdouble dy, y_label_center, y_obj_center, x1, y1, x2, y2, w, h;
+ gdouble dy;
+ gdouble y_label_center;
+ gdouble y_obj_center;
+ gdouble x1, y1;
+ gdouble x2, y2;
+ gdouble w, h;
gl_debug (DEBUG_VIEW, "START");
/*****************************************************************************/
void
gl_view_move_selection (glView *view,
- gdouble dx,
- gdouble dy)
+ gdouble dx,
+ gdouble dy)
{
- GList *p;
+ GList *p;
glLabelObject *object;
gl_debug (DEBUG_VIEW, "START");
/* Can text properties be set for selection? */
/*****************************************************************************/
gboolean
-gl_view_can_selection_text (glView *view)
+gl_view_can_selection_text (glView *view)
{
- GList *p;
+ GList *p;
glLabelObject *object;
gl_debug (DEBUG_VIEW, "");
/* Set font family for all text contained in selected objects. */
/*****************************************************************************/
void
-gl_view_set_selection_font_family (glView *view,
- const gchar *font_family)
+gl_view_set_selection_font_family (glView *view,
+ const gchar *font_family)
{
- GList *p;
+ GList *p;
glLabelObject *object;
gl_debug (DEBUG_VIEW, "START");
/* Set font size for all text contained in selected objects. */
/*****************************************************************************/
void
-gl_view_set_selection_font_size (glView *view,
- gdouble font_size)
+gl_view_set_selection_font_size (glView *view,
+ gdouble font_size)
{
- GList *p;
+ GList *p;
glLabelObject *object;
gl_debug (DEBUG_VIEW, "START");
/* Set font weight for all text contained in selected objects. */
/*****************************************************************************/
void
-gl_view_set_selection_font_weight (glView *view,
- GnomeFontWeight font_weight)
+gl_view_set_selection_font_weight (glView *view,
+ GnomeFontWeight font_weight)
{
- GList *p;
+ GList *p;
glLabelObject *object;
gl_debug (DEBUG_VIEW, "START");
/* Set font italic flag for all text contained in selected objects. */
/*****************************************************************************/
void
-gl_view_set_selection_font_italic_flag (glView *view,
- gboolean font_italic_flag)
+gl_view_set_selection_font_italic_flag (glView *view,
+ gboolean font_italic_flag)
{
- GList *p;
+ GList *p;
glLabelObject *object;
gl_debug (DEBUG_VIEW, "START");
gl_view_set_selection_text_alignment (glView *view,
GtkJustification text_alignment)
{
- GList *p;
+ GList *p;
glLabelObject *object;
gl_debug (DEBUG_VIEW, "START");
/* Set text line spacing for all text contained in selected objects. */
/*****************************************************************************/
void
-gl_view_set_selection_text_line_spacing (glView *view,
- gdouble text_line_spacing)
+gl_view_set_selection_text_line_spacing (glView *view,
+ gdouble text_line_spacing)
{
- GList *p;
+ GList *p;
glLabelObject *object;
gl_debug (DEBUG_VIEW, "START");
/* Set text color for all text contained in selected objects. */
/*****************************************************************************/
void
-gl_view_set_selection_text_color (glView *view,
- glColorNode *text_color_node)
+gl_view_set_selection_text_color (glView *view,
+ glColorNode *text_color_node)
{
- GList *p;
+ GList *p;
glLabelObject *object;
gl_debug (DEBUG_VIEW, "START");
/* Can fill properties be set for selection? */
/*****************************************************************************/
gboolean
-gl_view_can_selection_fill (glView *view)
+gl_view_can_selection_fill (glView *view)
{
- GList *p;
+ GList *p;
glLabelObject *object;
gl_debug (DEBUG_VIEW, "");
/* Set fill color for all selected objects. */
/*****************************************************************************/
void
-gl_view_set_selection_fill_color (glView *view,
- glColorNode *fill_color_node)
+gl_view_set_selection_fill_color (glView *view,
+ glColorNode *fill_color_node)
{
- GList *p;
+ GList *p;
glLabelObject *object;
gl_debug (DEBUG_VIEW, "START");
/* Can line color properties be set for selection? */
/*****************************************************************************/
gboolean
-gl_view_can_selection_line_color (glView *view)
+gl_view_can_selection_line_color (glView *view)
{
- GList *p;
+ GList *p;
glLabelObject *object;
gl_debug (DEBUG_VIEW, "");
/* Set line color for all selected objects. */
/*****************************************************************************/
void
-gl_view_set_selection_line_color (glView *view,
- glColorNode *line_color_node)
+gl_view_set_selection_line_color (glView *view,
+ glColorNode *line_color_node)
{
- GList *p;
+ GList *p;
glLabelObject *object;
gl_debug (DEBUG_VIEW, "START");
/* Can line width properties be set for selection? */
/*****************************************************************************/
gboolean
-gl_view_can_selection_line_width (glView *view)
+gl_view_can_selection_line_width (glView *view)
{
- GList *p;
+ GList *p;
glLabelObject *object;
gl_debug (DEBUG_VIEW, "");
/* Set line width for all selected objects. */
/*****************************************************************************/
void
-gl_view_set_selection_line_width (glView *view,
- gdouble line_width)
+gl_view_set_selection_line_width (glView *view,
+ gdouble line_width)
{
- GList *p;
+ GList *p;
glLabelObject *object;
gl_debug (DEBUG_VIEW, "START");
void
gl_view_copy (glView *view)
{
- GList *p;
- glViewObject *view_object;
+ GList *p;
+ glViewObject *view_object;
glLabelObject *object;
- glTemplate *template;
- gboolean rotate_flag;
+ glTemplate *template;
+ gboolean rotate_flag;
gl_debug (DEBUG_VIEW, "START");
void
gl_view_zoom_in (glView *view)
{
- gint i, i_min;
+ gint i, i_min;
gdouble dist, dist_min;
gl_debug (DEBUG_VIEW, "START");
void
gl_view_zoom_out (glView *view)
{
- gint i, i_min;
+ gint i, i_min;
gdouble dist, dist_min;
gl_debug (DEBUG_VIEW, "START");
void
gl_view_zoom_to_fit (glView *view)
{
- gint w_view, h_view;
+ gint w_view, h_view;
gdouble w_label, h_label;
gdouble x_scale, y_scale, scale;
/*****************************************************************************/
void
gl_view_set_zoom (glView *view,
- gdouble zoom)
+ gdouble zoom)
{
gl_debug (DEBUG_VIEW, "START");
/* PRIVATE. Set canvas scale. *
/*---------------------------------------------------------------------------*/
static void
-set_zoom_real (glView *view,
- gdouble zoom,
- gboolean zoom_to_fit_flag)
+set_zoom_real (glView *view,
+ gdouble zoom,
+ gboolean zoom_to_fit_flag)
{
gl_debug (DEBUG_VIEW, "START");
/* PRIVATE. Size allocation changed callback. */
/*---------------------------------------------------------------------------*/
static void
-size_allocate_cb (glView *view)
+size_allocate_cb (glView *view)
{
gl_debug (DEBUG_VIEW, "START");
/* PRIVATE. Screen changed callback. */
/*---------------------------------------------------------------------------*/
static void
-screen_changed_cb (glView *view)
+screen_changed_cb (glView *view)
{
gl_debug (DEBUG_VIEW, "START");
GdkEvent *event,
glView *view)
{
- static gdouble x0, y0;
- static gboolean dragging = FALSE;
+ static gdouble x0, y0;
+ static gboolean dragging = FALSE;
static GnomeCanvasItem *item;
- gdouble x, y, x1, y1, x2, y2;
- GnomeCanvasGroup *group;
- GdkCursor *cursor;
+ gdouble x, y;
+ gdouble x1, y1;
+ gdouble x2, y2;
+ GnomeCanvasGroup *group;
+ GdkCursor *cursor;
gl_debug (DEBUG_VIEW, "");
static void
selection_clear_cb (GtkWidget *widget,
GdkEventSelection *event,
- gpointer data)
+ glView *view)
{
- glView *view = GL_VIEW (data);
-
gl_debug (DEBUG_VIEW, "START");
g_return_if_fail (view && GL_IS_VIEW (view));
static void
selection_get_cb (GtkWidget *widget,
GtkSelectionData *selection_data,
- guint info,
- guint time,
- gpointer data)
+ guint info,
+ guint time,
+ glView *view)
{
- glView *view = GL_VIEW (data);
- gchar *buffer;
- glXMLLabelStatus status;
+ gchar *buffer;
+ glXMLLabelStatus status;
gl_debug (DEBUG_VIEW, "START");
static void
selection_received_cb (GtkWidget *widget,
GtkSelectionData *selection_data,
- guint time,
- gpointer data)
+ guint time,
+ glView *view)
{
- glView *view = GL_VIEW (data);
- glLabel *label = NULL;
- glXMLLabelStatus status;
- GList *p, *p_next;
- glLabelObject *object, *newobject;
- glViewObject *view_object;
+ glLabel *label = NULL;
+ glXMLLabelStatus status;
+ GList *p, *p_next;
+ glLabelObject *object, *newobject;
+ glViewObject *view_object;
gl_debug (DEBUG_VIEW, "START");
/* Set default font family. */
/****************************************************************************/
void
-gl_view_set_default_font_family (glView *view,
- const gchar *font_family)
+gl_view_set_default_font_family (glView *view,
+ const gchar *font_family)
{
gl_debug (DEBUG_VIEW, "START");
/* Set default font size. */
/****************************************************************************/
void
-gl_view_set_default_font_size (glView *view,
- gdouble font_size)
+gl_view_set_default_font_size (glView *view,
+ gdouble font_size)
{
gl_debug (DEBUG_VIEW, "START");
/* Set default font weight. */
/****************************************************************************/
void
-gl_view_set_default_font_weight (glView *view,
- GnomeFontWeight font_weight)
+gl_view_set_default_font_weight (glView *view,
+ GnomeFontWeight font_weight)
{
gl_debug (DEBUG_VIEW, "START");
/* Set default font italic flag. */
/****************************************************************************/
void
-gl_view_set_default_font_italic_flag (glView *view,
- gboolean font_italic_flag)
+gl_view_set_default_font_italic_flag (glView *view,
+ gboolean font_italic_flag)
{
gl_debug (DEBUG_VIEW, "START");
/* Set default text color. */
/****************************************************************************/
void
-gl_view_set_default_text_color (glView *view,
- guint text_color)
+gl_view_set_default_text_color (glView *view,
+ guint text_color)
{
gl_debug (DEBUG_VIEW, "START");
/* Set default text alignment. */
/****************************************************************************/
void
-gl_view_set_default_text_alignment (glView *view,
- GtkJustification text_alignment)
+gl_view_set_default_text_alignment (glView *view,
+ GtkJustification text_alignment)
{
gl_debug (DEBUG_VIEW, "START");
/* Set default text line spacing. */
/****************************************************************************/
void
-gl_view_set_default_text_line_spacing (glView *view,
- gdouble text_line_spacing)
+gl_view_set_default_text_line_spacing (glView *view,
+ gdouble text_line_spacing)
{
gl_debug (DEBUG_VIEW, "START");
/* Set default line width. */
/****************************************************************************/
void
-gl_view_set_default_line_width (glView *view,
- gdouble line_width)
+gl_view_set_default_line_width (glView *view,
+ gdouble line_width)
{
gl_debug (DEBUG_VIEW, "START");
/* Set default line color. */
/****************************************************************************/
void
-gl_view_set_default_line_color (glView *view,
- guint line_color)
+gl_view_set_default_line_color (glView *view,
+ guint line_color)
{
gl_debug (DEBUG_VIEW, "START");
/* Set default fill color. */
/****************************************************************************/
void
-gl_view_set_default_fill_color (glView *view,
- guint fill_color)
+gl_view_set_default_fill_color (glView *view,
+ guint fill_color)
{
gl_debug (DEBUG_VIEW, "START");
/* Get default font family. */
/****************************************************************************/
gchar *
-gl_view_get_default_font_family (glView *view)
+gl_view_get_default_font_family (glView *view)
{
gl_debug (DEBUG_VIEW, "START");
/* Get default font size. */
/****************************************************************************/
gdouble
-gl_view_get_default_font_size (glView *view)
+gl_view_get_default_font_size (glView *view)
{
gl_debug (DEBUG_VIEW, "START");
/* Get default font weight. */
/****************************************************************************/
GnomeFontWeight
-gl_view_get_default_font_weight (glView *view)
+gl_view_get_default_font_weight (glView *view)
{
gl_debug (DEBUG_VIEW, "START");
/* Get default font italic flag. */
/****************************************************************************/
gboolean
-gl_view_get_default_font_italic_flag (glView *view)
+gl_view_get_default_font_italic_flag (glView *view)
{
gl_debug (DEBUG_VIEW, "START");
/* Get default text color. */
/****************************************************************************/
guint
-gl_view_get_default_text_color (glView *view)
+gl_view_get_default_text_color (glView *view)
{
gl_debug (DEBUG_VIEW, "START");
/* Get default text alignment. */
/****************************************************************************/
GtkJustification
-gl_view_get_default_text_alignment (glView *view)
+gl_view_get_default_text_alignment (glView *view)
{
gl_debug (DEBUG_VIEW, "START");
/* Get default text line spacing. */
/****************************************************************************/
gdouble
-gl_view_get_default_text_line_spacing (glView *view)
+gl_view_get_default_text_line_spacing (glView *view)
{
gl_debug (DEBUG_VIEW, "START");
/* Get default line width. */
/****************************************************************************/
gdouble
-gl_view_get_default_line_width (glView *view)
+gl_view_get_default_line_width (glView *view)
{
gl_debug (DEBUG_VIEW, "START");
/****************************************************************************/
/* Get default line color. */
/****************************************************************************/
-guint gl_view_get_default_line_color (glView *view)
+guint
+gl_view_get_default_line_color (glView *view)
{
gl_debug (DEBUG_VIEW, "START");
/****************************************************************************/
/* Get default fill color. */
/****************************************************************************/
-guint gl_view_get_default_fill_color (glView *view)
+guint
+gl_view_get_default_fill_color (glView *view)
{
gl_debug (DEBUG_VIEW, "START");