25
25
#include <stdlib.h>
26
26
#include <stdint.h>
27
27
#include <math.h>
28
- #include "cairo.h"
29
28
#include "main.h"
30
29
#include "input.h"
31
30
#include "callbacks.h"
@@ -142,18 +141,10 @@ void on_monitors_changed ( GdkScreen *screen,
142
141
143
142
parse_config (data ); // also calls paint_context_new() :-(
144
143
145
-
146
- <<<<<<< HEAD
147
- data -> default_pen = paint_context_new (data , GROMIT_PEN , data -> red , 7 , 0 , GROMIT_ARROW_END ,
144
+ data -> default_pen = paint_context_new (data , GROMIT_PEN , gdk_rgba_copy (data -> red ), 7 , 0 , GROMIT_ARROW_END ,
148
145
5 , 10 , 15 , 25 , 1 , 0 , G_MAXUINT );
149
- data -> default_eraser = paint_context_new (data , GROMIT_ERASER , data -> red , 75 , 0 , GROMIT_ARROW_END ,
146
+ data -> default_eraser = paint_context_new (data , GROMIT_ERASER , gdk_rgba_copy ( data -> red ) , 75 , 0 , GROMIT_ARROW_END ,
150
147
5 , 10 , 15 , 25 , 1 , 0 , G_MAXUINT );
151
- = == == ==
152
- data -> default_pen = paint_context_new (data , GROMIT_PEN , gdk_rgba_copy (data -> red ), 7 ,
153
- 0 , GROMIT_ARROW_END , 1 , G_MAXUINT );
154
- data -> default_eraser = paint_context_new (data , GROMIT_ERASER , gdk_rgba_copy (data -> red ), 75 ,
155
- 0 , GROMIT_ARROW_END , 1 , G_MAXUINT );
156
- >>>>>>> 5385d 7b (config , callbacks : add option to change tool definitions and individual tool attributes )
157
148
158
149
if (!data -> composited ) // set shape
159
150
{
@@ -221,7 +212,7 @@ void on_clientapp_selection_get (GtkWidget *widget,
221
212
222
213
if (gtk_selection_data_get_target (selection_data ) == GA_TOGGLEDATA ||
223
214
gtk_selection_data_get_target (selection_data ) == GA_LINEDATA ||
224
- gtk_selection_data_get_target (selection_data ) == GA_DEFTOOLDATA ||
215
+ gtk_selection_data_get_target (selection_data ) == GA_CHGTOOLDATA ||
225
216
gtk_selection_data_get_target (selection_data ) == GA_CHGATTRDATA )
226
217
{
227
218
ans = data -> clientdata ;
@@ -292,11 +283,7 @@ gboolean on_buttonpress (GtkWidget *win,
292
283
GromitPaintType type = devdata -> cur_context -> type ;
293
284
294
285
// store original state to have dynamic update of line and rect
295
- <<<<<<< HEAD
296
286
if (type == GROMIT_LINE || type == GROMIT_RECT || type == GROMIT_SMOOTH || type == GROMIT_ORTHOGONAL )
297
- == == == =
298
- if (type == GROMIT_LINE || type == GROMIT_RECT )
299
- >>>>>>> 5385d 7b (config , callbacks : add option to change tool definitions and individual tool attributes )
300
287
{
301
288
copy_surface (data -> aux_backbuffer , data -> backbuffer );
302
289
}
@@ -413,12 +400,8 @@ gboolean on_motion (GtkWidget *win,
413
400
}
414
401
if (type == GROMIT_LINE )
415
402
{
416
- <<<<<<< HEAD
417
- GromitArrowType atype = devdata -> cur_context -> arrow_type ;
418
- = == == ==
419
- >>>>>>> 5385d 7b (config , callbacks : add option to change tool definitions and individual tool attributes )
420
403
draw_line (data , ev -> device , devdata -> lastx , devdata -> lasty , ev -> x , ev -> y );
421
- if (devdata -> cur_context -> arrowsize > 0 )
404
+ if (devdata -> cur_context -> arrowsize > 0.0 )
422
405
{
423
406
GromitArrowType atype = devdata -> cur_context -> arrow_type ;
424
407
gint width = devdata -> cur_context -> arrowsize * devdata -> cur_context -> width / 2 ;
@@ -467,14 +450,8 @@ gboolean on_buttonrelease (GtkWidget *win,
467
450
468
451
gfloat direction = 0 ;
469
452
gint width = 0 ;
470
- <<<<<<< HEAD
471
453
if (ctx )
472
454
width = ctx -> arrowsize * ctx -> width / 2 ;
473
- = == == ==
474
- if (devdata -> cur_context )
475
- width = devdata -> cur_context -> arrowsize * devdata -> cur_context -> width / 2 ;
476
-
477
- >>>>>>> 5385d 7b (config , callbacks : add option to change tool definitions and individual tool attributes )
478
455
479
456
if ((ev -> x != devdata -> lastx ) ||
480
457
(ev -> y != devdata -> lasty ))
@@ -483,7 +460,6 @@ gboolean on_buttonrelease (GtkWidget *win,
483
460
if (!devdata -> is_grabbed )
484
461
return FALSE;
485
462
486
- <<<<<<< HEAD
487
463
GromitPaintType type = ctx -> type ;
488
464
489
465
if (type == GROMIT_SMOOTH || type == GROMIT_ORTHOGONAL )
@@ -517,13 +493,6 @@ gboolean on_buttonrelease (GtkWidget *win,
517
493
if (ctx -> arrowsize != 0 )
518
494
{
519
495
GromitArrowType atype = ctx -> arrow_type ;
520
- = == == ==
521
- GromitPaintType type = devdata -> cur_context -> type ;
522
-
523
- if (devdata -> cur_context -> arrowsize != 0 )
524
- {
525
- GromitArrowType atype = devdata -> cur_context -> arrow_type ;
526
- >>>>>>> 5385d 7b (config , callbacks : add option to change tool definitions and individual tool attributes )
527
496
if (type == GROMIT_LINE )
528
497
{
529
498
direction = atan2 (ev -> y - devdata -> lasty , ev -> x - devdata -> lastx );
@@ -590,9 +559,9 @@ void on_mainapp_selection_get (GtkWidget *widget,
590
559
undo_drawing (data );
591
560
else if (action == GA_REDO )
592
561
redo_drawing (data );
593
- else if (action == GA_DEFTOOL )
562
+ else if (action == GA_CHGTOOL )
594
563
{
595
- gtk_selection_convert (data -> win , GA_DATA , GA_DEFTOOLDATA , time );
564
+ gtk_selection_convert (data -> win , GA_DATA , GA_CHGTOOLDATA , time );
596
565
gtk_main ();
597
566
}
598
567
else if (action == GA_CHGATTR )
@@ -687,13 +656,8 @@ void on_mainapp_selection_received (GtkWidget *widget,
687
656
"Keeping default.\n" );
688
657
}
689
658
GromitPaintContext * line_ctx =
690
- <<<<<<< HEAD
691
659
paint_context_new (data , GROMIT_PEN , fg_color , thickness , 0 , GROMIT_ARROW_END ,
692
660
5 , 10 , 15 , 25 , 0 , thickness , thickness );
693
- = == == ==
694
- paint_context_new (data , GROMIT_PEN , fg_color , thickness ,
695
- 0 , GROMIT_ARROW_END , thickness , thickness );
696
- >>>>>>> 5385d 7b (config , callbacks : add option to change tool definitions and individual tool attributes )
697
661
698
662
GdkRectangle rect ;
699
663
rect .x = MIN (startX ,endX ) - thickness / 2 ;
@@ -719,7 +683,7 @@ void on_mainapp_selection_received (GtkWidget *widget,
719
683
else
720
684
{
721
685
GdkAtom atom = gtk_selection_data_get_target (selection_data );
722
- if (atom == GA_DEFTOOLDATA || atom == GA_CHGATTRDATA )
686
+ if (atom == GA_CHGTOOLDATA || atom == GA_CHGATTRDATA )
723
687
{
724
688
gchar * a = (gchar * )gtk_selection_data_get_data (selection_data );
725
689
if (data -> debug ) g_printerr ("DEBUG: define tool: %s\n" , a );
@@ -1100,7 +1064,6 @@ void on_intro(GtkMenuItem *menuitem,
1100
1064
gtk_widget_show_all (assistant );
1101
1065
}
1102
1066
1103
- <<<<<<< HEAD
1104
1067
void on_edit_config (GtkMenuItem * menuitem ,
1105
1068
gpointer user_data )
1106
1069
{
@@ -1155,8 +1118,6 @@ void on_edit_config(GtkMenuItem *menuitem,
1155
1118
}
1156
1119
1157
1120
1158
- = == == ==
1159
- >>>>>>> 5385d 7b (config , callbacks : add option to change tool definitions and individual tool attributes )
1160
1121
void on_issues (GtkMenuItem * menuitem ,
1161
1122
gpointer user_data )
1162
1123
{
0 commit comments