Fixed input field zoom in contentRichlyEditable field
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / PageClientImpl.h
1 /*
2  * Copyright (C) 2011 Samsung Electronics
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #ifndef PageClientImpl_h
27 #define PageClientImpl_h
28
29 #include "PageClient.h"
30 #include <Evas.h>
31
32 #if OS(TIZEN)
33 #include "WebEditCommandProxy.h"
34 #include <WebCore/ViewportArguments.h>
35
36 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
37 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
38 #include "DrawingAreaProxyImpl.h"
39 #include <WebCore/Color.h>
40 #endif
41 #endif
42 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
43 #include "TextSelection.h"
44 #endif
45 #if ENABLE(TIZEN_OFFLINE_PAGE_SAVE)
46 #include "OfflinePageSave.h"
47 #endif
48 #if ENABLE(TIZEN_DRAG_SUPPORT)
49 #include "Drag.h"
50 #endif
51 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
52 #include "AutoFillManager.h"
53 #endif
54 using std::numeric_limits;
55 #endif // #if OS(TIZEN)
56
57 class EwkViewImpl;
58
59 namespace WebKit {
60
61 #if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
62 class MainFrameScrollbarTizen;
63 #endif
64
65 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
66 class TextSelection;
67 #endif
68
69 #if ENABLE(TIZEN_WEBKIT2_CLIPBOARD_HELPER)
70 class ClipboardHelper;
71 #endif
72
73 #if ENABLE(TIZEN_DRAG_SUPPORT)
74 class Drag;
75 #endif
76
77 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
78 class AutoFillManager;
79 #endif
80
81 class PageClientImpl : public PageClient {
82 public:
83     static PassOwnPtr<PageClientImpl> create(EwkViewImpl* viewImpl)
84     {
85         return adoptPtr(new PageClientImpl(viewImpl));
86     }
87     virtual ~PageClientImpl();
88
89     EwkViewImpl* viewImpl() const;
90
91 #if OS(TIZEN)
92     struct ViewportConstraints {
93         ViewportConstraints()
94             : initialScale(1.0)
95             , minimumScale(1.0)
96             , maximumScale(1.0)
97             , userScalable(true)
98             , fixedInitialScale(false)
99             , layoutSize(WebCore::IntSize())
100         {
101         }
102         double initialScale;
103         double minimumScale;
104         double maximumScale;
105         bool userScalable;
106         // fixedInitialScale is enabled when below conditions are satisfied
107         // 1. There's content defined "initial-scale" value on viewport meta tag
108         // 2. initialScale is calculated by disabled autofitting setting
109         bool fixedInitialScale;
110         WebCore::IntSize layoutSize;
111     };
112
113     bool userScalable() { return fabs(m_viewportConstraints.minimumScale - m_viewportConstraints.maximumScale) > numeric_limits<float>::epsilon(); }
114     ViewportConstraints viewportConstraints();
115     ViewportConstraints computeViewportConstraints(const WebCore::ViewportAttributes&);
116     double adjustScaleWithViewport(double);
117 #if USE(TILED_BACKING_STORE) && ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
118     TIZEN_VIRTUAL void updateViewportSize(const WebCore::IntSize&, const int);
119     TIZEN_VIRTUAL void updateVisibleContentRectSize(const WebCore::IntSize&);
120 #endif
121     void prepareRestoredVisibleContectRect();
122 #if ENABLE(TIZEN_WEBKIT2_RESTORE_SCROLLPOINT_ON_FRAME_LOAD_FINISH)
123     void setRestoredScrollPoints();
124 #endif
125     void initializeVisibleContentRect();
126     double availableMinimumScale();
127     void fitViewportToContent();
128     bool wasViewportFitsToContent() { return m_viewportFitsToContent; }
129
130     bool pageDidRendered() { return m_pageDidRendered; }
131
132     void setFocusedNodeRect(const WebCore::IntRect&);
133     WebCore::IntRect focusedNodeRect() { return m_focusedNodeRect; };
134
135 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
136     void textChangeInTextField(const String& name, const String& value);
137 #endif
138
139     void setViewFocused(bool focused) { m_viewFocused = focused; }
140     void setViewWindowActive(bool active) { m_viewWindowActive = active; }
141     void updateFormNavigation(int length, int offset);
142
143 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
144 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
145     DrawingAreaProxy* drawingArea() const;
146 #endif
147     float scaleFactor();
148     const WebCore::IntPoint scrollPosition();
149     WebCore::IntRect adjustVisibleContentRect(WebCore::IntRect, float);
150     void setVisibleContentRect(const WebCore::IntRect&, float newScale, const WebCore::FloatPoint& trajectory = WebCore::FloatPoint());
151     TIZEN_VIRTUAL void displayViewport();
152     TIZEN_VIRTUAL void drawContents();
153 #if ENABLE(TIZEN_RUNTIME_BACKEND_SELECTION)
154     virtual void drawContents(BackingStore::PlatformGraphicsContext);
155 #endif
156     void scaleImage(double, WebCore::IntPoint);
157     void scaleContents(double, const WebCore::IntPoint&);
158     WebCore::IntRect visibleContentRect() { return m_visibleContentRect; }
159
160 #if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
161     void updateScrollbar();
162     void frameRectChanged();
163     void updateVisibility();
164 #endif
165
166     // FIXME: The concept of suspending content comes from webkit opensource's PageViewportController,
167     // so below code should be replaced when PageViewportController codes are merged.
168     // Please do not use below codes. They are only for scaling contents.
169     void suspendContent();
170     void resumeContent();
171     WebCore::FloatPoint boundContentsPositionAtScale(const WebCore::FloatPoint&, float scale);
172 #else
173     float scaleFactor() { return page()->pageScaleFactor(); }
174     WebCore::IntPoint scrollPosition() { return page()->scrollPosition(); }
175 #endif // #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
176
177 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
178     bool isTextSelectionDowned();
179     bool isTextSelectionMode();
180     void setIsTextSelectionMode(bool isTextSelectionMode);
181     void updateTextSelectionHandlesAndContextMenu(bool isShow, bool isScrolling = false);
182     bool textSelectionDown(const WebCore::IntPoint& point);
183     void textSelectionMove(const WebCore::IntPoint& point);
184     void textSelectionUp(const WebCore::IntPoint& point, bool isStartedTextSelectionFromOutside = false);
185     bool isTextSelectionHandleDowned();
186 #if ENABLE(TIZEN_WEBKIT2_FOR_MOVING_TEXT_SELECTION_HANDLE_FROM_OSP)
187     void textSelectonHandleDown(const WebCore::IntPoint& point);
188     void textSelectonHandleMove(const WebCore::IntPoint& point);
189     void textSelectonHandleUp();
190 #endif
191     void requestToShowTextSelectionHandlesAndContextMenu();
192     void initTextSelectionHandlesMouseDownedStatus();
193     bool changeContextMenuPosition(WebCore::IntPoint& point, WebCore::IntPoint);
194     void selectWordAutomatically(const WebCore::IntPoint& point);
195 #endif
196
197 #if ENABLE(TIZEN_OFFLINE_PAGE_SAVE)
198     void saveSerializedHTMLDataForMainPage(const String& serializedData, const String& fileName);
199     void saveSubresourcesData(Vector<WebSubresourceTizen>& subresourceData);
200     void startOfflinePageSave(String& path, String& url, String& title);
201 #endif
202
203 #if ENABLE(TIZEN_CLIPBOARD) || ENABLE(TIZEN_PASTEBOARD)
204     void setClipboardData(const String& data, const String& type);
205     void clearClipboardData();
206 #endif
207
208 #if ENABLE(TIZEN_WEBKIT2_CLIPBOARD_HELPER)
209     void pasteContextMenuSelected();
210 #endif
211
212
213 #if ENABLE(TIZEN_WEBKIT2_VIEW_VISIBILITY)
214     void setIsVisible(bool isVisible);
215 #endif
216
217 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
218     bool scrollBy(WebCore::IntSize);
219     void scrollTo(WebCore::IntPoint);
220 #endif
221
222     void setIsScrollableLayerFocused(const bool b) { m_isScrollableLayerFocused = b; }
223     bool isScrollableLayerFocused() const { return m_isScrollableLayerFocused; }
224
225     void setIsScrollableNodeFocused(const bool b) { m_isScrollableNodeFocused = b; }
226     bool isScrollableNodeFocused() const { return m_isScrollableNodeFocused; }
227
228 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
229     void setOverflowResult(bool pressed, WebLayerID);
230     void findScrollableNode(const WebCore::IntPoint&);
231 #endif
232
233 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
234     bool isContextMenuVisible() { return m_isContextMenuVisible; }
235     void setIsContextMenuVisible(bool isVisible) { m_isContextMenuVisible = isVisible; }
236 #endif
237     TIZEN_VIRTUAL void didRenderFrame();
238 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
239     void setBackgroundColor(double red, double green, double blue, double alpha);
240     TIZEN_VIRTUAL bool makeContextCurrent() { return true; }
241 #endif
242
243     virtual void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&);
244
245 #if ENABLE(TIZEN_ICON_DATABASE)
246     virtual void didReceiveIcon();
247 #endif
248
249 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
250     void clipboardContextMenuSelected();
251     bool isClipboardWindowOpened();
252     void closeClipboardWindow();
253 #endif
254
255 #if ENABLE(TIZEN_DRAG_SUPPORT)
256     void setDragPoint(const WebCore::IntPoint& point);
257     bool isDragMode();
258     void setDragMode(bool isDragMode);
259 #endif
260
261 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
262     bool isShowingAutoFillPopup();
263     void updateAutoFillPopup(const Vector<AutoFillPopupItem>& data);
264     void hideAutoFillPopup();
265     void showAutoFillPopup(const WebCore::IntRect& rect);
266 #endif
267
268 #if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
269     void setWaitFrameOfNewViewortSize(bool waitFrameOfNewViewortSize) { m_waitFrameOfNewViewortSize = waitFrameOfNewViewortSize; }
270 #endif
271
272     // Added to check whether visible content rect can be updated or not
273     // Returns true when first frame is rendered and resizing view is done
274     bool canUpdateVisibleContentRect();
275
276     bool notifiedNonemptyLayout() { return m_nonemptyLayoutRendered; }
277
278 #if ENABLE(TIZEN_WEBKIT2_INPUT_FIELD_ZOOM)
279     void setNeedFocusAdjust(bool needFocusAdjust) { m_needFocusAdjust = needFocusAdjust; }
280 #endif
281
282 #endif // #if OS(TIZEN)
283
284 private:
285     // PageClient
286     virtual PassOwnPtr<DrawingAreaProxy> createDrawingAreaProxy();
287     virtual void setViewNeedsDisplay(const WebCore::IntRect&);
288     virtual void displayView();
289     virtual void scrollView(const WebCore::IntRect&, const WebCore::IntSize&);
290     virtual bool isViewWindowActive() { return m_viewWindowActive; }
291     virtual bool isViewFocused() { return m_viewFocused; }
292     virtual bool isViewVisible();
293     virtual bool isViewInWindow();
294
295     virtual void processDidCrash();
296     virtual void didRelaunchProcess();
297     virtual void pageClosed();
298
299     virtual void toolTipChanged(const String&, const String&);
300
301     virtual void setCursor(const WebCore::Cursor&);
302     virtual void setCursorHiddenUntilMouseMoves(bool);
303     virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&);
304
305     virtual void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo);
306     virtual void clearAllEditCommands();
307     virtual bool canUndoRedo(WebPageProxy::UndoOrRedo);
308     virtual void executeUndoRedo(WebPageProxy::UndoOrRedo);
309     virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&);
310     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
311     virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
312     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&);
313
314     void updateTextInputState();
315     virtual void handleDownloadRequest(DownloadProxy*);
316
317     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool);
318 #if ENABLE(GESTURE_EVENTS)
319     virtual void doneWithGestureEvent(const WebGestureEvent&, bool wasEventHandled);
320 #endif
321 #if ENABLE(TOUCH_EVENTS)
322     virtual void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled);
323 #endif
324
325     virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
326     virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*);
327
328 #if ENABLE(INPUT_TYPE_COLOR)
329     virtual PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color& initialColor);
330 #endif
331
332     virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool, bool);
333 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
334     TIZEN_VIRTUAL void initializeAcceleratedCompositingMode();
335     TIZEN_VIRTUAL void finalizeAcceleratedCompositingMode() {}
336     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) {}
337     virtual void exitAcceleratedCompositingMode() {}
338
339     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
340 #endif
341
342     virtual void didChangeScrollbarsForMainFrame() const;
343
344 #if OS(TIZEN)
345 #if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
346     void createScrollbarIfNeeded(bool horizontalBar, bool verticalBar);
347 #endif
348
349     virtual void didFirstVisuallyNonEmptyLayoutForMainFrame();
350     virtual void didChangeContentsSize(const WebCore::IntSize);
351     virtual void pageScaleFactorDidChange();
352 #endif
353
354     virtual void didCommitLoadForMainFrame(bool);
355     virtual void didFinishLoadingDataForCustomRepresentation(const String&, const CoreIPC::DataReference&);
356     virtual double customRepresentationZoomFactor();
357     virtual void setCustomRepresentationZoomFactor(double);
358
359     virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>&);
360     virtual void findStringInCustomRepresentation(const String&, FindOptions, unsigned);
361     virtual void countStringMatchesInCustomRepresentation(const String&, FindOptions, unsigned);
362
363 #if USE(TILED_BACKING_STORE)
364     virtual void pageDidRequestScroll(const WebCore::IntPoint&);
365 #endif
366
367 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
368     virtual void pageDidRequestRestoreVisibleContentRect(const WebCore::IntPoint&, float);
369 #endif
370
371 #if ENABLE(TIZEN_DRAG_SUPPORT)
372     virtual void startDrag(const WebCore::DragData&, PassRefPtr<ShareableBitmap> dragImage);
373 #endif
374
375 #if ENABLE(TIZEN_REGISTER_PROTOCOL_HANDLER)
376     virtual void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title);
377 #endif
378 #if ENABLE(TIZEN_CUSTOM_SCHEME_HANDLER)
379     virtual unsigned int isProtocolHandlerRegistered(const String& scheme, const String& baseURL, const String& url);
380     virtual void unregisterProtocolHandler(const String& scheme, const String& baseURL, const String& url);
381 #endif
382 #if ENABLE(TIZEN_REGISTER_CONTENT_HANDLER)
383     virtual void registerContentHandler(const String& mimeType, const String& baseURL, const String& url, const String& title);
384     virtual unsigned int isContentHandlerRegistered(const String& mimeType, const String& baseURL, const String& url);
385     virtual void unregisterContentHandler(const String& mimeType, const String& baseURL, const String& url);
386 #endif
387 #if ENABLE(TIZEN_SEARCH_PROVIDER)
388     virtual void addSearchProvider(const String& baseURL, const String& engineURL);
389     virtual unsigned long isSearchProviderInstalled(const String& baseURL, const String& engineURL);
390 #endif
391
392 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
393     virtual bool getStandaloneStatus();
394 #endif
395
396 #if ENABLE(SCREEN_ORIENTATION_SUPPORT) && ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT)
397     virtual bool lockOrientation(int willLockOrientation);
398     virtual void unlockOrientation();
399 #endif
400
401 protected:
402     explicit PageClientImpl(EwkViewImpl*);
403
404     virtual WebCore::IntSize viewSize();
405
406     EwkViewImpl* m_viewImpl;
407
408 #if OS(TIZEN)
409     ViewportConstraints m_viewportConstraints;
410
411     bool m_viewFocused;
412     bool m_viewWindowActive;
413
414     bool m_pageDidRendered;
415
416     // m_viewResizeCount is added to sync updateViewportSize() and didChangeViewportProperties()
417     int m_viewResizeCount;
418     // m_viewportFitsToContent is added to handle scale factor after load finish
419     bool m_viewportFitsToContent;
420
421     WebCore::IntRect m_focusedNodeRect;
422
423 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
424     WebCore::IntRect m_visibleContentRect;
425     float m_scaleFactor;
426
427     // FIXME: The concept of suspending content comes from webkit opensource's PageViewportController,
428     // so below code should be replaced when PageViewportController codes are merged.
429     // Please do not use below codes. They are only for scaling contents.
430     bool m_hasSuspendedContent;
431 #endif // ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
432
433 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
434     WebCore::IntPoint m_restoredScrollPosition;
435     float m_restoredScaleFactor;
436 #endif
437
438 #if ENABLE(TIZEN_WEBKIT2_RESTORE_SCROLLPOINT_ON_FRAME_LOAD_FINISH)
439     bool m_isInitializeCallBeforeFrameLoadFinished;
440 #endif
441
442 #if ENABLE(TIZEN_WEBKIT2_BEFORE_PAGE_RENDERED_SCROLL_POSITION)
443     WebCore::IntPoint m_scrollPositionBeforePageRendered;
444 #endif
445
446 #if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
447     RefPtr<MainFrameScrollbarTizen> m_horizontalScrollbar;
448     RefPtr<MainFrameScrollbarTizen> m_verticalScrollbar;
449 #endif
450 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
451     OwnPtr<TextSelection> m_textSelection;
452 #endif
453 #if ENABLE(TIZEN_OFFLINE_PAGE_SAVE)
454     OwnPtr<OfflinePageSave> m_offlinePageSave;
455 #endif
456 #if ENABLE(TIZEN_WEBKIT2_CLIPBOARD_HELPER)
457     OwnPtr<ClipboardHelper> m_clipboardHelper;
458 #endif
459 #if ENABLE(TIZEN_DRAG_SUPPORT)
460     OwnPtr<Drag> m_drag;
461 #endif
462 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
463     OwnPtr<AutoFillManager> m_autoFillManager;
464 #endif
465     bool m_suspendPainting;
466     bool m_suspendResource;
467     bool m_suspendRequested;
468     bool m_isVisible;
469
470     bool m_isScrollableLayerFocused;
471     bool m_isScrollableNodeFocused;
472
473 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE_BACKUP_IMAGE)
474     bool m_shouldMakeBackupTexture;
475     bool m_shouldShowBackupTexture;
476     WebCore::IntRect m_initialViewRect;
477 #endif
478
479 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
480     bool m_isContextMenuVisible;
481 #endif
482
483     WebCore::Color m_bgColor;
484
485     Vector<RefPtr<WebKit::WebEditCommandProxy> > m_undoCommands;
486     Vector<RefPtr<WebKit::WebEditCommandProxy> > m_redoCommands;
487
488 #if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
489     bool m_waitFrameOfNewViewortSize;
490 #endif
491
492 #if ENABLE(TIZEN_WEBKIT2_INPUT_FIELD_ZOOM)
493     bool m_needFocusAdjust;
494 #endif
495
496     bool m_nonemptyLayoutRendered;
497 #endif // #if OS(TIZEN)
498 };
499
500
501 #if ENABLE(TIZEN_WEBKIT2_TILED_AC) && ENABLE(TIZEN_RUNTIME_BACKEND_SELECTION)
502 class PageClientEvasGL : public PageClientImpl {
503 public:
504     static PassOwnPtr<PageClientEvasGL> create(EwkViewImpl* viewImpl)
505     {
506         return adoptPtr(new PageClientEvasGL(viewImpl));
507     }
508     ~PageClientEvasGL();
509
510     virtual void updateViewportSize(const WebCore::IntSize&, const int);
511     virtual void updateVisibleContentRectSize(const WebCore::IntSize&);
512     virtual void setViewNeedsDisplay(const WebCore::IntRect&);
513     virtual void displayViewport();
514     virtual void drawContents();
515     virtual void didRenderFrame();
516     virtual bool makeContextCurrent();
517
518 private:
519     explicit PageClientEvasGL(EwkViewImpl* viewImpl);
520
521     virtual void initializeAcceleratedCompositingMode();
522     virtual void finalizeAcceleratedCompositingMode();
523     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
524     virtual void exitAcceleratedCompositingMode();
525
526     void setTargetSurface();
527
528 #if ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)
529     bool isDirectRendering() { return (m_config->options_bits == EVAS_GL_OPTIONS_DIRECT); }
530 #endif
531
532     Evas_GL* m_evasGL;
533     Evas_GL_API* m_evasGlApi;
534     Evas_GL_Context* m_context;
535     Evas_GL_Surface* m_surface;
536     Evas_GL_Config* m_config;
537 #if ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)
538     int m_angle;
539 #endif
540
541     bool m_isAcceleratedCompositingModeInitialized;
542 };
543 #endif
544
545 } // namespace WebKit
546
547 #endif // PageClientImpl_h