📄 xlib.h
字号:
/* * this union is defined so Xlib can always use the same sized * event structure internally, to avoid memory fragmentation. */typedef union _XEvent { int type; /* must not be changed; first element */ XAnyEvent xany; XKeyEvent xkey; XButtonEvent xbutton; XMotionEvent xmotion; XCrossingEvent xcrossing; XFocusChangeEvent xfocus; XExposeEvent xexpose; XGraphicsExposeEvent xgraphicsexpose; XNoExposeEvent xnoexpose; XVisibilityEvent xvisibility; XCreateWindowEvent xcreatewindow; XDestroyWindowEvent xdestroywindow; XUnmapEvent xunmap; XMapEvent xmap; XMapRequestEvent xmaprequest; XReparentEvent xreparent; XConfigureEvent xconfigure; XGravityEvent xgravity; XResizeRequestEvent xresizerequest; XConfigureRequestEvent xconfigurerequest; XCirculateEvent xcirculate; XCirculateRequestEvent xcirculaterequest; XPropertyEvent xproperty; XSelectionClearEvent xselectionclear; XSelectionRequestEvent xselectionrequest; XSelectionEvent xselection; XColormapEvent xcolormap; XClientMessageEvent xclient; XMappingEvent xmapping; XErrorEvent xerror; XKeymapEvent xkeymap; long pad[24];} XEvent;#endif#define XAllocID(dpy) ((*((_XPrivDisplay)dpy)->resource_alloc)((dpy)))/* * per character font metric information. */typedef struct { short lbearing; /* origin to left edge of raster */ short rbearing; /* origin to right edge of raster */ short width; /* advance to next char's origin */ short ascent; /* baseline to top edge of raster */ short descent; /* baseline to bottom edge of raster */ unsigned short attributes; /* per char flags (not predefined) */} XCharStruct;/* * To allow arbitrary information with fonts, there are additional properties * returned. */typedef struct { Atom name; unsigned long card32;} XFontProp;typedef struct { XExtData *ext_data; /* hook for extension to hang data */ Font fid; /* Font id for this font */ unsigned direction; /* hint about direction the font is painted */ unsigned min_char_or_byte2;/* first character */ unsigned max_char_or_byte2;/* last character */ unsigned min_byte1; /* first row that exists */ unsigned max_byte1; /* last row that exists */ Bool all_chars_exist;/* flag if all characters have non-zero size*/ unsigned default_char; /* char to print for undefined character */ int n_properties; /* how many properties there are */ XFontProp *properties; /* pointer to array of additional properties*/ XCharStruct min_bounds; /* minimum bounds over all existing char*/ XCharStruct max_bounds; /* maximum bounds over all existing char*/ XCharStruct *per_char; /* first_char to last_char information */ int ascent; /* log. extent above baseline for spacing */ int descent; /* log. descent below baseline for spacing */} XFontStruct;/* * PolyText routines take these as arguments. */typedef struct { char *chars; /* pointer to string */ int nchars; /* number of characters */ int delta; /* delta between strings */ Font font; /* font to print it in, None don't change */} XTextItem;typedef struct { /* normal 16 bit characters are two bytes */ unsigned char byte1; unsigned char byte2;} XChar2b;typedef struct { XChar2b *chars; /* two byte characters */ int nchars; /* number of characters */ int delta; /* delta between strings */ Font font; /* font to print it in, None don't change */} XTextItem16;typedef union { Display *display; GC gc; Visual *visual; Screen *screen; ScreenFormat *pixmap_format; XFontStruct *font; } XEDataObject;typedef struct { XRectangle max_ink_extent; XRectangle max_logical_extent;} XFontSetExtents;/* unused:typedef void (*XOMProc)(); */typedef struct _XOM *XOM;typedef struct _XOC *XOC, *XFontSet;typedef struct { char *chars; int nchars; int delta; XFontSet font_set;} XmbTextItem;typedef struct { wchar_t *chars; int nchars; int delta; XFontSet font_set;} XwcTextItem;#define XNRequiredCharSet "requiredCharSet"#define XNQueryOrientation "queryOrientation"#define XNBaseFontName "baseFontName"#define XNOMAutomatic "omAutomatic"#define XNMissingCharSet "missingCharSet"#define XNDefaultString "defaultString"#define XNOrientation "orientation"#define XNDirectionalDependentDrawing "directionalDependentDrawing"#define XNContextualDrawing "contextualDrawing"#define XNFontInfo "fontInfo"typedef struct { int charset_count; char **charset_list;} XOMCharSetList;typedef enum { XOMOrientation_LTR_TTB, XOMOrientation_RTL_TTB, XOMOrientation_TTB_LTR, XOMOrientation_TTB_RTL, XOMOrientation_Context} XOrientation;typedef struct { int num_orientation; XOrientation *orientation; /* Input Text description */} XOMOrientation;typedef struct { int num_font; XFontStruct **font_struct_list; char **font_name_list;} XOMFontInfo;typedef struct _XIM *XIM;typedef struct _XIC *XIC;typedef void (*XIMProc)(#if NeedFunctionPrototypes XIM, XPointer, XPointer#endif);typedef Bool (*XICProc)(#if NeedFunctionPrototypes XIC, XPointer, XPointer#endif);typedef void (*XIDProc)(#if NeedFunctionPrototypes Display*, XPointer, XPointer#endif);typedef unsigned long XIMStyle;typedef struct { unsigned short count_styles; XIMStyle *supported_styles;} XIMStyles;#define XIMPreeditArea 0x0001L#define XIMPreeditCallbacks 0x0002L#define XIMPreeditPosition 0x0004L#define XIMPreeditNothing 0x0008L#define XIMPreeditNone 0x0010L#define XIMStatusArea 0x0100L#define XIMStatusCallbacks 0x0200L#define XIMStatusNothing 0x0400L#define XIMStatusNone 0x0800L#define XNVaNestedList "XNVaNestedList"#define XNQueryInputStyle "queryInputStyle"#define XNClientWindow "clientWindow"#define XNInputStyle "inputStyle"#define XNFocusWindow "focusWindow"#define XNResourceName "resourceName"#define XNResourceClass "resourceClass"#define XNGeometryCallback "geometryCallback"#define XNDestroyCallback "destroyCallback"#define XNFilterEvents "filterEvents"#define XNPreeditStartCallback "preeditStartCallback"#define XNPreeditDoneCallback "preeditDoneCallback"#define XNPreeditDrawCallback "preeditDrawCallback"#define XNPreeditCaretCallback "preeditCaretCallback"#define XNPreeditStateNotifyCallback "preeditStateNotifyCallback"#define XNPreeditAttributes "preeditAttributes"#define XNStatusStartCallback "statusStartCallback"#define XNStatusDoneCallback "statusDoneCallback"#define XNStatusDrawCallback "statusDrawCallback"#define XNStatusAttributes "statusAttributes"#define XNArea "area"#define XNAreaNeeded "areaNeeded"#define XNSpotLocation "spotLocation"#define XNColormap "colorMap"#define XNStdColormap "stdColorMap"#define XNForeground "foreground"#define XNBackground "background"#define XNBackgroundPixmap "backgroundPixmap"#define XNFontSet "fontSet"#define XNLineSpace "lineSpace"#define XNCursor "cursor"#define XNQueryIMValuesList "queryIMValuesList"#define XNQueryICValuesList "queryICValuesList"#define XNVisiblePosition "visiblePosition"#define XNR6PreeditCallback "r6PreeditCallback"#define XNStringConversionCallback "stringConversionCallback"#define XNStringConversion "stringConversion"#define XNResetState "resetState"#define XNHotKey "hotKey"#define XNHotKeyState "hotKeyState"#define XNPreeditState "preeditState"#define XNSeparatorofNestedList "separatorofNestedList"#define XBufferOverflow -1#define XLookupNone 1#define XLookupChars 2#define XLookupKeySym 3#define XLookupBoth 4#if NeedFunctionPrototypestypedef void *XVaNestedList;#elsetypedef XPointer XVaNestedList;#endiftypedef struct { XPointer client_data; XIMProc callback;} XIMCallback;typedef struct { XPointer client_data; XICProc callback;} XICCallback;typedef unsigned long XIMFeedback;#define XIMReverse 1L#define XIMUnderline (1L<<1) #define XIMHighlight (1L<<2)#define XIMPrimary (1L<<5)#define XIMSecondary (1L<<6)#define XIMTertiary (1L<<7)#define XIMVisibleToForward (1L<<8)#define XIMVisibleToBackword (1L<<9)#define XIMVisibleToCenter (1L<<10)typedef struct _XIMText { unsigned short length; XIMFeedback *feedback; Bool encoding_is_wchar; union { char *multi_byte; wchar_t *wide_char; } string; } XIMText;typedef unsigned long XIMPreeditState;#define XIMPreeditUnKnown 0L#define XIMPreeditEnable 1L#define XIMPreeditDisable (1L<<1)typedef struct _XIMPreeditStateNotifyCallbackStruct { XIMPreeditState state;} XIMPreeditStateNotifyCallbackStruct;typedef unsigned long XIMResetState;#define XIMInitialState 1L#define XIMPreserveState (1L<<1)typedef unsigned long XIMStringConversionFeedback;#define XIMStringConversionLeftEdge (0x00000001)#define XIMStringConversionRightEdge (0x00000002)#define XIMStringConversionTopEdge (0x00000004)#define XIMStringConversionBottomEdge (0x00000008)#define XIMStringConversionConcealed (0x00000010)#define XIMStringConversionWrapped (0x00000020)typedef struct _XIMStringConversionText { unsigned short length; XIMStringConversionFeedback *feedback; Bool encoding_is_wchar; union { char *mbs; wchar_t *wcs; } string; } XIMStringConversionText;typedef unsigned short XIMStringConversionPosition;typedef unsigned short XIMStringConversionType;#define XIMStringConversionBuffer (0x0001)#define XIMStringConversionLine (0x0002)#define XIMStringConversionWord (0x0003)#define XIMStringConversionChar (0x0004)typedef unsigned short XIMStringConversionOperation;#define XIMStringConversionSubstitution (0x0001)#define XIMStringConversionRetrival (0x0002)typedef enum { XIMForwardChar, XIMBackwardChar, XIMForwardWord, XIMBackwardWord, XIMCaretUp, XIMCaretDown, XIMNextLine, XIMPreviousLine, XIMLineStart, XIMLineEnd, XIMAbsolutePosition, XIMDontChange} XIMCaretDirection;typedef struct _XIMStringConversionCallbackStruct { XIMStringConversionPosition position; XIMCaretDirection direction; XIMStringConversionOperation operation; unsigned short factor; XIMStringConversionText *text;} XIMStringConversionCallbackStruct;typedef struct _XIMPreeditDrawCallbackStruct { int caret; /* Cursor offset within pre-edit string */ int chg_first; /* Starting change position */ int chg_length; /* Length of the change in character count */ XIMText *text;} XIMPreeditDrawCallbackStruct;typedef enum { XIMIsInvisible, /* Disable caret feedback */ XIMIsPrimary, /* UI defined caret feedback */ XIMIsSecondary /* UI defined caret feedback */} XIMCaretStyle;typedef struct _XIMPreeditCaretCallbackStruct { int position; /* Caret offset within pre-edit string */ XIMCaretDirection direction; /* Caret moves direction */ XIMCaretStyle style; /* Feedback of the caret */} XIMPreeditCaretCallbackStruct;typedef enum { XIMTextType, XIMBitmapType} XIMStatusDataType; typedef struct _XIMStatusDrawCallbackStruct { XIMStatusDataType type; union { XIMText *text; Pixmap bitmap; } data;} XIMStatusDrawCallbackStruct;typedef struct _XIMHotKeyTrigger { KeySym keysym; int modifier; int modifier_mask;} XIMHotKeyTrigger;typedef struct _XIMHotKeyTriggers { int num_hot_key; XIMHotKeyTrigger *key;} XIMHotKeyTriggers;typedef unsigned long XIMHotKeyState;#define XIMHotKeyStateON (0x0001L)#define XIMHotKeyStateOFF (0x0002L)typedef struct { unsigned short count_values; char **supported_values;} XIMValuesList;_XFUNCPROTOBEGIN#if defined(WIN32) && !defined(_XLIBINT_)#define _Xdebug (*_Xdebug_p)#endifextern int _Xdebug;extern XFontStruct *XLoadQueryFont(#if NeedFunctionPrototypes Display* /* display */, _Xconst char* /* name */#endif);extern XFontStruct *XQueryFont(#if NeedFunctionPrototypes Display* /* display */, XID /* font_ID */#endif);extern XTimeCoord *XGetMotionEvents(#if NeedFunctionPrototypes Display* /* display */, Window /* w */, Time /* start */, Time /* stop */, int* /* nevents_return */#endif);extern XModifierKeymap *XDeleteModifiermapEntry(#if NeedFunctionPrototypes XModifierKeymap* /* modmap */,#if NeedWidePrototypes unsigned int /* keycode_entry */,#else KeyCode /* keycode_entry */,#endif int /* modifier */#endif);extern XModifierKeymap *XGetModifierMapping(#if NeedFunctionPrototypes Display* /* display */#endif);extern XModifierKeymap *XInsertModifiermapEntry(#if NeedFunctionPrototypes XModifierKeymap* /* modmap */,#if NeedWidePrototypes unsigned int /* keycode_entry */,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -