Index: trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c =================================================================== --- trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 23295) +++ trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 23296) @@ -68,8 +68,6 @@ gint sketch_seq; } hid_gc_s; -static void draw_lead_user(render_priv_t *priv_); - static const gchar *get_color_name(pcb_gtk_color_t * color) { static char tmp[16]; @@ -1152,8 +1150,6 @@ if (priv->mark_invalidate_depth == 0) pcb_draw_mark(0); - draw_lead_user(priv); - priv->clip_rect_valid = pcb_false; /* Rest the clip for bg_gc, as it is used outside this function */ @@ -1537,53 +1533,6 @@ return FALSE; } -static void draw_lead_user(render_priv_t *priv) -{ - GdkWindow *window = gtk_widget_get_window(gport->drawing_area); - GtkStyle *style = gtk_widget_get_style(gport->drawing_area); - int i; - pcb_lead_user_t *lead_user = &gport->lead_user; - pcb_coord_t radius = lead_user->radius; - pcb_coord_t width = PCB_MM_TO_COORD(LEAD_USER_WIDTH); - pcb_coord_t separation = PCB_MM_TO_COORD(LEAD_USER_ARC_SEPARATION); - static GdkGC *lead_gc = NULL; - static GdkColormap *colormap = NULL; - GdkColor lead_color; - - if (!lead_user->lead_user) - return; - - if (colormap == NULL) - colormap = gtk_widget_get_colormap(gport->top_window); - - if (lead_gc == NULL) { - lead_gc = gdk_gc_new(window); - gdk_gc_copy(lead_gc, style->white_gc); - gdk_gc_set_function(lead_gc, GDK_XOR); - gdk_gc_set_clip_origin(lead_gc, 0, 0); - lead_color.pixel = 0; - lead_color.red = (int) (65535. * LEAD_USER_COLOR_R); - lead_color.green = (int) (65535. * LEAD_USER_COLOR_G); - lead_color.blue = (int) (65535. * LEAD_USER_COLOR_B); - gdk_color_alloc(colormap, &lead_color); - gdk_gc_set_foreground(lead_gc, &lead_color); - } - - set_clip(priv, lead_gc); - gdk_gc_set_line_attributes(lead_gc, Vz(width), GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER); - - /* arcs at the approrpriate radii */ - - for (i = 0; i < LEAD_USER_ARC_COUNT; i++, radius -= separation) { - if (radius < width) - radius += PCB_MM_TO_COORD(LEAD_USER_INITIAL_RADIUS); - - /* Draw an arc at radius */ - gdk_draw_arc(gport->render_priv->out_pixel, lead_gc, FALSE, - Vx(lead_user->x - radius), Vy(lead_user->y - radius), Vz(2. * radius), Vz(2. * radius), 0, 360 * 64); - } -} - static GtkWidget *ghid_gdk_new_drawing_widget(pcb_gtk_common_t *common) { GtkWidget *w = gtk_drawing_area_new(); Index: trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c =================================================================== --- trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 23295) +++ trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 23296) @@ -64,8 +64,6 @@ gchar xor; } hid_gc_s; -static void draw_lead_user(render_priv_t *priv); - void ghid_gl_render_burst(pcb_burst_op_t op, const pcb_box_t *screen) { pcb_gui->coord_per_pix = gport->view.coord_per_px; @@ -973,8 +971,6 @@ drawgl_flush(); - draw_lead_user(priv); - ghid_gl_end_drawing(port); return FALSE; @@ -1116,37 +1112,6 @@ return FALSE; } -static void draw_lead_user(render_priv_t *priv) -{ - int i; - pcb_lead_user_t *lead_user = &gport->lead_user; - double radius = lead_user->radius; - double width = PCB_MM_TO_COORD(LEAD_USER_WIDTH); - double separation = PCB_MM_TO_COORD(LEAD_USER_ARC_SEPARATION); - - if (!lead_user->lead_user) - return; - - glPushAttrib(GL_CURRENT_BIT | GL_COLOR_BUFFER_BIT); - glEnable(GL_COLOR_LOGIC_OP); - glLogicOp(GL_XOR); - glColor3f(LEAD_USER_COLOR_R, LEAD_USER_COLOR_G, LEAD_USER_COLOR_B); - - - /* arcs at the appropriate radii */ - - for(i = 0; i < LEAD_USER_ARC_COUNT; i++, radius -= separation) { - if (radius < width) - radius += PCB_MM_TO_COORD(LEAD_USER_INITIAL_RADIUS); - - /* Draw an arc at radius */ - hidgl_draw_arc(width, lead_user->x, lead_user->y, radius, radius, 0, 360, gport->view.coord_per_px); - } - - drawgl_flush(); - glPopAttrib(); -} - static GtkWidget *ghid_gl_new_drawing_widget(pcb_gtk_common_t *common) { GtkWidget *w = gtk_drawing_area_new(); Index: trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c =================================================================== --- trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 23295) +++ trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 23296) @@ -103,8 +103,6 @@ //gint mask_seq; } hid_gc_s; -static void draw_lead_user(render_priv_t * priv_); - static void copy_color(GdkRGBA * dest, GdkRGBA * source) { dest->red = source->red; @@ -1146,8 +1144,6 @@ pcb_draw_attached(0); pcb_draw_mark(0); - draw_lead_user(priv); - priv->clip = pcb_false; /* Rest the clip for bg_gc, as it is used outside this function */ @@ -1561,49 +1557,6 @@ return FALSE; } -static void draw_lead_user(render_priv_t * priv) -{ - //GdkWindow *window = gtk_widget_get_window(gport->drawing_area); - //GtkStyle *style = gtk_widget_get_style(gport->drawing_area); - int i; - pcb_lead_user_t *lead_user = &gport->lead_user; - pcb_coord_t radius = lead_user->radius; - pcb_coord_t width = PCB_MM_TO_COORD(LEAD_USER_WIDTH); - pcb_coord_t separation = PCB_MM_TO_COORD(LEAD_USER_ARC_SEPARATION); - //static GdkGC *lead_gc = NULL; - //GdkColor lead_color; - - if (!lead_user->lead_user) - return; - - //if (lead_gc == NULL) { - // lead_gc = gdk_gc_new(window); - // gdk_gc_copy(lead_gc, style->white_gc); - // gdk_gc_set_function(lead_gc, GDK_XOR); - // gdk_gc_set_clip_origin(lead_gc, 0, 0); - // lead_color.pixel = 0; - // lead_color.red = (int) (65535. * LEAD_USER_COLOR_R); - // lead_color.green = (int) (65535. * LEAD_USER_COLOR_G); - // lead_color.blue = (int) (65535. * LEAD_USER_COLOR_B); - // gdk_color_alloc(gport->colormap, &lead_color); - // gdk_gc_set_foreground(lead_gc, &lead_color); - //} - - //set_clip(priv, lead_gc); - //gdk_gc_set_line_attributes(lead_gc, Vz(width), GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER); - - /* arcs at the appropriate radii */ - - for (i = 0; i < LEAD_USER_ARC_COUNT; i++, radius -= separation) { - if (radius < width) - radius += PCB_MM_TO_COORD(LEAD_USER_INITIAL_RADIUS); - - /* Draw an arc at radius */ - //gdk_draw_arc(gport->drawable, lead_gc, FALSE, - // Vx(lead_user->x - radius), Vy(lead_user->y - radius), Vz(2. * radius), Vz(2. * radius), 0, 360 * 64); - } -} - static GtkWidget *ghid_cairo_new_drawing_widget(pcb_gtk_common_t *common) { GtkWidget *w = gtk_drawing_area_new(); Index: trunk/src_plugins/lib_gtk_common/glue.h =================================================================== --- trunk/src_plugins/lib_gtk_common/glue.h (revision 23295) +++ trunk/src_plugins/lib_gtk_common/glue.h (revision 23296) @@ -45,8 +45,6 @@ /* screen */ void (*mode_cursor_main)(int mode); void (*invalidate_all)(); - void (*cancel_lead_user)(void); - void (*lead_user_to_location)(pcb_coord_t x, pcb_coord_t y); void (*pan_common)(void); void (*port_ranges_scale)(void); void (*pack_mode_buttons)(void); Index: trunk/src_plugins/lib_gtk_hid/glue_common.c =================================================================== --- trunk/src_plugins/lib_gtk_hid/glue_common.c (revision 23295) +++ trunk/src_plugins/lib_gtk_hid/glue_common.c (revision 23296) @@ -162,64 +162,8 @@ } } -static gboolean lead_user_cb(gpointer data) -{ - pcb_lead_user_t *lead_user = data; - pcb_coord_t step; - double elapsed_time; - - /* Queue a redraw */ - ghid_invalidate_all(); - - /* Update radius */ - elapsed_time = g_timer_elapsed(lead_user->timer, NULL); - g_timer_start(lead_user->timer); - - step = PCB_MM_TO_COORD(LEAD_USER_VELOCITY * elapsed_time); - if (lead_user->radius > step) - lead_user->radius -= step; - else - lead_user->radius = PCB_MM_TO_COORD(LEAD_USER_INITIAL_RADIUS); - - return TRUE; -} - - -void ghid_lead_user_to_location(pcb_coord_t x, pcb_coord_t y) -{ - pcb_lead_user_t *lead_user = &gport->lead_user; - - ghid_cancel_lead_user(); - - lead_user->lead_user = pcb_true; - lead_user->x = x; - lead_user->y = y; - lead_user->radius = PCB_MM_TO_COORD(LEAD_USER_INITIAL_RADIUS); - lead_user->timeout = g_timeout_add(LEAD_USER_PERIOD, lead_user_cb, lead_user); - lead_user->timer = g_timer_new(); -} - -void ghid_cancel_lead_user(void) -{ - pcb_lead_user_t *lead_user = &gport->lead_user; - - if (lead_user->timeout) - g_source_remove(lead_user->timeout); - - if (lead_user->timer) - g_timer_destroy(lead_user->timer); - - if (lead_user->lead_user) - ghid_invalidate_all(); - - lead_user->timeout = 0; - lead_user->timer = NULL; - lead_user->lead_user = pcb_false; -} - static void ghid_main_destroy(void *port) { - ghid_cancel_lead_user(); ghidgui->common.shutdown_renderer(port); gtk_main_quit(); } @@ -242,8 +186,6 @@ ghidgui->common.status_line_set_text = ghid_status_line_set_text; ghidgui->common.route_styles_edited_cb = ghid_route_styles_edited_cb; ghidgui->common.mode_cursor_main = ghid_mode_cursor_main; - ghidgui->common.cancel_lead_user = ghid_cancel_lead_user; - ghidgui->common.lead_user_to_location = ghid_lead_user_to_location; ghidgui->common.pan_common = ghid_pan_common; ghidgui->common.port_ranges_scale = ghid_port_ranges_scale; ghidgui->common.pack_mode_buttons = ghid_pack_mode_buttons; Index: trunk/src_plugins/lib_gtk_hid/glue_common.h =================================================================== --- trunk/src_plugins/lib_gtk_hid/glue_common.h (revision 23295) +++ trunk/src_plugins/lib_gtk_hid/glue_common.h (revision 23296) @@ -1,6 +1,2 @@ #include "hid.h" void ghid_glue_common_init(void); -void ghid_lead_user_to_location(pcb_coord_t x, pcb_coord_t y); -void ghid_cancel_lead_user(void); - - Index: trunk/src_plugins/lib_gtk_hid/gui.h =================================================================== --- trunk/src_plugins/lib_gtk_hid/gui.h (revision 23295) +++ trunk/src_plugins/lib_gtk_hid/gui.h (revision 23296) @@ -75,8 +75,6 @@ pcb_gtk_mouse_t mouse; pcb_gtk_view_t view; - - pcb_lead_user_t lead_user; }; extern GHidPort ghid_port, *gport; Index: trunk/src_plugins/lib_gtk_hid/render.h =================================================================== --- trunk/src_plugins/lib_gtk_hid/render.h (revision 23295) +++ trunk/src_plugins/lib_gtk_hid/render.h (revision 23296) @@ -7,25 +7,6 @@ #include "conf.h" #include "pcb_bool.h" -#define LEAD_USER_WIDTH 0.2 /* millimeters */ -#define LEAD_USER_PERIOD (1000 / 5) /* 5fps (in ms) */ -#define LEAD_USER_VELOCITY 3. /* millimeters per second */ -#define LEAD_USER_ARC_COUNT 3 -#define LEAD_USER_ARC_SEPARATION 3. /* millimeters */ -#define LEAD_USER_INITIAL_RADIUS 10. /* millimetres */ -#define LEAD_USER_COLOR_R 1. -#define LEAD_USER_COLOR_G 1. -#define LEAD_USER_COLOR_B 0. - -typedef struct pcb_lead_user_s { - guint timeout; - GTimer *timer; - pcb_bool lead_user; - pcb_coord_t radius; - pcb_coord_t x; - pcb_coord_t y; -} pcb_lead_user_t; - /* the only entry points we should see from the actual renderers */ void ghid_gdk_install(pcb_gtk_common_t *common, pcb_hid_t *hid); void ghid_gl_install(pcb_gtk_common_t *common, pcb_hid_t *hid);