diff options
author | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-05-22 20:44:12 +0000 |
---|---|---|
committer | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-05-22 20:44:12 +0000 |
commit | 671cd656785de5e84564b6ffe4831625d7016ded (patch) | |
tree | eea4b9e21a459d2b5c183f24b2eeb47cfe0be294 /include | |
parent | 149e2f6159a797989f6f0fa93ecfaa66cdd55c40 (diff) |
add SDL support
git-svn-id: http://skia.googlecode.com/svn/trunk@182 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkPreConfig.h | 2 | ||||
-rw-r--r-- | include/views/SkOSWindow_SDL.h | 47 | ||||
-rw-r--r-- | include/views/SkWindow.h | 10 |
3 files changed, 53 insertions, 6 deletions
diff --git a/include/core/SkPreConfig.h b/include/core/SkPreConfig.h index 05f3d43fda..b66c97ebda 100644 --- a/include/core/SkPreConfig.h +++ b/include/core/SkPreConfig.h @@ -19,7 +19,7 @@ ////////////////////////////////////////////////////////////////////// -#if !defined(SK_BUILD_FOR_PALM) && !defined(SK_BUILD_FOR_WINCE) && !defined(SK_BUILD_FOR_WIN32) && !defined(SK_BUILD_FOR_SYMBIAN) && !defined(SK_BUILD_FOR_UNIX) && !defined(SK_BUILD_FOR_MAC) +#if !defined(SK_BUILD_FOR_PALM) && !defined(SK_BUILD_FOR_WINCE) && !defined(SK_BUILD_FOR_WIN32) && !defined(SK_BUILD_FOR_SYMBIAN) && !defined(SK_BUILD_FOR_UNIX) && !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_SDL) #if defined(PALMOS_SDK_VERSION) #define SK_BUILD_FOR_PALM diff --git a/include/views/SkOSWindow_SDL.h b/include/views/SkOSWindow_SDL.h new file mode 100644 index 0000000000..f2a6b32d12 --- /dev/null +++ b/include/views/SkOSWindow_SDL.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2006 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SkOSWindow_SDL_DEFINED +#define SkOSWindow_SDL_DEFINED + +#include "SDL.h" +#include "SkWindow.h" + +class SkOSWindow : public SkWindow { +public: + SkOSWindow(void* surface); + + static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay); + + void handleSDLEvent(const SDL_Event& event); + +protected: + // overrides from SkWindow + virtual void onHandleInval(const SkIRect&); + // overrides from SkView + virtual void onAddMenu(const SkOSMenu*); + virtual void onSetTitle(const char[]); + +private: + SDL_Surface* fSurface; + + void doDraw(); + + typedef SkWindow INHERITED; +}; + +#endif + diff --git a/include/views/SkWindow.h b/include/views/SkWindow.h index da3912e5a4..1c8f9a37d6 100644 --- a/include/views/SkWindow.h +++ b/include/views/SkWindow.h @@ -90,16 +90,16 @@ private: /////////////////////////////////////////////////////////// -#ifndef SK_USE_WXWIDGETS -#ifdef SK_BUILD_FOR_MAC +#ifdef SK_USE_WXWIDGETS + #include "SkOSWindow_wxwidgets.h" +#elif defined(SK_BUILD_FOR_MAC) #include "SkOSWindow_Mac.h" #elif defined(SK_BUILD_FOR_WIN) #include "SkOSWindow_Win.h" #elif defined(SK_BUILD_FOR_UNIXx) #include "SkOSWindow_Unix.h" -#endif -#else - #include "SkOSWindow_wxwidgets.h" +#elif defined(SK_BUILD_FOR_SDL) + #include "SkOSWindow_SDL.h" #endif #endif |