作図ソフト dia の改良版
Révision | 1c1578451633285dafd06dfb2204e6f287e8b5ff (tree) |
---|---|
l'heure | 2013-05-04 18:43:23 |
Auteur | Hans Breuer <hans@breu...> |
Commiter | Hans Breuer |
[warningectomy] unused variable
Removed superfluous variables where they were pure noise.
Now every unused variable warning should mark some potentially
unfinished stuff, i.e. deserve a closer look.
@@ -268,7 +268,6 @@ received_clipboard_image_handler(GtkClipboard *clipboard, | ||
268 | 268 | } |
269 | 269 | |
270 | 270 | if (!change) { |
271 | - gint x, y; | |
272 | 271 | Point pt; |
273 | 272 | DiaObjectType *type; |
274 | 273 | Handle *handle1; |
@@ -352,7 +351,6 @@ _targets_receive (GtkClipboard *clipboard, | ||
352 | 351 | gint n_atoms, |
353 | 352 | gpointer data) |
354 | 353 | { |
355 | - GdkAtom try_xml = 0; | |
356 | 354 | gint i; |
357 | 355 | gchar *aname; |
358 | 356 |
@@ -575,8 +575,6 @@ ddisplay_canvas_events (GtkWidget *canvas, | ||
575 | 575 | Point middle; |
576 | 576 | int return_val; |
577 | 577 | int key_handled; |
578 | - int width, height; | |
579 | - int new_size; | |
580 | 578 | int im_context_used; |
581 | 579 | static gboolean moving = FALSE; |
582 | 580 |
@@ -55,7 +55,7 @@ grid_step (DDisplay *ddisp, GtkOrientation orientation, | ||
55 | 55 | real *start, int *ipos, gboolean *is_major) |
56 | 56 | { |
57 | 57 | real length; |
58 | - real pos, tmp; | |
58 | + real pos; | |
59 | 59 | guint major_lines = ddisp->diagram->grid.major_lines; |
60 | 60 | int x, y; |
61 | 61 | int major_count = 1; |
@@ -188,7 +188,6 @@ filter_connected (const GList *objects, GList **connected, GList **unconnected) | ||
188 | 188 | |
189 | 189 | for (list = objects; list != NULL; list = g_list_next (list)) { |
190 | 190 | DiaObject *obj = list->data; |
191 | - Handle *handle; | |
192 | 191 | gboolean is_connected = FALSE; |
193 | 192 | int i; |
194 | 193 |
@@ -100,7 +100,6 @@ dia_gdk_interactive_renderer_class_init(DiaGdkInteractiveRendererClass *klass) | ||
100 | 100 | static void |
101 | 101 | dia_gdk_interactive_renderer_init(DiaGdkInteractiveRenderer *object) |
102 | 102 | { |
103 | - DiaGdkInteractiveRenderer *ia_renderer = DIA_GDK_INTERACTIVE_RENDERER (object); | |
104 | 103 | DiaGdkRenderer *renderer = DIA_GDK_RENDERER(object); |
105 | 104 | DiaRenderer *dia_renderer = DIA_RENDERER(object); |
106 | 105 |
@@ -115,7 +114,6 @@ DiaRenderer * | ||
115 | 114 | new_gdk_renderer(DDisplay *ddisp) |
116 | 115 | { |
117 | 116 | DiaGdkRenderer *renderer; |
118 | - GType renderer_type = 0; | |
119 | 117 | |
120 | 118 | renderer = g_object_new (DIA_TYPE_GDK_INTERACTIVE_RENDERER, NULL); |
121 | 119 | renderer->transform = dia_transform_new (&ddisp->visible, &ddisp->zoom_factor); |
@@ -185,7 +185,6 @@ GtkWidget* | ||
185 | 185 | create_sheets_edit_dialog (void) |
186 | 186 | { |
187 | 187 | GtkWidget *sheets_edit_dialog; |
188 | - GtkWidget *pixmap_object; | |
189 | 188 | GtkBuilder *builder; |
190 | 189 | |
191 | 190 | builder = builder_new_from_file ("ui/sheets-edit-dialog.xml"); |
@@ -218,7 +217,6 @@ GtkWidget* | ||
218 | 217 | create_sheets_remove_dialog (void) |
219 | 218 | { |
220 | 219 | GtkWidget *sheets_remove_dialog; |
221 | - GtkWidget *pixmap_object; | |
222 | 220 | GtkBuilder *builder; |
223 | 221 | |
224 | 222 | builder = builder_new_from_file ("ui/sheets-remove-dialog.xml"); |
@@ -680,7 +680,6 @@ void | ||
680 | 680 | on_sheets_dialog_button_new_clicked (GtkButton *button, |
681 | 681 | gpointer user_data) |
682 | 682 | { |
683 | - GtkWidget *combo; | |
684 | 683 | GtkWidget *wrapbox; |
685 | 684 | GList *button_list; |
686 | 685 | GtkWidget *active_button; |
@@ -100,7 +100,6 @@ textedit_button_release(TexteditTool *tool, GdkEventButton *event, | ||
100 | 100 | DDisplay *ddisp) |
101 | 101 | { |
102 | 102 | Point clickedpoint; |
103 | - Diagram *diagram = ddisp->diagram; | |
104 | 103 | DiaObject *obj = click_select_object (ddisp, &clickedpoint, event); |
105 | 104 | |
106 | 105 | if (obj) { |
@@ -125,7 +125,7 @@ _get_current_path (DiaPathRenderer *self, | ||
125 | 125 | /*! |
126 | 126 | * \brief Starting a new rendering run |
127 | 127 | * Could be used to clean the path leftovers from a previous run. |
128 | - * Typical export tenderers flush here. | |
128 | + * Typical export renderers flush here. | |
129 | 129 | */ |
130 | 130 | static void |
131 | 131 | begin_render (DiaRenderer *self, const Rectangle *update) |
@@ -138,7 +138,6 @@ begin_render (DiaRenderer *self, const Rectangle *update) | ||
138 | 138 | static void |
139 | 139 | end_render(DiaRenderer *self) |
140 | 140 | { |
141 | - DiaPathRenderer *renderer = DIA_PATH_RENDERER (self); | |
142 | 141 | } |
143 | 142 | static void |
144 | 143 | set_linewidth(DiaRenderer *self, real linewidth) |
@@ -678,7 +677,6 @@ create_standard_path_from_object (DiaObject *obj) | ||
678 | 677 | } else { |
679 | 678 | /* create a group of pathes */ |
680 | 679 | GList *list = NULL; |
681 | - GArray *points; | |
682 | 680 | gsize i; |
683 | 681 | |
684 | 682 | for (i = 0; i < pr->pathes->len; ++i) { |
@@ -90,7 +90,6 @@ arrayprop_load(ArrayProperty *prop, AttributeNode attr, DataNode data, DiaContex | ||
90 | 90 | { |
91 | 91 | const PropDescCommonArrayExtra *extra = prop->common.descr->extra_data; |
92 | 92 | DataNode composite; |
93 | - GError *err = NULL; | |
94 | 93 | |
95 | 94 | arrayprop_freerecords(prop); |
96 | 95 | g_ptr_array_set_size(prop->records,0); |
@@ -350,8 +350,7 @@ _arrayprop_get_widget (ArrayProperty *prop, PropDialog *dialog) | ||
350 | 350 | { |
351 | 351 | GtkTreeStore *model; |
352 | 352 | GtkWidget *view; |
353 | - int idx, i, cols, rows; | |
354 | - const PropDescCommonArrayExtra *extra = prop->common.descr->extra_data; | |
353 | + int idx, i, cols; | |
355 | 354 | |
356 | 355 | /* create */ |
357 | 356 | cols = prop->ex_props->len; |
@@ -333,7 +333,6 @@ void | ||
333 | 333 | object_load_props(DiaObject *obj, ObjectNode obj_node, DiaContext *ctx) |
334 | 334 | { |
335 | 335 | GPtrArray *props; |
336 | - GError *err = NULL; | |
337 | 336 | |
338 | 337 | g_return_if_fail(obj != NULL); |
339 | 338 | g_return_if_fail(obj_node != NULL); |
@@ -392,8 +392,6 @@ stdpath_update_data (StdPath *stdpath) | ||
392 | 392 | static void |
393 | 393 | stdpath_draw(StdPath *stdpath, DiaRenderer *renderer) |
394 | 394 | { |
395 | - DiaObject *obj = &stdpath->object; | |
396 | - | |
397 | 395 | DIA_RENDERER_GET_CLASS (renderer)->set_linewidth (renderer, stdpath->line_width); |
398 | 396 | DIA_RENDERER_GET_CLASS (renderer)->set_linestyle (renderer, stdpath->line_style); |
399 | 397 | DIA_RENDERER_GET_CLASS (renderer)->set_linejoin(renderer, stdpath->line_join); |
@@ -188,7 +188,6 @@ actor_distance_from(Actor *actor, Point *point) | ||
188 | 188 | { |
189 | 189 | Element *elem = &actor->element; |
190 | 190 | Point c; |
191 | - real dist, rad; | |
192 | 191 | |
193 | 192 | c.x = elem->corner.x + elem->width / 2; |
194 | 193 | c.y = elem->corner.y + elem->height/ 2; |
@@ -242,7 +242,6 @@ ellipse_distance_from(Ellipse *ellipse, Point *point) | ||
242 | 242 | { |
243 | 243 | Element *elem = &ellipse->element; |
244 | 244 | Point c; |
245 | - real dist, rad; | |
246 | 245 | |
247 | 246 | c.x = elem->corner.x + elem->width / 2; |
248 | 247 | c.y = elem->corner.y + elem->height/ 2; |
@@ -327,7 +327,6 @@ point_projection_is_between (const Point *c, | ||
327 | 327 | const Point *b) |
328 | 328 | { |
329 | 329 | real len = distance_point_point (a, b); |
330 | - real r; | |
331 | 330 | |
332 | 331 | if (len > 0) { |
333 | 332 | real r = ((a->y - c->y) * (a->y - b->y) - (a->x - c->x) * (b->x - a->x)) / (len * len); |
@@ -535,12 +534,12 @@ calculate_arc_object_edge(Arc *arc, real ang_start, real ang_end, DiaObject *obj | ||
535 | 534 | mid2 = get_middle_arc_angle(ang_start, ang_end, clockwiseness); |
536 | 535 | mid3 = ang_end; |
537 | 536 | |
538 | - TRACE(printf("Find middle angle between %fー and %fー\n",ang_start,ang_end)); | |
537 | + TRACE(printf("Find middle angle between %fツー and %fツー\n",ang_start,ang_end)); | |
539 | 538 | /* If the other end is inside the object */ |
540 | 539 | arc_get_point_at_angle(arc,target,mid1); |
541 | 540 | dist = obj->ops->distance_from(obj, target ); |
542 | 541 | if (dist < 0.001){ |
543 | - TRACE(printf("Point at %fー: %f,%f is very close to object: %f, returning it\n",mid1, target->x, target->y, dist)); | |
542 | + TRACE(printf("Point at %fツー: %f,%f is very close to object: %f, returning it\n",mid1, target->x, target->y, dist)); | |
544 | 543 | return ; |
545 | 544 | } |
546 | 545 | do { |
@@ -564,7 +563,7 @@ calculate_arc_object_edge(Arc *arc, real ang_start, real ang_end, DiaObject *obj | ||
564 | 563 | #ifdef TRACE_DIST |
565 | 564 | for (j = 0; j < i; j++) { |
566 | 565 | arc_get_point_at_angle(arc,target,trace[j]); |
567 | - printf("%d: %f ー : %f,%f :%f\n", j, trace[j],target->x,target->y, disttrace[j]); | |
566 | + printf("%d: %fツー : %f,%f :%f\n", j, trace[j],target->x,target->y, disttrace[j]); | |
568 | 567 | } |
569 | 568 | #endif |
570 | 569 | arc_get_point_at_angle(arc,target,mid2); |
@@ -588,7 +587,7 @@ arc_draw(Arc *arc, DiaRenderer *renderer) | ||
588 | 587 | start_cp = arc->connection.endpoint_handles[0].connected_to; |
589 | 588 | end_cp = arc->connection.endpoint_handles[1].connected_to; |
590 | 589 | |
591 | - TRACE(printf("drawing arc:\n start:%f ー:%f,%f \tend:%f ー:%f,%f\n",arc->angle1,endpoints[0].x,endpoints[0].y, arc->angle2,endpoints[1].x,endpoints[1].y)); | |
590 | + TRACE(printf("drawing arc:\n start:%fツー:%f,%f \tend:%fツー:%f,%f\n",arc->angle1,endpoints[0].x,endpoints[0].y, arc->angle2,endpoints[1].x,endpoints[1].y)); | |
592 | 591 | |
593 | 592 | if (connpoint_is_autogap(start_cp)) { |
594 | 593 | TRACE(printf("computing start intersection\ncurve_distance: %f\n",arc->curve_distance)); |
@@ -396,7 +396,6 @@ zigzagline_delete_segment_callback(DiaObject *obj, Point *clicked, gpointer data | ||
396 | 396 | static ObjectChange * |
397 | 397 | _convert_to_bezierline_callback (DiaObject *obj, Point *clicked, gpointer data) |
398 | 398 | { |
399 | - DiaObject *poly; | |
400 | 399 | Zigzagline *zigzagline = (Zigzagline *)obj; |
401 | 400 | OrthConn *orth = &zigzagline->orth; |
402 | 401 | BezPoint *bp; |
@@ -153,7 +153,9 @@ cairo_interactive_renderer_init (DiaCairoInteractiveRenderer *object, void *p) | ||
153 | 153 | static void |
154 | 154 | cairo_interactive_renderer_finalize (GObject *object) |
155 | 155 | { |
156 | +#if !DIA_CAIRO_WITH_PIXMAP | |
156 | 157 | DiaCairoInteractiveRenderer *renderer = DIA_CAIRO_INTERACTIVE_RENDERER (object); |
158 | +#endif | |
157 | 159 | DiaCairoRenderer *base_renderer = DIA_CAIRO_RENDERER (object); |
158 | 160 | |
159 | 161 | if (base_renderer->cr) |
@@ -474,7 +476,6 @@ set_size(DiaRenderer *object, gpointer window, | ||
474 | 476 | { |
475 | 477 | DiaCairoInteractiveRenderer *renderer = DIA_CAIRO_INTERACTIVE_RENDERER (object); |
476 | 478 | DiaCairoRenderer *base_renderer = DIA_CAIRO_RENDERER (object); |
477 | - cairo_rectangle_t extents; | |
478 | 479 | |
479 | 480 | renderer->width = width; |
480 | 481 | renderer->height = height; |
@@ -482,7 +483,9 @@ set_size(DiaRenderer *object, gpointer window, | ||
482 | 483 | if (renderer->pixmap != NULL) |
483 | 484 | g_object_unref(renderer->pixmap); |
484 | 485 | |
485 | - /* TODO: we can probably get rid of this extra pixmap and just draw directly to what gdk_cairo_create() gives us for the window */ | |
486 | + /* TODO: we can probably get rid of this extra pixmap and just draw directly | |
487 | + * to what gdk_cairo_create() gives us for the window | |
488 | + */ | |
486 | 489 | renderer->pixmap = gdk_pixmap_new(GDK_WINDOW(window), width, height, -1); |
487 | 490 | #else |
488 | 491 | # if GTK_CHECK_VERSION(2,22,0) |
@@ -490,11 +493,15 @@ set_size(DiaRenderer *object, gpointer window, | ||
490 | 493 | CAIRO_CONTENT_COLOR, |
491 | 494 | width, height); |
492 | 495 | # else |
493 | - extents.x = 0; | |
494 | - extents.y = 0; | |
495 | - extents.width = width; | |
496 | - extents.height = height; | |
497 | - renderer->pixmap = cairo_recording_surface_create(CAIRO_CONTENT_COLOR_ALPHA, &extents); | |
496 | + { | |
497 | + cairo_rectangle_t extents; | |
498 | + | |
499 | + extents.x = 0; | |
500 | + extents.y = 0; | |
501 | + extents.width = width; | |
502 | + extents.height = height; | |
503 | + renderer->pixmap = cairo_recording_surface_create(CAIRO_CONTENT_COLOR_ALPHA, &extents); | |
504 | + } | |
498 | 505 | # endif |
499 | 506 | #endif |
500 | 507 |
@@ -388,7 +388,6 @@ set_dashlength(DiaRenderer *self, real length) | ||
388 | 388 | static void |
389 | 389 | set_fillstyle(DiaRenderer *self, FillStyle mode) |
390 | 390 | { |
391 | - DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self); | |
392 | 391 | DIAG_NOTE(g_message("set_fillstyle %d", mode)); |
393 | 392 | |
394 | 393 | switch(mode) { |
@@ -266,8 +266,6 @@ set_dashlength(DiaRenderer *self, real length) | ||
266 | 266 | static void |
267 | 267 | set_fillstyle(DiaRenderer *self, FillStyle mode) |
268 | 268 | { |
269 | - DiaPsRenderer *renderer = DIA_PS_RENDERER(self); | |
270 | - | |
271 | 269 | switch(mode) { |
272 | 270 | case FILLSTYLE_SOLID: |
273 | 271 | break; |
@@ -228,7 +228,6 @@ static DiaSvgRenderer * | ||
228 | 228 | new_svg_renderer(DiagramData *data, const char *filename) |
229 | 229 | { |
230 | 230 | DiaSvgRenderer *renderer; |
231 | - FILE *file; | |
232 | 231 | gchar buf[512]; |
233 | 232 | Rectangle *extent; |
234 | 233 | xmlDtdPtr dtd; |
@@ -610,7 +610,6 @@ vdx_simple_properties(DiaObject *obj, | ||
610 | 610 | const VDXDocument* theDoc, DiaContext *ctx) |
611 | 611 | { |
612 | 612 | GPtrArray *props = g_ptr_array_new (); |
613 | - unsigned int debug_id; | |
614 | 613 | |
615 | 614 | if (Line) |
616 | 615 | { |