1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
|
/* Classic Ladder Project */
/* Copyright (C) 2001-2006 Marc Le Douarain */
/* http://www.multimania.com/mavati/classicladder */
/* http://www.sourceforge.net/projects/classicladder */
/* October 2002 */
/* --------------------- */
/* Draw sequential pages */
/* --------------------- */
/* This library is free software; you can redistribute it and/or */
/* modify it under the terms of the GNU Lesser General Public */
/* License as published by the Free Software Foundation; either */
/* version 2.1 of the License, or (at your option) any later version. */
/* This library 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 */
/* Lesser General Public License for more details. */
/* You should have received a copy of the GNU Lesser General Public */
/* License along with this library; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <gtk/gtk.h>
#include <stdio.h>
#include <string.h>
#include "classicladder.h"
#include "global.h"
#include "drawing.h"
#include "vars_names.h"
#include "drawing_sequential.h"
#ifdef GTK2
#include <pango/pango.h>
#endif
void DrawSeqStep(GdkPixmap * DrawPixmap,int x,int y,int Size,StrStep * pStep,char DrawingOption)
{
char BufTxt[50];
GdkGC * TheGc;
GdkColor DynaGdkColor;
GdkGC * DynaGcOn;
DynaGdkColor.pixel = 0xFF22FF;
DynaGdkColor.red = 0xFF;
DynaGdkColor.green = 0x22;
DynaGdkColor.blue = 0xFF;
DynaGcOn = gdk_gc_new(DrawPixmap);
gdk_gc_set_foreground(DynaGcOn,&DynaGdkColor);
#ifdef THICK_LINE_ELE_ACTIVATED
gdk_gc_set_line_attributes(DynaGcOn, THICK_LINE_ELE_ACTIVATED,
GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER);
#endif
/* State with color */
TheGc = drawing_area->style->black_gc;
if ( (DrawingOption==DRAW_NORMAL) && (!EditDatas.ModeEdit) && (pStep->Activated) )
TheGc = DynaGcOn;
gdk_draw_rectangle(DrawPixmap, TheGc, FALSE /*filled*/,
x+2, y+2,
Size-4, Size-4);
// init step ?
if ( pStep->InitStep )
{
gdk_draw_rectangle(DrawPixmap, /*TheGc*/drawing_area->style->black_gc, FALSE /*filled*/,
x+5, y+5,
Size-10, Size-10);
}
// step number
sprintf(BufTxt,"%d",pStep->StepNumber);
#ifndef GTK2
gdk_draw_text(DrawPixmap, drawing_area->style->font, drawing_area->style->black_gc,
x+SizeDiv3,y+SizeDiv2+4,BufTxt,strlen(BufTxt));
#else
DrawTextGTK2( DrawPixmap, drawing_area->style->black_gc, x, y, Size, Size, BufTxt );
#endif
gdk_gc_unref(DynaGcOn);
}
void DrawSeqTransition(GdkPixmap * DrawPixmap,int x,int y,int Size,StrTransition * pTransi,char DrawingOption)
{
int SizeDiv2 = Size/2;
int SizeDiv3 = Size/3;
int SizeDiv4 = Size/4;
char BufTxt[50];
GdkGC * DynaGcOff;
GdkGC * TheGc;
GdkColor DynaGdkColor;
GdkGC * DynaGcOn;
int ScanSwitch;
int StepX,StepY;
StrStep * pStep, * pStep2;
int TransiX;
char cNoDirectStepOnTop = FALSE;
char cNoDirectStepOnBottom = FALSE;
StrSequential * Seq = Sequential;
// lifts positions (not used if for print!)
int ShiftX = InfosGene->HScrollValue;
int ShiftY = InfosGene->VScrollValue;
if ( DrawingOption==DRAW_FOR_PRINT )
{
ShiftX = 0;
ShiftY = 0;
}
// if in edit, use datas in edit...
if ( EditDatas.ModeEdit )
Seq = &EditSeqDatas;
DynaGdkColor.pixel = 0xFF22FF;
DynaGdkColor.red = 0xFF;
DynaGdkColor.green = 0x22;
DynaGdkColor.blue = 0xFF;
DynaGcOn = gdk_gc_new(DrawPixmap);
gdk_gc_set_foreground(DynaGcOn,&DynaGdkColor);
#ifdef THICK_LINE_ELE_ACTIVATED
gdk_gc_set_line_attributes(DynaGcOn, THICK_LINE_ELE_ACTIVATED,
GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER);
#endif
DynaGcOff = drawing_area->style->black_gc;
/* State with color */
TheGc = drawing_area->style->black_gc;
if ( (DrawingOption==DRAW_NORMAL) && (!EditDatas.ModeEdit) && (pTransi->Activated) )
TheGc = DynaGcOn;
// direct step on top ?
pStep = &Seq->Step[ pTransi->NumStepToDesactiv[ 0 ] ];
StepX = pStep->PosiX;
StepY = pStep->PosiY;
if ( pTransi->PosiX!=StepX || pTransi->PosiY-1!=StepY )
cNoDirectStepOnTop = TRUE;
// direct step on bottom ?
pStep = &Seq->Step[ pTransi->NumStepToActiv[ 0 ] ];
StepX = pStep->PosiX;
StepY = pStep->PosiY;
if ( pTransi->PosiX!=StepX || pTransi->PosiY+1!=StepY )
cNoDirectStepOnBottom = TRUE;
// |
gdk_draw_line(DrawPixmap, DynaGcOff,
x+SizeDiv2, cNoDirectStepOnTop?y+SizeDiv3:y,
x+SizeDiv2, cNoDirectStepOnBottom?y+Size-SizeDiv3:y+Size+1);
// -
gdk_draw_line(DrawPixmap, TheGc,
x+SizeDiv3, y+SizeDiv2,
x+Size-SizeDiv3, y+SizeDiv2);
// variable for transition
strcpy(BufTxt, CreateVarName( pTransi->VarTypeCondi, pTransi->VarNumCondi ) );
#ifndef GTK2
gdk_draw_text(DrawPixmap, drawing_area->style->font, drawing_area->style->black_gc,
x+3*SizeDiv4,y+SizeDiv2+5,BufTxt,strlen(BufTxt));
#else
DrawTextGTK2( DrawPixmap, drawing_area->style->black_gc, x+3*SizeDiv4, y+1, -1, Size, BufTxt );
#endif
// multiple steps activation ?
for ( ScanSwitch=1; ScanSwitch<NBR_SWITCHS_MAX; ScanSwitch++ )
{
int NumStep;
NumStep = pTransi->NumStepToActiv[ ScanSwitch ];
if ( NumStep!=-1 )
{
StepX = Seq->Step[ NumStep ].PosiX * Size - ShiftX;
// ===
gdk_draw_line(DrawPixmap, DynaGcOff,
x+SizeDiv3, y+Size-SizeDiv4+2, StepX+Size-SizeDiv3, y+Size-SizeDiv4+2);
gdk_draw_line(DrawPixmap, DynaGcOff,
x+SizeDiv3, y+Size-SizeDiv4+4, StepX+Size-SizeDiv3, y+Size-SizeDiv4+4);
gdk_draw_line(DrawPixmap, drawing_area->style->white_gc,
x+SizeDiv3, y+Size-SizeDiv4+3, StepX+Size-SizeDiv3, y+Size-SizeDiv4+3);
// | with the step
gdk_draw_line(DrawPixmap, DynaGcOff,
StepX+SizeDiv2, y+Size-SizeDiv4+4, StepX+SizeDiv2, y+Size+1);
}
}
// multiple steps desactivation ?
for ( ScanSwitch=1; ScanSwitch<NBR_SWITCHS_MAX; ScanSwitch++ )
{
int NumStep;
NumStep = pTransi->NumStepToDesactiv[ ScanSwitch ];
if ( NumStep!=-1 )
{
StepX = Seq->Step[ NumStep ].PosiX * Size - ShiftX;
// ===
gdk_draw_line(DrawPixmap, DynaGcOff,
x+SizeDiv3, y+SizeDiv4-2, StepX+Size-SizeDiv3, y+SizeDiv4-2);
gdk_draw_line(DrawPixmap, DynaGcOff,
x+SizeDiv3, y+SizeDiv4-4, StepX+Size-SizeDiv3, y+SizeDiv4-4);
gdk_draw_line(DrawPixmap, drawing_area->style->white_gc,
x+SizeDiv3, y+SizeDiv4-3, StepX+Size-SizeDiv3, y+SizeDiv4-3);
// | with the step
gdk_draw_line(DrawPixmap, DynaGcOff,
StepX+SizeDiv2, y, StepX+SizeDiv2, y+SizeDiv4-4);
}
}
// transitions linked (start of OR)
if ( pTransi->NumTransLinkedForStart[ 0 ]!=-1 )
{
for ( ScanSwitch=0; ScanSwitch<NBR_SWITCHS_MAX; ScanSwitch++ )
{
int NumTransi;
NumTransi = pTransi->NumTransLinkedForStart[ ScanSwitch ];
if ( NumTransi!=-1 )
{
TransiX = Seq->Transition[ NumTransi ].PosiX * Size - ShiftX;
gdk_draw_line(DrawPixmap, DynaGcOff,
x+SizeDiv2, y+SizeDiv3, TransiX+SizeDiv2, y+SizeDiv3);
}
}
}
// transitions linked (end of OR)
if ( pTransi->NumTransLinkedForEnd[ 0 ]!=-1 )
{
for ( ScanSwitch=0; ScanSwitch<NBR_SWITCHS_MAX; ScanSwitch++ )
{
int NumTransi;
NumTransi = pTransi->NumTransLinkedForEnd[ ScanSwitch ];
if ( NumTransi!=-1 )
{
TransiX = Seq->Transition[ NumTransi ].PosiX * Size - ShiftX;
gdk_draw_line(DrawPixmap, DynaGcOff,
x+SizeDiv2, y+Size-SizeDiv3, TransiX+SizeDiv2, y+Size-SizeDiv3);
}
}
}
// cross step ?
if ( pTransi->NumStepToActiv[ 0 ]!=-1 && pTransi->NumStepToDesactiv[ 0 ]!=-1 )
{
pStep = &Seq->Step[ pTransi->NumStepToActiv[ 0 ] ];
pStep2 = &Seq->Step[ pTransi->NumStepToDesactiv[ 0 ] ];
StepX = pStep->PosiX;
StepY = pStep->PosiY;
if ( pTransi->PosiX!=StepX || pTransi->PosiY+1!=StepY )
{
if ( pTransi->NumTransLinkedForEnd[ 0 ]==-1 )
{
// draw v with step number (below transition)
gdk_draw_line(DrawPixmap, DynaGcOff,
x+SizeDiv3, y+Size-SizeDiv3, x+SizeDiv2, y+Size-SizeDiv3+SizeDiv4);
gdk_draw_line(DrawPixmap, DynaGcOff,
x+Size-SizeDiv3, y+Size-SizeDiv3, x+SizeDiv2, y+Size-SizeDiv3+SizeDiv4);
gdk_draw_line(DrawPixmap, DynaGcOff,
x+SizeDiv2, y+Size-SizeDiv3, x+SizeDiv2, y+Size-SizeDiv3+SizeDiv4);
sprintf( BufTxt, "%d", pStep->StepNumber );
#ifndef GTK2
gdk_draw_text(DrawPixmap, drawing_area->style->font, drawing_area->style->black_gc,
x+SizeDiv3,y+Size-SizeDiv3+SizeDiv4+11,BufTxt,strlen(BufTxt));
#else
DrawTextGTK2( DrawPixmap, drawing_area->style->black_gc, x+SizeDiv3,y+Size-SizeDiv3+SizeDiv4+13, -1, -1, BufTxt );
#endif
// draw step number with v (above the cross step)
StepX = StepX*Size - ShiftX;
StepY = StepY*Size - ShiftY;
gdk_draw_line(DrawPixmap, DynaGcOff,
StepX+SizeDiv3, StepY-SizeDiv2, StepX+SizeDiv2, StepY-SizeDiv4);
gdk_draw_line(DrawPixmap, DynaGcOff,
StepX+Size-SizeDiv3, StepY-SizeDiv2, StepX+SizeDiv2, StepY-SizeDiv4);
gdk_draw_line(DrawPixmap, DynaGcOff,
StepX+SizeDiv2, StepY-SizeDiv4, StepX+SizeDiv2, StepY+1);
if ( pStep->OffDrawCrossStep==0 )
sprintf( BufTxt, "%d", pStep2->StepNumber );
else
sprintf( BufTxt, ";%d", pStep2->StepNumber );
#ifndef GTK2
gdk_draw_text(DrawPixmap, drawing_area->style->font, drawing_area->style->black_gc,
StepX+SizeDiv3+pStep->OffDrawCrossStep,StepY-SizeDiv4-9,BufTxt,strlen(BufTxt));
#else
DrawTextGTK2( DrawPixmap, drawing_area->style->black_gc, StepX+SizeDiv3+pStep->OffDrawCrossStep,StepY-SizeDiv4-7, -1, -1, BufTxt );
#endif
//printf("CrossStep n°=%d, offX=%d\n", pStep->StepNumber, pStep->OffDrawCrossStep );
pStep->OffDrawCrossStep = pStep->OffDrawCrossStep+((pStep->OffDrawCrossStep!=0)?3:0)+15; // TODO: add length in pixels of the text written
}
}
}
//TODO: cross step for pTransi->NumStepToDesactiv[ 0 ]
gdk_gc_unref(DynaGcOn);
}
void DrawSeqComment(GdkPixmap * DrawPixmap,int x,int y,int Size,StrSeqComment * pSeqComment)
{
char * BufTxt = pSeqComment->Comment;
GdkColor CornersColor = {0, 38000, 38000, 62000 };
GdkGC *gcCorners = gdk_gc_new( pixmap );
gdk_gc_set_rgb_fg_color( gcCorners, &CornersColor );
gdk_draw_line(DrawPixmap, gcCorners, x+2 +6, y+2, x+2, y+2 +6);
gdk_draw_line(DrawPixmap, gcCorners, x+2+4*Size-4 -6, y+2+Size-4, x+2+4*Size-4, y+2+Size-4 -6);
gdk_draw_rectangle(DrawPixmap, drawing_area->style->black_gc, FALSE /*filled*/,
x+2, y+2,
4*Size-4, Size-4);
#ifndef GTK2
gdk_draw_text(DrawPixmap, drawing_area->style->font, drawing_area->style->black_gc,
x+SizeDiv3,y+SizeDiv2+4,BufTxt,strlen(BufTxt));
#else
DrawTextWithOffsetGTK2( DrawPixmap, drawing_area->style->black_gc, x, y, 4*Size, Size, BufTxt, 3 );
#endif
g_object_unref( G_OBJECT(gcCorners) );
}
void DrawSequentialGrid( )
{
int x,y,z;
GdkColor DynaGdkColor;
GdkGC * DynaGcOn;
DynaGdkColor.pixel = 0xF4F4F4;
DynaGdkColor.red = 0xF4;
DynaGdkColor.green = 0xF4;
DynaGdkColor.blue = 0xF4;
DynaGcOn = gdk_gc_new(pixmap);
gdk_gc_set_foreground(DynaGcOn,&DynaGdkColor);
z = 0;
for(y=0; y<=SEQ_SIZE_DEF*SEQ_PAGE_HEIGHT; y=y+SEQ_SIZE_DEF)
{
gdk_draw_line(pixmap, DynaGcOn, 0, y-InfosGene->VScrollValue, SEQ_SIZE_DEF*NBR_STEPS, y-InfosGene->VScrollValue );
if ( z&1 )
{
for(x=0; x<=SEQ_SIZE_DEF*SEQ_PAGE_WIDTH; x=x+SEQ_SIZE_DEF)
gdk_draw_line(pixmap, DynaGcOn, x-InfosGene->HScrollValue, y-InfosGene->VScrollValue, x-InfosGene->HScrollValue, y-InfosGene->VScrollValue+SEQ_SIZE_DEF );
}
z++;
}
gdk_gc_unref(DynaGcOn);
}
void DrawSequentialPage( GdkPixmap * DrawPixmap, int PageNbr, char DrawingOption )
{
int ScanStep;
StrStep * pStep;
int ScanTransi;
StrTransition * pTransi;
int ScanSeqComment;
StrSequential * Seq = Sequential;
// lifts positions (not used if for print!)
int ShiftX = InfosGene->HScrollValue;
int ShiftY = InfosGene->VScrollValue;
if ( DrawingOption==DRAW_FOR_PRINT )
{
ShiftX = 0;
ShiftY = 0;
}
// if in edit, use datas in edit...
if ( EditDatas.ModeEdit )
Seq = &EditSeqDatas;
// clean all
gdk_draw_rectangle(pixmap, drawing_area->style->white_gc, TRUE /*filled*/,
0, 0, GTK_WIDGET(drawing_area)->allocation.width,GTK_WIDGET(drawing_area)->allocation.height);
if ( EditDatas.ModeEdit )
DrawSequentialGrid( );
for( ScanStep=0; ScanStep<NBR_STEPS; ScanStep++ )
{
pStep = &Seq->Step[ ScanStep ];
if ( pStep->NumPage==PageNbr )
pStep->OffDrawCrossStep = 0;
}
// draw the steps of this page
for( ScanStep=0; ScanStep<NBR_STEPS; ScanStep++ )
{
pStep = &Seq->Step[ ScanStep ];
if ( pStep->NumPage==PageNbr )
DrawSeqStep( DrawPixmap, pStep->PosiX*SEQ_SIZE_DEF-ShiftX, pStep->PosiY*SEQ_SIZE_DEF-ShiftY, SEQ_SIZE_DEF, pStep, DrawingOption );
}
// draw the transitions of this page
for( ScanTransi=0; ScanTransi<NBR_TRANSITIONS; ScanTransi++ )
{
pTransi = &Seq->Transition[ ScanTransi ];
if ( pTransi->NumPage==PageNbr )
DrawSeqTransition( DrawPixmap, pTransi->PosiX*SEQ_SIZE_DEF-ShiftX, pTransi->PosiY*SEQ_SIZE_DEF-ShiftY, SEQ_SIZE_DEF, pTransi, DrawingOption );
}
// draw the comments
for( ScanSeqComment=0; ScanSeqComment<NBR_SEQ_COMMENTS; ScanSeqComment++ )
{
StrSeqComment * pSeqComment = &Seq->SeqComment[ ScanSeqComment ];
if ( pSeqComment->NumPage==PageNbr )
DrawSeqComment( DrawPixmap, pSeqComment->PosiX*SEQ_SIZE_DEF-ShiftX,
pSeqComment->PosiY*SEQ_SIZE_DEF-ShiftY, SEQ_SIZE_DEF, pSeqComment);
}
}
void DrawSeqElementForToolBar( GdkPixmap * DrawPixmap, int x, int y, int Size, int NumElement )
{
int SizeDiv2 = Size/2;
int SizeDiv3 = Size/3;
int SizeDiv4 = Size/4;
GdkGC * TheGc;
TheGc = drawing_area->style->black_gc;
switch( NumElement )
{
case ELE_SEQ_STEP:
case EDIT_SEQ_INIT_STEP:
gdk_draw_rectangle(DrawPixmap, TheGc, FALSE /*filled*/,
x+SizeDiv4, y+SizeDiv4,
Size-2*SizeDiv4, Size-2*SizeDiv4);
if( NumElement==EDIT_SEQ_INIT_STEP )
gdk_draw_rectangle(DrawPixmap, TheGc, FALSE /*filled*/,
x+SizeDiv4+2, y+SizeDiv4+2,
Size-2*SizeDiv4-4, Size-2*SizeDiv4-4);
break;
case ELE_SEQ_TRANSITION:
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+SizeDiv2,y+SizeDiv4, x+SizeDiv2,y+Size-SizeDiv4);
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+SizeDiv3,y+SizeDiv2, x+Size-SizeDiv3,y+SizeDiv2);
break;
case EDIT_SEQ_STEP_AND_TRANS:
gdk_draw_rectangle(DrawPixmap, TheGc, FALSE /*filled*/,
x+SizeDiv4, y+2,
Size-2*SizeDiv4, SizeDiv2-2);
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+SizeDiv2,y+SizeDiv2, x+SizeDiv2,y+Size-2);
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+SizeDiv3,y+Size-SizeDiv4, x+Size-SizeDiv3,y+Size-SizeDiv4);
break;
case EDIT_SEQ_START_MANY_TRANS:
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+2,y+SizeDiv4, x+Size-2,y+SizeDiv4);
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+SizeDiv4,y+SizeDiv4-4, x+SizeDiv4,y+SizeDiv4+4);
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+Size-SizeDiv4,y+SizeDiv4, x+Size-SizeDiv4,y+SizeDiv4+4);
break;
case EDIT_SEQ_END_MANY_TRANS:
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+2,y+Size-SizeDiv4, x+Size-2,y+Size-SizeDiv4);
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+SizeDiv4,y+Size-SizeDiv4-4, x+SizeDiv4,y+Size-SizeDiv4+4);
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+Size-SizeDiv4,y+Size-SizeDiv4, x+Size-SizeDiv4,y+Size-SizeDiv4-4);
break;
case EDIT_SEQ_START_MANY_STEPS:
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+2,y+SizeDiv4, x+Size-2,y+SizeDiv4);
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+2,y+SizeDiv4+2, x+Size-2,y+SizeDiv4+2);
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+SizeDiv4,y+SizeDiv4-4, x+SizeDiv4,y+SizeDiv4+4);
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+Size-SizeDiv4,y+SizeDiv4+2, x+Size-SizeDiv4,y+SizeDiv4+4);
break;
case EDIT_SEQ_END_MANY_STEPS:
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+2,y+Size-SizeDiv4, x+Size-2,y+Size-SizeDiv4);
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+2,y+Size-SizeDiv4-2, x+Size-2,y+Size-SizeDiv4-2);
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+SizeDiv4,y+Size-SizeDiv4-4, x+SizeDiv4,y+Size-SizeDiv4+4);
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+Size-SizeDiv4,y+Size-SizeDiv4-2, x+Size-SizeDiv4,y+Size-SizeDiv4-4);
break;
case EDIT_SEQ_LINK:
gdk_draw_line(DrawPixmap, drawing_area->style->black_gc,
x+SizeDiv3,y+SizeDiv4, x+Size-SizeDiv3,y+Size-SizeDiv4);
gdk_draw_arc(DrawPixmap, drawing_area->style->black_gc, FALSE/*filled*/,
x+SizeDiv3-2,y+SizeDiv4-2, 4, 4, 0/*angle1*/, 23040/*angle2*/);
gdk_draw_arc(DrawPixmap, drawing_area->style->black_gc, FALSE/*filled*/,
x+Size-SizeDiv3-2,y+Size-SizeDiv4-2, 4, 4, 0/*angle1*/, 23040/*angle2*/);
break;
case ELE_SEQ_COMMENT:
gdk_draw_rectangle(DrawPixmap, TheGc, FALSE /*filled*/,
x+SizeDiv4, y+SizeDiv4,
Size-2*SizeDiv4, Size-2*SizeDiv4);
#ifndef GTK2
gdk_draw_text(DrawPixmap, drawing_area->style->font, drawing_area->style->black_gc,
x+SizeDiv3,y+SizeDiv2+4,"xx",strlen("xx"));
#else
DrawTextGTK2( DrawPixmap, drawing_area->style->black_gc, x, y, Size, Size, "xx" );
#endif
break;
default:
DrawCommonElementForToolbar( DrawPixmap, x, y, Size, NumElement );
break;
}
}
|