Sat, 13 Apr 2024 23:52:51 -0500
Stop using PurpleBuddy in Pidgin
PurpleBuddy was replaced by PurpleContactInfo a long time ago, and this stuff
just hadn't been updated yet.
Testing Done:
Let the turtles do their thing and verified that the avatars still show up for the demo protocol plugin.
Reviewed at https://reviews.imfreedom.org/r/3121/
| 11475 | 1 | /* |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
2 | * pidgin |
| 11475 | 3 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
4 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 11475 | 5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 6 | * source distribution. | |
| 7 | * | |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
17243
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 11475 | 21 | * |
| 22 | */ | |
| 23 | ||
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
24 | #include <glib/gi18n-lib.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
25 | |
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
26 | #include <gtk/gtk.h> |
|
42180
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
27 | #include <adwaita.h> |
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
28 | |
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
29 | #include <math.h> |
|
41947
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
30 | #ifndef M_PI |
|
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
31 | #define M_PI (3.14159265358979323846264338327950288) |
|
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
32 | #endif |
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
33 | |
|
40360
e21f3bbcc2a5
Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
34 | #include <purple.h> |
| 11475 | 35 | |
| 36 | #include "gtkwhiteboard.h" | |
| 17243 | 37 | #include "gtkutils.h" |
| 11475 | 38 | |
|
40593
5933c91abf0c
Remove use of purple_whiteboard_[gs]et_ui_data.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
39 | #define UI_DATA "pidgin-ui-data" |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
40 | #define PIDGIN_TYPE_WHITEBOARD (pidgin_whiteboard_get_type()) |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
41 | G_DECLARE_FINAL_TYPE(PidginWhiteboard, pidgin_whiteboard, PIDGIN, WHITEBOARD, |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
42 | GtkWindow) |
|
33113
73e1a4f7a1a9
Privatize some GtkWhiteboard fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32286
diff
changeset
|
43 | |
|
35543
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
44 | /** |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
45 | * PidginWhiteboard: |
|
39764
abfcdf65a268
Remove unnecessary PidginWhiteboardPrivate struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39763
diff
changeset
|
46 | * @cr: Cairo context for drawing |
|
abfcdf65a268
Remove unnecessary PidginWhiteboardPrivate struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39763
diff
changeset
|
47 | * @surface: Cairo surface for drawing |
|
35543
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
48 | * @wb: Backend data for this whiteboard |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
49 | * @drawing_area: Drawing area |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
50 | * @color_button: A color chooser widget |
|
35543
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
51 | * @width: Canvas width |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
52 | * @height: Canvas height |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
53 | * @brush_color: Foreground color |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
54 | * @brush_size: Brush size |
|
39767
cc78de97f7dd
Move globals into PidginWhiteboard struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39766
diff
changeset
|
55 | * @brush_state: The @PidginWhiteboardBrushState state of the brush |
|
35543
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
56 | * |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
57 | * A PidginWhiteboard |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
58 | */ |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
59 | struct _PidginWhiteboard |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
60 | { |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
61 | GtkWindow parent; |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
62 | |
|
39764
abfcdf65a268
Remove unnecessary PidginWhiteboardPrivate struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39763
diff
changeset
|
63 | cairo_t *cr; |
|
abfcdf65a268
Remove unnecessary PidginWhiteboardPrivate struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39763
diff
changeset
|
64 | cairo_surface_t *surface; |
|
35543
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
65 | |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
66 | PurpleWhiteboard *wb; |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
67 | |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
68 | GtkWidget *drawing_area; |
|
42221
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
69 | GtkBox *toolbar; |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
70 | GtkWidget *color_button; |
|
35543
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
71 | |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
72 | int width; |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
73 | int height; |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
74 | int brush_color; |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
75 | int brush_size; |
|
39767
cc78de97f7dd
Move globals into PidginWhiteboard struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39766
diff
changeset
|
76 | |
|
cc78de97f7dd
Move globals into PidginWhiteboard struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39766
diff
changeset
|
77 | /* Tracks last position of the mouse when drawing */ |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
78 | gdouble start_x; |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
79 | gdouble start_y; |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
80 | gdouble last_x; |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
81 | gdouble last_y; |
|
35543
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
82 | }; |
|
a0f314250ac6
Hide PidginWhiteboard API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
83 | |
|
42575
580339aa47cc
Make sure all of the final types in pidgin are defined as such
Gary Kramlich <grim@reaperworld.com>
parents:
42352
diff
changeset
|
84 | G_DEFINE_FINAL_TYPE(PidginWhiteboard, pidgin_whiteboard, GTK_TYPE_WINDOW) |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
85 | |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
86 | /****************************************************************************** |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
87 | * Helpers |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
88 | *****************************************************************************/ |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
89 | static void |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
90 | pidgin_whiteboard_rgb24_to_rgba(int color_rgb, GdkRGBA *color) |
| 11475 | 91 | { |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
92 | color->red = ((color_rgb >> 16) & 0xFF) / 255.0f; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
93 | color->green = ((color_rgb >> 8) & 0xFF) / 255.0f; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
94 | color->blue = (color_rgb & 0xFF) / 255.0f; |
|
41523
2ca542ed08e2
Convert the usage of GdkRGBA in the whiteboard to use floats instead of doubles
Gary Kramlich <grim@reaperworld.com>
parents:
41040
diff
changeset
|
95 | color->alpha = 1.0f; |
| 11475 | 96 | } |
| 97 | ||
|
42014
b6a9fcf02157
Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41947
diff
changeset
|
98 | static void |
|
b6a9fcf02157
Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41947
diff
changeset
|
99 | whiteboard_destroy_cb(GtkWidget *widget, G_GNUC_UNUSED gpointer data) |
| 11475 | 100 | { |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
101 | PidginWhiteboard *gtkwb = PIDGIN_WHITEBOARD(widget); |
|
13411
3ccc9f3e3e29
[gaim-migrate @ 15785]
Richard Laager <rlaager@pidgin.im>
parents:
12039
diff
changeset
|
102 | |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
103 | g_clear_object(>kwb->wb); |
| 11475 | 104 | } |
| 105 | ||
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
106 | static void |
|
41947
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
107 | pidgin_whiteboard_resize(G_GNUC_UNUSED GtkDrawingArea *self, gint width, |
|
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
108 | gint height, gpointer data) |
| 11475 | 109 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
110 | PidginWhiteboard *gtkwb = (PidginWhiteboard*)data; |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
111 | GdkRGBA white = {1.0f, 1.0f, 1.0f, 1.0f}; |
|
30567
9356eb596043
So I only changed the obvious GdkGC use in the whiteboard. I think
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30565
diff
changeset
|
112 | cairo_t *cr; |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
113 | |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
114 | g_clear_pointer(>kwb->cr, cairo_destroy); |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
115 | g_clear_pointer(>kwb->surface, cairo_surface_destroy); |
| 11475 | 116 | |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
117 | gtkwb->surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
118 | height); |
|
39764
abfcdf65a268
Remove unnecessary PidginWhiteboardPrivate struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39763
diff
changeset
|
119 | gtkwb->cr = cr = cairo_create(gtkwb->surface); |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
120 | |
|
35549
1128302c7511
Fix more colour deprecation warnings.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
121 | gdk_cairo_set_source_rgba(cr, &white); |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
122 | cairo_rectangle(cr, 0, 0, width, height); |
|
30567
9356eb596043
So I only changed the obvious GdkGC use in the whiteboard. I think
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30565
diff
changeset
|
123 | cairo_fill(cr); |
| 11475 | 124 | } |
| 125 | ||
|
35542
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
126 | static gboolean |
|
41947
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
127 | pidgin_whiteboard_draw_event(G_GNUC_UNUSED GtkWidget *widget, cairo_t *cr, |
|
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
128 | gpointer _gtkwb) |
| 11475 | 129 | { |
|
35542
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
130 | PidginWhiteboard *gtkwb = _gtkwb; |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
131 | |
|
39764
abfcdf65a268
Remove unnecessary PidginWhiteboardPrivate struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39763
diff
changeset
|
132 | cairo_set_source_surface(cr, gtkwb->surface, 0, 0); |
|
35542
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
133 | cairo_paint(cr); |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
134 | |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
135 | return FALSE; |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
136 | } |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
137 | |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
138 | static void |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
139 | pidgin_whiteboard_draw_brush_point(PurpleWhiteboard *wb, int x, int y, |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
140 | int color, int size) |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
141 | { |
|
40593
5933c91abf0c
Remove use of purple_whiteboard_[gs]et_ui_data.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
142 | PidginWhiteboard *gtkwb = g_object_get_data(G_OBJECT(wb), UI_DATA); |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
143 | GtkWidget *widget = gtkwb->drawing_area; |
|
39764
abfcdf65a268
Remove unnecessary PidginWhiteboardPrivate struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39763
diff
changeset
|
144 | cairo_t *gfx_con = gtkwb->cr; |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
145 | GdkRGBA rgba; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
146 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
147 | /* Interpret and convert color */ |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
148 | pidgin_whiteboard_rgb24_to_rgba(color, &rgba); |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
149 | gdk_cairo_set_source_rgba(gfx_con, &rgba); |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
150 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
151 | /* Draw a circle */ |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
152 | cairo_arc(gfx_con, x, y, size / 2.0, 0.0, 2.0 * M_PI); |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
153 | cairo_fill(gfx_con); |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
154 | |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
155 | gtk_widget_queue_draw(widget); |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
156 | } |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
157 | |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
158 | /* Uses Bresenham's algorithm (as provided by Wikipedia) */ |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
159 | static void |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
160 | pidgin_whiteboard_draw_brush_line(PurpleWhiteboard *wb, int x0, int y0, int x1, |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
161 | int y1, int color, int size) |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
162 | { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
163 | int temp; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
164 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
165 | int xstep; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
166 | int ystep; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
167 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
168 | int dx; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
169 | int dy; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
170 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
171 | int error; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
172 | int derror; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
173 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
174 | int x; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
175 | int y; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
176 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
177 | gboolean steep = abs(y1 - y0) > abs(x1 - x0); |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
178 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
179 | if (steep) { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
180 | temp = x0; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
181 | x0 = y0; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
182 | y0 = temp; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
183 | temp = x1; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
184 | x1 = y1; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
185 | y1 = temp; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
186 | } |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
187 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
188 | dx = abs(x1 - x0); |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
189 | dy = abs(y1 - y0); |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
190 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
191 | error = 0; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
192 | derror = dy; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
193 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
194 | x = x0; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
195 | y = y0; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
196 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
197 | if (x0 < x1) { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
198 | xstep = 1; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
199 | } else { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
200 | xstep = -1; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
201 | } |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
202 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
203 | if (y0 < y1) { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
204 | ystep = 1; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
205 | } else { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
206 | ystep = -1; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
207 | } |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
208 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
209 | if (steep) { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
210 | pidgin_whiteboard_draw_brush_point(wb, y, x, color, size); |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
211 | } else { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
212 | pidgin_whiteboard_draw_brush_point(wb, x, y, color, size); |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
213 | } |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
214 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
215 | while (x != x1) { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
216 | x += xstep; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
217 | error += derror; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
218 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
219 | if ((error * 2) >= dx) { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
220 | y += ystep; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
221 | error -= dx; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
222 | } |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
223 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
224 | if (steep) { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
225 | pidgin_whiteboard_draw_brush_point(wb, y, x, color, |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
226 | size); |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
227 | } else { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
228 | pidgin_whiteboard_draw_brush_point(wb, x, y, color, |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
229 | size); |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
230 | } |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
231 | } |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
232 | } |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
233 | |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
234 | static void |
|
41947
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
235 | pidgin_whiteboard_brush_down(G_GNUC_UNUSED GtkGestureDrag* self, gdouble x, |
|
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
236 | gdouble y, gpointer data) |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
237 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
238 | PidginWhiteboard *gtkwb = (PidginWhiteboard*)data; |
| 15884 | 239 | PurpleWhiteboard *wb = gtkwb->wb; |
|
32286
316da124dc0e
Use the new accessor functions of PidginWhiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
30698
diff
changeset
|
240 | GList *draw_list = purple_whiteboard_get_draw_list(wb); |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
241 | |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
242 | if(gtkwb->cr != NULL) { |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
243 | /* Check if draw_list has contents; if so, clear it */ |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
244 | if(draw_list) { |
| 15884 | 245 | purple_whiteboard_draw_list_destroy(draw_list); |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11829
diff
changeset
|
246 | draw_list = NULL; |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11829
diff
changeset
|
247 | } |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
248 | |
|
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
249 | /* Set tracking variables */ |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
250 | gtkwb->start_x = x; |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
251 | gtkwb->start_y = y; |
|
39767
cc78de97f7dd
Move globals into PidginWhiteboard struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39766
diff
changeset
|
252 | |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
253 | gtkwb->last_x = 0; |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
254 | gtkwb->last_y = 0; |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
255 | |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
256 | draw_list = g_list_append(draw_list, GINT_TO_POINTER(gtkwb->start_x)); |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
257 | draw_list = g_list_append(draw_list, GINT_TO_POINTER(gtkwb->start_y)); |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
258 | |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
259 | pidgin_whiteboard_draw_brush_point(gtkwb->wb, gtkwb->start_x, |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
260 | gtkwb->start_y, gtkwb->brush_color, |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
261 | gtkwb->brush_size); |
| 11475 | 262 | } |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
263 | |
|
32286
316da124dc0e
Use the new accessor functions of PidginWhiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
30698
diff
changeset
|
264 | purple_whiteboard_set_draw_list(wb, draw_list); |
| 11475 | 265 | } |
| 266 | ||
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
267 | static void |
|
41947
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
268 | pidgin_whiteboard_brush_motion(G_GNUC_UNUSED GtkGestureDrag* self, gdouble x, |
|
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
269 | gdouble y, gpointer data) |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
270 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
271 | PidginWhiteboard *gtkwb = (PidginWhiteboard*)data; |
| 15884 | 272 | PurpleWhiteboard *wb = gtkwb->wb; |
|
32286
316da124dc0e
Use the new accessor functions of PidginWhiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
30698
diff
changeset
|
273 | GList *draw_list = purple_whiteboard_get_draw_list(wb); |
| 11475 | 274 | |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
275 | if (gtkwb->cr != NULL) { |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
276 | gdouble dx, dy; |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
277 | |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
278 | /* x and y are relative to the starting post, but we need to know where |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
279 | * there are according to the last point, so we have to do the algebra. |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
280 | */ |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
281 | dx = (x + gtkwb->start_x - gtkwb->last_x); |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
282 | dy = (y + gtkwb->start_y - gtkwb->last_y); |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
283 | |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11829
diff
changeset
|
284 | draw_list = g_list_append(draw_list, GINT_TO_POINTER(dx)); |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11829
diff
changeset
|
285 | draw_list = g_list_append(draw_list, GINT_TO_POINTER(dy)); |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
286 | |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
287 | pidgin_whiteboard_draw_brush_line(gtkwb->wb, |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
288 | gtkwb->start_x + gtkwb->last_x, |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
289 | gtkwb->start_y + gtkwb->last_y, |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
290 | gtkwb->start_x + x, |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
291 | gtkwb->start_y + y, |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
292 | gtkwb->brush_color, |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
293 | gtkwb->brush_size); |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
294 | |
|
39767
cc78de97f7dd
Move globals into PidginWhiteboard struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39766
diff
changeset
|
295 | gtkwb->last_x = x; |
|
cc78de97f7dd
Move globals into PidginWhiteboard struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39766
diff
changeset
|
296 | gtkwb->last_y = y; |
| 11475 | 297 | } |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
298 | |
|
32286
316da124dc0e
Use the new accessor functions of PidginWhiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
30698
diff
changeset
|
299 | purple_whiteboard_set_draw_list(wb, draw_list); |
| 11475 | 300 | } |
| 301 | ||
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
302 | static void |
|
41947
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
303 | pidgin_whiteboard_brush_up(G_GNUC_UNUSED GtkGestureDrag *self, |
|
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
304 | G_GNUC_UNUSED gdouble x, G_GNUC_UNUSED gdouble y, |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
305 | gpointer data) |
| 11475 | 306 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
307 | PidginWhiteboard *gtkwb = (PidginWhiteboard*)data; |
| 15884 | 308 | PurpleWhiteboard *wb = gtkwb->wb; |
|
32286
316da124dc0e
Use the new accessor functions of PidginWhiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
30698
diff
changeset
|
309 | GList *draw_list = purple_whiteboard_get_draw_list(wb); |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
310 | |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
311 | if(gtkwb->cr != NULL) { |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
312 | /* Send draw list to protocol draw_list handler */ |
| 15884 | 313 | purple_whiteboard_send_draw_list(gtkwb->wb, draw_list); |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
314 | |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
315 | /* The brush stroke is finished, clear the list for another one |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
316 | */ |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
317 | if (draw_list) { |
| 15884 | 318 | purple_whiteboard_draw_list_destroy(draw_list); |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
319 | } |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
320 | |
|
32286
316da124dc0e
Use the new accessor functions of PidginWhiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
30698
diff
changeset
|
321 | purple_whiteboard_set_draw_list(wb, NULL); |
| 11475 | 322 | } |
| 323 | } | |
| 324 | ||
| 15884 | 325 | static void pidgin_whiteboard_set_dimensions(PurpleWhiteboard *wb, int width, int height) |
| 11475 | 326 | { |
|
40593
5933c91abf0c
Remove use of purple_whiteboard_[gs]et_ui_data.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
327 | PidginWhiteboard *gtkwb = g_object_get_data(G_OBJECT(wb), UI_DATA); |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
328 | |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11829
diff
changeset
|
329 | gtkwb->width = width; |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11829
diff
changeset
|
330 | gtkwb->height = height; |
| 11475 | 331 | } |
| 332 | ||
| 15884 | 333 | static void pidgin_whiteboard_set_brush(PurpleWhiteboard *wb, int size, int color) |
|
12022
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11938
diff
changeset
|
334 | { |
|
40593
5933c91abf0c
Remove use of purple_whiteboard_[gs]et_ui_data.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
335 | PidginWhiteboard *gtkwb = g_object_get_data(G_OBJECT(wb), UI_DATA); |
|
12022
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11938
diff
changeset
|
336 | |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11938
diff
changeset
|
337 | gtkwb->brush_size = size; |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11938
diff
changeset
|
338 | gtkwb->brush_color = color; |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11938
diff
changeset
|
339 | } |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11938
diff
changeset
|
340 | |
| 15884 | 341 | static void pidgin_whiteboard_clear(PurpleWhiteboard *wb) |
| 11475 | 342 | { |
|
40593
5933c91abf0c
Remove use of purple_whiteboard_[gs]et_ui_data.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
343 | PidginWhiteboard *gtkwb = g_object_get_data(G_OBJECT(wb), UI_DATA); |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11829
diff
changeset
|
344 | GtkWidget *drawing_area = gtkwb->drawing_area; |
|
39764
abfcdf65a268
Remove unnecessary PidginWhiteboardPrivate struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39763
diff
changeset
|
345 | cairo_t *cr = gtkwb->cr; |
|
32422
c215bc5d85e4
Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32410
diff
changeset
|
346 | GtkAllocation allocation; |
|
41523
2ca542ed08e2
Convert the usage of GdkRGBA in the whiteboard to use floats instead of doubles
Gary Kramlich <grim@reaperworld.com>
parents:
41040
diff
changeset
|
347 | GdkRGBA white = {1.0f, 1.0f, 1.0f, 1.0f}; |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
348 | |
|
32422
c215bc5d85e4
Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32410
diff
changeset
|
349 | gtk_widget_get_allocation(drawing_area, &allocation); |
|
c215bc5d85e4
Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32410
diff
changeset
|
350 | |
|
35549
1128302c7511
Fix more colour deprecation warnings.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
351 | gdk_cairo_set_source_rgba(cr, &white); |
|
35542
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
352 | cairo_rectangle(cr, 0, 0, allocation.width, allocation.height); |
|
30567
9356eb596043
So I only changed the obvious GdkGC use in the whiteboard. I think
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30565
diff
changeset
|
353 | cairo_fill(cr); |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
354 | |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
355 | gtk_widget_queue_draw(drawing_area); |
| 11475 | 356 | } |
| 357 | ||
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
358 | static void |
|
42180
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
359 | pidgin_whiteboard_clear_response(G_GNUC_UNUSED AdwMessageDialog *self, |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
360 | char *response, gpointer data) |
| 11475 | 361 | { |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
362 | PidginWhiteboard *gtkwb = (PidginWhiteboard *)data; |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11558
diff
changeset
|
363 | |
|
42180
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
364 | if(!purple_strequal(response, "yes")) { |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
365 | return; |
|
29325
45a011117ac5
Display a confirmation prompt when attempting to clear the whiteboard.
Kartik Mohta <kartikmohta@gmail.com>
parents:
28981
diff
changeset
|
366 | } |
|
41596
2f0fec76cfbc
Handle delete event in more dialogs (probably all, but can't be too sure.)
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41564
diff
changeset
|
367 | |
|
42180
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
368 | pidgin_whiteboard_clear(gtkwb->wb); |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
369 | |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
370 | /* Do protocol specific clearing procedures */ |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
371 | purple_whiteboard_send_clear(gtkwb->wb); |
| 11475 | 372 | } |
| 373 | ||
|
35542
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
374 | static void |
|
41947
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
375 | pidgin_whiteboard_button_clear_press(G_GNUC_UNUSED GtkWidget *widget, |
|
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
376 | gpointer data) |
|
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
377 | { |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
378 | PidginWhiteboard *gtkwb = (PidginWhiteboard*)(data); |
|
42180
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
379 | AdwMessageDialog *dialog = NULL; |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
380 | |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
381 | /* Confirm whether the user really wants to clear */ |
|
42180
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
382 | dialog = ADW_MESSAGE_DIALOG(adw_message_dialog_new( |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
383 | GTK_WINDOW(gtkwb), |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
384 | _("Clear whiteboard?"), |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
385 | _("Do you want to clear this whiteboard?"))); |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
386 | |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
387 | adw_message_dialog_add_responses(dialog, "no", _("_No"), "yes", _("_Yes"), |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
388 | NULL); |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
389 | adw_message_dialog_set_response_appearance(dialog, "yes", |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
390 | ADW_RESPONSE_DESTRUCTIVE); |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
391 | adw_message_dialog_set_default_response(dialog, "yes"); |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
392 | adw_message_dialog_set_close_response(dialog, "no"); |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
393 | |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
394 | g_signal_connect(dialog, "response", |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
395 | G_CALLBACK(pidgin_whiteboard_clear_response), gtkwb); |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
396 | |
|
42180
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
397 | gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); |
|
fa77251b87f3
Move whiteboard clearing to AdwMessageDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42014
diff
changeset
|
398 | gtk_window_present_with_time(GTK_WINDOW(dialog), GDK_CURRENT_TIME); |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
399 | } |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
400 | |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
401 | static void |
|
42352
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
402 | pidgin_whiteboard_save_response(GObject *obj, GAsyncResult *result, |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
403 | gpointer data) |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
404 | { |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
405 | PidginWhiteboard *gtkwb = (PidginWhiteboard *)data; |
|
42352
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
406 | GFile *file = NULL; |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
407 | char *filename = NULL; |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
408 | GdkPixbuf *pixbuf; |
|
42352
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
409 | gboolean success; |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
410 | |
|
42352
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
411 | file = gtk_file_dialog_save_finish(GTK_FILE_DIALOG(obj), result, NULL); |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
412 | if(file == NULL) { |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
413 | return; |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
414 | } |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
415 | |
|
42352
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
416 | filename = g_file_get_path(file); |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
417 | pixbuf = gdk_pixbuf_get_from_surface(gtkwb->surface, 0, 0, |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
418 | gtkwb->width, gtkwb->height); |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
419 | |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
420 | success = gdk_pixbuf_save(pixbuf, filename, "png", NULL, |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
421 | "compression", "9", NULL); |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
422 | g_object_unref(pixbuf); |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
423 | |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
424 | if (success) { |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
425 | purple_debug_info("gtkwhiteboard", "whiteboard saved to \"%s\"", |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
426 | filename); |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
427 | } else { |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
428 | purple_notify_error(NULL, _("Whiteboard"), |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
429 | _("Unable to save the file"), NULL, NULL); |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
430 | purple_debug_error("gtkwhiteboard", |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
431 | "whiteboard couldn't be saved to \"%s\"", filename); |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
432 | } |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
433 | |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
434 | g_free(filename); |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
435 | g_object_unref(file); |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
436 | } |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
437 | |
|
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
438 | static void |
|
41947
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
439 | pidgin_whiteboard_button_save_press(G_GNUC_UNUSED GtkWidget *widget, |
|
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41720
diff
changeset
|
440 | gpointer _gtkwb) |
| 11475 | 441 | { |
|
35542
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
442 | PidginWhiteboard *gtkwb = _gtkwb; |
|
42352
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
443 | GtkFileDialog *dialog; |
| 11475 | 444 | |
|
42352
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
445 | dialog = gtk_file_dialog_new(); |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
446 | gtk_file_dialog_set_title(dialog, _("Save File")); |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
447 | gtk_file_dialog_set_modal(dialog, TRUE); |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
448 | gtk_file_dialog_set_initial_name(dialog, "whiteboard.png"); |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
449 | gtk_file_dialog_save(dialog, GTK_WINDOW(gtkwb), NULL, |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
450 | pidgin_whiteboard_save_response, gtkwb); |
|
1c53950f9052
Migrate from GtkFileChooserNative to GtkFileDialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42251
diff
changeset
|
451 | g_object_unref(dialog); |
| 11475 | 452 | } |
| 453 | ||
|
42221
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
454 | static void |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
455 | notify_color_cb(GObject *obj, G_GNUC_UNUSED GParamSpec *pspec, gpointer data) { |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
456 | PidginWhiteboard *gtkwb = data; |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
457 | PurpleWhiteboard *wb = gtkwb->wb; |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
458 | const GdkRGBA *color; |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
459 | int old_size, old_color; |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
460 | int new_color; |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
461 | |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
462 | color = gtk_color_dialog_button_get_rgba(GTK_COLOR_DIALOG_BUTTON(obj)); |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
463 | |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
464 | new_color = (unsigned int)(color->red * 255) << 16; |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
465 | new_color |= (unsigned int)(color->green * 255) << 8; |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
466 | new_color |= (unsigned int)(color->blue * 255); |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
467 | |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
468 | purple_whiteboard_get_brush(wb, &old_size, &old_color); |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
469 | purple_whiteboard_send_brush(wb, old_size, new_color); |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
470 | } |
|
12039
eaa207b93455
[gaim-migrate @ 14332]
Daniel Atallah <datallah@pidgin.im>
parents:
12022
diff
changeset
|
471 | |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
472 | static void |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
473 | pidgin_whiteboard_create(PurpleWhiteboard *wb) |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
474 | { |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
475 | PidginWhiteboard *gtkwb; |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
476 | GdkRGBA color; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
477 | |
|
42592
6b65c0e4ba15
Remove unnecessary casts for GObject methods
Gary Kramlich <grim@reaperworld.com>
parents:
42575
diff
changeset
|
478 | gtkwb = g_object_new(PIDGIN_TYPE_WHITEBOARD, NULL); |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
479 | gtkwb->wb = wb; |
|
40593
5933c91abf0c
Remove use of purple_whiteboard_[gs]et_ui_data.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
480 | g_object_set_data_full(G_OBJECT(wb), UI_DATA, gtkwb, g_object_unref); |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
481 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
482 | /* Get dimensions (default?) for the whiteboard canvas */ |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
483 | if (!purple_whiteboard_get_dimensions(wb, >kwb->width, |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
484 | >kwb->height)) { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
485 | /* Give some initial board-size */ |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
486 | gtkwb->width = 300; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
487 | gtkwb->height = 250; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
488 | } |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
489 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
490 | if (!purple_whiteboard_get_brush(wb, >kwb->brush_size, |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
491 | >kwb->brush_color)) { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
492 | /* Give some initial brush-info */ |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
493 | gtkwb->brush_size = 2; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
494 | gtkwb->brush_color = 0xff0000; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
495 | } |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
496 | |
|
42723
3761ba966eed
Stop using PurpleBuddy in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
42592
diff
changeset
|
497 | /* Set the window title to the id of the whiteboard as we can't test |
|
3761ba966eed
Stop using PurpleBuddy in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
42592
diff
changeset
|
498 | * anything right now. |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
499 | */ |
|
42723
3761ba966eed
Stop using PurpleBuddy in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
42592
diff
changeset
|
500 | gtk_window_set_title(GTK_WINDOW(gtkwb), purple_whiteboard_get_id(wb)); |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
501 | gtk_widget_set_name(GTK_WIDGET(gtkwb), purple_whiteboard_get_id(wb)); |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
502 | |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
503 | gtk_widget_set_size_request(GTK_WIDGET(gtkwb->drawing_area), |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
504 | gtkwb->width, gtkwb->height); |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
505 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
506 | pidgin_whiteboard_rgb24_to_rgba(gtkwb->brush_color, &color); |
|
42221
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
507 | gtk_color_dialog_button_set_rgba(GTK_COLOR_DIALOG_BUTTON(gtkwb->color_button), |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
508 | &color); |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
509 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
510 | /* Make all this (window) visible */ |
|
42202
2273647d24b0
Use gtk_widget_set_visible for everything
Gary Kramlich <grim@reaperworld.com>
parents:
42180
diff
changeset
|
511 | gtk_widget_set_visible(GTK_WIDGET(gtkwb), TRUE); |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
512 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
513 | /* TODO Specific protocol/whiteboard assignment here? Needs a UI Op? */ |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
514 | /* Set default brush size and color */ |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
515 | /* |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
516 | ds->brush_size = DOODLE_BRUSH_MEDIUM; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
517 | ds->brush_color = 0; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
518 | */ |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
519 | } |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
520 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
521 | static void |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
522 | pidgin_whiteboard_destroy(PurpleWhiteboard *wb) |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
523 | { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
524 | PidginWhiteboard *gtkwb; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
525 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
526 | g_return_if_fail(wb != NULL); |
|
40593
5933c91abf0c
Remove use of purple_whiteboard_[gs]et_ui_data.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
527 | gtkwb = g_object_get_data(G_OBJECT(wb), UI_DATA); |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
528 | g_return_if_fail(gtkwb != NULL); |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
529 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
530 | /* TODO Ask if user wants to save picture before the session is closed |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
531 | */ |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
532 | |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
533 | gtkwb->wb = NULL; |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
534 | } |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
535 | |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
536 | /****************************************************************************** |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
537 | * GObject implementation |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
538 | *****************************************************************************/ |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
539 | static void |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
540 | pidgin_whiteboard_init(PidginWhiteboard *self) { |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
541 | gtk_widget_init_template(GTK_WIDGET(self)); |
|
42221
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
542 | |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
543 | self->color_button = gtk_color_dialog_button_new(gtk_color_dialog_new()); |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
544 | g_signal_connect(self->color_button, "notify::rgba", |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
545 | G_CALLBACK(notify_color_cb), self); |
|
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
546 | gtk_box_append(self->toolbar, GTK_WIDGET(self->color_button)); |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
547 | } |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
548 | |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
549 | static void |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
550 | pidgin_whiteboard_finalize(GObject *obj) { |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
551 | PidginWhiteboard *gtkwb = PIDGIN_WHITEBOARD(obj); |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
552 | |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
553 | /* Clear graphical memory */ |
|
39764
abfcdf65a268
Remove unnecessary PidginWhiteboardPrivate struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39763
diff
changeset
|
554 | g_clear_pointer(>kwb->cr, cairo_destroy); |
|
abfcdf65a268
Remove unnecessary PidginWhiteboardPrivate struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39763
diff
changeset
|
555 | g_clear_pointer(>kwb->surface, cairo_surface_destroy); |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
556 | |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
557 | G_OBJECT_CLASS(pidgin_whiteboard_parent_class)->finalize(obj); |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
558 | } |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
559 | |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
560 | static void |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
561 | pidgin_whiteboard_class_init(PidginWhiteboardClass *klass) |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
562 | { |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
563 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
564 | GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
565 | |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
566 | obj_class->finalize = pidgin_whiteboard_finalize; |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
567 | |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
568 | gtk_widget_class_set_template_from_resource( |
|
41030
ec8b76f3bf0a
Fix the resource path so we can use the automatic stuff that GtkApplication supports
Gary Kramlich <grim@reaperworld.com>
parents:
40604
diff
changeset
|
569 | widget_class, "/im/pidgin/Pidgin3/Whiteboard/whiteboard.ui"); |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
570 | |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
571 | gtk_widget_class_bind_template_child(widget_class, PidginWhiteboard, |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
572 | drawing_area); |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
573 | gtk_widget_class_bind_template_child(widget_class, PidginWhiteboard, |
|
42221
92201aea614d
Use GtkColorDialogButton instead of GtkColorButton
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42202
diff
changeset
|
574 | toolbar); |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
575 | |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
576 | gtk_widget_class_bind_template_callback( |
|
42014
b6a9fcf02157
Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41947
diff
changeset
|
577 | widget_class, whiteboard_destroy_cb); |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
578 | gtk_widget_class_bind_template_callback( |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
579 | widget_class, pidgin_whiteboard_draw_event); |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
580 | gtk_widget_class_bind_template_callback( |
|
41532
4b22b4d9d1cc
Convert PidginWhiteboard to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41523
diff
changeset
|
581 | widget_class, pidgin_whiteboard_resize); |
|
39766
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
582 | gtk_widget_class_bind_template_callback( |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
583 | widget_class, pidgin_whiteboard_brush_down); |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
584 | gtk_widget_class_bind_template_callback( |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
585 | widget_class, pidgin_whiteboard_brush_motion); |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
586 | gtk_widget_class_bind_template_callback( |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
587 | widget_class, pidgin_whiteboard_brush_up); |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
588 | gtk_widget_class_bind_template_callback( |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
589 | widget_class, pidgin_whiteboard_button_clear_press); |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
590 | gtk_widget_class_bind_template_callback( |
|
ebddeaa4b39b
Convert PidginWhiteboard into Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39765
diff
changeset
|
591 | widget_class, pidgin_whiteboard_button_save_press); |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
592 | } |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
593 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
594 | /****************************************************************************** |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
595 | * API |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
596 | *****************************************************************************/ |
|
41720
bcfc2c9e5213
Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents:
41596
diff
changeset
|
597 | static PurpleWhiteboardUiOps ui_ops = { |
|
bcfc2c9e5213
Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents:
41596
diff
changeset
|
598 | .create = pidgin_whiteboard_create, |
|
bcfc2c9e5213
Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents:
41596
diff
changeset
|
599 | .destroy = pidgin_whiteboard_destroy, |
|
bcfc2c9e5213
Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents:
41596
diff
changeset
|
600 | .set_dimensions = pidgin_whiteboard_set_dimensions, |
|
bcfc2c9e5213
Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents:
41596
diff
changeset
|
601 | .set_brush = pidgin_whiteboard_set_brush, |
|
bcfc2c9e5213
Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents:
41596
diff
changeset
|
602 | .draw_point = pidgin_whiteboard_draw_brush_point, |
|
bcfc2c9e5213
Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents:
41596
diff
changeset
|
603 | .draw_line = pidgin_whiteboard_draw_brush_line, |
|
bcfc2c9e5213
Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents:
41596
diff
changeset
|
604 | .clear = pidgin_whiteboard_clear, |
|
39763
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
605 | }; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
606 | |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
607 | PurpleWhiteboardUiOps * |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
608 | pidgin_whiteboard_get_ui_ops(void) |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
609 | { |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
610 | return &ui_ops; |
|
c819e240b60e
Re-arrange whiteboard to avoid prototypes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38712
diff
changeset
|
611 | } |