Index: trunk/src/Makefile.dep =================================================================== --- trunk/src/Makefile.dep (revision 6725) +++ trunk/src/Makefile.dep (revision 6726) @@ -2227,38 +2227,28 @@ ../src_plugins/lib_gtk_common/dlg_progress.c ../config.h \ ../src_plugins/lib_gtk_common/dlg_progress.h pcb_bool.h compat_nls.h ../src_plugins/lib_gtk_common/dlg_propedit.o: \ - ../src_plugins/lib_gtk_common/dlg_propedit.c ../config.h compat_misc.h \ - compat_nls.h polygon.h flag.h globalconst.h rtree.h global_typedefs.h \ - pcb_bool.h unit.h math_helper.h polyarea.h obj_all.h obj_arc.h \ - obj_common.h ../src_3rd/liblihata/genht/hash.h \ - ../src_3rd/genlist/gendlist.h attrib.h obj_elem.h obj_arc_list.h \ - ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ - ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_pad_list.h obj_pad.h obj_pinvia_list.h obj_pinvia.h obj_text.h \ - obj_poly.h obj_rat.h ../src_plugins/lib_gtk_common/bu_box.h \ - ../src_plugins/lib_gtk_common/compat.h \ - ../src_plugins/lib_gtk_common/../hid_gtk/gui.h board.h const.h macro.h \ + ../src_plugins/lib_gtk_common/dlg_propedit.c ../config.h \ + ../src_plugins/lib_gtk_common/dlg_propedit.h compat_misc.h compat_nls.h \ + polygon.h flag.h globalconst.h rtree.h global_typedefs.h pcb_bool.h \ + unit.h math_helper.h polyarea.h obj_all.h obj_arc.h obj_common.h \ + ../src_3rd/liblihata/genht/hash.h ../src_3rd/genlist/gendlist.h attrib.h \ + obj_elem.h obj_arc_list.h ../src_3rd/genlist/gentdlist_impl.h \ + ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ + obj_line_list.h obj_line.h obj_pad_list.h obj_pad.h obj_pinvia_list.h \ + obj_pinvia.h obj_text.h obj_poly.h obj_rat.h board.h const.h macro.h \ vtroutestyle.h ../src_3rd/genvector/genvector_impl.h \ ../src_3rd/genvector/genvector_undef.h layer.h obj_all_list.h \ obj_elem_list.h ht_element.h ../src_3rd/liblihata/genht/ht.h \ ../src_3rd/liblihata/genht/ht_inlines.h obj_poly_list.h obj_text_list.h \ obj_rat_list.h layer_grp.h library.h rats_patch.h board.h font.h box.h \ - move.h misc_util.h hid.h error.h drc.h hid_cfg.h \ - ../src_3rd/liblihata/dom.h ../src_3rd/liblihata/lihata.h \ - ../src_3rd/liblihata/parser.h ../src_3rd/liblihata/genht/htsp.h \ - ../src_3rd/liblihata/genht/ht.h hid_cfg_input.h \ - ../src_3rd/liblihata/genht/htip.h hid_cfg.h data.h crosshair.h \ - vtonpoint.h hid.h buffer.h \ - ../src_plugins/lib_gtk_common/../hid_gtk/ghid-main-menu.h \ - ../src_plugins/lib_gtk_common/wt_layer_selector.h \ - ../src_plugins/lib_gtk_common/wt_route_style.h route_style.h conf_core.h \ - conf.h pcb-printf.h ../src_3rd/genvector/gds_char.h \ - ../src_3rd/liblihata/lihata.h ../src_3rd/genvector/vtp0.h list_conf.h \ - event.h ../src_plugins/lib_gtk_common/../hid_gtk/colors.h \ - ../src_plugins/lib_gtk_common/../hid_gtk/hid_gtk_conf.h conf.h \ - ../src_plugins/lib_gtk_common/bu_cursor_pos.h \ - ../src_plugins/lib_gtk_common/ui_zoompan.h unit.h pcb_bool.h \ - ../src_plugins/lib_gtk_common/dlg_propedit.h + move.h misc_util.h data.h crosshair.h vtonpoint.h hid.h error.h drc.h \ + buffer.h conf_core.h conf.h pcb-printf.h ../src_3rd/genvector/gds_char.h \ + ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/dom.h \ + ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/parser.h \ + ../src_3rd/liblihata/genht/htsp.h ../src_3rd/liblihata/genht/ht.h \ + ../src_3rd/genvector/vtp0.h list_conf.h buffer.h \ + ../src_plugins/lib_gtk_common/bu_box.h \ + ../src_plugins/lib_gtk_common/compat.h ../src_plugins/lib_gtk_common/dlg_report.o: \ ../src_plugins/lib_gtk_common/dlg_report.c ../config.h \ ../src_plugins/lib_gtk_common/dlg_report.h \ Index: trunk/src_plugins/hid_gtk/gtkhid-main.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 6725) +++ trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 6726) @@ -255,8 +255,8 @@ { ghidgui->propedit_widget = pcb_gtk_dlg_propedit_create(&ghidgui->propedit_dlg, gport->top_window); - ghidgui->propedit_query = query; - ghidgui->propedit_pe = pe; + ghidgui->propedit_dlg.propedit_query = query; + ghidgui->propedit_dlg.propedit_pe = pe; return 0; } Index: trunk/src_plugins/hid_gtk/gui.h =================================================================== --- trunk/src_plugins/hid_gtk/gui.h (revision 6725) +++ trunk/src_plugins/hid_gtk/gui.h (revision 6726) @@ -112,8 +112,6 @@ pcb_gtk_dlg_propedit_t propedit_dlg; GtkWidget *propedit_widget; - const char *(*propedit_query)(void *pe, const char *cmd, const char *key, const char *val, int idx); - void *propedit_pe; } GhidGui; extern GhidGui _ghidgui, *ghidgui; Index: trunk/src_plugins/lib_gtk_common/dlg_propedit.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_propedit.c (revision 6725) +++ trunk/src_plugins/lib_gtk_common/dlg_propedit.c (revision 6726) @@ -25,22 +25,23 @@ #include #include +#include #include "config.h" +#include "dlg_propedit.h" #include "compat_misc.h" #include "compat_nls.h" #include "polygon.h" #include "obj_all.h" +#include "board.h" +#include "data.h" +#include "conf_core.h" +#include "buffer.h" #include "bu_box.h" #include "compat.h" -/* FIXME: Get rid of that ... means get rid of global ghidgui */ -#include "../hid_gtk/gui.h" - -/*#include "dlg_propedit.h"*/ - static char *str_sub(const char *val, char sepi, char sepo) { char *tmp, *sep; @@ -119,12 +120,12 @@ val_combo_reset(dlg); - val = ghidgui->propedit_query(ghidgui->propedit_pe, "v1st", prop, NULL, 0); + val = dlg->propedit_query(dlg->propedit_pe, "v1st", prop, NULL, 0); while (val != NULL) { tmp = str_sub(val, '\n', '='); val_combo_add(dlg, tmp); free(tmp); - val = ghidgui->propedit_query(ghidgui->propedit_pe, "vnxt", prop, NULL, 0); + val = dlg->propedit_query(dlg->propedit_pe, "vnxt", prop, NULL, 0); } tmp = str_sub(comm, '\n', '\0'); @@ -149,7 +150,7 @@ gtk_tree_model_get(tm, &iter, 0, &prop, -1); - if (ghidgui->propedit_query(ghidgui->propedit_pe, "vdel", prop, NULL, 0) != NULL) + if (dlg->propedit_query(dlg->propedit_pe, "vdel", prop, NULL, 0) != NULL) gtk_list_store_remove(GTK_LIST_STORE(tm), &iter); free(prop); @@ -222,7 +223,7 @@ path[1] = '/'; strcpy(path + 2, name); } - ghidgui->propedit_query(ghidgui->propedit_pe, "vset", path, value, 0); + dlg->propedit_query(dlg->propedit_pe, "vset", path, value, 0); free(path); free(name); } @@ -248,7 +249,7 @@ val = pcb_strdup(gtk_entry_get_text(GTK_ENTRY(dlg->entry_val))); - typ = ghidgui->propedit_query(ghidgui->propedit_pe, "type", prop, NULL, 0); + typ = dlg->propedit_query(dlg->propedit_pe, "type", prop, NULL, 0); if (typ != NULL) { if (*typ == 'c') { /* if type of the field if coords, we may need to fix missing units */ char *end; @@ -266,7 +267,7 @@ } } - if (ghidgui->propedit_query(ghidgui->propedit_pe, "vset", prop, val, 0) != NULL) { + if (dlg->propedit_query(dlg->propedit_pe, "vset", prop, val, 0) != NULL) { /* could change values update the table - the new row is already added, remove the old */ gtk_list_store_remove(GTK_LIST_STORE(tm), &iter); if (dlg->last_add_iter_valid) { @@ -373,7 +374,7 @@ fy = conf_core.editor.view.flip_y; conf_set(CFR_DESIGN, "editor/view/flip_x", -1, "0", POL_OVERWRITE); conf_set(CFR_DESIGN, "editor/view/flip_y", -1, "0", POL_OVERWRITE); - pm = ghid_render_pixmap(cx, cy, 40000 * zoom1, 300, 400, gdk_drawable_get_depth(GDK_DRAWABLE(gport->top_window->window))); + pm = ghid_render_pixmap(cx, cy, 40000 * zoom1, 300, 400, gdk_drawable_get_depth(GDK_DRAWABLE(dlg->top_window->window))); conf_setf(CFR_DESIGN, "editor/view/flip_x", -1, "%d", fx, POL_OVERWRITE); conf_setf(CFR_DESIGN, "editor/view/flip_y", -1, "%d", fy, POL_OVERWRITE); Index: trunk/src_plugins/lib_gtk_common/dlg_propedit.h =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_propedit.h (revision 6725) +++ trunk/src_plugins/lib_gtk_common/dlg_propedit.h (revision 6726) @@ -40,8 +40,10 @@ /* buttons */ GtkWidget *apply, *remove, *addattr; + /* glue to hid_gtk* */ + const char *(*propedit_query)(void *pe, const char *cmd, const char *key, const char *val, int idx); + void *propedit_pe; GtkWidget *top_window; - } pcb_gtk_dlg_propedit_t; /** Creates and runs a dialog to edit selected object properties */ @@ -50,3 +52,7 @@ /** */ void pcb_gtk_dlg_propedit_prop_add(pcb_gtk_dlg_propedit_t * dlg, const char *name, const char *common, const char *min, const char *max, const char *avg); + + +/* Temporary: call back to hid_gtk, will be replaced by a preview call */ +extern GdkPixmap *ghid_render_pixmap(int cx, int cy, double zoom, int width, int height, int depth);