From 0be474ef3d438045213346ef080ab2c5b5b8100b Mon Sep 17 00:00:00 2001 From: Chitlesh GOORAH Date: Dec 05 2007 00:26:42 +0000 Subject: *** empty log message *** --- diff --git a/.cvsignore b/.cvsignore index 9cc3345..5888944 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -gerbv-1.0.2.tar.gz +gerbv-1.0.3.tar.gz diff --git a/gerbv-1.0.2-init.patch b/gerbv-1.0.2-init.patch deleted file mode 100644 index d811953..0000000 --- a/gerbv-1.0.2-init.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/Makefile.am 2006-07-25 16:53:20.000000000 +0000 -+++ Makefile.am_init 2006-09-14 12:12:31.000000000 +0000 -@@ -31,7 +31,7 @@ - opdefines.h project.c project.h scheme-private.h scheme.c \ - scheme.h setup.c setup.h tooltable.c tooltable.h - --scmdatadir = $(datarootdir)/gerbv/scheme/ -+scmdatadir = $(datadir)/gerbv/scheme/ - dist_scmdata_DATA = init.scm - - INCLUDES = @GTK_CFLAGS@ @GDK_PIXBUF_CFLAGS@ @PNG_CFLAGS@ diff --git a/gerbv-1.0.2-overflow.patch b/gerbv-1.0.2-overflow.patch deleted file mode 100644 index 5bcca1d..0000000 --- a/gerbv-1.0.2-overflow.patch +++ /dev/null @@ -1,920 +0,0 @@ ---- src/gerbv.c 2006-07-28 12:33:13.000000000 +0200 -+++ gerbv.c 2007-05-26 13:40:31.000000000 +0200 -@@ -202,7 +202,7 @@ - int nmenu_items = sizeof(menu_items) / sizeof(menu_items[0]); - GtkItemFactory *item_factory; - GtkAccelGroup *accel_group; -- -+ - accel_group = gtk_accel_group_new(); - - /* This function initializes the item factory. -@@ -212,17 +212,17 @@ - Param 3: A pointer to a gtk_accel_group. The item factory sets up - the accelerator table while generating menus. - */ -- -- item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "
", -+ -+ item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "
", - accel_group); - /* This function generates the menu items. Pass the item factory, - the number of items in the array, the array itself, and any - callback data for the menu items. */ - gtk_item_factory_create_items(item_factory, nmenu_items, menu_items, NULL); -- -+ - /* Attach the new accelerator group to the window */ - gtk_window_add_accel_group (GTK_WINDOW(window), accel_group); -- -+ - if(menubar) { - GtkWidget *menuEntry; - -@@ -249,7 +249,7 @@ - item_factory = gtk_item_factory_new(GTK_TYPE_MENU, "", NULL); - gtk_item_factory_create_items(item_factory, nmenu_items, popup_menu_items, - NULL); -- -+ - if(popupmenu) - /* Finally, return the actual menu bar created by the item factory. */ - *popupmenu = gtk_item_factory_get_widget(item_factory, ""); -@@ -289,7 +289,7 @@ - - - static gint --layer_button_press_event(GtkWidget *widget, GdkEventButton *event, -+layer_button_press_event(GtkWidget *widget, GdkEventButton *event, - gpointer button) - { - GdkEventButton *event_button; -@@ -307,9 +307,9 @@ - return FALSE; - } - -- gtk_menu_popup(GTK_MENU(screen.popup_menu), NULL, NULL, NULL, NULL, -+ gtk_menu_popup(GTK_MENU(screen.popup_menu), NULL, NULL, NULL, NULL, - event_button->button, event_button->time); -- -+ - screen.curr_index = (long int)button; - - return TRUE; -@@ -329,7 +329,7 @@ - - box = gtk_vbox_new(TRUE, 0); - -- /* -+ /* - * Create style to be used by "all layer" buttons - */ - color = alloc_color(0, 0, 0, "white"); -@@ -344,22 +344,22 @@ - */ - button = gtk_button_new_with_label("On"); - gtk_signal_connect(GTK_OBJECT(button), "button_press_event", -- GTK_SIGNAL_FUNC(all_layers_on), -+ GTK_SIGNAL_FUNC(all_layers_on), - (gpointer)NULL); - gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); - gtk_widget_set_style(button, newstyle); -- gtk_tooltips_set_tip(tooltips, button, "Turn On All Layers", NULL); -+ gtk_tooltips_set_tip(tooltips, button, "Turn On All Layers", NULL); - - /* - * Create Off button with callback, color and tooltips - */ - button = gtk_button_new_with_label("Off"); - gtk_signal_connect(GTK_OBJECT(button), "button_press_event", -- GTK_SIGNAL_FUNC(all_layers_off), -+ GTK_SIGNAL_FUNC(all_layers_off), - (gpointer)NULL); - gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); - gtk_widget_set_style(button, newstyle); -- gtk_tooltips_set_tip(tooltips, button, "Turn Off All Layers", NULL); -+ gtk_tooltips_set_tip(tooltips, button, "Turn Off All Layers", NULL); - - /* - * Create the rest of the buttons -@@ -368,11 +368,11 @@ - snprintf(info, sizeof(info), "%ld", bi); - button = gtk_toggle_button_new_with_label(info); - -- gtk_signal_connect(GTK_OBJECT(button), "toggled", -+ gtk_signal_connect(GTK_OBJECT(button), "toggled", - GTK_SIGNAL_FUNC(cb_layer_button), - (gpointer)bi); - gtk_signal_connect(GTK_OBJECT(button), "button_press_event", -- GTK_SIGNAL_FUNC(layer_button_press_event), -+ GTK_SIGNAL_FUNC(layer_button_press_event), - (gpointer)bi); - - gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); -@@ -409,17 +409,17 @@ - /* Allocate new color */ - if (background) { - free(screen.background); -- screen.background = -+ screen.background = - alloc_color((int)(color[0] * MAX_COLOR_RESOLUTION), - (int)(color[1] * MAX_COLOR_RESOLUTION), - (int)(color[2] * MAX_COLOR_RESOLUTION), - NULL); - } else { - free(screen.file[screen.curr_index]->color); -- screen.file[screen.curr_index]->color = -- alloc_color((int)(color[0] * MAX_COLOR_RESOLUTION), -- (int)(color[1] * MAX_COLOR_RESOLUTION), -- (int)(color[2] * MAX_COLOR_RESOLUTION), -+ screen.file[screen.curr_index]->color = -+ alloc_color((int)(color[0] * MAX_COLOR_RESOLUTION), -+ (int)(color[1] * MAX_COLOR_RESOLUTION), -+ (int)(color[2] * MAX_COLOR_RESOLUTION), - NULL); - } - -@@ -445,7 +445,7 @@ - } /* cb_ok_color_selection */ - - --static void -+static void - swap_layers(GtkWidget *widget, gpointer data) - { - gerbv_fileinfo_t *temp_file; -@@ -460,7 +460,7 @@ - if (screen.curr_index == 0) return; - if (screen.file[screen.curr_index - 1] == NULL) return; - idx = -1; -- } else { -+ } else { - /* Moving Down */ - if (screen.curr_index == MAX_FILES - 1) return; - if (screen.file[screen.curr_index + 1] == NULL) return; -@@ -488,7 +488,7 @@ - - - redraw_pixmap(screen.drawing_area, TRUE); -- -+ - } /* swap_layers */ - - -@@ -524,19 +524,19 @@ - - /* Get current color and use it as a start in color selection dialog */ - if (background) { -- curr_color[0] = (gdouble)screen.background->red / -+ curr_color[0] = (gdouble)screen.background->red / - (gdouble)MAX_COLOR_RESOLUTION; -- curr_color[1] = (gdouble)screen.background->green / -+ curr_color[1] = (gdouble)screen.background->green / - (gdouble)MAX_COLOR_RESOLUTION; -- curr_color[2] = (gdouble)screen.background->blue / -+ curr_color[2] = (gdouble)screen.background->blue / - (gdouble)MAX_COLOR_RESOLUTION; - curr_color[3] = 0.0; /* Actually don't know how to get this value */ - }else { -- curr_color[0] = (gdouble)screen.file[screen.curr_index]->color->red / -+ curr_color[0] = (gdouble)screen.file[screen.curr_index]->color->red / - (gdouble)MAX_COLOR_RESOLUTION; - curr_color[1] = (gdouble)screen.file[screen.curr_index]->color->green / - (gdouble)MAX_COLOR_RESOLUTION; -- curr_color[2] = (gdouble)screen.file[screen.curr_index]->color->blue / -+ curr_color[2] = (gdouble)screen.file[screen.curr_index]->color->blue / - (gdouble)MAX_COLOR_RESOLUTION; - curr_color[3] = 0.0; /* Actually don't know how to get this value */ - } -@@ -557,7 +557,7 @@ - } /* color_selection_popup */ - - --static void -+static void - invert_color(GtkWidget *widget, gpointer data) - { - if (!screen.file[screen.curr_index]) -@@ -569,7 +569,7 @@ - screen.file[screen.curr_index]->inverted = 1; - - redraw_pixmap(screen.drawing_area, TRUE); -- -+ - return; - } /* invert_color */ - -@@ -593,7 +593,7 @@ - GERB_FATAL_ERROR("malloc screen.path failed\n"); - strcpy(screen.path, filename); - screen.path = strncat(screen.path, "/", 1); -- -+ - /* Make loaded image appear on screen */ - redraw_pixmap(screen.drawing_area, TRUE); - } -@@ -631,17 +631,17 @@ - NULL); - gtk_signal_connect - (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.load_file)->ok_button), -- "clicked", GTK_SIGNAL_FUNC(cb_ok_load_file), -+ "clicked", GTK_SIGNAL_FUNC(cb_ok_load_file), - (gpointer)screen.win.load_file); - gtk_signal_connect - (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.load_file)->cancel_button), -- "clicked", GTK_SIGNAL_FUNC(cb_cancel_load_file), -+ "clicked", GTK_SIGNAL_FUNC(cb_cancel_load_file), - (gpointer)screen.win.load_file); -- -+ - gtk_widget_show(screen.win.load_file); - - gtk_grab_add(screen.win.load_file); -- -+ - return; - } /* load_file_popup */ - -@@ -692,9 +692,9 @@ - GERB_FATAL_ERROR("malloc screen.path failed\n"); - strcpy(screen.path, filename); - screen.path = strncat(screen.path, "/", 1); -- -+ - gtk_grab_remove(screen.win.export_png); -- -+ - screen.win.export_png = NULL; - - return; -@@ -712,21 +712,21 @@ - - gtk_signal_connect - (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.export_png)->ok_button), -- "clicked", GTK_SIGNAL_FUNC(cb_ok_export_png), -+ "clicked", GTK_SIGNAL_FUNC(cb_ok_export_png), - (gpointer)screen.win.export_png); - gtk_signal_connect_object - (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.export_png)->ok_button), -- "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), -+ "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), - (gpointer)screen.win.export_png); - gtk_signal_connect_object - (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.export_png)->cancel_button), -- "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), -+ "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), - (gpointer)screen.win.export_png); -- -+ - gtk_widget_show(screen.win.export_png); - - gtk_grab_add(screen.win.export_png); -- -+ - return; - } /* export_png_popup */ - -@@ -739,7 +739,7 @@ - char *filename = NULL; - project_list_t *project_list = NULL, *tmp; - int idx; -- -+ - if (screen.win.project) { - filename = (char *)gtk_file_selection_get_filename(GTK_FILE_SELECTION(screen.win.project)); - -@@ -758,7 +758,7 @@ - - switch ((long)data) { - case OPEN_PROJECT: -- -+ - project_list = read_project_file(filename); - - if (project_list) { -@@ -797,13 +797,13 @@ - memset((void *)screen.project, 0, strlen(filename) + 1); - strncpy(screen.project, filename, strlen(filename)); - rename_main_window(filename, NULL); -- -+ - case SAVE_PROJECT: - if (!screen.project) { - GERB_MESSAGE("Missing project filename\n"); - goto cb_ok_project_end; - } -- -+ - if (screen.path) { - project_list = (project_list_t *)malloc(sizeof(project_list_t)); - if (project_list == NULL) -@@ -817,7 +817,7 @@ - project_list->rgb[2] = screen.background->blue; - project_list->next = NULL; - } -- -+ - for (idx = 0; idx < MAX_FILES; idx++) { - if (screen.file[idx] && screen.file[idx]->name) { - tmp = (project_list_t *)malloc(sizeof(project_list_t)); -@@ -865,7 +865,7 @@ - } /* cb_ok_project */ - - --static void -+static void - project_popup(GtkWidget *widget, gpointer data) - { - -@@ -887,24 +887,24 @@ - else if (screen.path) - gtk_file_selection_set_filename - (GTK_FILE_SELECTION(screen.win.project), screen.path); -- -+ - gtk_signal_connect - (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.project)->ok_button), - "clicked", GTK_SIGNAL_FUNC(cb_ok_project), data); - gtk_signal_connect_object - (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.project)->ok_button), -- "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), -+ "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), - (gpointer)screen.win.project); - gtk_signal_connect_object - (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.project)->cancel_button), -- "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), -+ "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), - (gpointer)screen.win.project); -- -+ - - gtk_widget_show(screen.win.project); - - gtk_grab_add(screen.win.project); -- -+ - return; - } /* project_popup */ - -@@ -912,9 +912,9 @@ - project_save_cb(GtkWidget *widget, gpointer data) - { - -- if (!screen.project) -+ if (!screen.project) - project_popup(widget, (gpointer) SAVE_AS_PROJECT); -- else -+ else - cb_ok_project(widget, (gpointer) SAVE_PROJECT); - - } -@@ -960,20 +960,20 @@ - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(screen.layer_button[idx]), - FALSE); - -- /* -- * Remove color on layer button (set default style) -+ /* -+ * Remove color on layer button (set default style) - */ - defstyle = gtk_widget_get_default_style(); - gtk_widget_set_style(screen.layer_button[idx], defstyle); - -- /* -- * Remove tool tips -+ /* -+ * Remove tool tips - */ -- gtk_tooltips_set_tip(screen.tooltips, screen.layer_button[idx], -- NULL, NULL); -+ gtk_tooltips_set_tip(screen.tooltips, screen.layer_button[idx], -+ NULL, NULL); - -- /* -- * Remove data struct -+ /* -+ * Remove data struct - */ - free_gerb_image(screen.file[idx]->image); screen.file[idx]->image = NULL; - free(screen.file[idx]->color); screen.file[idx]->color = NULL; -@@ -995,7 +995,7 @@ - return; - } - } -- -+ - redraw_pixmap(screen.drawing_area, TRUE); - - return; -@@ -1007,10 +1007,10 @@ - { - project_list_t *pl_tmp; - GtkStyle *defstyle, *newstyle; -- -+ - while (project_list) { - if (project_list->layerno == -1) { -- screen.background = alloc_color(project_list->rgb[0], -+ screen.background = alloc_color(project_list->rgb[0], - project_list->rgb[1], - project_list->rgb[2], NULL); - } else { -@@ -1019,15 +1019,15 @@ - if (open_image(project_list->filename, idx, FALSE) == -1) - exit(-1); - -- /* -+ /* - * Change color from default to from the project list - */ - free(screen.file[idx]->color); -- screen.file[idx]->color = alloc_color(project_list->rgb[0], -+ screen.file[idx]->color = alloc_color(project_list->rgb[0], - project_list->rgb[1], - project_list->rgb[2], NULL); - -- /* -+ /* - * Also change color on layer button - */ - defstyle = gtk_widget_get_default_style(); -@@ -1054,7 +1054,7 @@ - double max_width = LONG_MIN, max_height = LONG_MIN; - double x_scale, y_scale; - int i; -- -+ - if (screen.drawing_area == NULL) - return; - -@@ -1065,8 +1065,8 @@ - - for(i = 0; i < MAX_FILES; i++) { - if (screen.file[i]) { -- -- /* -+ -+ /* - * Find the biggest image and use as a size reference - */ - screen.gerber_bbox.x1 = MIN(screen.gerber_bbox.x1, -@@ -1182,13 +1182,13 @@ - - - /* Superimpose function */ --static void -+static void - si_func(GtkWidget *widget, gpointer data) - { - - if ((GdkFunction)data == screen.si_func) - return; -- -+ - screen.si_func = (GdkFunction)data; - - /* Redraw the image(s) */ -@@ -1199,13 +1199,13 @@ - - - /* Unit function, sets unit for statusbar */ --static void -+static void - unit_func(GtkWidget *widget, gpointer data) - { - - if ((gerbv_unit_t)data == screen.unit) - return; -- -+ - screen.unit = (gerbv_unit_t)data; - - /* Redraw the status bar */ -@@ -1274,11 +1274,11 @@ - - /* Update clipping bbox */ - screen.clip_bbox.x1 = -screen.trans_x/(double)screen.scale; -- screen.clip_bbox.y1 = -screen.trans_y/(double)screen.scale; -+ screen.clip_bbox.y1 = -screen.trans_y/(double)screen.scale; - - /* Redraw screen */ - redraw_pixmap(screen.drawing_area, TRUE); -- -+ - return; - } /* zoom */ - -@@ -1335,10 +1335,10 @@ - create_drawing_area(gint win_width, gint win_height) - { - GtkWidget *drawing_area; -- -+ - drawing_area = gtk_drawing_area_new(); - gtk_drawing_area_size(GTK_DRAWING_AREA(drawing_area), win_width, win_height); -- -+ - return drawing_area; - } /* create_drawing_area */ - -@@ -1462,14 +1462,14 @@ - * Pixmap size is always size of window, no - * matter how the scale. - */ -- gdk_window_get_size(widget->window, &width, &height); -+ gdk_window_get_size(widget->window, &width, &height); - state.max_width = width; - state.max_height = height; - -- /* -+ /* - * Remove old pixmap, allocate a new one, draw the background. - */ -- if (screen.pixmap) -+ if (screen.pixmap) - gdk_pixmap_unref(screen.pixmap); - screen.pixmap = gdk_pixmap_new(widget->window, state.max_width, - state.max_height, -1); -@@ -1495,9 +1495,9 @@ - gdk_gc_set_function(gc, screen.si_func); - - -- /* -+ /* - * This now allows drawing several layers on top of each other. -- * Higher layer numbers have higher priority in the Z-order. -+ * Higher layer numbers have higher priority in the Z-order. - */ - for(i = state.file_index; i < MAX_FILES; i++) { - if (g_main_pending()) { -@@ -1523,7 +1523,7 @@ - /* - * Show progress in status bar - */ -- snprintf(screen.statusbar.msgstr, MAX_STATUSMSGLEN, -+ snprintf(screen.statusbar.msgstr, MAX_ERRMSGLEN, - "%d %s...", - i, screen.file[i]->basename); - update_statusbar(&screen); -@@ -1540,12 +1540,12 @@ - * which is not always centered perfectly for GTK/X. - */ - image2pixmap(&(state.clipmask), -- screen.file[i]->image, screen.scale, -+ screen.file[i]->image, screen.scale, - (screen.clip_bbox.x1-dmin_x)*screen.scale, - (screen.clip_bbox.y1+dmax_y)*screen.scale, - polarity); - -- /* -+ /* - * Set clipmask and draw the clipped out image onto the - * screen pixmap. Afterwards we remove the clipmask, else - * it will screw things up when run this loop again. -@@ -1611,10 +1611,10 @@ - GERB_MESSAGE("Trying to open %s:%s\n", filename, strerror(errno)); - return -1; - } -- -+ - if(drill_file_p(fd)) - parsed_image = parse_drillfile(fd); -- else -+ else - parsed_image = parse_gerb(fd); - - if (parsed_image == NULL) -@@ -1632,7 +1632,7 @@ - GERB_COMPILE_ERROR("* Missing netlist\n"); - if (error & GERB_IMAGE_MISSING_FORMAT) - GERB_COMPILE_ERROR("* Missing format\n"); -- if (error & GERB_IMAGE_MISSING_APERTURES) -+ if (error & GERB_IMAGE_MISSING_APERTURES) - GERB_COMPILE_ERROR("* Missing apertures/drill sizes\n"); - if (error & GERB_IMAGE_MISSING_INFO) - GERB_COMPILE_ERROR("* Missing info\n"); -@@ -1700,7 +1700,7 @@ - - screen.file[idx]->color = alloc_color(r, g, b, NULL); - -- /* -+ /* - * Set color on layer button - */ - defstyle = gtk_widget_get_default_style(); -@@ -1710,11 +1710,11 @@ - newstyle->bg[GTK_STATE_PRELIGHT] = *(screen.file[idx]->color); - gtk_widget_set_style(screen.layer_button[idx], newstyle); - -- /* -- * Tool tips on button is the file name -+ /* -+ * Tool tips on button is the file name - */ - gtk_tooltips_set_tip(screen.tooltips, screen.layer_button[idx], -- filename, NULL); -+ filename, NULL); - - return 0; - } /* open_image */ -@@ -1751,7 +1751,7 @@ - gdk_window_set_cursor(gtk_widget_get_parent_window(widget), - cursor); - gdk_cursor_destroy(cursor); -- -+ - } - break; - case 2 : -@@ -1807,7 +1807,7 @@ - case GDK_SCROLL_DOWN: - data.z_dir = ZOOM_OUT_CMOUSE; - break; -- case GDK_SCROLL_LEFT: -+ case GDK_SCROLL_LEFT: - /* Ignore */ - return TRUE; - case GDK_SCROLL_RIGHT: -@@ -1867,7 +1867,7 @@ - gdk_cursor_destroy(cursor); - break; - case GDK_Alt_L: -- case GDK_Alt_R: -+ case GDK_Alt_R: - screen.state = ALT_PRESSED; - screen.selected_layer = -1; - break; -@@ -1891,17 +1891,17 @@ - case ALT_PRESSED: - if ((event->keyval >= GDK_KP_0) && - (event->keyval <= GDK_KP_9)) { -- if (screen.selected_layer == -1) -+ if (screen.selected_layer == -1) - screen.selected_layer = event->keyval - GDK_KP_0; - else -- screen.selected_layer = 10 * screen.selected_layer + -+ screen.selected_layer = 10 * screen.selected_layer + - (event->keyval - GDK_KP_0); - } - break; - default: - break; - } -- -+ - /* Escape may be used to abort outline zoom and just plain repaint */ - if (event->keyval == GDK_Escape) { - GdkRectangle update_rect; -@@ -1964,7 +1964,7 @@ - int x, y; - GdkModifierType state; - GdkRectangle update_rect; -- -+ - if (event->is_hint) - gdk_window_get_pointer (event->window, &x, &y, &state); - else { -@@ -1972,7 +1972,7 @@ - y = event->y; - state = event->state; - } -- -+ - if (screen.pixmap != NULL) { - double X, Y; - -@@ -2044,7 +2044,7 @@ - break; - } - } -- -+ - return TRUE; - } /* motion_notify_event */ - -@@ -2067,10 +2067,10 @@ - - gdk_gc_set_foreground(gc, screen.background); - -- gdk_draw_rectangle(new_pixmap, gc, TRUE, -+ gdk_draw_rectangle(new_pixmap, gc, TRUE, - event->area.x, event->area.y, - event->area.width, event->area.height); -- -+ - /* - * Copy gerber pixmap onto background if we have one to copy. - * Do translation at the same time. -@@ -2078,9 +2078,9 @@ - if (screen.pixmap != NULL) { - gdk_draw_pixmap(new_pixmap, - widget->style->fg_gc[GTK_WIDGET_STATE (widget)], -- screen.pixmap, -- event->area.x + screen.off_x, -- event->area.y + screen.off_y, -+ screen.pixmap, -+ event->area.x + screen.off_x, -+ event->area.y + screen.off_y, - event->area.x, event->area.y, - event->area.width, event->area.height); - } -@@ -2101,7 +2101,7 @@ - dx = screen.gerber_bbox.x2-screen.gerber_bbox.x1; - dy = screen.gerber_bbox.y2-screen.gerber_bbox.y1; - gdk_gc_set_foreground(gc, screen.dist_measure_color); -- gdk_draw_rectangle(widget->window, gc, FALSE, -+ gdk_draw_rectangle(widget->window, gc, FALSE, - (screen.gerber_bbox.x1-1.1)*screen.scale - screen.trans_x, - ((screen.gerber_bbox.y1-0.6)*screen.scale - screen.trans_y), - dx*screen.scale, -@@ -2274,7 +2274,7 @@ - } /* draw_measure_distance */ - - --static void -+static void - update_statusbar(gerbv_screen_t *scr) - { - char str[MAX_STATUSMSGLEN+1]; -@@ -2296,7 +2296,7 @@ - gtk_widget_show(screen.win.scale); - gtk_grab_add(screen.win.scale); - } /* menu_ask_zoom */ -- -+ - - static GtkWidget * - create_ZoomFactorWindow(void) -@@ -2308,21 +2308,21 @@ - GtkWidget *zoom_cancel_button; - GtkWidget *zoom_ok_button; - GtkWidget *zoomwindowlabel; -- -+ - ZoomFactorWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_object_set_data (GTK_OBJECT (ZoomFactorWindow), "ZoomFactorWindow", - ZoomFactorWindow); - gtk_window_set_title (GTK_WINDOW (ZoomFactorWindow), "Set Scale"); - /* XXX Hardcoded window size values */ - gtk_window_set_default_size(GTK_WINDOW(ZoomFactorWindow), 180, 50); -- -+ - table2 = gtk_table_new (2, 2, FALSE); - gtk_widget_ref (table2); - gtk_object_set_data_full (GTK_OBJECT (ZoomFactorWindow), "table2", table2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (table2); - gtk_container_add (GTK_CONTAINER (ZoomFactorWindow), table2); -- -+ - zoom_spinbutton1_adj = gtk_adjustment_new (1, 1, 65535, 1, 10, 10); - zoom_spinbutton1 = - gtk_spin_button_new (GTK_ADJUSTMENT (zoom_spinbutton1_adj), 1, 0); -@@ -2462,7 +2462,7 @@ - snprintf(win_title, len, "%s%s: %s", WIN_TITLE, VERSION, filename); - gtk_window_set_title(GTK_WINDOW(win), win_title); - free(win_title); -- -+ - } - - #ifdef HAVE_GETOPT_LONG -@@ -2518,9 +2518,9 @@ - screen.execpath = dirname(argv[0]); - - setup_init(); -- -+ - #ifdef HAVE_GETOPT_LONG -- while ((read_opt = getopt_long(argc, argv, opt_options, -+ while ((read_opt = getopt_long(argc, argv, opt_options, - longopts, &longopt_idx)) != -1) { - #else - while ((read_opt = getopt(argc, argv, opt_options)) != -1) { -@@ -2615,13 +2615,13 @@ - printf("Not handled option [%d=%c]\n", read_opt, read_opt); - } - } -- -+ - /* - * Init GTK+ - */ - gtk_init(&argc, &argv); - -- /* -+ /* - * Good defaults according to Ales. Gives aspect ratio of 1.3333... - */ - if ((req_width != -1) && (req_height != -1)) { -@@ -2636,7 +2636,7 @@ - /* - * Setup some GTK+ defaults - */ -- screen.tooltips = gtk_tooltips_new(); -+ screen.tooltips = gtk_tooltips_new(); - screen.background = alloc_color(0, 0, 0, "black"); - screen.zoom_outline_color = alloc_color(0, 0, 0, "gray"); - screen.dist_measure_color = alloc_color(0, 0, 0, "lightblue"); -@@ -2645,45 +2645,45 @@ - * Set console error log handler. The default gives us error levels in - * in the beginning which I don't want. - */ -- g_log_set_handler (NULL, -- G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION | G_LOG_LEVEL_MASK, -- gerbv_console_log_handler, NULL); -+ g_log_set_handler (NULL, -+ G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION | G_LOG_LEVEL_MASK, -+ gerbv_console_log_handler, NULL); - - /* Set default unit to the configured default */ - screen.unit = GERBV_DEFAULT_UNIT; - - /* -- * Main window -+ * Main window - */ - main_win = gtk_window_new(GTK_WINDOW_TOPLEVEL); - rename_main_window("", main_win); - g_signal_connect(GTK_OBJECT(main_win), "delete_event", G_CALLBACK(destroy), NULL); - -- /* -+ /* - * vbox contains menubar and hbox - */ - vbox = gtk_vbox_new(FALSE, 0); - gtk_container_add(GTK_CONTAINER(main_win), vbox); -- -+ - create_menubar(main_win, &menubar); - gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0); -- -- /* -+ -+ /* - * hbox contains drawing area and image select area - */ - hbox = gtk_hbox_new(FALSE, 0); -- -+ - /* - * Create drawing area - */ - screen.drawing_area = create_drawing_area(width, height); - gtk_box_pack_start(GTK_BOX(hbox), screen.drawing_area, TRUE, TRUE, 0); -- -+ - /* - * Build layer buttons with popup menus - */ - create_popupmenu(&screen.popup_menu); -- gtk_box_pack_start(GTK_BOX(hbox), create_layer_buttons(MAX_FILES), -+ gtk_box_pack_start(GTK_BOX(hbox), create_layer_buttons(MAX_FILES), - FALSE, FALSE, 0); - - gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0); -@@ -2713,7 +2713,7 @@ - project_list_t *project_list; - - project_list = read_project_file(project_filename); -- -+ - if (project_list) { - load_project(project_list); - if (screen.project) { -@@ -2736,7 +2736,7 @@ - strcpy(screen.path, project_filename); - dirname(screen.path); - screen.path = strncat(screen.path, "/", 1); -- -+ - rename_main_window(screen.project, NULL); - } else { - GERB_MESSAGE("Failed to load project\n"); -@@ -2751,13 +2751,13 @@ - /* - * Set gtk error log handler - */ -- g_log_set_handler (NULL, -- G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION | G_LOG_LEVEL_MASK, -- gerbv_gtk_log_handler, NULL); -+ g_log_set_handler (NULL, -+ G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION | G_LOG_LEVEL_MASK, -+ gerbv_gtk_log_handler, NULL); - - /* -- * Connect all events on drawing area -- */ -+ * Connect all events on drawing area -+ */ - gtk_signal_connect(GTK_OBJECT(screen.drawing_area), "expose_event", - GTK_SIGNAL_FUNC(expose_event), NULL); - gtk_signal_connect(GTK_OBJECT(screen.drawing_area),"configure_event", -@@ -2798,6 +2798,6 @@ - TRUE); - - gtk_main(); -- -+ - return 0; - } /* main */ diff --git a/gerbv-1.0.3-init.patch b/gerbv-1.0.3-init.patch new file mode 100644 index 0000000..d811953 --- /dev/null +++ b/gerbv-1.0.3-init.patch @@ -0,0 +1,11 @@ +--- src/Makefile.am 2006-07-25 16:53:20.000000000 +0000 ++++ Makefile.am_init 2006-09-14 12:12:31.000000000 +0000 +@@ -31,7 +31,7 @@ + opdefines.h project.c project.h scheme-private.h scheme.c \ + scheme.h setup.c setup.h tooltable.c tooltable.h + +-scmdatadir = $(datarootdir)/gerbv/scheme/ ++scmdatadir = $(datadir)/gerbv/scheme/ + dist_scmdata_DATA = init.scm + + INCLUDES = @GTK_CFLAGS@ @GDK_PIXBUF_CFLAGS@ @PNG_CFLAGS@ diff --git a/gerbv-1.0.3-overflow.patch b/gerbv-1.0.3-overflow.patch new file mode 100644 index 0000000..5bcca1d --- /dev/null +++ b/gerbv-1.0.3-overflow.patch @@ -0,0 +1,920 @@ +--- src/gerbv.c 2006-07-28 12:33:13.000000000 +0200 ++++ gerbv.c 2007-05-26 13:40:31.000000000 +0200 +@@ -202,7 +202,7 @@ + int nmenu_items = sizeof(menu_items) / sizeof(menu_items[0]); + GtkItemFactory *item_factory; + GtkAccelGroup *accel_group; +- ++ + accel_group = gtk_accel_group_new(); + + /* This function initializes the item factory. +@@ -212,17 +212,17 @@ + Param 3: A pointer to a gtk_accel_group. The item factory sets up + the accelerator table while generating menus. + */ +- +- item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "
", ++ ++ item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "
", + accel_group); + /* This function generates the menu items. Pass the item factory, + the number of items in the array, the array itself, and any + callback data for the menu items. */ + gtk_item_factory_create_items(item_factory, nmenu_items, menu_items, NULL); +- ++ + /* Attach the new accelerator group to the window */ + gtk_window_add_accel_group (GTK_WINDOW(window), accel_group); +- ++ + if(menubar) { + GtkWidget *menuEntry; + +@@ -249,7 +249,7 @@ + item_factory = gtk_item_factory_new(GTK_TYPE_MENU, "", NULL); + gtk_item_factory_create_items(item_factory, nmenu_items, popup_menu_items, + NULL); +- ++ + if(popupmenu) + /* Finally, return the actual menu bar created by the item factory. */ + *popupmenu = gtk_item_factory_get_widget(item_factory, ""); +@@ -289,7 +289,7 @@ + + + static gint +-layer_button_press_event(GtkWidget *widget, GdkEventButton *event, ++layer_button_press_event(GtkWidget *widget, GdkEventButton *event, + gpointer button) + { + GdkEventButton *event_button; +@@ -307,9 +307,9 @@ + return FALSE; + } + +- gtk_menu_popup(GTK_MENU(screen.popup_menu), NULL, NULL, NULL, NULL, ++ gtk_menu_popup(GTK_MENU(screen.popup_menu), NULL, NULL, NULL, NULL, + event_button->button, event_button->time); +- ++ + screen.curr_index = (long int)button; + + return TRUE; +@@ -329,7 +329,7 @@ + + box = gtk_vbox_new(TRUE, 0); + +- /* ++ /* + * Create style to be used by "all layer" buttons + */ + color = alloc_color(0, 0, 0, "white"); +@@ -344,22 +344,22 @@ + */ + button = gtk_button_new_with_label("On"); + gtk_signal_connect(GTK_OBJECT(button), "button_press_event", +- GTK_SIGNAL_FUNC(all_layers_on), ++ GTK_SIGNAL_FUNC(all_layers_on), + (gpointer)NULL); + gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); + gtk_widget_set_style(button, newstyle); +- gtk_tooltips_set_tip(tooltips, button, "Turn On All Layers", NULL); ++ gtk_tooltips_set_tip(tooltips, button, "Turn On All Layers", NULL); + + /* + * Create Off button with callback, color and tooltips + */ + button = gtk_button_new_with_label("Off"); + gtk_signal_connect(GTK_OBJECT(button), "button_press_event", +- GTK_SIGNAL_FUNC(all_layers_off), ++ GTK_SIGNAL_FUNC(all_layers_off), + (gpointer)NULL); + gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); + gtk_widget_set_style(button, newstyle); +- gtk_tooltips_set_tip(tooltips, button, "Turn Off All Layers", NULL); ++ gtk_tooltips_set_tip(tooltips, button, "Turn Off All Layers", NULL); + + /* + * Create the rest of the buttons +@@ -368,11 +368,11 @@ + snprintf(info, sizeof(info), "%ld", bi); + button = gtk_toggle_button_new_with_label(info); + +- gtk_signal_connect(GTK_OBJECT(button), "toggled", ++ gtk_signal_connect(GTK_OBJECT(button), "toggled", + GTK_SIGNAL_FUNC(cb_layer_button), + (gpointer)bi); + gtk_signal_connect(GTK_OBJECT(button), "button_press_event", +- GTK_SIGNAL_FUNC(layer_button_press_event), ++ GTK_SIGNAL_FUNC(layer_button_press_event), + (gpointer)bi); + + gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); +@@ -409,17 +409,17 @@ + /* Allocate new color */ + if (background) { + free(screen.background); +- screen.background = ++ screen.background = + alloc_color((int)(color[0] * MAX_COLOR_RESOLUTION), + (int)(color[1] * MAX_COLOR_RESOLUTION), + (int)(color[2] * MAX_COLOR_RESOLUTION), + NULL); + } else { + free(screen.file[screen.curr_index]->color); +- screen.file[screen.curr_index]->color = +- alloc_color((int)(color[0] * MAX_COLOR_RESOLUTION), +- (int)(color[1] * MAX_COLOR_RESOLUTION), +- (int)(color[2] * MAX_COLOR_RESOLUTION), ++ screen.file[screen.curr_index]->color = ++ alloc_color((int)(color[0] * MAX_COLOR_RESOLUTION), ++ (int)(color[1] * MAX_COLOR_RESOLUTION), ++ (int)(color[2] * MAX_COLOR_RESOLUTION), + NULL); + } + +@@ -445,7 +445,7 @@ + } /* cb_ok_color_selection */ + + +-static void ++static void + swap_layers(GtkWidget *widget, gpointer data) + { + gerbv_fileinfo_t *temp_file; +@@ -460,7 +460,7 @@ + if (screen.curr_index == 0) return; + if (screen.file[screen.curr_index - 1] == NULL) return; + idx = -1; +- } else { ++ } else { + /* Moving Down */ + if (screen.curr_index == MAX_FILES - 1) return; + if (screen.file[screen.curr_index + 1] == NULL) return; +@@ -488,7 +488,7 @@ + + + redraw_pixmap(screen.drawing_area, TRUE); +- ++ + } /* swap_layers */ + + +@@ -524,19 +524,19 @@ + + /* Get current color and use it as a start in color selection dialog */ + if (background) { +- curr_color[0] = (gdouble)screen.background->red / ++ curr_color[0] = (gdouble)screen.background->red / + (gdouble)MAX_COLOR_RESOLUTION; +- curr_color[1] = (gdouble)screen.background->green / ++ curr_color[1] = (gdouble)screen.background->green / + (gdouble)MAX_COLOR_RESOLUTION; +- curr_color[2] = (gdouble)screen.background->blue / ++ curr_color[2] = (gdouble)screen.background->blue / + (gdouble)MAX_COLOR_RESOLUTION; + curr_color[3] = 0.0; /* Actually don't know how to get this value */ + }else { +- curr_color[0] = (gdouble)screen.file[screen.curr_index]->color->red / ++ curr_color[0] = (gdouble)screen.file[screen.curr_index]->color->red / + (gdouble)MAX_COLOR_RESOLUTION; + curr_color[1] = (gdouble)screen.file[screen.curr_index]->color->green / + (gdouble)MAX_COLOR_RESOLUTION; +- curr_color[2] = (gdouble)screen.file[screen.curr_index]->color->blue / ++ curr_color[2] = (gdouble)screen.file[screen.curr_index]->color->blue / + (gdouble)MAX_COLOR_RESOLUTION; + curr_color[3] = 0.0; /* Actually don't know how to get this value */ + } +@@ -557,7 +557,7 @@ + } /* color_selection_popup */ + + +-static void ++static void + invert_color(GtkWidget *widget, gpointer data) + { + if (!screen.file[screen.curr_index]) +@@ -569,7 +569,7 @@ + screen.file[screen.curr_index]->inverted = 1; + + redraw_pixmap(screen.drawing_area, TRUE); +- ++ + return; + } /* invert_color */ + +@@ -593,7 +593,7 @@ + GERB_FATAL_ERROR("malloc screen.path failed\n"); + strcpy(screen.path, filename); + screen.path = strncat(screen.path, "/", 1); +- ++ + /* Make loaded image appear on screen */ + redraw_pixmap(screen.drawing_area, TRUE); + } +@@ -631,17 +631,17 @@ + NULL); + gtk_signal_connect + (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.load_file)->ok_button), +- "clicked", GTK_SIGNAL_FUNC(cb_ok_load_file), ++ "clicked", GTK_SIGNAL_FUNC(cb_ok_load_file), + (gpointer)screen.win.load_file); + gtk_signal_connect + (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.load_file)->cancel_button), +- "clicked", GTK_SIGNAL_FUNC(cb_cancel_load_file), ++ "clicked", GTK_SIGNAL_FUNC(cb_cancel_load_file), + (gpointer)screen.win.load_file); +- ++ + gtk_widget_show(screen.win.load_file); + + gtk_grab_add(screen.win.load_file); +- ++ + return; + } /* load_file_popup */ + +@@ -692,9 +692,9 @@ + GERB_FATAL_ERROR("malloc screen.path failed\n"); + strcpy(screen.path, filename); + screen.path = strncat(screen.path, "/", 1); +- ++ + gtk_grab_remove(screen.win.export_png); +- ++ + screen.win.export_png = NULL; + + return; +@@ -712,21 +712,21 @@ + + gtk_signal_connect + (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.export_png)->ok_button), +- "clicked", GTK_SIGNAL_FUNC(cb_ok_export_png), ++ "clicked", GTK_SIGNAL_FUNC(cb_ok_export_png), + (gpointer)screen.win.export_png); + gtk_signal_connect_object + (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.export_png)->ok_button), +- "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), ++ "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), + (gpointer)screen.win.export_png); + gtk_signal_connect_object + (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.export_png)->cancel_button), +- "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), ++ "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), + (gpointer)screen.win.export_png); +- ++ + gtk_widget_show(screen.win.export_png); + + gtk_grab_add(screen.win.export_png); +- ++ + return; + } /* export_png_popup */ + +@@ -739,7 +739,7 @@ + char *filename = NULL; + project_list_t *project_list = NULL, *tmp; + int idx; +- ++ + if (screen.win.project) { + filename = (char *)gtk_file_selection_get_filename(GTK_FILE_SELECTION(screen.win.project)); + +@@ -758,7 +758,7 @@ + + switch ((long)data) { + case OPEN_PROJECT: +- ++ + project_list = read_project_file(filename); + + if (project_list) { +@@ -797,13 +797,13 @@ + memset((void *)screen.project, 0, strlen(filename) + 1); + strncpy(screen.project, filename, strlen(filename)); + rename_main_window(filename, NULL); +- ++ + case SAVE_PROJECT: + if (!screen.project) { + GERB_MESSAGE("Missing project filename\n"); + goto cb_ok_project_end; + } +- ++ + if (screen.path) { + project_list = (project_list_t *)malloc(sizeof(project_list_t)); + if (project_list == NULL) +@@ -817,7 +817,7 @@ + project_list->rgb[2] = screen.background->blue; + project_list->next = NULL; + } +- ++ + for (idx = 0; idx < MAX_FILES; idx++) { + if (screen.file[idx] && screen.file[idx]->name) { + tmp = (project_list_t *)malloc(sizeof(project_list_t)); +@@ -865,7 +865,7 @@ + } /* cb_ok_project */ + + +-static void ++static void + project_popup(GtkWidget *widget, gpointer data) + { + +@@ -887,24 +887,24 @@ + else if (screen.path) + gtk_file_selection_set_filename + (GTK_FILE_SELECTION(screen.win.project), screen.path); +- ++ + gtk_signal_connect + (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.project)->ok_button), + "clicked", GTK_SIGNAL_FUNC(cb_ok_project), data); + gtk_signal_connect_object + (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.project)->ok_button), +- "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), ++ "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), + (gpointer)screen.win.project); + gtk_signal_connect_object + (GTK_OBJECT(GTK_FILE_SELECTION(screen.win.project)->cancel_button), +- "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), ++ "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), + (gpointer)screen.win.project); +- ++ + + gtk_widget_show(screen.win.project); + + gtk_grab_add(screen.win.project); +- ++ + return; + } /* project_popup */ + +@@ -912,9 +912,9 @@ + project_save_cb(GtkWidget *widget, gpointer data) + { + +- if (!screen.project) ++ if (!screen.project) + project_popup(widget, (gpointer) SAVE_AS_PROJECT); +- else ++ else + cb_ok_project(widget, (gpointer) SAVE_PROJECT); + + } +@@ -960,20 +960,20 @@ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(screen.layer_button[idx]), + FALSE); + +- /* +- * Remove color on layer button (set default style) ++ /* ++ * Remove color on layer button (set default style) + */ + defstyle = gtk_widget_get_default_style(); + gtk_widget_set_style(screen.layer_button[idx], defstyle); + +- /* +- * Remove tool tips ++ /* ++ * Remove tool tips + */ +- gtk_tooltips_set_tip(screen.tooltips, screen.layer_button[idx], +- NULL, NULL); ++ gtk_tooltips_set_tip(screen.tooltips, screen.layer_button[idx], ++ NULL, NULL); + +- /* +- * Remove data struct ++ /* ++ * Remove data struct + */ + free_gerb_image(screen.file[idx]->image); screen.file[idx]->image = NULL; + free(screen.file[idx]->color); screen.file[idx]->color = NULL; +@@ -995,7 +995,7 @@ + return; + } + } +- ++ + redraw_pixmap(screen.drawing_area, TRUE); + + return; +@@ -1007,10 +1007,10 @@ + { + project_list_t *pl_tmp; + GtkStyle *defstyle, *newstyle; +- ++ + while (project_list) { + if (project_list->layerno == -1) { +- screen.background = alloc_color(project_list->rgb[0], ++ screen.background = alloc_color(project_list->rgb[0], + project_list->rgb[1], + project_list->rgb[2], NULL); + } else { +@@ -1019,15 +1019,15 @@ + if (open_image(project_list->filename, idx, FALSE) == -1) + exit(-1); + +- /* ++ /* + * Change color from default to from the project list + */ + free(screen.file[idx]->color); +- screen.file[idx]->color = alloc_color(project_list->rgb[0], ++ screen.file[idx]->color = alloc_color(project_list->rgb[0], + project_list->rgb[1], + project_list->rgb[2], NULL); + +- /* ++ /* + * Also change color on layer button + */ + defstyle = gtk_widget_get_default_style(); +@@ -1054,7 +1054,7 @@ + double max_width = LONG_MIN, max_height = LONG_MIN; + double x_scale, y_scale; + int i; +- ++ + if (screen.drawing_area == NULL) + return; + +@@ -1065,8 +1065,8 @@ + + for(i = 0; i < MAX_FILES; i++) { + if (screen.file[i]) { +- +- /* ++ ++ /* + * Find the biggest image and use as a size reference + */ + screen.gerber_bbox.x1 = MIN(screen.gerber_bbox.x1, +@@ -1182,13 +1182,13 @@ + + + /* Superimpose function */ +-static void ++static void + si_func(GtkWidget *widget, gpointer data) + { + + if ((GdkFunction)data == screen.si_func) + return; +- ++ + screen.si_func = (GdkFunction)data; + + /* Redraw the image(s) */ +@@ -1199,13 +1199,13 @@ + + + /* Unit function, sets unit for statusbar */ +-static void ++static void + unit_func(GtkWidget *widget, gpointer data) + { + + if ((gerbv_unit_t)data == screen.unit) + return; +- ++ + screen.unit = (gerbv_unit_t)data; + + /* Redraw the status bar */ +@@ -1274,11 +1274,11 @@ + + /* Update clipping bbox */ + screen.clip_bbox.x1 = -screen.trans_x/(double)screen.scale; +- screen.clip_bbox.y1 = -screen.trans_y/(double)screen.scale; ++ screen.clip_bbox.y1 = -screen.trans_y/(double)screen.scale; + + /* Redraw screen */ + redraw_pixmap(screen.drawing_area, TRUE); +- ++ + return; + } /* zoom */ + +@@ -1335,10 +1335,10 @@ + create_drawing_area(gint win_width, gint win_height) + { + GtkWidget *drawing_area; +- ++ + drawing_area = gtk_drawing_area_new(); + gtk_drawing_area_size(GTK_DRAWING_AREA(drawing_area), win_width, win_height); +- ++ + return drawing_area; + } /* create_drawing_area */ + +@@ -1462,14 +1462,14 @@ + * Pixmap size is always size of window, no + * matter how the scale. + */ +- gdk_window_get_size(widget->window, &width, &height); ++ gdk_window_get_size(widget->window, &width, &height); + state.max_width = width; + state.max_height = height; + +- /* ++ /* + * Remove old pixmap, allocate a new one, draw the background. + */ +- if (screen.pixmap) ++ if (screen.pixmap) + gdk_pixmap_unref(screen.pixmap); + screen.pixmap = gdk_pixmap_new(widget->window, state.max_width, + state.max_height, -1); +@@ -1495,9 +1495,9 @@ + gdk_gc_set_function(gc, screen.si_func); + + +- /* ++ /* + * This now allows drawing several layers on top of each other. +- * Higher layer numbers have higher priority in the Z-order. ++ * Higher layer numbers have higher priority in the Z-order. + */ + for(i = state.file_index; i < MAX_FILES; i++) { + if (g_main_pending()) { +@@ -1523,7 +1523,7 @@ + /* + * Show progress in status bar + */ +- snprintf(screen.statusbar.msgstr, MAX_STATUSMSGLEN, ++ snprintf(screen.statusbar.msgstr, MAX_ERRMSGLEN, + "%d %s...", + i, screen.file[i]->basename); + update_statusbar(&screen); +@@ -1540,12 +1540,12 @@ + * which is not always centered perfectly for GTK/X. + */ + image2pixmap(&(state.clipmask), +- screen.file[i]->image, screen.scale, ++ screen.file[i]->image, screen.scale, + (screen.clip_bbox.x1-dmin_x)*screen.scale, + (screen.clip_bbox.y1+dmax_y)*screen.scale, + polarity); + +- /* ++ /* + * Set clipmask and draw the clipped out image onto the + * screen pixmap. Afterwards we remove the clipmask, else + * it will screw things up when run this loop again. +@@ -1611,10 +1611,10 @@ + GERB_MESSAGE("Trying to open %s:%s\n", filename, strerror(errno)); + return -1; + } +- ++ + if(drill_file_p(fd)) + parsed_image = parse_drillfile(fd); +- else ++ else + parsed_image = parse_gerb(fd); + + if (parsed_image == NULL) +@@ -1632,7 +1632,7 @@ + GERB_COMPILE_ERROR("* Missing netlist\n"); + if (error & GERB_IMAGE_MISSING_FORMAT) + GERB_COMPILE_ERROR("* Missing format\n"); +- if (error & GERB_IMAGE_MISSING_APERTURES) ++ if (error & GERB_IMAGE_MISSING_APERTURES) + GERB_COMPILE_ERROR("* Missing apertures/drill sizes\n"); + if (error & GERB_IMAGE_MISSING_INFO) + GERB_COMPILE_ERROR("* Missing info\n"); +@@ -1700,7 +1700,7 @@ + + screen.file[idx]->color = alloc_color(r, g, b, NULL); + +- /* ++ /* + * Set color on layer button + */ + defstyle = gtk_widget_get_default_style(); +@@ -1710,11 +1710,11 @@ + newstyle->bg[GTK_STATE_PRELIGHT] = *(screen.file[idx]->color); + gtk_widget_set_style(screen.layer_button[idx], newstyle); + +- /* +- * Tool tips on button is the file name ++ /* ++ * Tool tips on button is the file name + */ + gtk_tooltips_set_tip(screen.tooltips, screen.layer_button[idx], +- filename, NULL); ++ filename, NULL); + + return 0; + } /* open_image */ +@@ -1751,7 +1751,7 @@ + gdk_window_set_cursor(gtk_widget_get_parent_window(widget), + cursor); + gdk_cursor_destroy(cursor); +- ++ + } + break; + case 2 : +@@ -1807,7 +1807,7 @@ + case GDK_SCROLL_DOWN: + data.z_dir = ZOOM_OUT_CMOUSE; + break; +- case GDK_SCROLL_LEFT: ++ case GDK_SCROLL_LEFT: + /* Ignore */ + return TRUE; + case GDK_SCROLL_RIGHT: +@@ -1867,7 +1867,7 @@ + gdk_cursor_destroy(cursor); + break; + case GDK_Alt_L: +- case GDK_Alt_R: ++ case GDK_Alt_R: + screen.state = ALT_PRESSED; + screen.selected_layer = -1; + break; +@@ -1891,17 +1891,17 @@ + case ALT_PRESSED: + if ((event->keyval >= GDK_KP_0) && + (event->keyval <= GDK_KP_9)) { +- if (screen.selected_layer == -1) ++ if (screen.selected_layer == -1) + screen.selected_layer = event->keyval - GDK_KP_0; + else +- screen.selected_layer = 10 * screen.selected_layer + ++ screen.selected_layer = 10 * screen.selected_layer + + (event->keyval - GDK_KP_0); + } + break; + default: + break; + } +- ++ + /* Escape may be used to abort outline zoom and just plain repaint */ + if (event->keyval == GDK_Escape) { + GdkRectangle update_rect; +@@ -1964,7 +1964,7 @@ + int x, y; + GdkModifierType state; + GdkRectangle update_rect; +- ++ + if (event->is_hint) + gdk_window_get_pointer (event->window, &x, &y, &state); + else { +@@ -1972,7 +1972,7 @@ + y = event->y; + state = event->state; + } +- ++ + if (screen.pixmap != NULL) { + double X, Y; + +@@ -2044,7 +2044,7 @@ + break; + } + } +- ++ + return TRUE; + } /* motion_notify_event */ + +@@ -2067,10 +2067,10 @@ + + gdk_gc_set_foreground(gc, screen.background); + +- gdk_draw_rectangle(new_pixmap, gc, TRUE, ++ gdk_draw_rectangle(new_pixmap, gc, TRUE, + event->area.x, event->area.y, + event->area.width, event->area.height); +- ++ + /* + * Copy gerber pixmap onto background if we have one to copy. + * Do translation at the same time. +@@ -2078,9 +2078,9 @@ + if (screen.pixmap != NULL) { + gdk_draw_pixmap(new_pixmap, + widget->style->fg_gc[GTK_WIDGET_STATE (widget)], +- screen.pixmap, +- event->area.x + screen.off_x, +- event->area.y + screen.off_y, ++ screen.pixmap, ++ event->area.x + screen.off_x, ++ event->area.y + screen.off_y, + event->area.x, event->area.y, + event->area.width, event->area.height); + } +@@ -2101,7 +2101,7 @@ + dx = screen.gerber_bbox.x2-screen.gerber_bbox.x1; + dy = screen.gerber_bbox.y2-screen.gerber_bbox.y1; + gdk_gc_set_foreground(gc, screen.dist_measure_color); +- gdk_draw_rectangle(widget->window, gc, FALSE, ++ gdk_draw_rectangle(widget->window, gc, FALSE, + (screen.gerber_bbox.x1-1.1)*screen.scale - screen.trans_x, + ((screen.gerber_bbox.y1-0.6)*screen.scale - screen.trans_y), + dx*screen.scale, +@@ -2274,7 +2274,7 @@ + } /* draw_measure_distance */ + + +-static void ++static void + update_statusbar(gerbv_screen_t *scr) + { + char str[MAX_STATUSMSGLEN+1]; +@@ -2296,7 +2296,7 @@ + gtk_widget_show(screen.win.scale); + gtk_grab_add(screen.win.scale); + } /* menu_ask_zoom */ +- ++ + + static GtkWidget * + create_ZoomFactorWindow(void) +@@ -2308,21 +2308,21 @@ + GtkWidget *zoom_cancel_button; + GtkWidget *zoom_ok_button; + GtkWidget *zoomwindowlabel; +- ++ + ZoomFactorWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_object_set_data (GTK_OBJECT (ZoomFactorWindow), "ZoomFactorWindow", + ZoomFactorWindow); + gtk_window_set_title (GTK_WINDOW (ZoomFactorWindow), "Set Scale"); + /* XXX Hardcoded window size values */ + gtk_window_set_default_size(GTK_WINDOW(ZoomFactorWindow), 180, 50); +- ++ + table2 = gtk_table_new (2, 2, FALSE); + gtk_widget_ref (table2); + gtk_object_set_data_full (GTK_OBJECT (ZoomFactorWindow), "table2", table2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (table2); + gtk_container_add (GTK_CONTAINER (ZoomFactorWindow), table2); +- ++ + zoom_spinbutton1_adj = gtk_adjustment_new (1, 1, 65535, 1, 10, 10); + zoom_spinbutton1 = + gtk_spin_button_new (GTK_ADJUSTMENT (zoom_spinbutton1_adj), 1, 0); +@@ -2462,7 +2462,7 @@ + snprintf(win_title, len, "%s%s: %s", WIN_TITLE, VERSION, filename); + gtk_window_set_title(GTK_WINDOW(win), win_title); + free(win_title); +- ++ + } + + #ifdef HAVE_GETOPT_LONG +@@ -2518,9 +2518,9 @@ + screen.execpath = dirname(argv[0]); + + setup_init(); +- ++ + #ifdef HAVE_GETOPT_LONG +- while ((read_opt = getopt_long(argc, argv, opt_options, ++ while ((read_opt = getopt_long(argc, argv, opt_options, + longopts, &longopt_idx)) != -1) { + #else + while ((read_opt = getopt(argc, argv, opt_options)) != -1) { +@@ -2615,13 +2615,13 @@ + printf("Not handled option [%d=%c]\n", read_opt, read_opt); + } + } +- ++ + /* + * Init GTK+ + */ + gtk_init(&argc, &argv); + +- /* ++ /* + * Good defaults according to Ales. Gives aspect ratio of 1.3333... + */ + if ((req_width != -1) && (req_height != -1)) { +@@ -2636,7 +2636,7 @@ + /* + * Setup some GTK+ defaults + */ +- screen.tooltips = gtk_tooltips_new(); ++ screen.tooltips = gtk_tooltips_new(); + screen.background = alloc_color(0, 0, 0, "black"); + screen.zoom_outline_color = alloc_color(0, 0, 0, "gray"); + screen.dist_measure_color = alloc_color(0, 0, 0, "lightblue"); +@@ -2645,45 +2645,45 @@ + * Set console error log handler. The default gives us error levels in + * in the beginning which I don't want. + */ +- g_log_set_handler (NULL, +- G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION | G_LOG_LEVEL_MASK, +- gerbv_console_log_handler, NULL); ++ g_log_set_handler (NULL, ++ G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION | G_LOG_LEVEL_MASK, ++ gerbv_console_log_handler, NULL); + + /* Set default unit to the configured default */ + screen.unit = GERBV_DEFAULT_UNIT; + + /* +- * Main window ++ * Main window + */ + main_win = gtk_window_new(GTK_WINDOW_TOPLEVEL); + rename_main_window("", main_win); + g_signal_connect(GTK_OBJECT(main_win), "delete_event", G_CALLBACK(destroy), NULL); + +- /* ++ /* + * vbox contains menubar and hbox + */ + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_add(GTK_CONTAINER(main_win), vbox); +- ++ + create_menubar(main_win, &menubar); + gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0); +- +- /* ++ ++ /* + * hbox contains drawing area and image select area + */ + hbox = gtk_hbox_new(FALSE, 0); +- ++ + /* + * Create drawing area + */ + screen.drawing_area = create_drawing_area(width, height); + gtk_box_pack_start(GTK_BOX(hbox), screen.drawing_area, TRUE, TRUE, 0); +- ++ + /* + * Build layer buttons with popup menus + */ + create_popupmenu(&screen.popup_menu); +- gtk_box_pack_start(GTK_BOX(hbox), create_layer_buttons(MAX_FILES), ++ gtk_box_pack_start(GTK_BOX(hbox), create_layer_buttons(MAX_FILES), + FALSE, FALSE, 0); + + gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0); +@@ -2713,7 +2713,7 @@ + project_list_t *project_list; + + project_list = read_project_file(project_filename); +- ++ + if (project_list) { + load_project(project_list); + if (screen.project) { +@@ -2736,7 +2736,7 @@ + strcpy(screen.path, project_filename); + dirname(screen.path); + screen.path = strncat(screen.path, "/", 1); +- ++ + rename_main_window(screen.project, NULL); + } else { + GERB_MESSAGE("Failed to load project\n"); +@@ -2751,13 +2751,13 @@ + /* + * Set gtk error log handler + */ +- g_log_set_handler (NULL, +- G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION | G_LOG_LEVEL_MASK, +- gerbv_gtk_log_handler, NULL); ++ g_log_set_handler (NULL, ++ G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION | G_LOG_LEVEL_MASK, ++ gerbv_gtk_log_handler, NULL); + + /* +- * Connect all events on drawing area +- */ ++ * Connect all events on drawing area ++ */ + gtk_signal_connect(GTK_OBJECT(screen.drawing_area), "expose_event", + GTK_SIGNAL_FUNC(expose_event), NULL); + gtk_signal_connect(GTK_OBJECT(screen.drawing_area),"configure_event", +@@ -2798,6 +2798,6 @@ + TRUE); + + gtk_main(); +- ++ + return 0; + } /* main */ diff --git a/gerbv.spec b/gerbv.spec index 9898a25..2d53158 100644 --- a/gerbv.spec +++ b/gerbv.spec @@ -1,10 +1,10 @@ Name: gerbv -Version: 1.0.2 -Release: 2%{?dist} +Version: 1.0.3 +Release: 1%{?dist} Summary: Gerber file viewer from the gEDA toolkit Group: Applications/Engineering -License: GPL +License: GPLv2 URL: http://gerbv.sourceforge.net/ Source: http://downloads.sourceforge.net/gerbv/%{name}-%{version}.tar.gz @@ -25,6 +25,7 @@ gerbv also supports drill files. The format supported are known under names as NC-drill or Excellon. The format is a bit undefined and different EDA-vendors implement it different. +gerbv is listed among Fedora Electronic Lab (FEL) packages. %prep %setup -q @@ -55,6 +56,7 @@ and different EDA-vendors implement it different. desktop-file-install --vendor fedora \ + --remove-category Education \ --add-category Engineering \ --add-category Science \ --dir %{buildroot}%{_datadir}/applications \ @@ -119,6 +121,12 @@ touch --no-create %{_datadir}/icons/hicolor || : %Changelog +* Tue Dec 04 2007 Chitlesh Goorah - 1.0.3-1 +- new upstream release + +* Thu Aug 23 2007 Chitlesh Goorah - 1.0.2-3 +- mass rebuild for fedora 8 - ppc + * Thu Jun 28 2007 Chitlesh Goorah - 1.0.2-2 - remove gdk-pixbuf-devel as BR diff --git a/sources b/sources index 7b8dea5..188d6c3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2d5dccd9a060e92916bb7a41ef5433e6 gerbv-1.0.2.tar.gz +dc7f2c362c7e9e406133ed0a60bb17b9 gerbv-1.0.3.tar.gz