180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru/* 380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Copyright 2006 The Android Open Source Project 480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * 580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Use of this source code is governed by a BSD-style license that can be 680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * found in the LICENSE file. 780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru */ 880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#ifndef SkOSWindow_MacCocoa_DEFINED 1080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#define SkOSWindow_MacCocoa_DEFINED 1180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 1280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "SkWindow.h" 1380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 1480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruclass SkOSWindow : public SkWindow { 1580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Querupublic: 1680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru SkOSWindow(void* hwnd); 1780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru ~SkOSWindow(); 1880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void* getHWND() const { return fHWND; } 1980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 2080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru virtual bool onDispatchClick(int x, int y, Click::State state, 21d686ac77c2c485c4a3302eda9c1de597a6f8c568Derek Sollenberger void* owner, unsigned modi); 2280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru enum SkBackEndTypes { 2380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kNone_BackEndType, 2480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#if SK_SUPPORT_GPU 2580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kNativeGL_BackEndType, 2680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#endif 2780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru }; 2880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 29096defe64d408e54474fe19f418c95bf1a554fc7Derek Sollenberger struct AttachmentInfo { 30096defe64d408e54474fe19f418c95bf1a554fc7Derek Sollenberger int fSampleCount; 31096defe64d408e54474fe19f418c95bf1a554fc7Derek Sollenberger int fStencilBits; 32096defe64d408e54474fe19f418c95bf1a554fc7Derek Sollenberger }; 33096defe64d408e54474fe19f418c95bf1a554fc7Derek Sollenberger 3480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void detach(); 35096defe64d408e54474fe19f418c95bf1a554fc7Derek Sollenberger bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*); 3680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void present(); 3780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 3880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruprotected: 3980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru // overrides from SkEventSink 4080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru virtual bool onEvent(const SkEvent& evt); 4180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru // overrides from SkWindow 4280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru virtual void onHandleInval(const SkIRect&); 4380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru // overrides from SkView 4480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru virtual void onAddMenu(const SkOSMenu*); 4580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru virtual void onUpdateMenu(const SkOSMenu*); 4680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru virtual void onSetTitle(const char[]); 4780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 4880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruprivate: 4980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void* fHWND; 5080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru bool fInvalEventIsPending; 5180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void* fNotifier; 5280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#if SK_SUPPORT_GPU 5380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void* fGLContext; 5480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#endif 5580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru typedef SkWindow INHERITED; 5680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru}; 5780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 5880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#endif 59