00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef INC_MI32_TEXTED_H
00035 #define INC_MI32_TEXTED_H
00036
00037 #ifndef INC_MI32_TEXT_H
00038 #include <mi32/text.h>
00039 #endif
00040
00041 #ifndef INC_MI32_ELEMSTYL_H
00042 #include <mi32/elemstyl.h>
00043 #endif
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086 #define XtNallowEdit "allowEdit"
00087 #define XtCAllowEdit "AllowEdit"
00088 #define XtNcursorPosition "cursorPosition"
00089 #define XtCCursorPosition "CursorPosition"
00090 #define XtNmodifyCallback "modifyCallback"
00091 #define XtCModifyCallback "ModifyCallback"
00092 #define XtNblinkRate "blinkRate"
00093 #define XtCBlinkRate "BlinkRate"
00094 #define XtNpasswordMode "passwordMode"
00095 #define XtCPasswordMode "PasswordMode"
00096 #ifndef XtNdisplayCaret
00097 #define XtNdisplayCaret "displayCaret"
00098 #endif
00099 #ifndef XtCOutput
00100 #define XtCOutput "Output"
00101 #endif
00102
00103
00104 #if defined(__cplusplus)
00105 extern "C" {
00106 #endif
00107
00108 extern WidgetClass xeTextEdWidgetClass;
00109
00110 #if defined(__cplusplus)
00111 }
00112 #endif
00113
00114 typedef struct _XeTextEdClassRec *XeTextEdWidgetClass;
00115 typedef struct _XeTextEdRec *XeTextEdWidget;
00116
00117 typedef struct {
00118 MIUNICODE *ucptr;
00119 int length;
00120 } XeTextBlockRec, *XeTextBlock;
00121
00122 struct TEXTSTYLE;
00123
00124 struct XeTextVerifyCallbackStruct {
00125 int reason;
00126 XEvent *event;
00127 Boolean doit;
00128 int currInsert, newInsert;
00129 int startPos, endPos;
00130 XeTextBlock text;
00131 const TEXTSTYLE* style;
00132 };
00133
00134 #define XeCR_UP_ARROW XmCR_INCREMENT
00135 #define XeCR_DOWN_ARROW XmCR_DECREMENT
00136
00137
00138
00139
00140
00141
00142
00143
00144 typedef struct XeTextModifyCallbackData
00145 {
00146 int reason;
00147 Boolean cancel;
00148 } XeTextModifyCallbackData;
00149
00150
00151
00152
00153 typedef enum
00154 {
00155 XeTextUnit_POINT,
00156 XeTextUnit_POSITION,
00157 XeTextUnit_WORD,
00158 XeTextUnit_LINE,
00159 XeTextUnit_LINE_BEGIN,
00160 XeTextUnit_LINE_END,
00161 XeTextUnit_PARAGRAPH,
00162 XeTextUnit_TAG,
00163 XeTextUnit_ALL
00164 } XeTextUnit;
00165
00169
00170 _XFUNCPROTOBEGIN
00171
00172 void XeTextEnableDisplay
00173 (
00174 #if NeedFunctionPrototypes
00175 Widget
00176 #endif
00177 );
00178
00179 void XeTextDisableDisplay
00180 (
00181 #if NeedFunctionPrototypes
00182 Widget
00183 #endif
00184 );
00185
00186 void XeTextDisplay
00187 (
00188 #if NeedFunctionPrototypes
00189 Widget
00190 #endif
00191 );
00192
00193 Boolean XeTextSaveAsFile
00194 (
00195 #if NeedFunctionPrototypes
00196 Widget,
00197 String
00198 #endif
00199 );
00200
00201 void XeTextSetString
00202 (
00203 Widget,
00204 const char *
00205 );
00206
00207 #define XeTextSetStringUnicode XeTextSetStringUC
00208
00209 void XeTextSetStringUC
00210 (
00211 Widget,
00212 const MIUNICODE *
00213 );
00214
00215 String XeTextGetString
00216 (
00217 Widget,
00218 int *
00219 );
00220
00221 #define XeTextGetStringUnicode XeTextGetStringUC
00222
00223 MIUNICODE *XeTextGetStringUC
00224 (
00225 Widget
00226 );
00227
00228
00229 MIUNICODE *XeTextGetSelectionUC (
00230 Widget
00231 );
00232
00233 String XeTextGetSubstring
00234 (
00235 Widget,
00236 int *,
00237 int,
00238 int
00239 );
00240
00241 int XeTextGetLength
00242 (
00243 Widget,
00244 int
00245 );
00246
00247 #define XeTextMakeCursorPositionVisible XeTextMakeCursorPositionVisable
00248
00249 void XeTextMakeCursorPositionVisable
00250 (
00251 Widget,
00252 void *
00253 );
00254
00255 int XeTextGetInsertionPosition
00256 (
00257 Widget
00258 );
00259
00260 void XeTextSetInsertionPosition
00261 (
00262 Widget,
00263 int
00264 );
00265
00266 typedef int (*XeTextExtractFeed)
00267 (
00268 MIUNICODE *,
00269 int,
00270 XeTextTag,
00271 XtPointer
00272 );
00273
00274 void XeTextExtract
00275 (
00276 Widget,
00277 int,
00278 int,
00279 XeTextExtractFeed,
00280 XtPointer
00281 );
00282
00283 void XeTextReplace
00284 (
00285 Widget,
00286 int,
00287 int,
00288 const char *,
00289 int
00290 );
00291
00292 void XeTextInsert
00293 (
00294 #if NeedFunctionPrototypes
00295 Widget,
00296 const char *,
00297 int
00298 #endif
00299 );
00300
00301 void XeTextInsertUnicode
00302 (
00303 #if NeedFunctionPrototypes
00304 Widget,
00305 const MIUNICODE *
00306 #endif
00307 );
00308
00309 void XeTextReplaceTagged
00310 (
00311 Widget,
00312 int,
00313 int,
00314 const char *,
00315 int,
00316 XeTextTag
00317 );
00318
00319 void XeTextReplaceTaggedUC
00320 (
00321 Widget,
00322 int,
00323 int,
00324 const MIUNICODE *,
00325 int,
00326 XeTextTag
00327 );
00328
00329 int XeTextGetInsertionPoint
00330 (
00331 #if NeedFunctionPrototypes
00332 Widget
00333 #endif
00334 );
00335
00336 int XeTextScan
00337 (
00338 #if NeedFunctionPrototypes
00339 Widget,
00340 XeTextUnit,
00341 int
00342 #endif
00343 );
00344
00345 int XeTextSearch
00346 (
00347 #if NeedFunctionPrototypes
00348 Widget,
00349 int,
00350 const char *,
00351 int,
00352 int
00353 #endif
00354 );
00355
00356 XeTextTag XeTextGetInsertionTag
00357 (
00358 #if NeedFunctionPrototypes
00359 Widget
00360 #endif
00361 );
00362
00363 void XeTextGetSelectionPosition
00364 (
00365 #if NeedFunctionPrototypes
00366 Widget,
00367 int *,
00368 int *
00369 #endif
00370 );
00371
00372 void XeTextSetSelection
00373 (
00374 #if NeedFunctionPrototypes
00375 Widget,
00376 int,
00377 int
00378 #endif
00379 );
00380
00381 void XeTextUnsetSelection
00382 (
00383 #if NeedFunctionPrototypes
00384 Widget
00385 #endif
00386 );
00387
00388 void XeTextCut(Widget);
00389 void XeTextCopy(Widget);
00390 void XeTextPaste(Widget);
00391 void XeTextRemove(Widget);
00392
00393 void _XeTextMarkSelection(Widget);
00394 void _XeTextPrepareToScrol(Widget);
00395 void _XeTextUpdateFromScro(Widget);
00396 void _XeAdjustScrollBars(Widget);
00397
00403 bool XeTextScrollToAnchor(Widget, const MIUNICODE* anchor);
00404
00405 void XeTextKeyEventHandler(Widget, XtPointer, XEvent*, Boolean*);
00406
00407 _XFUNCPROTOEND
00408
00409
00410 #if defined(__cplusplus)
00411
00413 inline MISTRING XeTextGetString (
00414 Widget xetext
00415 ) {
00416 MIUNICODE *ucstr = XeTextGetStringUC(xetext);
00417 MISTRING string(ucstr);
00418 free(ucstr);
00419 return (string);
00420 }
00421
00423 inline void XeTextGetString (
00424 Widget xetext,
00425 MISTRING& string
00426 ) {
00427 MIUNICODE *ucstr = XeTextGetStringUC(xetext);
00428 string = ucstr;
00429 free(ucstr);
00430 return;
00431 }
00432
00434 inline void XeTextInsert (
00435 Widget xetext,
00436 const char* string
00437 ) {
00438 XeTextInsert(xetext,string,strlen(string));
00439 return;
00440 }
00441
00443 inline void XeTextInsert (
00444 Widget xetext,
00445 const MIUNICODE* string
00446 ) {
00447 XeTextInsertUnicode(xetext,string);
00448 return;
00449 }
00450
00451 class EDITMENU;
00452
00454 EDITMENU* XeTextAddPopupEditMenu (
00455 Widget xetext
00456 );
00457
00459 EDITMENU* XeTextGetEditMenu (
00460 Widget xetext
00461 );
00462
00464 const TEXTSTYLE& XeTextGetStyle (
00465 Widget widget,
00466 int offset
00467 );
00468
00472 void XeTextSetStyle (
00473 Widget widget,
00474 const TEXTSTYLEDIFF& style,
00475 int startoffset = -1,
00476 int endoffset = -1
00477 );
00478
00479 #ifndef GENERATING_DOXYGEN_OUTPUT
00491
00492
00493
00494
00495
00496
00497 #endif
00498
00499 #endif
00500
00502
00503 #define XeIsXeText(w) XtIsSubclass((w), xeTextEdWidgetClass)
00504
00505
00506 #endif // INC_MI32_TEXTED_H