"TargetType" : "StaticLibrary",
"TargetFileName" : "ecereStatic"
}
+ },
+ {
+ "Name" : "pnacl",
+ "Options" : {
+ "PreprocessorDefinitions" : [
+ "_DEBUG",
+ "ECERE_NOSSL"
+ ]
+ }
}
],
"Files" : [
}
},
{
- "FileName" : "SDL2DisplayDriver.ec",
- "Options" : {
- "ExcludeFromBuild" : false
- }
+ "FileName" : "PepperDisplayDriver.ec",
+ "Configurations" : [
+ {
+ "Name" : "pnacl",
+ "Options" : {
+ "ExcludeFromBuild" : false
+ }
+ }
+ ]
}
],
"Options" : {
}
},
{
- "FileName" : "SDL2Interface.ec",
- "Options" : {
- "ExcludeFromBuild" : false
- }
+ "FileName" : "PepperInterface.ec",
+ "Configurations" : [
+ {
+ "Name" : "pnacl",
+ "Options" : {
+ "ExcludeFromBuild" : false
+ }
+ }
+ ]
}
],
"Options" : {
#if defined(__unix__) || defined(__APPLE__)
#define bool _bool
#include <utime.h>
+#if !defined(__pnacl__)
#include <dlfcn.h>
+#endif
#if defined(__APPLE__)
#include <mach-o/dyld.h>
#endif
}
fclose(f);
}
-#if !defined(ECERE_NOFILE) && !defined(__linux__) && !defined(__EMSCRIPTEN__)
+#if !defined(ECERE_NOFILE) && !defined(__linux__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
if(name && name[0])
{
// Couldn't locate libraries with /proc/curmap/map, attempt with ldd
void Instance_COM_Initialize(int argc, char ** argv, char ** parsedCommand, int * argcPtr, const char *** argvPtr)
{
-#if !defined(__WIN32__) && !defined(__EMSCRIPTEN__) && !defined(ECERE_BOOTSTRAP)
+#if !defined(__WIN32__) && !defined(__EMSCRIPTEN__) && !defined(ECERE_BOOTSTRAP) && !defined(__pnacl__)
// Disable stdout buffering on Unix
setvbuf(stdout, null, _IONBF, 0);
#endif
strcat(fileName, ".so");
#endif
-#if !defined(__EMSCRIPTEN__)
+#if !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
library = dlopen(fileName, RTLD_LAZY);
#endif
while(!library && attempts < sizeof(paths)/sizeof(paths[0]))
#else
strcat(fileName, ".so");
#endif
-#if !defined(__EMSCRIPTEN__)
+#if !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
library = dlopen(fileName, RTLD_LAZY);
#endif
}
{
*Load = dlsym(library, "__ecereDll_Load");
*Unload = dlsym(library, "__ecereDll_Unload");
-#if !defined(__EMSCRIPTEN__)
+#if !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
if(!*Load)
dlclose(library);
#endif
#if defined(__WIN32__) && !defined(__EMSCRIPTEN__)
if(library)
FreeLibrary(library);
-#elif (defined(__unix__) || defined(__APPLE__)) && !defined(__EMSCRIPTEN__)
+#elif (defined(__unix__) || defined(__APPLE__)) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
if(library)
dlclose(library);
#endif
#define strnicmp strncasecmp
#endif
-#if defined(ECERE_BOOTSTRAP) || (defined(__GNUC__) && !defined(__DJGPP__) && !defined(__WIN32__) && !defined(__EMSCRIPTEN__))
+#if defined(ECERE_BOOTSTRAP) || (defined(__GNUC__) && !defined(__DJGPP__) && !defined(__WIN32__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__))
#undef strlwr
#undef strupr
default dllexport char * strlwr(char *string)
import "Display"
-#if !defined(__EMSCRIPTEN__)
+#if !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
#include "gif_lib.h"
import "Display"
-#if !defined(__EMSCRIPTEN__)
+#if !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
#define uint _uint
#include "png.h"
#undef __BLOCKS__
-#if (defined(__unix__) || defined(__APPLE__)) && !defined(__DOS__) && !defined(__EMSCRIPTEN__)
+#if (defined(__unix__) || defined(__APPLE__)) && !defined(__DOS__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
#include <curses.h>
#if defined(__unix__) || defined(__APPLE__)
- #if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+ #if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
import "XInterface"
#endif
int imageBuffers[2];
byte * pboMemory1, * pboMemory2;
*/
-#elif !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#elif !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
GLXContext glContext;
Pixmap pixmap;
HDC hdc;
HGLRC glrc;
HWND hwnd;
-#elif !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#elif !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
XVisualInfo * visualInfo;
GLXContext glContext;
GLXDrawable glxDrawable;
bool LockSystem(DisplaySystem displaySystem)
{
-#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
OGLSystem oglSystem = displaySystem.driverData;
if(useSingleGLContext) return true;
#if defined(__WIN32__)
bool Lock(Display display)
{
-#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
OGLDisplay oglDisplay = display.driverData;
if(useSingleGLContext) return true;
#if defined(__WIN32__)
{
bool result = false;
OGLDisplay oglDisplay = display.driverData;
-#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
OGLSystem oglSystem = display.displaySystem.driverData;
#endif
if(!oglDisplay)
--- /dev/null
+namespace gfx::drivers;
+
+#ifdef BUILDING_ECERE_COM
+import "instance"
+import "Display"
+#else
+#ifdef ECERE_STATIC
+public import static "ecere"
+#else
+public import "ecere"
+#endif
+#endif
+
+import "PepperInterface"
+
+#if !defined(ENABLE_PEPPER_DRIVER)
+#define NO_PEPPER_DRIVER
+#endif
+
+#if (defined(__nacl__) || defined(__pnacl__)) // && !defined(NO_PEPPER_DRIVER)
+
+#include <stdio.h>
+
+// source file line number printf (sflnprintf)
+#define sflnprintf(format,...) printf("%s:% 5d: " format, __FILE__, __LINE__, ##__VA_ARGS__)
+
+class PepperDisplayDriver : DisplayDriver
+{
+ class_property(name) = "Pepper";
+
+
+ // Constructor / Destructor
+
+ bool ::CreateDisplaySystem(DisplaySystem displaySystem)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::CreateDisplaySystem [STUB!]\n");
+ return false;
+ }
+
+ void ::DestroyDisplaySystem(DisplaySystem displaySystem)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::DestroyDisplaySystem [STUB!]\n");
+ }
+
+ bool ::CreateDisplay(Display display)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::CreateDisplay [STUB!]\n");
+ return false;
+ }
+
+ void ::DestroyDisplay(Display display)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::DestroyDisplay [STUB!]\n");
+ }
+
+
+ // Display Position and Size
+
+ bool ::DisplaySize(Display display, int width, int height)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::DisplaySize [STUB!]\n");
+ return false;
+ }
+
+ void ::DisplayPosition(Display display, int x, int y)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::DisplayPosition [STUB!]\n");
+ }
+
+
+ // Palettes
+
+ void ::SetPalette(Display display, ColorAlpha * palette, bool colorMatch)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::SetPalette [STUB!]\n");
+ }
+
+ void ::RestorePalette(Display display)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::RestorePalette [STUB!]\n");
+ }
+
+
+ // Display the back buffer content
+
+ void ::StartUpdate(Display display)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::StartUpdate [STUB!]\n");
+ }
+
+ void ::EndUpdate(Display display)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::EndUpdate [STUB!]\n");
+ }
+
+ void ::Scroll(Display display, Box scroll, int x, int y, Extent dirty)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::Scroll [STUB!]\n");
+ }
+
+ void ::Update(Display display, Box updateBox)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::Update [STUB!]\n");
+ }
+
+
+ // Allocate/free a bitmap
+
+ bool ::AllocateBitmap(DisplaySystem displaySystem, Bitmap bitmap, int width, int height, int stride, PixelFormat format, bool allocatePalette)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::AllocateBitmap [STUB!]\n");
+ return false;
+ }
+
+ void ::FreeBitmap(DisplaySystem displaySystem, Bitmap bitmap)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::FreeBitmap [STUB!]\n");
+ }
+
+
+ // Lock
+
+ bool ::LockSystem(DisplaySystem displaySystem)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::LockSystem [STUB!]\n");
+ return false;
+ }
+
+ void ::UnlockSystem(DisplaySystem displaySystem)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::UnlockSystem [STUB!]\n");
+ }
+
+ bool ::Lock(Display display)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::Lock [STUB!]\n");
+ return false;
+ }
+
+ void ::Unlock(Display display)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::Unlock [STUB!]\n");
+ }
+
+
+ // Get/release a surface
+
+ bool ::GetSurface(Display display, Surface surface, int x, int y, Box clip)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::GetSurface [STUB!]\n");
+ return false;
+ }
+
+ bool ::GetBitmapSurface(DisplaySystem displaySystem, Surface surface, Bitmap bitmap, int x, int y, Box clip)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::GetBitmapSurface [STUB!]\n");
+ return false;
+ }
+
+ void ::ReleaseSurface(Display display, Surface surface)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::ReleaseSurface [STUB!]\n");
+ }
+
+
+ // Clip a surface
+
+ void ::Clip(Display display, Surface surface, Box clip)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::Clip [STUB!]\n");
+ }
+
+
+ // Grab from the screen
+
+ bool ::GrabScreen(Display display, Bitmap bitmap, int x, int y, unsigned int w, unsigned int h)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::GrabScreen [STUB!]\n");
+ return false;
+ }
+
+
+ // Converts a bitmap format
+
+ bool ::ConvertBitmap(DisplaySystem displaySystem, Bitmap src, PixelFormat format, ColorAlpha * palette)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::ConvertBitmap [STUB!]\n");
+ return false;
+ }
+
+
+ // Converts an LFB bitmap into an offscreen bitmap for this device
+
+ bool ::MakeDDBitmap(DisplaySystem displaySystem, Bitmap bitmap, bool mipMaps)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::MakeDDBitmap [STUB!]\n");
+ return false;
+ }
+
+
+ // Font loading
+
+ Font ::LoadFont(DisplaySystem displaySystem, const char * faceName, float size, FontFlags flags)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::LoadFont [STUB!]\n");
+ return null;
+ }
+
+ void ::UnloadFont(DisplaySystem displaySystem, Font font)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::UnloadFont [STUB!]\n");
+ }
+
+
+ // 2D Drawing
+
+ void ::SetForeground(Display display, Surface surface, ColorAlpha color)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::SetForeground [STUB!]\n");
+ }
+
+ void ::SetBackground(Display display, Surface surface, ColorAlpha color)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::SetBackground [STUB!]\n");
+ }
+
+ void ::LineStipple(Display display, Surface surface, uint stipple)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::LineStipple [STUB!]\n");
+ }
+
+ ColorAlpha ::GetPixel(Display display, Surface surface, int x, int y)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::GetPixel [STUB!]\n");
+ return 0;
+ }
+
+ void ::PutPixel(Display display, Surface surface, int x, int y)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::PutPixel [STUB!]\n");
+ }
+
+ void ::DrawLine(Display display, Surface surface, int x1, int y1, int x2, int y2)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::DrawLine [STUB!]\n");
+ }
+
+ void ::Rectangle(Display display, Surface surface, int x1, int y1, int x2, int y2)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::Rectangle [STUB!]\n");
+ }
+
+ void ::Area(Display display, Surface surface, int x1, int y1, int x2, int y2)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::Area [STUB!]\n");
+ }
+
+ void ::Clear(Display display, Surface surface, ClearType type)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::Clear [STUB!]\n");
+ }
+
+ void ::Blit(Display display, Surface surface, Bitmap src, int dx, int dy, int sx, int sy, int w, int h)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::Blit [STUB!]\n");
+ }
+
+ void ::SetBlitTint(Display display, Surface surface, ColorAlpha tint)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::SetBlitTint [STUB!]\n");
+ }
+
+ void ::Stretch(Display display, Surface surface, Bitmap src, int dx, int dy, int sx, int sy, int w, int h, int sw, int sh)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::Stretch [STUB!]\n");
+ }
+
+ void ::Filter(Display display, Surface surface, Bitmap src, int dx, int dy, int sx, int sy, int w, int h, int sw, int sh)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::Filter [STUB!]\n");
+ }
+
+ void ::BlitDI(Display display, Surface surface, Bitmap src, int dx, int dy, int sx, int sy, int w, int h)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::BlitDI [STUB!]\n");
+ }
+
+ void ::StretchDI(Display display, Surface surface, Bitmap src, int dx, int dy, int sx, int sy, int w, int h, int sw, int sh)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::StretchDI [STUB!]\n");
+ }
+
+ void ::FilterDI(Display display, Surface surface, Bitmap src, int dx, int dy, int sx, int sy, int w, int h, int sw, int sh)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::FilterDI [STUB!]\n");
+ }
+
+ void ::TextFont(Display display, Surface surface, Font font)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::TextFont [STUB!]\n");
+ }
+
+ void ::TextOpacity(Display display, Surface surface, bool opaque)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::TextOpacity [STUB!]\n");
+ }
+
+ void ::WriteText(Display display, Surface surface, int x, int y, const char * text, int len)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::WriteText [STUB!]\n");
+ }
+
+ void ::TextExtent(Display display, Surface surface, const char * text, int len, int * width, int * height)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::TextExtent [STUB!]\n");
+ }
+
+ void ::FontExtent(DisplaySystem displaySystem, Font font, const char * text, int len, int * width, int * height)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::FontExtent [STUB!]\n");
+ }
+
+ void ::DrawingChar(Display display, Surface surface, char character)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::DrawingChar [STUB!]\n");
+ }
+
+ void ::NextPage(Display display)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::NextPage [STUB!]\n");
+ }
+
+ // 3D Graphics
+
+#if !defined(ECERE_VANILLA) && !defined(ECERE_NO3D)
+ void ::SetRenderState(Display display, RenderState state, uint value)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::SetRenderState [STUB!]\n");
+ }
+
+ void ::SetLight(Display display, int id, Light light)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::SetLight [STUB!]\n");
+ }
+
+ void ::SetCamera(Display display, Surface surface, Camera camera)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::SetCamera [STUB!]\n");
+ }
+
+ bool ::AllocateMesh(DisplaySystem displaySystem, Mesh mesh, MeshFeatures flags, int nVertices)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::AllocateMesh [STUB!]\n");
+ return false;
+ }
+
+ void ::FreeMesh(DisplaySystem displaySystem, Mesh mesh)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::FreeMesh [STUB!]\n");
+ }
+
+ bool ::LockMesh(DisplaySystem displaySystem, Mesh mesh, MeshFeatures flags)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::LockMesh [STUB!]\n");
+ return false;
+ }
+
+ void ::UnlockMesh(DisplaySystem displaySystem, Mesh mesh, MeshFeatures flags)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::UnlockMesh [STUB!]\n");
+ }
+
+ void * ::AllocateIndices(DisplaySystem displaySystem, int nIndices, bool indices32bit)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::AllocateIndices [STUB!]\n");
+ return null;
+ }
+
+ void ::FreeIndices(DisplaySystem displaySystem, void * indices)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::FreeIndices [STUB!]\n");
+ }
+
+ uint16 * ::LockIndices(DisplaySystem displaySystem, void * indices)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::LockIndices [STUB!]\n");
+ return null;
+ }
+
+ void ::UnlockIndices(DisplaySystem displaySystem, void * indices, bool indices32bit, int nIndices)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::UnlockIndices [STUB!]\n");
+ }
+
+ void ::SelectMesh(Display display, Mesh mesh)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::SelectMesh [STUB!]\n");
+ }
+
+ void ::ApplyMaterial(Display display, Material material, Mesh mesh)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::ApplyMaterial [STUB!]\n");
+ }
+
+ void ::DrawPrimitives(Display display, PrimitiveSingle * primitive, Mesh mesh)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::DrawPrimitives [STUB!]\n");
+ }
+
+ void ::PushMatrix(Display display)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::PushMatrix [STUB!]\n");
+ }
+
+ void ::PopMatrix(Display display, bool setMatrix)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::PopMatrix [STUB!]\n");
+ }
+
+ void ::SetTransform(Display display, Matrix transMatrix, bool viewSpace, bool useCamera)
+ {
+ sflnprintf("class(PepperDisplayDriver) ::SetTransform [STUB!]\n");
+ }
+#endif
+
+}
+
+#endif // !defined(NO_PEPPER_DRIVER)
import "instance"
-#if (defined(__unix__) || defined(__APPLE__)) && !defined(ECERE_MINIGLX) && !defined(__EMSCRIPTEN__)
+#if (defined(__unix__) || defined(__APPLE__)) && !defined(ECERE_MINIGLX) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
default:
#include <X11/Xlib.h>
#include <X11/Xutil.h>
-#if !defined(__EMSCRIPTEN__)
+#if !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
#include <X11/extensions/shape.h>
#include <X11/extensions/Xrender.h>
#endif
#include <emscripten.h>
#endif
-#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
#define property _property
#define new _new
#define class _class
import "CocoaInterface"
#endif
-#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
import "XInterface"
#endif
delete desktop;
customCursors.Clear();
-#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
if(xGlobalDisplay)
XUnlockDisplay(xGlobalDisplay);
#endif
Wait();
else
{
-#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
if(xGlobalDisplay)
XUnlockDisplay(xGlobalDisplay);
#endif
lockMutex.Wait();
#endif
-#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
if(xGlobalDisplay)
XLockDisplay(xGlobalDisplay);
#endif
void Wait(void)
{
-#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
if(xGlobalDisplay)
XUnlockDisplay(xGlobalDisplay);
#endif
lockMutex.Wait();
#endif
-#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
if(xGlobalDisplay)
XLockDisplay(xGlobalDisplay);
#endif
{
#if !defined(__EMSCRIPTEN__)
lockMutex.Wait();
-#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
if(xGlobalDisplay)
XLockDisplay(xGlobalDisplay);
#endif
void Unlock(void)
{
#if !defined(__EMSCRIPTEN__)
-#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
if(xGlobalDisplay)
XUnlockDisplay(xGlobalDisplay);
#endif
import "instance"
-#if (defined(__unix__) || defined(__APPLE__)) && !defined(__DOS__) && !defined(__EMSCRIPTEN__)
+#if (defined(__unix__) || defined(__APPLE__)) && !defined(__DOS__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
#undef __BLOCKS__
#define DBLCLICK_DELAY 0.3 // seconds
--- /dev/null
+namespace gui::drivers;
+
+#ifdef BUILDING_ECERE_COM
+import "Window"
+import "Interface"
+#else
+#ifdef ECERE_STATIC
+public import static "ecere"
+#else
+public import "ecere"
+#endif
+#endif
+
+/*#if !defined(ENABLE_PEPPER_DRIVER)
+#define NO_PEPPER_DRIVER
+#endif*/
+
+#if (defined(__nacl__) || defined(__pnacl__)) // && !defined(NO_PEPPER_DRIVER)
+
+#include <stdio.h>
+
+//#include "ppapi_simple/ps_main.h"
+
+#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_module.h"
+#include "ppapi/c/pp_var.h"
+
+
+// source file line number printf (sflnprintf)
+#define sflnprintf(format,...) printf("%s:% 5d: " format, __FILE__, __LINE__, ##__VA_ARGS__)
+
+#include <stddef.h>
+
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/c/pp_module.h"
+#include "ppapi/c/ppb.h"
+#include "ppapi/c/ppp.h"
+
+class PepperInterface : Interface
+{
+ class_property(name) = "Pepper";
+
+
+ // --- User Interface System ---
+
+ bool ::Initialize()
+ {
+ sflnprintf("class(PepperInterface) ::Initialize [STUB!]\n");
+ return false;
+ }
+
+ void ::Terminate()
+ {
+ sflnprintf("class(PepperInterface) ::Terminate [STUB!]\n");
+ }
+
+ bool ::ProcessInput(bool processAll)
+ {
+ sflnprintf("class(PepperInterface) ::ProcessInput [STUB!]\n");
+ return false;
+ }
+
+ void ::Wait()
+ {
+ sflnprintf("class(PepperInterface) ::Wait [STUB!]\n");
+ }
+
+ void ::Lock(Window window)
+ {
+ sflnprintf("class(PepperInterface) ::Lock [STUB!]\n");
+ }
+
+ void ::Unlock(Window window)
+ {
+ sflnprintf("class(PepperInterface) ::Unlock [STUB!]\n");
+ }
+
+ void ::SetTimerResolution(uint hertz)
+ {
+ sflnprintf("class(PepperInterface) ::SetTimerResolution [STUB!] Implement high resolution timer here\n");
+ }
+
+ const char ** ::GraphicsDrivers(int * numDrivers)
+ {
+ sflnprintf("class(PepperInterface) ::GraphicsDrivers [STUB!]\n");
+ return null;
+ }
+
+ void ::EnsureFullScreen(bool * fullScreen)
+ {
+ sflnprintf("class(PepperInterface) ::EnsureFullScreen [STUB!]\n");
+ }
+
+ void ::GetCurrentMode(bool * fullScreen, Resolution * resolution, PixelFormat * colorDepth, int * refreshRate)
+ {
+ sflnprintf("class(PepperInterface) ::GetCurrentMode [STUB!]\n");
+ }
+
+ bool ::ScreenMode(bool fullScreen, Resolution resolution, PixelFormat colorDepth, int refreshRate, bool * textMode)
+ {
+ sflnprintf("class(PepperInterface) ::ScreenMode [STUB!]\n");
+ return false;
+ }
+
+
+ // --- Window Creation ---
+
+ void * ::CreateRootWindow(Window window)
+ {
+ sflnprintf("class(PepperInterface) ::CreateRootWindow [STUB!]\n");
+ return null;
+ }
+
+ void ::DestroyRootWindow(Window window)
+ {
+ sflnprintf("class(PepperInterface) ::DestroyRootWindow [STUB!]\n");
+ }
+
+
+ // --- Window manipulation ---
+
+ void ::SetRootWindowCaption(Window window, const char * name)
+ {
+ sflnprintf("class(PepperInterface) ::SetRootWindowCaption [STUB!]\n");
+ }
+
+ void ::PositionRootWindow(Window window, int x, int y, int w, int h, bool move, bool resize)
+ {
+ sflnprintf("class(PepperInterface) ::PositionRootWindow [STUB!]\n");
+ }
+
+ void ::OffsetWindow(Window window, int * x, int * y)
+ {
+ sflnprintf("class(PepperInterface) ::OffsetWindow [STUB!]\n");
+ }
+
+ void ::UpdateRootWindow(Window window)
+ {
+ sflnprintf("class(PepperInterface) ::UpdateRootWindow [STUB!]\n");
+ }
+
+ void ::SetRootWindowState(Window window, WindowState state, bool visible)
+ {
+ sflnprintf("class(PepperInterface) ::SetRootWindowState [STUB!]\n");
+ }
+
+ void ::ActivateRootWindow(Window window)
+ {
+ sflnprintf("class(PepperInterface) ::ActivateRootWindow [STUB!]\n");
+ }
+
+ void ::OrderRootWindow(Window window, bool topMost)
+ {
+ sflnprintf("class(PepperInterface) ::OrderRootWindow [STUB!]\n");
+ }
+
+ void ::SetRootWindowColor(Window window)
+ {
+ sflnprintf("class(PepperInterface) ::SetRootWindowColor [STUB!]\n");
+ }
+
+ void ::FlashRootWindow(Window window)
+ {
+ sflnprintf("class(PepperInterface) ::FlashRootWindow [STUB!]\n");
+ }
+
+
+ // --- Mouse-based window movement ---
+
+ void ::StartMoving(Window window, int x, int y, bool fromKeyBoard)
+ {
+ sflnprintf("class(PepperInterface) ::StartMoving [STUB!]\n");
+ }
+
+ void ::StopMoving(Window window)
+ {
+ sflnprintf("class(PepperInterface) ::StopMoving [STUB!]\n");
+ }
+
+
+ // --- Mouse manipulation ---
+
+ void ::GetMousePosition(int *x, int *y)
+ {
+ sflnprintf("class(PepperInterface) ::GetMousePosition [STUB!]\n");
+ }
+
+ void ::SetMousePosition(int x, int y)
+ {
+ sflnprintf("class(PepperInterface) ::SetMousePosition [STUB!]\n");
+ }
+
+ void ::SetMouseRange(Window window, Box box)
+ {
+ sflnprintf("class(PepperInterface) ::SetMouseRange [STUB!]\n");
+ }
+
+ void ::SetMouseCapture(Window window)
+ {
+ sflnprintf("class(PepperInterface) ::SetMouseCapture [STUB!]\n");
+ }
+
+
+ // --- Mouse cursor ---
+
+ void ::SetMouseCursor(Window window, SystemCursor cursor)
+ {
+ sflnprintf("class(PepperInterface) ::SetMouseCursor [STUB!]\n");
+ }
+
+
+ // --- Caret manipulation ---
+
+ void ::SetCaret(int caretX, int caretY, int size)
+ {
+ sflnprintf("class(PepperInterface) ::SetCaret [STUB!]\n");
+ }
+
+
+ // --- Clipboard manipulation ---
+
+ void ::ClearClipboard()
+ {
+ sflnprintf("class(PepperInterface) ::ClearClipboard [STUB!]\n");
+ }
+
+ bool ::AllocateClipboard(ClipBoard clipBoard, uint size)
+ {
+ sflnprintf("class(PepperInterface) ::AllocateClipboard [STUB!]\n");
+ return false;
+ }
+
+ bool ::SaveClipboard(ClipBoard clipBoard)
+ {
+ sflnprintf("class(PepperInterface) ::SaveClipboard [STUB!]\n");
+ return false;
+ }
+
+ bool ::LoadClipboard(ClipBoard clipBoard)
+ {
+ sflnprintf("class(PepperInterface) ::LoadClipboard [STUB!]\n");
+ return false;
+ }
+
+ void ::UnloadClipboard(ClipBoard clipBoard)
+ {
+ sflnprintf("class(PepperInterface) ::UnloadClipboard [STUB!]\n");
+ }
+
+
+ // --- State based input ---
+
+ bool ::AcquireInput(Window window, bool state)
+ {
+ sflnprintf("class(PepperInterface) ::AcquireInput [STUB!]\n");
+ return false;
+ }
+
+ bool ::GetMouseState(MouseButtons * buttons, int * x, int * y)
+ {
+ sflnprintf("class(PepperInterface) ::GetMouseState [STUB!]\n");
+ return false;
+ }
+
+ bool ::GetJoystickState(int device, Joystick joystick)
+ {
+ sflnprintf("class(PepperInterface) ::GetJoystickState [STUB!]\n");
+ return false;
+ }
+
+ bool ::GetKeyState(Key key)
+ {
+ sflnprintf("class(PepperInterface) ::GetKeyState [STUB!]\n");
+ return false;
+ }
+
+ bool ::SetIcon(Window window, BitmapResource icon)
+ {
+ sflnprintf("class(PepperInterface) ::SetIcon [STUB!]\n");
+ return false;
+ }
+
+ void ::GetScreenArea(Window window, Box box)
+ {
+ sflnprintf("class(PepperInterface) ::GetScreenArea [STUB!]\n");
+ }
+}
+
+#endif // !defined(NO_PEPPER_DRIVER)
import "OpenGLDisplayDriver"
#endif
-#if (defined(__unix__) || defined(__APPLE__)) && !defined(ECERE_MINIGLX) && !defined(__EMSCRIPTEN__)
+#if (defined(__unix__) || defined(__APPLE__)) && !defined(ECERE_MINIGLX) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
#undef __BLOCKS__
default:
#include <X11/Xatom.h>
#include <X11/Xlib.h>
-#if !defined(__EMSCRIPTEN__)
+#if !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
#include <X11/Xresource.h>
#endif
#include <X11/Xutil.h>
#include <GL/glx.h>
#endif
#endif
-#if !defined(__EMSCRIPTEN__)
+#if !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
#include <X11/extensions/Xrender.h>
#endif
#include <X11/extensions/XShm.h>
// PrintLn(_class.name, " is at l = ", rcWindow.left, ", r = ", rcWindow.right);
#else
Box widths = { 0 };
-#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
XGetBorderWidths(this, widths);
#endif
*w += widths.left + widths.right;
*y += client00.y - rcWindow.top;
#else
Box widths = { 0 };
-#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
+#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
XGetBorderWidths(this, widths);
#endif
*x += widths.left;
}
#else
struct utimbuf t = { (int)accessed, (int)modified };
+#if !defined(__pnacl__)
if(!utime(fileName, &t))
result = true;
#endif
+#endif
}
return result;
}
strcat(file.path, file.name);
if(!stat(file.path, &s))
{
+#if !defined(__pnacl__)
file.stats.attribs = (s.st_mode&S_IFDIR) ? FileAttribs { isDirectory = true } : FileAttribs { isFile = true };
file.stats.size = (FileSize)s.st_size;
file.stats.accessed = s.st_atime;
file.stats.modified = s.st_mtime;
file.stats.created = s.st_ctime;
+#endif
}
strcpy(d.name, path);
strcat(path, name);
if(!stat(path, &s))
{
+#if !defined(__pnacl__)
stats.attribs = FileAttribs { };
stats.attribs = (s.st_mode&S_IFDIR) ? FileAttribs { isDirectory = true } : FileAttribs { isFile = true };
stats.size = (FileSize)s.st_size;
stats.accessed = s.st_atime;
stats.modified = s.st_mtime;
stats.created = s.st_ctime;
+#endif
}
result = this;
}
public dllexport void LoadTranslatedStrings(const String moduleName, const char * name)
{
-#if !defined(ECERE_NOFILE) && !defined(__EMSCRIPTEN__)
+#if !defined(ECERE_NOFILE) && !defined(__EMSCRIPTEN__) && !defined(__pnacl__)
File f;
char fileName[MAX_LOCATION];
if(binaryDocExt.Find(ext))
ShellOpen(path);
else if(!strcmp(ext, "a") || !strcmp(ext, "o") || !strcmp(ext, "bc") ||
- !strcmp(ext, "lib") || !strcmp(ext, "dll") || !strcmp(ext, "exe"))
+ !strcmp(ext, "lib") || !strcmp(ext, "dll") ||
+ !strcmp(ext, "exe") || !strcmp(ext, "nexe") || !strcmp(ext, "pexe"))
{
char dirPath[MAX_LOCATION];
StripLastDirectory(path, dirPath);
// Important: We cannot use this ifdef anymore, EXECUTABLE_TARGET is not yet defined. It's embedded in the crossplatform.mk EXECUTABLE
//f.Puts("ifdef EXECUTABLE_TARGET\n");
+ f.Puts("ifneq ($(COMPILER),pnacl)\n");
f.Printf("CONSOLE = %s\n", GetConsole(config) ? "-mconsole" : "-mwindows");
+ f.Puts("endif\n");
//f.Puts("endif\n");
f.Puts("\n");