aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2018-01-07 18:18:44 +0100
committerJavier <dev.git@javispedro.com>2018-01-07 18:18:44 +0100
commit1dd7a1791cddd829be08edfc32c3b45c22900383 (patch)
treef17631b6a01e51f2e1a1710e4265210df35bfb89
parent6d7ccc43da032c9e43094a127d584c885901acac (diff)
downloadtopmenu-gtk-1dd7a1791cddd829be08edfc32c3b45c22900383.tar.gz
topmenu-gtk-1dd7a1791cddd829be08edfc32c3b45c22900383.zip
require path to gtk3 source code instead of hardcoding private members
-rw-r--r--configure.ac9
-rw-r--r--module/gtk3privates.h193
-rw-r--r--module/menuitem-proxy.c4
3 files changed, 11 insertions, 195 deletions
diff --git a/configure.ac b/configure.ac
index 6c8c43e..ce07299 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,6 +21,10 @@ AC_ARG_WITH([gtk-module-dir],
[AS_HELP_STRING([--with-gtk-module-dir=DIR], [GTK+ module directory [default=`pkg-config --variable=libdir gtk+-3.0`/gtk-3.0/modules]])],
[],
[with_gtk_module_dir=$with_gtk_libdir/gtk-$with_gtk.0/modules])
+AC_ARG_WITH([gtk-srcdir],
+ [AS_HELP_STRING([--with-gtk-srcdir=DIR], [GTK+ source directory (only for GTK+ 3)])],
+ [],
+ [with_gtk_srcdir=])
AC_ARG_WITH([lxpanel-plugin-dir],
[AS_HELP_STRING([--with-lxpanel-plugin-dir=DIR], [LXPanel plugin directory [default=`pkg-config --variable=pluginsdir lxpanel`]])],
[],
@@ -61,7 +65,10 @@ PKG_CHECK_MODULES([GTK], [gtk+-x11-$with_gtk.0])
PKG_CHECK_MODULES([X11], [x11])
AS_IF([test "x$with_gtk" = x3],
- [AS_IF([test "x$with_wnck" = xwnck3 -o "x$with_wnck" = xcheck],
+ [AS_IF([test "x$with_gtk_srcdir" = x],
+ [AC_MSG_FAILURE([--with-gtk-srcdir was not specified.])],
+ [GTK_CFLAGS="-I$with_gtk_srcdir $GTK_CFLAGS"])
+ AS_IF([test "x$with_wnck" = xwnck3 -o "x$with_wnck" = xcheck],
[PKG_CHECK_MODULES([WNCK3], [libwnck-3.0],
[
AC_DEFINE([HAVE_WNCK3], [1], [Define if you have libwnck-3.0])
diff --git a/module/gtk3privates.h b/module/gtk3privates.h
deleted file mode 100644
index bce2b61..0000000
--- a/module/gtk3privates.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _GTK3PRIVATES_H_
-#define _GTK3PRIVATES_H_
-
-#include "../global.h"
-
-#if GTK_MAJOR_VERSION == 3
-#include <gtk/gtk.h>
-
-/* What could possibly go wrong if I just pull all those privates here? */
-typedef enum
-{
- GTK_DIRECTION_LEFT,
- GTK_DIRECTION_RIGHT
-} GtkSubmenuDirection;
-
-typedef enum
-{
- GTK_TOP_BOTTOM,
- GTK_LEFT_RIGHT
-} GtkSubmenuPlacement;
-
-typedef struct _GtkMenuTracker GtkMenuTracker;
-typedef struct _GtkMnemnonicHash GtkMnemonicHash;
-typedef struct _GtkKeyHash GtkKeyHash;
-typedef struct _GtkActionHelper GtkActionHelper;
-
-struct _GtkMenuPrivate
-{
- GtkWidget *parent_menu_item;
- GtkWidget *old_active_menu_item;
-
- GtkAccelGroup *accel_group;
- gchar *accel_path;
-
- GtkMenuPositionFunc position_func;
- gpointer position_func_data;
- GDestroyNotify position_func_data_destroy;
- gint position_x;
- gint position_y;
-
- guint toggle_size;
- guint accel_size;
-
- /* Do _not_ touch these widgets directly. We hide the reference
- * count from the toplevel to the menu, so it must be restored
- * before operating on these widgets
- */
- GtkWidget *toplevel;
-
- GtkWidget *tearoff_window;
- GtkWidget *tearoff_hbox;
- GtkWidget *tearoff_scrollbar;
- GtkAdjustment *tearoff_adjustment;
-
- GdkWindow *view_window;
- GdkWindow *bin_window;
-
- gint scroll_offset;
- gint saved_scroll_offset;
- gint scroll_step;
-
- guint scroll_timeout;
-
- guint needs_destruction_ref : 1;
- guint torn_off : 1;
- /* The tearoff is active when it is torn off and the not-torn-off
- * menu is not popped up.
- */
- guint tearoff_active : 1;
- guint scroll_fast : 1;
-
- guint upper_arrow_visible : 1;
- guint lower_arrow_visible : 1;
- guint upper_arrow_prelight : 1;
- guint lower_arrow_prelight : 1;
-
- guint have_position : 1;
- guint have_layout : 1;
- guint seen_item_enter : 1;
- guint ignore_button_release : 1;
- guint no_toggle_size : 1;
- guint drag_already_pressed : 1;
- guint drag_scroll_started : 1;
-
- /* info used for the table */
- guint *heights;
- gint heights_length;
- gint requested_height;
-
- gboolean initially_pushed_in;
- gint monitor_num;
-
- /* Cached layout information */
- gint n_rows;
- gint n_columns;
-
- gchar *title;
-
- /* Arrow states */
- GtkStateFlags lower_arrow_state;
- GtkStateFlags upper_arrow_state;
-
- /* navigation region */
- gint navigation_x;
- gint navigation_y;
- gint navigation_width;
- gint navigation_height;
-
- guint navigation_timeout;
-
- gdouble drag_start_y;
- gint initial_drag_offset;
-};
-
-struct _GtkMenuShellPrivate
-{
- GList *children;
-
- GtkWidget *active_menu_item; /* This is not an "active" menu item
- * (there is no such thing) but rather,
- * the selected menu item in that MenuShell,
- * if there is one.
- */
- GtkWidget *parent_menu_shell;
- GtkMenuTracker *tracker; // if bound to a GMenuModel
-
- guint button;
- guint32 activate_time;
-
- guint active : 1;
- guint have_grab : 1;
- guint have_xgrab : 1;
- guint ignore_enter : 1;
- guint keyboard_mode : 1;
-
- guint take_focus : 1;
- guint activated_submenu : 1;
- guint in_unselectable_item : 1; /* This flag is a crutch to keep
- * mnemonics in the same menu if
- * the user moves the mouse over
- * an unselectable menuitem.
- */
- GtkMnemonicHash *mnemonic_hash;
- GtkKeyHash *key_hash;
-
- GdkDevice *grab_pointer;
-};
-
-struct _GtkMenuItemPrivate
-{
- GtkWidget *submenu;
- GdkWindow *event_window;
-
- guint16 toggle_size;
- guint16 accelerator_width;
-
- guint timer;
-
- gchar *accel_path;
-
- GtkAction *action;
- GtkActionHelper *action_helper;
-
- guint show_submenu_indicator : 1;
- guint submenu_placement : 1;
- guint submenu_direction : 1;
- guint right_justify : 1;
- guint timer_from_keypress : 1;
- guint from_menubar : 1;
- guint use_action_appearance : 1;
- guint reserve_indicator : 1;
-};
-
-#endif /* GTK_MAJOR_VERSION == 3 */
-
-#endif /* _GTK3PRIVATES_H_ */
diff --git a/module/menuitem-proxy.c b/module/menuitem-proxy.c
index 6c413b8..0700681 100644
--- a/module/menuitem-proxy.c
+++ b/module/menuitem-proxy.c
@@ -59,7 +59,9 @@ static void init_static_data()
}
#if GTK_MAJOR_VERSION == 3
-#include "gtk3privates.h"
+#include "gtk/gtkmenushellprivate.h"
+#include "gtk/gtkmenuprivate.h"
+#include "gtk/gtkmenuitemprivate.h"
#endif
static gboolean