| 1 | /* |
| 2 | * Copyright (C) 2011 Igalia S.L. |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Library General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Library General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Library General Public License |
| 15 | * along with this library; see the file COPYING.LIB. If not, write to |
| 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 | * Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | #pragma once |
| 21 | |
| 22 | #include "WebPopupMenuProxy.h" |
| 23 | #include <WebCore/GUniquePtrGtk.h> |
| 24 | #include <wtf/Vector.h> |
| 25 | #include <wtf/glib/GRefPtr.h> |
| 26 | #include <wtf/text/WTFString.h> |
| 27 | |
| 28 | typedef struct _GMainLoop GMainLoop; |
| 29 | typedef struct _GdkDevice GdkDevice; |
| 30 | typedef struct _GdkEventButton GdkEventButton; |
| 31 | typedef struct _GdkEventKey GdkEventKey; |
| 32 | typedef struct _GtkTreePath GtkTreePath; |
| 33 | typedef struct _GtkTreeView GtkTreeView; |
| 34 | typedef struct _GtkTreeViewColumn GtkTreeViewColumn; |
| 35 | |
| 36 | namespace WebCore { |
| 37 | class IntRect; |
| 38 | } |
| 39 | |
| 40 | namespace WebKit { |
| 41 | |
| 42 | class WebPageProxy; |
| 43 | |
| 44 | class : public WebPopupMenuProxy { |
| 45 | public: |
| 46 | static Ref<WebPopupMenuProxyGtk> (GtkWidget* webView, WebPopupMenuProxy::Client& client) |
| 47 | { |
| 48 | return adoptRef(*new WebPopupMenuProxyGtk(webView, client)); |
| 49 | } |
| 50 | (); |
| 51 | |
| 52 | void (const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex) override; |
| 53 | void () override; |
| 54 | void () override; |
| 55 | |
| 56 | virtual void (unsigned itemIndex); |
| 57 | virtual void (Optional<unsigned> itemIndex); |
| 58 | |
| 59 | protected: |
| 60 | (GtkWidget*, WebPopupMenuProxy::Client&); |
| 61 | |
| 62 | GtkWidget* { nullptr }; |
| 63 | |
| 64 | private: |
| 65 | void (const Vector<WebPopupItem>&, int32_t selectedIndex); |
| 66 | void (); |
| 67 | bool (GtkTreePath*); |
| 68 | Optional<unsigned> (GdkEventKey*); |
| 69 | bool (GdkEventKey*); |
| 70 | |
| 71 | static gboolean (GtkWidget*, GdkEventButton*, WebPopupMenuProxyGtk*); |
| 72 | static gboolean (GtkWidget*, GdkEventKey*, WebPopupMenuProxyGtk*); |
| 73 | static void treeViewRowActivatedCallback(GtkTreeView*, GtkTreePath*, GtkTreeViewColumn*, WebPopupMenuProxyGtk*); |
| 74 | static gboolean (GtkWidget*, GdkEventButton*, WebPopupMenuProxyGtk*); |
| 75 | |
| 76 | GtkWidget* { nullptr }; |
| 77 | GtkWidget* { nullptr }; |
| 78 | GdkDevice* { nullptr }; |
| 79 | |
| 80 | Vector<GUniquePtr<GtkTreePath>> ; |
| 81 | Optional<unsigned> ; |
| 82 | |
| 83 | // Typeahead find. |
| 84 | gunichar { '\0' }; |
| 85 | uint32_t { 0 }; |
| 86 | GString* { nullptr }; |
| 87 | }; |
| 88 | |
| 89 | } // namespace WebKit |
| 90 | |