📄 xlcint.h
字号:
/* $Xorg: Xlcint.h,v 1.3 2000/08/17 19:45:06 cpqbld Exp $ *//*Copyright 1991, 1998 The Open GroupAll Rights Reserved.The above copyright notice and this permission notice shall be includedin all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OROTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OROTHER DEALINGS IN THE SOFTWARE.Except as contained in this notice, the name of The Open Group shallnot be used in advertising or otherwise to promote the sale, use orother dealings in this Software without prior written authorizationfrom The Open Group.*//* $XFree86: xc/lib/X11/Xlcint.h,v 3.8 2001/01/17 19:41:49 dawes Exp $ *//* * Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation, * and Nippon Telegraph and Telephone Corporation * Copyright 1991 by the Open Software Foundation * Copyright 1993 by the TOSHIBA Corp. * Copyright 1993, 1994 by Sony Corporation * Copyright 1993, 1994 by the FUJITSU LIMITED * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the names of OMRON, NTT Software, NTT, Open * Software Foundation, and Sony Corporation not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. OMRON, NTT Software, NTT, Open Software * Foundation, and Sony Corporation make no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, AND SONY * CORPORATION DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT * SHALL OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, OR SONY * CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: Li Yuhong OMRON Corporation * Tatsuya Kato NTT Software Corporation * Hiroshi Kuribayashi OMRON Coproration * Muneiyoshi Suzuki Nippon Telegraph and Telephone Co. * * M. Collins OSF * Katsuhisa Yano TOSHIBA Corp. * Makoto Wakamatsu Sony Corporation * Takashi Fujiwara FUJITSU LIMITED */ #ifndef _XLCINT_H_#define _XLCINT_H_#include "Xresource.h"#include "Xutil.h"/*#include "Xvarargs.h"*/#include "varargs.h"typedef Bool (*XFilterEventProc)(#if NeedFunctionPrototypes Display* /* display */, Window /* window */, XEvent* /* event */, XPointer /* client_data */#endif);typedef struct _XIMFilter { struct _XIMFilter *next; Window window; unsigned long event_mask; int start_type, end_type; XFilterEventProc filter; XPointer client_data;} XFilterEventRec, *XFilterEventList;typedef struct { char *name; XPointer value;} XIMArg;#ifdef offsetof#define XOffsetOf(s_type,field) offsetof(s_type,field)#else#define XOffsetOf(s_type,field) ((unsigned int)&(((s_type*)NULL)->field))#endif#define XIMNumber(arr) ((unsigned int) (sizeof(arr) / sizeof(arr[0])))/* * define secondary data structs which are part of Input Methods * and Input Context */typedef struct { char *resource_name; /* Resource string */ XrmQuark xrm_name; /* Resource name quark */ int resource_size; /* Size in bytes of data */ long resource_offset; /* Offset from base */ unsigned short mode; /* Read Write Permission */ unsigned short id; /* Input Method Protocol */} XIMResource, *XIMResourceList;/* * data block describing the visual attributes associated with * an input context */typedef struct { XRectangle area; XRectangle area_needed; XPoint spot_location; Colormap colormap; Atom std_colormap; unsigned long foreground; unsigned long background; Pixmap background_pixmap; XFontSet fontset; int line_spacing; Cursor cursor; XICCallback start_callback; XICCallback done_callback; XICCallback draw_callback; XICCallback caret_callback; XIMPreeditState preedit_state; XICCallback state_notify_callback;} ICPreeditAttributes, *ICPreeditAttributesPtr;typedef struct { XRectangle area; XRectangle area_needed; Colormap colormap; Atom std_colormap; unsigned long foreground; unsigned long background; Pixmap background_pixmap; XFontSet fontset; int line_spacing; Cursor cursor; XICCallback start_callback; XICCallback done_callback; XICCallback draw_callback;} ICStatusAttributes, *ICStatusAttributesPtr;/* * Methods for Xrm parsing *//* The state is a pointer to an object created by the locale's init_parse_info function (default: _XrmDefaultInitParseInfo). *//* Sets the state to the initial state. Initiates a sequence of calls to the XmbCharProc. */typedef void (*XmbInitProc)( XPointer state);/* Transforms one multibyte character, starting at str, and return a 'char' in the same parsing class (not a wide character!). Returns the number of consumed bytes in *lenp. */typedef char (*XmbCharProc)( XPointer state, const char * str, int* lenp);/* Terminates a sequence of calls to the XmbCharProc. */typedef void (*XmbFinishProc)( XPointer state);/* Returns the name of the state's locale, as a static string. */typedef const char* (*XlcNameProc)( XPointer state);/* Frees the state, which was allocated by the locale's init_parse_info function. */typedef void (*XrmDestroyProc)( XPointer state);/* Set of methods for Xrm parsing. */typedef struct { XmbInitProc mbinit; XmbCharProc mbchar; XmbFinishProc mbfinish; XlcNameProc lcname; XrmDestroyProc destroy;} XrmMethodsRec;typedef const XrmMethodsRec *XrmMethods;typedef struct _XLCd *XLCd; /* need forward reference *//* * define an LC, it's methods, and data. */typedef void (*XCloseLCProc)(#if NeedFunctionPrototypes XLCd /* lcd */#endif);typedef char* (*XlcMapModifiersProc)(#if NeedFunctionPrototypes XLCd /* lcd */, _Xconst char* /* user_mods */, _Xconst char* /* prog_mods */#endif);typedef XOM (*XOpenOMProc)(#if NeedFunctionPrototypes XLCd /* lcd */, Display* /* display */, XrmDatabase /* rdb */, _Xconst char* /* res_name */, _Xconst char* /* res_class */#endif);typedef XIM (*XOpenIMProc)(#if NeedFunctionPrototypes XLCd /* lcd */, Display* /* display */, XrmDatabase /* rdb */, char* /* res_name */, char* /* res_class */#endif);typedef Bool (*XRegisterIMInstantiateCBProc)(#if NeedFunctionPrototypes XLCd /* lcd */, Display* /* display */, XrmDatabase /* rdb */, char* /* res_name */, char* /* res_class */, XIDProc /* callback */, XPointer /* client_data */#endif);typedef Bool (*XUnregisterIMInstantiateCBProc)(#if NeedFunctionPrototypes XLCd /* lcd */, Display* /* display */, XrmDatabase /* rdb */, char* /* res_name */, char* /* res_class */, XIDProc /* callback */, XPointer /* client_data */#endif);typedef XrmMethods (*XrmInitParseInfoProc)(#if NeedFunctionPrototypes XLCd /* lcd */, XPointer* /* state */#endif);typedef int (*XmbTextPropertyToTextListProc)( XLCd lcd, Display* display, const XTextProperty* text_prop, char*** list_return, int* count_return);typedef int (*XwcTextPropertyToTextListProc)( XLCd lcd, Display* display, const XTextProperty* text_prop, wchar_t*** list_return, int* count_return);typedef int (*XmbTextListToTextPropertyProc)( XLCd lcd, Display* display, char** list, int count, XICCEncodingStyle style, XTextProperty* text_prop_return);typedef int (*XwcTextListToTextPropertyProc)( XLCd lcd, Display* display, wchar_t** list, int count, XICCEncodingStyle style, XTextProperty* text_prop_return);typedef void (*XwcFreeStringListProc)( XLCd lcd, wchar_t** list);typedef const char* (*XDefaultStringProc)( XLCd lcd);typedef struct { XCloseLCProc close; XlcMapModifiersProc map_modifiers; XOpenOMProc open_om; XOpenIMProc open_im; XrmInitParseInfoProc init_parse_info; XmbTextPropertyToTextListProc mb_text_prop_to_list; XwcTextPropertyToTextListProc wc_text_prop_to_list; XmbTextPropertyToTextListProc utf8_text_prop_to_list; XmbTextListToTextPropertyProc mb_text_list_to_prop; XwcTextListToTextPropertyProc wc_text_list_to_prop; XmbTextListToTextPropertyProc utf8_text_list_to_prop; XwcFreeStringListProc wc_free_string_list; XDefaultStringProc default_string; XRegisterIMInstantiateCBProc register_callback; XUnregisterIMInstantiateCBProc unregister_callback;} XLCdMethodsRec, *XLCdMethods;typedef struct { char* name; /* name of this LC */ char* modifiers; /* modifiers of locale */} XLCdCoreRec, *XLCdCore;typedef struct _XLCd { XLCdMethods methods; /* methods of this LC */ XLCdCore core; /* data of this LC */ XPointer opaque; /* LDX specific data */} XLCdRec;typedef int XlcPosition;#define XlcHead 0#define XlcTail -1typedef struct { char *name; XPointer value;} XlcArg, *XlcArgList;typedef struct _XlcResource { char *name; XrmQuark xrm_name; int size; int offset; unsigned long mask;} XlcResource, *XlcResourceList;#define XlcCreateMask (1L<<0)#define XlcDefaultMask (1L<<1)#define XlcGetMask (1L<<2)#define XlcSetMask (1L<<3)#define XlcIgnoreMask (1L<<4)#define XlcNumber(arr) (sizeof(arr) / sizeof(arr[0]))typedef Status (*XCloseOMProc)(#if NeedFunctionPrototypes XOM /* om */#endif);typedef char* (*XSetOMValuesProc)(#if NeedFunctionPrototypes XOM /* om */, XlcArgList /* args */, int /* num_args */#endif);typedef char* (*XGetOMValuesProc)(#if NeedFunctionPrototypes XOM /* om */, XlcArgList /* args */, int /* num_args */#endif);typedef XOC (*XCreateOCProc)(#if NeedFunctionPrototypes XOM /* om */, XlcArgList /* args */, int /* num_args */#endif);typedef struct _XOMMethodsRec { XCloseOMProc close; XSetOMValuesProc set_values; XGetOMValuesProc get_values; XCreateOCProc create_oc;} XOMMethodsRec, *XOMMethods;typedef struct _XOMCoreRec { XLCd lcd; /* lcd */ Display *display; /* display */ XrmDatabase rdb; /* database */ char *res_name; /* resource name */ char *res_class; /* resource class */ XOC oc_list; /* xoc list */ XlcResourceList resources; /* xom resources */ int num_resources; /* number of xom resources */ XOMCharSetList required_charset; /* required charset list */ XOMOrientation orientation_list; /* orientation list */ Bool directional_dependent; /* directional-dependent */ Bool contextual_drawing; /* contextual drawing */ Bool context_dependent; /* context-dependent drawing */} XOMCoreRec, *XOMCore;typedef struct _XOM { XOMMethods methods; XOMCoreRec core;} XOMRec;typedef void (*XDestroyOCProc)(#if NeedFunctionPrototypes XOC /* oc */#endif);typedef char* (*XSetOCValuesProc)(#if NeedFunctionPrototypes XOC /* oc */, XlcArgList /* args */, int /* num_args */#endif);typedef char* (*XGetOCValuesProc)(#if NeedFunctionPrototypes XOC /* oc */, XlcArgList /* args */, int /* num_args */#endif);/* * X Font Sets are an instantiable object, so we define it, the * object itself, a method list and data *//* * XFontSet object method list */typedef int (*XmbTextEscapementProc)(#if NeedFunctionPrototypes XFontSet /* font_set */, _Xconst char* /* text */, int /* text_len */#endif);typedef int (*XmbTextExtentsProc)(#if NeedFunctionPrototypes XFontSet /* font_set */, _Xconst char* /* text */, int /* text_len */, XRectangle* /* overall_ink_extents */, XRectangle* /* overall_logical_extents */#endif);typedef Status (*XmbTextPerCharExtentsProc)(#if NeedFunctionPrototypes XFontSet /* font_set */, _Xconst char* /* text */, int /* text_len */, XRectangle* /* ink_extents_buffer */, XRectangle* /* logical_extents_buffer */, int /* buffer_size */, int* /* num_chars */, XRectangle* /* max_ink_extents */, XRectangle* /* max_logical_extents */#endif);typedef int (*XmbDrawStringProc)(#if NeedFunctionPrototypes Display* /* display */, Drawable /* drawable */, XFontSet /* font_set */, GC /* gc */, int /* x */, int /* y */, _Xconst char* /* text */, int /* text_len */#endif);typedef void (*XmbDrawImageStringProc)(#if NeedFunctionPrototypes Display* /* display */, Drawable /* drawable */, XFontSet /* font_set */, GC /* gc */, int /* x */,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -