UNIXworkcode

1 /* 2 * Copyright 2020 Olaf Wintermann 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice shall be included in 12 * all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 * DEALINGS IN THE SOFTWARE. 21 */ 22 23 #ifndef XNE_TEXTFIELDP_H 24 #define XNE_TEXTFIELDP_H 25 26 #include <Xm/XmP.h> 27 #include <Xm/PrimitiveP.h> 28 #include <X11/CoreP.h> 29 30 #include "../source/textDisp.h" /* NFont */ 31 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 35 36 typedef struct TextFieldClassPart { 37 int unused; 38 } TextFieldClassPart; 39 40 typedef struct TextFieldClassRec { 41 CoreClassPart core_class; 42 XmPrimitiveClassPart primitive_class; 43 TextFieldClassPart textfield_class; 44 } TextFieldClassRec; 45 46 extern TextFieldClassRec nTextFieldClassRec; 47 48 typedef struct TextFieldPart { 49 XtCallbackList valueChangedCB; 50 XtCallbackList focusCB; 51 XtCallbackList losingFocusCB; 52 XtCallbackList activateCB; 53 54 int hasFocus; 55 56 char *renderTable; 57 NFont *font; 58 XIM xim; 59 XIC xic; 60 GC gc; 61 GC gcInv; 62 GC highlightBackground; 63 64 XftColor foregroundColor; 65 XftColor backgroundColor; 66 XftDraw *d; 67 68 char *buffer; 69 size_t alloc; 70 size_t length; 71 size_t pos; 72 73 int posCalc; 74 int posX; 75 76 int scrollX; 77 78 int textarea_xoff; 79 int textarea_yoff; 80 81 int hasSelection; 82 int selStart; 83 int selEnd; 84 85 int selStartX; 86 int selEndX; 87 88 Time btn1ClickPrev; 89 Time btn1ClickPrev2; 90 int dontAdjustSel; 91 92 int blinkrate; 93 int cursorOn; 94 XtIntervalId blinkProcId; 95 } TextFieldPart; 96 97 typedef struct TextFieldRec { 98 CorePart core; 99 XmPrimitivePart primitive; 100 TextFieldPart textfield; 101 } TextFieldRec; 102 103 104 #ifdef __cplusplus 105 } 106 #endif 107 108 #endif /* XNE_TEXTFIELDP_H */ 109 110