Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 6698) +++ trunk/scconfig/Rev.h (revision 6699) @@ -1 +1 @@ -static const int myrev = 6689; +static const int myrev = 6699; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 6698) +++ trunk/scconfig/Rev.tab (revision 6699) @@ -1,4 +1,4 @@ -6689 configure gtk splitup +6699 configure gtk splitup 6392 configure draw cross section plugin (gtk and lesstif depend on it) 6365 configure gtk splitup 6111 configure layer vs. layer group code split Index: trunk/src_plugins/hid_gtk/gtkhid-main.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 6698) +++ trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 6699) @@ -32,6 +32,7 @@ /* AV: Care to circular includes !!!? */ #include "../src_plugins/lib_gtk_common/ui_zoompan.h" +#include "../src_plugins/lib_gtk_common/util_timer.h" #include "../src_plugins/lib_gtk_common/dlg_about.h" #include "../src_plugins/lib_gtk_common/dlg_attribute.h" #include "../src_plugins/lib_gtk_common/dlg_export.h" @@ -196,42 +197,6 @@ } typedef struct { - void (*func) (pcb_hidval_t); - guint id; - pcb_hidval_t user_data; -} GuiTimer; - - /* We need a wrapper around the hid timer because a gtk timer needs - | to return FALSE else the timer will be restarted. - */ -static gboolean ghid_timer(GuiTimer * timer) -{ - (*timer->func) (timer->user_data); - ghid_mode_cursor(conf_core.editor.mode); - return FALSE; /* Turns timer off */ -} - -pcb_hidval_t ghid_add_timer(void (*func) (pcb_hidval_t user_data), unsigned long milliseconds, pcb_hidval_t user_data) -{ - GuiTimer *timer = g_new0(GuiTimer, 1); - pcb_hidval_t ret; - - timer->func = func; - timer->user_data = user_data; - timer->id = g_timeout_add(milliseconds, (GSourceFunc) ghid_timer, timer); - ret.ptr = (void *) timer; - return ret; -} - -void ghid_stop_timer(pcb_hidval_t timer) -{ - void *ptr = timer.ptr; - - g_source_remove(((GuiTimer *) ptr)->id); - g_free(ptr); -} - -typedef struct { void (*func) (pcb_hidval_t, int, unsigned int, pcb_hidval_t); pcb_hidval_t user_data; int fd; Index: trunk/src_plugins/lib_gtk_common/Plug.tmpasm =================================================================== --- trunk/src_plugins/lib_gtk_common/Plug.tmpasm (revision 6698) +++ trunk/src_plugins/lib_gtk_common/Plug.tmpasm (revision 6699) @@ -27,12 +27,13 @@ $(PLUGDIR)/lib_gtk_common/in_mouse.o $(PLUGDIR)/lib_gtk_common/menu_lht.o $(PLUGDIR)/lib_gtk_common/ui_zoompan.o + $(PLUGDIR)/lib_gtk_common/util_str.o + $(PLUGDIR)/lib_gtk_common/util_timer.o $(PLUGDIR)/lib_gtk_common/win_place.o $(PLUGDIR)/lib_gtk_common/wt_coord_entry.o $(PLUGDIR)/lib_gtk_common/wt_layer_selector.o $(PLUGDIR)/lib_gtk_common/wt_preview.o $(PLUGDIR)/lib_gtk_common/wt_route_style.o - $(PLUGDIR)/lib_gtk_common/util_str.o @] Index: trunk/src_plugins/lib_gtk_common/util_timer.c =================================================================== --- trunk/src_plugins/lib_gtk_common/util_timer.c (nonexistent) +++ trunk/src_plugins/lib_gtk_common/util_timer.c (revision 6699) @@ -0,0 +1,63 @@ +/* + * COPYRIGHT + * + * PCB, interactive printed circuit board design + * Copyright (C) 1994,1995,1996 Thomas Nau + * pcb-rnd Copyright (C) 2017 Tibor 'Igor2' Palinkas + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#include "config.h" +#include +#include "util_timer.h" +#include "conf_core.h" + +typedef struct { + void (*func) (pcb_hidval_t); + guint id; + pcb_hidval_t user_data; +} GuiTimer; + + /* We need a wrapper around the hid timer because a gtk timer needs + | to return FALSE else the timer will be restarted. + */ +static gboolean ghid_timer(GuiTimer * timer) +{ + (*timer->func) (timer->user_data); + ghid_mode_cursor(conf_core.editor.mode); + return FALSE; /* Turns timer off */ +} + +pcb_hidval_t ghid_add_timer(void (*func) (pcb_hidval_t user_data), unsigned long milliseconds, pcb_hidval_t user_data) +{ + GuiTimer *timer = g_new0(GuiTimer, 1); + pcb_hidval_t ret; + + timer->func = func; + timer->user_data = user_data; + timer->id = g_timeout_add(milliseconds, (GSourceFunc) ghid_timer, timer); + ret.ptr = (void *) timer; + return ret; +} + +void ghid_stop_timer(pcb_hidval_t timer) +{ + void *ptr = timer.ptr; + + g_source_remove(((GuiTimer *) ptr)->id); + g_free(ptr); +} Index: trunk/src_plugins/lib_gtk_common/util_timer.h =================================================================== --- trunk/src_plugins/lib_gtk_common/util_timer.h (nonexistent) +++ trunk/src_plugins/lib_gtk_common/util_timer.h (revision 6699) @@ -0,0 +1,4 @@ +#include "hid.h" + +pcb_hidval_t ghid_add_timer(void (*func) (pcb_hidval_t user_data), unsigned long milliseconds, pcb_hidval_t user_data); +void ghid_stop_timer(pcb_hidval_t timer);