aboutsummaryrefslogtreecommitdiffstats
path: root/meta-xfce/recipes-panel-plugins/datetime/files/port-to-libxfce4ui.patch
blob: aab20caab9f98ba3aa89c1e97d82787ec0580893 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
From 2041c011c62e13c5bc1f0824733bc34ebb8a8bfe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmx.de>
Date: Sun, 23 Oct 2011 20:14:42 +0200
Subject: [PATCH] port to libxfce4ui
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit


Signed-off-by: Andreas Müller <schnitzeltony@gmx.de>
---
 configure.ac.in                |    9 +--
 panel-plugin/Makefile.am       |    8 +-
 panel-plugin/datetime-dialog.c |    8 +-
 panel-plugin/datetime.c        |    4 +-
 panel-plugin/xfce46-compat.c   |  193 ----------------------------------------
 panel-plugin/xfce46-compat.h   |   20 ----
 6 files changed, 11 insertions(+), 231 deletions(-)
 delete mode 100644 panel-plugin/xfce46-compat.c
 delete mode 100644 panel-plugin/xfce46-compat.h

diff --git a/configure.ac.in b/configure.ac.in
index 4d58211..5200268 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -31,12 +31,9 @@ XDT_I18N([@LINGUAS@])
 
 dnl Check for required packages
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0])
-XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.99.2])
-XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.99.2])
-XDT_CHECK_PACKAGE([LIBXFCE4PANEL],[libxfce4panel-1.0],[4.3.99.2])
-
-dnl check for optional packages/versions
-XDT_CHECK_OPTIONAL_PACKAGE([LIBXFCE4PANEL_46], [libxfce4panel-1.0], [4.5.92], [libxfce4panel46], [Take advantage of Xfce 4.6 panel changes])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.8.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.8.0])
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL],[libxfce4panel-1.0],[4.8.0])
 
 #CFLAGS="$CFLAGS -Wall -Werror"
 
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 4005f85..18bbc7e 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -7,16 +7,14 @@ libdatetime_la_SOURCES = 			\
 	datetime.h				\
 	datetime.c				\
 	datetime-dialog.h			\
-	datetime-dialog.c			\
-	xfce46-compat.h				\
-	xfce46-compat.c
+	datetime-dialog.c
 
 libdatetime_la_CFLAGS = 			\
 	-I$(top_srcdir)				\
 	-DLOCALEDIR=\"$(localedir)\"		\
 	$(GTK_CFLAGS)				\
 	$(LIBXFCE4PANEL_CFLAGS)			\
-	$(LIBXFCEGUI4_CFLAGS)			\
+	$(LIBXFCE4UI_CFLAGS)			\
 	$(LIBXFCE4UTIL_CFLAGS)
 
 libdatetime_la_LDFLAGS = 			\
@@ -31,7 +29,7 @@ endif
 libdatetime_la_LIBADD = 			\
 	$(GTK_LIBS)				\
 	$(LIBXFCE4PANEL_LIBS)			\
-	$(LIBXFCEGUI4_LIBS)			\
+	$(LIBXFCE4UI_LIBS)			\
 	$(LIBXFCE4UTIL_LIBS)
 
 desktopdir = $(datadir)/xfce4/panel-plugins
diff --git a/panel-plugin/datetime-dialog.c b/panel-plugin/datetime-dialog.c
index 193587e..4ef3ab8 100644
--- a/panel-plugin/datetime-dialog.c
+++ b/panel-plugin/datetime-dialog.c
@@ -28,7 +28,7 @@
 #include <string.h>
 
 /* xfce includes */
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 #include <libxfce4util/libxfce4util.h>
 #include <libxfce4panel/xfce-panel-plugin.h>
 
@@ -388,7 +388,7 @@ datetime_properties_dialog(XfcePanelPlugin *plugin, t_datetime * datetime)
   /*
    * layout frame
    */
-  frame = xfce_create_framebox(_("Layout"), &bin);
+  frame = xfce_gtk_frame_box_new(_("Layout"), &bin);
   gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->vbox), frame,
       FALSE, FALSE, 0);
   gtk_container_set_border_width(GTK_CONTAINER(frame), 6);
@@ -422,7 +422,7 @@ datetime_properties_dialog(XfcePanelPlugin *plugin, t_datetime * datetime)
   /*
    * Date frame
    */
-  datetime->date_frame = xfce_create_framebox(_("Date"), &bin);
+  datetime->date_frame = xfce_gtk_frame_box_new(_("Date"), &bin);
   gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->vbox), datetime->date_frame,
       FALSE, FALSE, 0);
   gtk_container_set_border_width(GTK_CONTAINER(datetime->date_frame), 6);
@@ -525,7 +525,7 @@ datetime_properties_dialog(XfcePanelPlugin *plugin, t_datetime * datetime)
   /*
    * time frame
    */
-  datetime->time_frame = xfce_create_framebox(_("Time"), &bin);
+  datetime->time_frame = xfce_gtk_frame_box_new(_("Time"), &bin);
   gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->vbox), datetime->time_frame,
       FALSE, FALSE, 0);
   gtk_container_set_border_width(GTK_CONTAINER(datetime->time_frame), 6);
diff --git a/panel-plugin/datetime.c b/panel-plugin/datetime.c
index 30ee04a..0738889 100644
--- a/panel-plugin/datetime.c
+++ b/panel-plugin/datetime.c
@@ -28,13 +28,11 @@
 #include <string.h>
 
 /* xfce includes */
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 #include <libxfce4util/libxfce4util.h>
 #include <libxfce4panel/xfce-panel-plugin.h>
 #include <libxfce4panel/xfce-panel-convenience.h>
 
-#include "xfce46-compat.h"
-
 #include "datetime.h"
 #include "datetime-dialog.h"
 
diff --git a/panel-plugin/xfce46-compat.c b/panel-plugin/xfce46-compat.c
deleted file mode 100644
index 97f10b1..0000000
--- a/panel-plugin/xfce46-compat.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Code was taken from libxfce4panel (LGPL2 or any later version),
- * distributed here under the GPL.
- *
- * Copyright (c) 2005-2007 Jasper Huijsmans <jasper@xfce.org>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#ifndef HAVE_LIBXFCE4PANEL_46
-
-#include "xfce46-compat.h"
-
-#include <libxfce4panel/xfce-panel-plugin.h>
-#include <libxfce4panel/xfce-panel-macros.h>
-
-/* support macros for debugging */
-#ifndef NDEBUG
-#define _panel_assert(expr)                  g_assert (expr)
-#define _panel_assert_not_reached()          g_assert_not_reached ()
-#define _panel_return_if_fail(expr)          g_return_if_fail (expr)
-#define _panel_return_val_if_fail(expr, val) g_return_val_if_fail (expr, (val))
-#else
-#define _panel_assert(expr)                  G_STMT_START{ (void)0; }G_STMT_END
-#define _panel_assert_not_reached()          G_STMT_START{ (void)0; }G_STMT_END
-#define _panel_return_if_fail(expr)          G_STMT_START{ (void)0; }G_STMT_END
-#define _panel_return_val_if_fail(expr, val) G_STMT_START{ (void)0; }G_STMT_END
-#endif
-
-/**
- * xfce_panel_plugin_arrow_type:
- * @plugin        : an #XfcePanelPlugin
- *
- * Determine the #GtkArrowType for a widget that opens a menu and uses
- *  xfce_panel_plugin_position_menu() to position the menu.
- *
- * Returns: The #GtkArrowType to use.
- **/
-GtkArrowType
-xfce_panel_plugin_arrow_type (XfcePanelPlugin *plugin)
-{
-    XfceScreenPosition  position;
-    GdkScreen          *screen;
-    GdkRectangle        geom;
-    gint                mon, x, y;
-
-    if (!GTK_WIDGET_REALIZED (plugin))
-        return GTK_ARROW_UP;
-
-    position = xfce_panel_plugin_get_screen_position (plugin);
-    switch (position)
-    {
-        /* top */
-        case XFCE_SCREEN_POSITION_NW_H:
-        case XFCE_SCREEN_POSITION_N:
-        case XFCE_SCREEN_POSITION_NE_H:
-            return GTK_ARROW_DOWN;
-
-        /* left */
-        case XFCE_SCREEN_POSITION_NW_V:
-        case XFCE_SCREEN_POSITION_W:
-        case XFCE_SCREEN_POSITION_SW_V:
-            return GTK_ARROW_RIGHT;
-
-        /* right */
-        case XFCE_SCREEN_POSITION_NE_V:
-        case XFCE_SCREEN_POSITION_E:
-        case XFCE_SCREEN_POSITION_SE_V:
-            return GTK_ARROW_LEFT;
-
-        /* bottom */
-        case XFCE_SCREEN_POSITION_SW_H:
-        case XFCE_SCREEN_POSITION_S:
-        case XFCE_SCREEN_POSITION_SE_H:
-            return GTK_ARROW_UP;
-
-        /* floating */
-        default:
-            /* get the screen information */
-            screen = gtk_widget_get_screen (GTK_WIDGET (plugin));
-            mon = gdk_screen_get_monitor_at_window (screen, GTK_WIDGET (plugin)->window);
-            gdk_screen_get_monitor_geometry (screen, mon, &geom);
-            gdk_window_get_root_origin (GTK_WIDGET (plugin)->window, &x, &y);
-
-            /* get the position based on the screen position */
-            if (position == XFCE_SCREEN_POSITION_FLOATING_H)
-                return ((y < (geom.y + geom.height / 2)) ? GTK_ARROW_DOWN : GTK_ARROW_UP);
-            else
-                return ((x < (geom.x + geom.width / 2)) ? GTK_ARROW_RIGHT : GTK_ARROW_LEFT);
-    }
-}
-
-
-
-/**
- * xfce_panel_plugin_position_widget:
- * @plugin        : an #XfcePanelPlugin
- * @menu_widget   : a #GtkWidget that will be used as popup menu
- * @attach_widget : a #GtkWidget relative to which the menu should be positioned
- * @x             : return location for the x coordinate
- * @y             : return location for the y coordinate
- *
- * The menu widget is positioned relative to @attach_widget.
- * If @attach_widget is NULL, the menu widget is instead positioned
- * relative to @panel_plugin.
- *
- * This function is intended for custom menu widgets.
- * For a regular #GtkMenu you should use xfce_panel_plugin_position_menu()
- * instead (as callback argument to gtk_menu_popup()).
- *
- * See also: xfce_panel_plugin_position_menu().
- **/
-void
-xfce_panel_plugin_position_widget (XfcePanelPlugin  *plugin,
-                                   GtkWidget        *menu_widget,
-                                   GtkWidget        *attach_widget,
-                                   gint             *x,
-                                   gint             *y)
-{
-    GtkRequisition  req;
-    GdkScreen      *screen;
-    GdkRectangle    geom;
-    gint            mon;
-
-    _panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
-    _panel_return_if_fail (GTK_IS_WIDGET (menu_widget));
-    _panel_return_if_fail (attach_widget == NULL || GTK_IS_WIDGET (attach_widget));
-
-    if (attach_widget == NULL)
-        attach_widget = GTK_WIDGET (plugin);
-
-    if (!GTK_WIDGET_REALIZED (menu_widget))
-        gtk_widget_realize (menu_widget);
-
-    gtk_widget_size_request (menu_widget, &req);
-    gdk_window_get_origin (attach_widget->window, x, y);
-
-    switch (xfce_panel_plugin_arrow_type (plugin))
-    {
-        case GTK_ARROW_UP:
-            *y -= req.height;
-            break;
-
-        case GTK_ARROW_DOWN:
-            *y += attach_widget->allocation.height;
-            break;
-
-        case GTK_ARROW_LEFT:
-            *x -= req.width;
-            break;
-
-        default: /* GTK_ARROW_RIGHT and GTK_ARROW_NONE */
-            *x += attach_widget->allocation.width;
-            break;
-    }
-
-    screen = gtk_widget_get_screen (attach_widget);
-    mon = gdk_screen_get_monitor_at_window (screen, attach_widget->window);
-    gdk_screen_get_monitor_geometry (screen, mon, &geom);
-
-    /* keep inside the screen */
-    if (*x > geom.x + geom.width - req.width)
-        *x = geom.x + geom.width - req.width;
-    if (*x < geom.x)
-        *x = geom.x;
-    if (*y > geom.y + geom.height - req.height)
-        *y = geom.y + geom.height - req.height;
-    if (*y < geom.y)
-        *y = geom.y;
-
-    if (G_LIKELY (GTK_IS_MENU (menu_widget)))
-        gtk_menu_set_screen (GTK_MENU (menu_widget), screen);
-    else if (GTK_IS_WINDOW (menu_widget))
-        gtk_window_set_screen (GTK_WINDOW (menu_widget), screen);
-}
-
-#endif
diff --git a/panel-plugin/xfce46-compat.h b/panel-plugin/xfce46-compat.h
deleted file mode 100644
index d385ec4..0000000
--- a/panel-plugin/xfce46-compat.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef _XFCE46_COMPAT
-#define _XFCE46_COMPAT
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#ifndef HAVE_LIBXFCE4PANEL_46
-
-#include <gtk/gtk.h>
-#include <libxfce4panel/xfce-panel-plugin.h>
-
-void                 xfce_panel_plugin_position_widget      (XfcePanelPlugin  *plugin,
-                                                             GtkWidget        *menu_widget,
-                                                             GtkWidget        *attach_widget,
-                                                             gint             *x,
-                                                             gint             *y);
-
-#endif
-#endif
-- 
1.7.4.4