/* * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code 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 General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ #ifndef GLASS_GTKCOMPAT_H #define GLASS_GTKCOMPAT_H #include #include #include #if GTK_CHECK_VERSION(2, 22, 0) #define GLASS_GDK_DRAG_CONTEXT_GET_SELECTED_ACTION(context) \ gdk_drag_context_get_selected_action(context) #define GLASS_GDK_DRAG_CONTEXT_GET_ACTIONS(context) \ gdk_drag_context_get_actions(context) #define GLASS_GDK_DRAG_CONTEXT_LIST_TARGETS(context) \ gdk_drag_context_list_targets(context) #define GLASS_GDK_DRAG_CONTEXT_GET_SUGGESTED_ACTION(context) \ gdk_drag_context_get_suggested_action(context) #else /* GTK_CHECK_VERSION(2, 22, 0) */ #define GLASS_GDK_DRAG_CONTEXT_GET_SELECTED_ACTION(context) \ (context->action) #define GLASS_GDK_DRAG_CONTEXT_GET_ACTIONS(context) \ (context->actions) #define GLASS_GDK_DRAG_CONTEXT_LIST_TARGETS(context) \ (context->targets) #define GLASS_GDK_DRAG_CONTEXT_GET_SUGGESTED_ACTION(context) \ (context->suggested_action) #endif /* GTK_CHECK_VERSION(2, 22, 0) */ #if GTK_CHECK_VERSION(2, 24, 0) #define GLASS_GDK_KEY_CONSTANT(key) (GDK_KEY_ ## key) #define GLASS_GDK_WINDOW_FOREIGN_NEW_FOR_DISPLAY(display, anid) \ gdk_x11_window_foreign_new_for_display(display, anid) #define GLASS_GDK_WINDOW_LOOKUP_FOR_DISPLAY(display, anid) \ gdk_x11_window_lookup_for_display(display, anid) #else /* GTK_CHECK_VERSION(2, 24, 0) */ #define GLASS_GDK_KEY_CONSTANT(key) (GDK_ ## key) #define GLASS_GDK_WINDOW_FOREIGN_NEW_FOR_DISPLAY(display, anid) \ gdk_window_foreign_new_for_display(display, anid) #define GLASS_GDK_WINDOW_LOOKUP_FOR_DISPLAY(display, anid) \ gdk_window_lookup_for_display(display, anid) #endif /* GTK_CHECK_VERSION(2, 24, 0) */ #if GTK_CHECK_VERSION(3, 0, 0) #define GLASS_GTK_WINDOW_SET_HAS_RESIZE_GRIP(window, value) \ gtk_window_set_has_resize_grip(window, TRUE) #define GLASS_GDK_SELECTION_EVENT_GET_REQUESTOR(event) \ (event->requestor) #define GLASS_GDK_DRAG_CONTEXT_GET_DEST_WINDOW(context) \ gdk_drag_context_get_dest_window(context) #else /* GTK_CHECK_VERSION(3, 0, 0) */ #define GLASS_GTK_WINDOW_SET_HAS_RESIZE_GRIP(window, value) \ (void) window; \ (void) value; #define GLASS_GDK_SELECTION_EVENT_GET_REQUESTOR(event) \ GLASS_GDK_WINDOW_FOREIGN_NEW_FOR_DISPLAY( \ gdk_display_get_default(), event->requestor) #define GLASS_GDK_DRAG_CONTEXT_GET_DEST_WINDOW(context) \ ((context != NULL) ? gdk_drag_context_get_dest_window(context) : NULL) #endif /* GTK_CHECK_VERSION(3, 0, 0) */ #endif /* GLASS_GTKCOMPAT_H */