23 * questions.
24 */
25
26 #ifdef HEADLESS
27 #error This file should not be included in headless library
28 #endif
29
30 #include <stdio.h>
31 #include <stdlib.h>
32 #include <X11/Xlib.h>
33 #include <sys/time.h>
34
35 #include "awt.h"
36 #include "awt_p.h"
37
38 #include <sun_awt_X11InputMethod.h>
39 #include <sun_awt_X11_XInputMethod.h>
40
41 #define THROW_OUT_OF_MEMORY_ERROR() \
42 JNU_ThrowOutOfMemoryError((JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2), NULL)
43 #define SETARG(name, value) XtSetArg(args[argc], name, value); argc++
44
45 struct X11InputMethodIDs {
46 jfieldID pData;
47 } x11InputMethodIDs;
48
49 static void PreeditStartCallback(XIC, XPointer, XPointer);
50 static void PreeditDoneCallback(XIC, XPointer, XPointer);
51 static void PreeditDrawCallback(XIC, XPointer,
52 XIMPreeditDrawCallbackStruct *);
53 static void PreeditCaretCallback(XIC, XPointer,
54 XIMPreeditCaretCallbackStruct *);
55 #if defined(__linux__) || defined(MACOSX)
56 static void StatusStartCallback(XIC, XPointer, XPointer);
57 static void StatusDoneCallback(XIC, XPointer, XPointer);
58 static void StatusDrawCallback(XIC, XPointer,
59 XIMStatusDrawCallbackStruct *);
60 #endif
61
62 #define ROOT_WINDOW_STYLES (XIMPreeditNothing | XIMStatusNothing)
63 #define NO_STYLES (XIMPreeditNone | XIMStatusNone)
573 }
574
575 return result;
576 }
577
578 #if defined(__linux__) || defined(MACOSX)
579 static StatusWindow *createStatusWindow(
580 Window parent) {
581 StatusWindow *statusWindow;
582 XSetWindowAttributes attrib;
583 unsigned long attribmask;
584 Window containerWindow;
585 Window status;
586 Window child;
587 XWindowAttributes xwa;
588 XWindowAttributes xxwa;
589 /* Variable for XCreateFontSet()*/
590 char **mclr;
591 int mccr = 0;
592 char *dsr;
593 Pixel bg, fg, light, dim;
594 int x, y, off_x, off_y, xx, yy;
595 unsigned int w, h, bw, depth;
596 XGCValues values;
597 unsigned long valuemask = 0; /*ignore XGCvalue and use defaults*/
598 int screen = 0;
599 int i;
600 AwtGraphicsConfigDataPtr adata;
601 extern int awt_numScreens;
602 /*hardcode the size right now, should get the size base on font*/
603 int width=80, height=22;
604 Window rootWindow;
605 Window *ignoreWindowPtr;
606 unsigned int ignoreUnit;
607
608 XGetGeometry(dpy, parent, &rootWindow, &x, &y, &w, &h, &bw, &depth);
609
610 attrib.override_redirect = True;
611 attribmask = CWOverrideRedirect;
612 for (i = 0; i < awt_numScreens; i++) {
613 if (RootWindow(dpy, i) == rootWindow) {
|
23 * questions.
24 */
25
26 #ifdef HEADLESS
27 #error This file should not be included in headless library
28 #endif
29
30 #include <stdio.h>
31 #include <stdlib.h>
32 #include <X11/Xlib.h>
33 #include <sys/time.h>
34
35 #include "awt.h"
36 #include "awt_p.h"
37
38 #include <sun_awt_X11InputMethod.h>
39 #include <sun_awt_X11_XInputMethod.h>
40
41 #define THROW_OUT_OF_MEMORY_ERROR() \
42 JNU_ThrowOutOfMemoryError((JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2), NULL)
43
44 struct X11InputMethodIDs {
45 jfieldID pData;
46 } x11InputMethodIDs;
47
48 static void PreeditStartCallback(XIC, XPointer, XPointer);
49 static void PreeditDoneCallback(XIC, XPointer, XPointer);
50 static void PreeditDrawCallback(XIC, XPointer,
51 XIMPreeditDrawCallbackStruct *);
52 static void PreeditCaretCallback(XIC, XPointer,
53 XIMPreeditCaretCallbackStruct *);
54 #if defined(__linux__) || defined(MACOSX)
55 static void StatusStartCallback(XIC, XPointer, XPointer);
56 static void StatusDoneCallback(XIC, XPointer, XPointer);
57 static void StatusDrawCallback(XIC, XPointer,
58 XIMStatusDrawCallbackStruct *);
59 #endif
60
61 #define ROOT_WINDOW_STYLES (XIMPreeditNothing | XIMStatusNothing)
62 #define NO_STYLES (XIMPreeditNone | XIMStatusNone)
572 }
573
574 return result;
575 }
576
577 #if defined(__linux__) || defined(MACOSX)
578 static StatusWindow *createStatusWindow(
579 Window parent) {
580 StatusWindow *statusWindow;
581 XSetWindowAttributes attrib;
582 unsigned long attribmask;
583 Window containerWindow;
584 Window status;
585 Window child;
586 XWindowAttributes xwa;
587 XWindowAttributes xxwa;
588 /* Variable for XCreateFontSet()*/
589 char **mclr;
590 int mccr = 0;
591 char *dsr;
592 unsigned long bg, fg, light, dim;
593 int x, y, off_x, off_y, xx, yy;
594 unsigned int w, h, bw, depth;
595 XGCValues values;
596 unsigned long valuemask = 0; /*ignore XGCvalue and use defaults*/
597 int screen = 0;
598 int i;
599 AwtGraphicsConfigDataPtr adata;
600 extern int awt_numScreens;
601 /*hardcode the size right now, should get the size base on font*/
602 int width=80, height=22;
603 Window rootWindow;
604 Window *ignoreWindowPtr;
605 unsigned int ignoreUnit;
606
607 XGetGeometry(dpy, parent, &rootWindow, &x, &y, &w, &h, &bw, &depth);
608
609 attrib.override_redirect = True;
610 attribmask = CWOverrideRedirect;
611 for (i = 0; i < awt_numScreens; i++) {
612 if (RootWindow(dpy, i) == rootWindow) {
|