Hi, all
After study XIM document and some C example, I am trying to implement XIM
protocol in factor(can't input chinese character in listener now), but I got
a problem in first step.
problem: can't call XGetIMValues ?
call XGetIMValues is simple in C:
--------------------------------------------------------
typedef unsigned long XIMStyle;
typedef struct {
unsigned short count_styles;
XIMStyle *supported_styles;
} XIMStyles;
#define XNQueryInputStyle "queryInputStyle"
extern char *XGetIMValues(
XIM /* im */, ...
) _X_SENTINEL(0);
XIMStyles *xim_styles = NULL;
XGetIMValues(im, XNQueryInputStyle, &xim_styles, NULL);
--------------------------------------------------------
then we can get input styles information from XIM server.
I try in factor:
TYPEDEF: ulong XIMStyle
C-STRUCT: XIMStyles
{ "ushort" "count_styles" }
{ "XIMStyle*" "supported_styles" } ;
X-FUNCTION: char* XGetIMValues ( XIM im, char* query_str, XIMStyles*
styles, int endkey )
! in xlib.factor
SYMBOL: styles
: get-styles ( im str ximstyles n -- object )
"XIMStyles" <c-object> styles set
xim get-global XNQueryInputStyle styles get 0 XGetIMValues ;
! in xim.factor
get-styles return f, styles can't get input styles from XIM server,
Can someone give me a suggestion ?
Caesar Hu
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk