diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI')
6 files changed, 97 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak index fcb1dabccd..cb8c846325 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak @@ -24,6 +24,7 @@ CAIRO_PREFIX = swt-cairo ATK_PREFIX = swt-atk GNOME_PREFIX = swt-gnome MOZILLA_PREFIX = swt-mozilla +GLX_PREFIX = swt-glx SWT_LIB = lib$(SWT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so AWT_LIB = lib$(AWT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so SWTPI_LIB = lib$(SWTPI_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so @@ -31,6 +32,7 @@ CAIRO_LIB = lib$(CAIRO_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so ATK_LIB = lib$(ATK_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so GNOME_LIB = lib$(GNOME_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so MOZILLA_LIB = lib$(MOZILLA_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so +GLX_LIB = lib$(GLX_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so CAIROCFLAGS = `pkg-config --cflags cairo` CAIROLIBS = `pkg-config --libs-only-L cairo` -lcairo @@ -47,6 +49,9 @@ ATKLIBS = `pkg-config --libs-only-L atk gtk+-2.0` -latk-1.0 -lgtk-x11-2.0 GNOMECFLAGS = `pkg-config --cflags gnome-vfs-module-2.0 libgnome-2.0 libgnomeui-2.0` GNOMELIBS = `pkg-config --libs-only-L gnome-vfs-module-2.0 libgnome-2.0 libgnomeui-2.0` -lgnomevfs-2 -lgnome-2 -lgnomeui-2 +GLXCFLAGS = +GLXLIBS = -shared -fpic -fPIC -L/usr/X11R6/lib -lGL -lGLU -lm + # Uncomment for Native Stats tool #NATIVE_STATS = -DNATIVE_STATS @@ -74,6 +79,7 @@ CAIRO_OBJECTS = swt.o cairo.o cairo_structs.o cairo_stats.o ATK_OBJECTS = swt.o atk.o atk_structs.o atk_custom.o atk_stats.o GNOME_OBJECTS = swt.o gnome.o gnome_structs.o gnome_stats.o MOZILLA_OBJECTS = swt.o xpcom.o xpcom_custom.o xpcom_structs.o xpcom_stats.o +GLX_OBJECTS = swt.o glx.o glx_structs.o glx_stats.o CFLAGS = -O -Wall \ -DSWT_VERSION=$(SWT_VERSION) \ @@ -86,7 +92,7 @@ CFLAGS = -O -Wall \ LIBS = -shared -fpic -s -all: make_swt make_atk make_gnome make_awt +all: make_swt make_atk make_gnome make_awt make_glx # # SWT libs @@ -191,6 +197,23 @@ xpcom_stats.o: xpcom_stats.cpp $(CXX) $(MOZILLACFLAGS) -c xpcom_stats.cpp # +# GLX lib +# +make_glx: $(GLX_LIB) + +$(GLX_LIB): $(GLX_OBJECTS) + $(LD) $(LIBS) $(GLXLIBS) -o $(GLX_LIB) $(GLX_OBJECTS) + +glx.o: glx.c + $(CC) $(CFLAGS) $(GLXCFLAGS) -c glx.c + +glx_structs.o: glx_structs.c + $(CC) $(CFLAGS) $(GLXCFLAGS) -c glx_structs.c + +glx_stats.o: glx_stats.c glx_stats.h + $(CC) $(CFLAGS) $(GLXCFLAGS) -c glx_stats.c + +# # Install # install: all diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/make_linux.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/make_linux.mak index 2040fc0436..6f844be482 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/make_linux.mak +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/make_linux.mak @@ -77,7 +77,13 @@ MOZILLACFLAGS = -O \ ${SWT_PTR_CFLAGS} MOZILLALIBS = -shared -s -Wl,--version-script=mozilla_exports -Bsymbolic ${GECKO_LIBS} -all: make_swt make_awt make_gnome make_gtk +GLX_PREFIX = swt-glx +GLX_LIB = lib$(GLX_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so +GLX_OBJECTS = swt.o glx.o glx_structs.o glx_stats.o +GLXCFLAGS = +GLXLIBS = -shared -fpic -fPIC -L/usr/X11R6/lib -lGL -lGLU -lm + +all: make_swt make_awt make_gnome make_gtk make_glx make_swt: $(SWT_LIB) @@ -148,6 +154,21 @@ xpcom_custom.o: xpcom_custom.cpp xpcom_stats.o: xpcom_stats.cpp $(CXX) $(MOZILLACFLAGS) -c xpcom_stats.cpp +make_glx: $(GLX_LIB) + +$(GLX_LIB): $(GLX_OBJECTS) + $(LD) $(LIBS) $(GLXLIBS) -o $(GLX_LIB) $(GLX_OBJECTS) + +glx.o: glx.c + $(CC) $(CFLAGS) $(GLXCFLAGS) -c glx.c + +glx_structs.o: glx_structs.c + $(CC) $(CFLAGS) $(GLXCFLAGS) -c glx_structs.c + +glx_stats.o: glx_stats.c glx_stats.h + $(CC) $(CFLAGS) $(GLXCFLAGS) -c glx_stats.c + + install: all cp *.so $(OUTPUT_DIR) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/os.c index 94f1bafa59..e39c331bcb 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/os.c @@ -315,6 +315,18 @@ fail: } #endif +#ifndef NO__1XCreateColormap +JNIEXPORT jint JNICALL OS_NATIVE(_1XCreateColormap) + (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3) +{ + jint rc = 0; + OS_NATIVE_ENTER(env, that, _1XCreateColormap_FUNC); + rc = (jint)XCreateColormap(arg0, arg1, arg2, arg3); + OS_NATIVE_EXIT(env, that, _1XCreateColormap_FUNC); + return rc; +} +#endif + #ifndef NO__1XCreateFontCursor JNIEXPORT jint JNICALL OS_NATIVE(_1XCreateFontCursor) (JNIEnv *env, jclass that, jint arg0, jint arg1) @@ -767,6 +779,18 @@ JNIEXPORT jint JNICALL OS_NATIVE(_1XFree) } #endif +#ifndef NO__1XFreeColormap +JNIEXPORT jint JNICALL OS_NATIVE(_1XFreeColormap) + (JNIEnv *env, jclass that, jint arg0, jint arg1) +{ + jint rc = 0; + OS_NATIVE_ENTER(env, that, _1XFreeColormap_FUNC); + rc = (jint)XFreeColormap(arg0, arg1); + OS_NATIVE_EXIT(env, that, _1XFreeColormap_FUNC); + return rc; +} +#endif + #ifndef NO__1XFreeColors JNIEXPORT jint JNICALL OS_NATIVE(_1XFreeColors) (JNIEnv *env, jclass that, jint arg0, jint arg1, jintArray arg2, jint arg3, jint arg4) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/os_stats.c index dd4f01e2fb..0ddf82a86d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/os_stats.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/os_stats.c @@ -14,8 +14,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 459; -int OS_nativeFunctionCallCount[459]; +int OS_nativeFunctionCount = 461; +int OS_nativeFunctionCallCount[461]; char * OS_nativeFunctionNames[] = { "CODESET", "FD_1ISSET", @@ -43,6 +43,7 @@ char * OS_nativeFunctionNames[] = { "_1XCopyArea", "_1XCopyPlane", "_1XCreateBitmapFromData", + "_1XCreateColormap", "_1XCreateFontCursor", "_1XCreateGC", "_1XCreateImage", @@ -80,6 +81,7 @@ char * OS_nativeFunctionNames[] = { "_1XFlush", "_1XFontsOfFontSet", "_1XFree", + "_1XFreeColormap", "_1XFreeColors", "_1XFreeCursor", "_1XFreeFont", diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/os_stats.h index f34bdce37e..f9719ef8cc 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/os_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/os_stats.h @@ -47,6 +47,7 @@ typedef enum { _1XCopyArea_FUNC, _1XCopyPlane_FUNC, _1XCreateBitmapFromData_FUNC, + _1XCreateColormap_FUNC, _1XCreateFontCursor_FUNC, _1XCreateGC_FUNC, _1XCreateImage_FUNC, @@ -84,6 +85,7 @@ typedef enum { _1XFlush_FUNC, _1XFontsOfFontSet_FUNC, _1XFree_FUNC, + _1XFreeColormap_FUNC, _1XFreeColors_FUNC, _1XFreeCursor_FUNC, _1XFreeFont_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/OS.java index cba80c6663..d1f519b626 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/OS.java @@ -52,6 +52,7 @@ public class OS extends Platform { /** Constants */ public static final int Above = 0; public static final int AllPlanes = 0xFFFFFFFF; + public static final int AllocNone = 0; public static final int Below = 1; public static final int Button1Mask = (1<<8); public static final int Button2Mask = (1<<9); @@ -68,6 +69,7 @@ public class OS extends Platform { public static final int Button5MotionMask = 1 << 12; public static final int CWBackPixmap = 0x1; public static final int CWBitGravity = 0x10; + public static final int CWColormap = 1 << 13; public static final int CWCursor = 0x4000; public static final int CWDontPropagate = 0x1000; public static final int CWEventMask = 0x800; @@ -575,6 +577,7 @@ public class OS extends Platform { public static final int XmNverifyBell = malloc ("verifyBell", 1); public static final int XmNverticalScrollBar = malloc ("verticalScrollBar", 4); public static final int XmNvisibleItemCount = malloc ("visibleItemCount", 4); + public static final int XmNvisual = malloc ("visual", 4); public static final int XmNUMERIC = 0x3; public static final int XmNwidth = malloc ("width", 2); public static final int XmNwordWrap = malloc ("wordWrap", 1); @@ -946,6 +949,15 @@ public static final int XCreateBitmapFromData(int display, int drawable, byte[] lock.unlock(); } } +public static final native int _XCreateColormap(int display, int window, int visual, int alloc); +public static final int XCreateColormap(int display, int window, int visual, int alloc) { + lock.lock(); + try { + return _XCreateColormap(display, window, visual, alloc); + } finally { + lock.unlock(); + } +} public static final native int _XCreateFontCursor(int display, int shape); public static final int XCreateFontCursor(int display, int shape) { lock.lock(); @@ -1279,6 +1291,15 @@ public static final int XFree(int address) { lock.unlock(); } } +public static final native int _XFreeColormap(int display, int colormap); +public static final int XFreeColormap(int display, int colormap) { + lock.lock(); + try { + return _XFreeColormap(display, colormap); + } finally { + lock.unlock(); + } +} public static final native int _XFreeColors(int display, int colormap, int[] pixels, int npixels, int planes); public static final int XFreeColors(int display, int colormap, int[] pixels, int npixels, int planes) { lock.lock(); |