Hello All,
the attached patch adds a new arrow type,
found often in CAD drawings. A line with
the new arrow type at both looks like this:
|/ |/
-+-------------+-
/| /|
Steffen
-diff -Naur ./app/lineprops_area.c ../dia-0.83-patch/app/lineprops_area.c
---- ./app/lineprops_area.c Mon Oct 11 02:34:51 1999
-+++ ../dia-0.83-patch/app/lineprops_area.c Thu Jan 20 23:44:48 2000
-@@ -241,6 +241,18 @@
- gdk_draw_line(win, gc, x+width-5,y+height/2, x+width-5-height/2,y+height-5);
- }
- break;
-+ case ARROW_SLASHED_CROSS:
-+ if (arrow->left) {
-+ gdk_draw_line(win, gc, x+5,y+height/2, x+width,y+height/2); /*line*/
-+ gdk_draw_line(win, gc, x+5,y+height-5, x+height-5,y+5); /*slash*/
-+ gdk_draw_line(win, gc, x+height/2,y+height-5, x+height/2,y+5); /*cross*/
-+ } else {
-+ gdk_draw_line(win, gc, x,y+height/2, x+width-5,y+height/2); /*line*/
-+ gdk_draw_line(win, gc, x+width-height/2-5,y+height-5, x+width-5,y+5);
/*slash*/
-+ gdk_draw_line(win, gc, x+width-height/2,y+height-5, x+width-height/2,y+5);
/*cross*/
-+ }
-+ break;
-+
- }
- gdk_gc_set_line_attributes(gc, gcvalues.line_width, gcvalues.line_style,
- gcvalues.cap_style, gcvalues.join_style);
-@@ -538,7 +550,7 @@
- menu = gtk_menu_new();
- gtk_object_set_data_full(GTK_OBJECT(chooser), button_menu_key, menu,
- (GtkDestroyNotify)gtk_widget_unref);
-- for (i = 0; i <= ARROW_HALF_HEAD; i++) {
-+ for (i = 0; i <= ARROW_SLASHED_CROSS; i++) {
- mi = gtk_menu_item_new();
- gtk_object_set_data(GTK_OBJECT(mi), menuitem_enum_key, GINT_TO_POINTER(i));
- ar = dia_arrow_preview_new(i, left);
-@@ -809,4 +821,8 @@
- lchooser->user_data);
- }
- }
-+
-+
-+
-+
-
-diff -Naur ./lib/arrows.c ../dia-0.83-patch/lib/arrows.c
---- ./lib/arrows.c Thu Jun 3 12:09:50 1999
-+++ ../dia-0.83-patch/lib/arrows.c Thu Jan 20 23:44:27 2000
-@@ -193,6 +193,76 @@
- renderer->ops->fill_polygon(renderer, poly, 4, color);
- }
-
-+static void
-+calculate_slashed_cross(Point *poly/*[6]*/, Point *to, Point *from,
-+ real length, real width)
-+{
-+ Point delta;
-+ Point orth_delta;
-+ real len;
-+ int i;
-+
-+ delta = *to;
-+ point_sub(&delta, from);
-+ len = sqrt(point_dot(&delta, &delta));
-+ if (len <= 0.0001) {
-+ delta.x=1.0;
-+ delta.y=0.0;
-+ } else {
-+ delta.x/=len;
-+ delta.y/=len;
-+ }
-+
-+ orth_delta.x = delta.y;
-+ orth_delta.y = -delta.x;
-+
-+ point_scale(&delta, length/2.0);
-+ point_scale(&orth_delta, width/2.0);
-+
-+ for(i=0; i<6;i++)poly[i] = *to;
-+
-+ point_add(&poly[1], &delta);
-+
-+ point_add(&poly[2], &delta);
-+ point_add(&poly[2], &orth_delta);
-+
-+ point_sub(&poly[3], &delta);
-+ point_sub(&poly[3], &orth_delta);
-+
-+ point_add(&poly[4], &orth_delta);
-+ point_sub(&poly[5], &orth_delta);
-+
-+/* point_sub(&poly[1], &delta);
-+ point_sub(&poly[1], &orth_delta);
-+ poly[2] = *to;
-+ point_sub(&poly[2], &delta);
-+ point_sub(&poly[2], &delta);
-+ poly[3] = *to;
-+ point_sub(&poly[3], &delta);
-+ point_add(&poly[3], &orth_delta);*/
-+}
-+
-+static void
-+draw_slashed_cross(Renderer *renderer, Point *to, Point *from,
-+ real length, real width, real linewidth, Color *color)
-+{
-+ Point poly[6];
-+
-+ calculate_slashed_cross(poly, to, from, length, width);
-+
-+ renderer->ops->set_linewidth(renderer, linewidth);
-+ renderer->ops->set_linestyle(renderer, LINESTYLE_SOLID);
-+ renderer->ops->set_linejoin(renderer, LINEJOIN_MITER);
-+ renderer->ops->set_linecaps(renderer, LINECAPS_BUTT);
-+
-+// point_sub(&poly[2], &poly[0]);
-+ // point_add(&poly[2], &poly[1]);
-+
-+ renderer->ops->draw_line(renderer, &poly[0],&poly[1], color);
-+ renderer->ops->draw_line(renderer, &poly[2],&poly[3], color);
-+ renderer->ops->draw_line(renderer, &poly[4],&poly[5], color);
-+}
-+
- void
- arrow_draw(Renderer *renderer, ArrowType type,
- Point *to, Point *from,
-@@ -222,7 +292,13 @@
- case ARROW_FILLED_DIAMOND:
- fill_diamond(renderer, to, from, length, width, fg_color);
- break;
-+ case ARROW_SLASHED_CROSS:
-+ draw_slashed_cross(renderer, to, from, length, width, linewidth, fg_color);
-+ break;
- }
-
- }
-+
-+
-+
-
-diff -Naur ./lib/arrows.h ../dia-0.83-patch/lib/arrows.h
---- ./lib/arrows.h Thu Jun 3 12:09:50 1999
-+++ ../dia-0.83-patch/lib/arrows.h Thu Jan 20 23:45:15 2000
-@@ -31,7 +31,8 @@
- ARROW_FILLED_TRIANGLE,
- ARROW_HOLLOW_DIAMOND,
- ARROW_FILLED_DIAMOND,
-- ARROW_HALF_HEAD
-+ ARROW_HALF_HEAD,
-+ ARROW_SLASHED_CROSS
- } ArrowType;
-
- typedef struct {
-diff -Naur ./lib/widgets.c ../dia-0.83-patch/lib/widgets.c
---- ./lib/widgets.c Wed Oct 20 03:50:36 1999
-+++ ../dia-0.83-patch/lib/widgets.c Thu Jan 20 23:46:02 2000
-@@ -693,6 +693,12 @@
- gtk_menu_append (GTK_MENU (menu), menuitem);
- gtk_widget_show (menuitem);
-
-+ menuitem = gtk_radio_menu_item_new_with_label (group, _("Slashed Cross"));
-+ gtk_object_set_user_data(GTK_OBJECT(menuitem),
GINT_TO_POINTER(ARROW_SLASHED_CROSS));
-+ group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menuitem));
-+ gtk_menu_append (GTK_MENU (menu), menuitem);
-+ gtk_widget_show (menuitem);
-+
- gtk_menu_set_active(GTK_MENU (menu), DEFAULT_ARROW);
- gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
- gtk_signal_connect_object(GTK_OBJECT(menu), "selection-done",
-@@ -911,4 +917,6 @@
- {
- return gtk_entry_get_text(GTK_ENTRY(fs->entry));
- }
-+
-+
-
diff -Naur ./po/cat-id-tbl.c ../dia-0.83-patch/po/cat-id-tbl.c
--- ./po/cat-id-tbl.c Fri Dec 24 11:18:09 1999
+++ ../dia-0.83-patch/po/cat-id-tbl.c Thu Jan 20 23:46:47 2000
@@ -284,178 +284,179 @@
{"Hollow Diamond", 237},
{"Filled Diamond", 238},
{"Half Head", 239},
- {"Length: ", 240},
- {"Width: ", 241},
- {"Select image file", 242},
- {"Browse", 243},
- {"Actor", 244},
- {"Add segment", 245},
- {"Delete segment", 246},
- {"Name:", 247},
- {"Direction:", 248},
- {"Side A", 249},
- {"Side B", 250},
- {"Role:", 251},
- {"Multiplicity:", 252},
- {"Show arrow", 253},
- {"Aggregate", 254},
- {"Composition", 255},
- {"Class", 256},
- {"Class name:", 257},
- {"Stereotype:", 258},
- {"Abstract", 259},
- {"Attributes visible", 260},
- {"Suppress Attributes", 261},
- {"Operations visible", 262},
- {"Suppress operations", 263},
- {"Attributes", 264},
- {"New", 265},
- {"Delete", 266},
- {"Move up", 267},
- {"Move down", 268},
- {"Attribute data", 269},
- {"Type:", 270},
- {"Value:", 271},
- {"Visibility:", 272},
- {"Public", 273},
- {"Private", 274},
- {"Protected", 275},
- {"Implementation", 276},
- {"Class scope", 277},
- {"Operations", 278},
- {"Operation data", 279},
- {"abstract", 280},
- {"Parameters:", 281},
- {"Parameter data", 282},
- {"Def. value:", 283},
- {"Templates", 284},
- {"Template class", 285},
- {"Formal parameter data", 286},
- {"Constraint:", 287},
- {"Show arrow:", 288},
- {"Interface:", 289},
- {"Text outside:", 290},
- {"Collaboration", 291},
- {"Explicit state:", 292},
- {"Attributes:", 293},
- {"Show attributes", 294},
- {"Active object", 295},
- {"multiple instance", 296},
- {"Show focus of control:", 297},
- {"Show destruction mark:", 298},
- {"Message:", 299},
- {"Message type:", 300},
- {"Call", 301},
- {"Return", 302},
- {"Asynchronous", 303},
- {"Create", 304},
- {"Destroy", 305},
- {"Simple", 306},
- {"Recursive", 307},
- {"Normal", 308},
- {"Begin", 309},
- {"End", 310},
- {"Control", 311},
- {"Boundary", 312},
- {"Entity", 313},
- {"Is an object", 314},
- {"Key", 315},
- {"Weak key", 316},
- {"Derived", 317},
- {"Multivalue", 318},
- {"Border width:", 319},
- {"Foreground color:", 320},
- {"Background color:", 321},
- {"Attribute", 322},
- {"Weak", 323},
- {"Total:", 324},
- {"Left Cardinality:", 325},
- {"Right Cardinality:", 326},
- {"Rotate", 327},
- {"Identifying", 328},
- {"Relationship", 329},
- {"Add Handle", 330},
- {"Delete Handle", 331},
- {"Line width:", 332},
- {"Color:", 333},
- {"Line style:", 334},
- {"Start arrow:", 335},
- {"End arrow:", 336},
- {"Draw background", 337},
- {"Corner rounding:", 338},
- {"Alignment:", 339},
- {"Font:", 340},
- {"Fontsize:", 341},
- {"Image file:", 342},
- {"Keep aspect ratio", 343},
- {"Show border", 344},
- {"Keep aspect ratio:", 345},
- {"Show border:", 346},
+ {"Slashed Cross", 240},
+ {"Length: ", 241},
+ {"Width: ", 242},
+ {"Select image file", 243},
+ {"Browse", 244},
+ {"Actor", 245},
+ {"Add segment", 246},
+ {"Delete segment", 247},
+ {"Name:", 248},
+ {"Direction:", 249},
+ {"Side A", 250},
+ {"Side B", 251},
+ {"Role:", 252},
+ {"Multiplicity:", 253},
+ {"Show arrow", 254},
+ {"Aggregate", 255},
+ {"Composition", 256},
+ {"Class", 257},
+ {"Class name:", 258},
+ {"Stereotype:", 259},
+ {"Abstract", 260},
+ {"Attributes visible", 261},
+ {"Suppress Attributes", 262},
+ {"Operations visible", 263},
+ {"Suppress operations", 264},
+ {"Attributes", 265},
+ {"New", 266},
+ {"Delete", 267},
+ {"Move up", 268},
+ {"Move down", 269},
+ {"Attribute data", 270},
+ {"Type:", 271},
+ {"Value:", 272},
+ {"Visibility:", 273},
+ {"Public", 274},
+ {"Private", 275},
+ {"Protected", 276},
+ {"Implementation", 277},
+ {"Class scope", 278},
+ {"Operations", 279},
+ {"Operation data", 280},
+ {"abstract", 281},
+ {"Parameters:", 282},
+ {"Parameter data", 283},
+ {"Def. value:", 284},
+ {"Templates", 285},
+ {"Template class", 286},
+ {"Formal parameter data", 287},
+ {"Constraint:", 288},
+ {"Show arrow:", 289},
+ {"Interface:", 290},
+ {"Text outside:", 291},
+ {"Collaboration", 292},
+ {"Explicit state:", 293},
+ {"Attributes:", 294},
+ {"Show attributes", 295},
+ {"Active object", 296},
+ {"multiple instance", 297},
+ {"Show focus of control:", 298},
+ {"Show destruction mark:", 299},
+ {"Message:", 300},
+ {"Message type:", 301},
+ {"Call", 302},
+ {"Return", 303},
+ {"Asynchronous", 304},
+ {"Create", 305},
+ {"Destroy", 306},
+ {"Simple", 307},
+ {"Recursive", 308},
+ {"Normal", 309},
+ {"Begin", 310},
+ {"End", 311},
+ {"Control", 312},
+ {"Boundary", 313},
+ {"Entity", 314},
+ {"Is an object", 315},
+ {"Key", 316},
+ {"Weak key", 317},
+ {"Derived", 318},
+ {"Multivalue", 319},
+ {"Border width:", 320},
+ {"Foreground color:", 321},
+ {"Background color:", 322},
+ {"Attribute", 323},
+ {"Weak", 324},
+ {"Total:", 325},
+ {"Left Cardinality:", 326},
+ {"Right Cardinality:", 327},
+ {"Rotate", 328},
+ {"Identifying", 329},
+ {"Relationship", 330},
+ {"Add Handle", 331},
+ {"Delete Handle", 332},
+ {"Line width:", 333},
+ {"Color:", 334},
+ {"Line style:", 335},
+ {"Start arrow:", 336},
+ {"End arrow:", 337},
+ {"Draw background", 338},
+ {"Corner rounding:", 339},
+ {"Alignment:", 340},
+ {"Font:", 341},
+ {"Fontsize:", 342},
+ {"Image file:", 343},
+ {"Keep aspect ratio", 344},
+ {"Show border", 345},
+ {"Keep aspect ratio:", 346},
+ {"Show border:", 347},
{"\
The image file '%s' was not found in that directory.\n\
-Using the file '%s' instead\n", 347},
- {"The image file '%s' was not found.\n", 348},
- {"Add Corner", 349},
- {"Delete Corner", 350},
- {"Flow:", 351},
- {"Flow type:", 352},
- {"Energy", 353},
- {"Material", 354},
- {"Signal", 355},
- {"Orthflow:", 356},
- {"Orthflow type:", 357},
- {"Function:", 358},
- {"Wish function", 359},
- {"User function", 360},
- {"Channel", 361},
- {" Import", 362},
- {" Export", 363},
- {" Transfer", 364},
- {" Transport", 365},
- {" Transmit", 366},
- {" Guide", 367},
- {" Translate", 368},
- {" Rotate", 369},
- {" Allow DOF", 370},
- {"Support", 371},
- {" Stop", 372},
- {" Stabilize", 373},
- {" Secure", 374},
- {" Position", 375},
- {"Connect", 376},
- {" Couple", 377},
- {" Mix", 378},
- {"Branch", 379},
- {" Separate", 380},
- {" Remove", 381},
- {" Refine", 382},
- {" Distribute", 383},
- {" Dissipate", 384},
- {"Provision", 385},
- {" Store", 386},
- {" Supply", 387},
- {" Extract", 388},
- {"Control Magnitude", 389},
- {" Actuate", 390},
- {" Regulate", 391},
- {" Change", 392},
- {" Form", 393},
- {"Convert", 394},
- {" Sense", 395},
- {" Indicate", 396},
- {" Display", 397},
- {" Measure", 398},
- {"Text padding:", 399},
- {"Font size:", 400},
- {"Font color:", 401},
- {"Shear angle:", 402},
- {"A custom with text inside.", 403},
- {"Flip Horizontal", 404},
- {"Flip Vertical", 405},
+Using the file '%s' instead\n", 348},
+ {"The image file '%s' was not found.\n", 349},
+ {"Add Corner", 350},
+ {"Delete Corner", 351},
+ {"Flow:", 352},
+ {"Flow type:", 353},
+ {"Energy", 354},
+ {"Material", 355},
+ {"Signal", 356},
+ {"Orthflow:", 357},
+ {"Orthflow type:", 358},
+ {"Function:", 359},
+ {"Wish function", 360},
+ {"User function", 361},
+ {"Channel", 362},
+ {" Import", 363},
+ {" Export", 364},
+ {" Transfer", 365},
+ {" Transport", 366},
+ {" Transmit", 367},
+ {" Guide", 368},
+ {" Translate", 369},
+ {" Rotate", 370},
+ {" Allow DOF", 371},
+ {"Support", 372},
+ {" Stop", 373},
+ {" Stabilize", 374},
+ {" Secure", 375},
+ {" Position", 376},
+ {"Connect", 377},
+ {" Couple", 378},
+ {" Mix", 379},
+ {"Branch", 380},
+ {" Separate", 381},
+ {" Remove", 382},
+ {" Refine", 383},
+ {" Distribute", 384},
+ {" Dissipate", 385},
+ {"Provision", 386},
+ {" Store", 387},
+ {" Supply", 388},
+ {" Extract", 389},
+ {"Control Magnitude", 390},
+ {" Actuate", 391},
+ {" Regulate", 392},
+ {" Change", 393},
+ {" Form", 394},
+ {"Convert", 395},
+ {" Sense", 396},
+ {" Indicate", 397},
+ {" Display", 398},
+ {" Measure", 399},
+ {"Text padding:", 400},
+ {"Font size:", 401},
+ {"Font color:", 402},
+ {"Shear angle:", 403},
+ {"A custom with text inside.", 404},
+ {"Flip Horizontal", 405},
+ {"Flip Vertical", 406},
{"\
Image row length larger than maximum cell array.\n\
-Image not exported to CGM.", 406},
- {"Computer Graphics Metafile", 407},
+Image not exported to CGM.", 407},
+ {"Computer Graphics Metafile", 408},
};
-int _msg_tbl_length = 407;
+int _msg_tbl_length = 408;