Project

General

Profile

SO3Engine
SO3Android.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
32#ifndef __SO3_ANDROID_H__
33#define __SO3_ANDROID_H__
34
35#include <jni.h>
36#include <errno.h>
37#include <stdio.h>
38#include <android_native_app_glue.h>
39#include <android/asset_manager.h>
40#include <dlfcn.h>
41
42#include "OgreArchiveManager.h"
43#include "OgreFileSystem.h"
44#include "OgreZip.h"
45
46// Dll exporting symbols (SO3Engine.dll build), or importing (SO3 plugins)?
47#ifdef SO3_STATIC_BUILD
48# define _SO3_Export
49#else
50# ifdef SO3_NON_CLIENT_BUILD
51# define _SO3_Export __attribute__ ((visibility ("default")))
52# else
53# define _SO3_Export
54# endif
55#endif
56
57#define __stdcall
58typedef unsigned int UINT;
59typedef long LONG;
60typedef void* HCURSOR;
61
62#define WPARAM SCOL_PTR_TYPE
63#define LPARAM SCOL_PTR_TYPE
64
65// ANDROID dynamic library loading and unloading functions.
66// see SPlugin class
67#define SO3_PLUGIN_INSTANCE void*
68#define SO3_PLUGIN_LOAD(a) dlopen(a,RTLD_LAZY)
69#define SO3_PLUGIN_UNLOAD(a) dlclose(a)
70#define SO3_PLUGIN_GET_SYMBOL(a,b) dlsym(a,b)
71#define SO3_PLUGIN_ERROR() dlerror()
72
73
74#define WM_KEYDOWN 0x0100
75#define WM_KEYUP 0x0101
76#define WM_CHAR 0x0102
77#define WM_SYSKEYDOWN 0x0104
78#define WM_SYSKEYUP 0x0105
79#define WM_SYSCHAR 0x0106
80#define WM_IME_KEYDOWN 0x0290
81#define WM_IME_KEYUP 0x0291
82
83#if defined(_DEBUG)
84 //# define SO3_DEBUG 1
85#endif
86
87#include <android/log.h>
88#define LOG_TAG "ScolApp"
89#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
90#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
91#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
92
93
94#endif
long LONG
Definition SO3Android.h:59
unsigned int UINT
Definition SO3Android.h:58
void * HCURSOR
Definition SO3Android.h:60