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
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 #ifndef INC_MI32_TEXT_H
00059 #define INC_MI32_TEXT_H
00060
00061 #ifndef INC_MI32_XEWBASIC_H
00062 #include <mi32/xewbasic.h>
00063 #endif
00064
00065 #ifndef GENERATING_DOXYGEN_OUTPUT
00066 struct COLOR;
00067 #endif
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106 typedef enum
00107 {
00108 XeAlignment_NONE,
00109 XeAlignment_START,
00110 XeAlignment_END,
00111 XeAlignment_CENTER,
00112 XeAlignment_JUSTIFIED,
00113 XeAlignment_AROUND
00114 } XeAlignment;
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143 typedef enum
00144 {
00145 XeTextExport_STRING = 0,
00146 XeTextExport_STRING_F = 1,
00147 XeTextExport_ODIF = 2,
00148 XeTextExport_ODIF_F = 3,
00149 XeTextExport_ODIF_FP = 7,
00150 XeTextExport_TILDE = 8
00151 } XeTextExport;
00152
00153 #define XeTextExportFormatted(f) ((f)&1)
00154 #define XeTextExportOdif(f) ((f)&2)
00155
00156 typedef struct XeFontListRec *XeFontList;
00157
00158 typedef struct XeFont
00159 {
00160 int font_size;
00161 XeFontList font_list;
00162 } XeFont;
00163
00164 typedef struct XeItemization
00165 {
00166 int identifier_alignment;
00167 int identifier_start_offset;
00168 int identifier_end_offset;
00169 } XeItemization;
00170
00171 typedef struct XeTabStop
00172 {
00173 String tabulation_reference;
00174 Dimension tabulation_position;
00175 int alignment;
00176 String alignment_character_string;
00177 } XeTabStop;
00178
00179
00180
00181
00182
00183 typedef struct XeTextInsertContextRec *XeTextInsertContext;
00184
00185
00186
00187 typedef XtPointer XeTextTag;
00188
00189 enum XeSyntaxState {
00190 XeSYNTAX_Normal = 0,
00191 XeSYNTAX_Keyword,
00192 XeSYNTAX_Constant,
00193 XeSYNTAX_SingleQuotedString,
00194 XeSYNTAX_DoubleQuotedString,
00195 XeSYNTAX_Comment,
00196 XeSYNTAX_Function
00197 };
00198
00199 typedef struct XeTextSyntaxParseCallbackData {
00200 const MIUNICODE* str;
00201 XeSyntaxState* state;
00202 int len;
00203 XeSyntaxState initial_state;
00204 Boolean start_of_line;
00205 } XeTextSyntaxParseCallbackData;
00206
00207 typedef struct XeTextHyperlinkCallbackData {
00208 const MIUNICODE* str;
00209 } XeTextHyperlinkCallbackData;
00210
00211 typedef struct XeTextToggleWYSIWYGCallbackData {
00212 Boolean state;
00213 } XeTextToggleWYSISYGCallbackData;
00214
00215
00216
00217
00218
00219
00220 typedef struct XeTextLayoutCallbackData
00221 {
00222 int reason;
00223
00224
00225 XeTextTag Old, New;
00226 XeTextInsertContext context;
00227 int (*feed)(XeTextInsertContext context, const MIUNICODE *string, int length);
00228 } XeTextLayoutCallbackData;
00229
00230
00231
00232
00233
00234 #define XeTEXT_BoldOn "\033[1m"
00235 #define XeTEXT_BoldOff "\033[22m"
00236 #define XeTEXT_ItaliacOn "\033[3m"
00237 #define XeTEXT_ItaliacOff "\033[23m"
00238 #define XeTEXT_UnderlineOn "\033[4m"
00239 #define XeTEXT_UnderlineOff "\033[24m"
00240 #define XeTEXT_FrameBox "\033[51m"
00241 #define XeTEXT_FrameCircled "\033[52m"
00242 #define XeTEXT_OverlineOn "\033[53m"
00243 #define XeTEXT_FrameNone "\033[54m"
00244 #define XeTEXT_OverlineOff "\033[55m"
00245
00246 #define XeTEXT_FGBlack "\033[30m"
00247 #define XeTEXT_FGRed "\033[31m"
00248 #define XeTEXT_FGGreen "\033[32m"
00249 #define XeTEXT_FGYellow "\033[33m"
00250 #define XeTEXT_FGBlue "\033[34m"
00251 #define XeTEXT_FGMagenta "\033[35m"
00252 #define XeTEXT_FGCyan "\033[36m"
00253 #define XeTEXT_FGWhite "\033[37m"
00254 #define XeTEXT_FGDefault "\033[39m"
00255 #define XeTEXT_BGBlack "\033[40m"
00256 #define XeTEXT_BGRed "\033[41m"
00257 #define XeTEXT_BGGreen "\033[42m"
00258 #define XeTEXT_BGYellow "\033[43m"
00259 #define XeTEXT_BGBlue "\033[44m"
00260 #define XeTEXT_BGMagenta "\033[45m"
00261 #define XeTEXT_BGCyan "\033[46m"
00262 #define XeTEXT_BGWhite "\033[47m"
00263 #define XeTEXT_BGDefault "\033[49m"
00264 #define XeTEXT_LinkHREF "\033[5m" // Note: these are really the Blink
00265 #define XeTEXT_LinkText "\033[6m" // modes, but we reused them
00266 #define XeTEXT_LinkEnd "\033[25m"
00267
00268
00269
00270
00271 #define XtNalignment "alignment"
00272 #define XtCAlignment "Alignment"
00273 #define XtRXeAlignment "XeAlignment"
00274 #define XtNexportFormat "exportFormat"
00275 #define XtCExportFormat "ExportFormat"
00276 #define XtRXeTextExport "XeTextExport"
00277 #define XtNfonts "fonts"
00278 #define XtCFonts "Fonts"
00279 #define XtRXeFonts "XeFonts"
00280 #define XtNfirstLineOffset "firstLineOffset"
00281 #define XtCOffset "Offset"
00282 #define XtNformat "format"
00283 #define XtCFormat "Format"
00284 #ifndef XtNinitialState
00285 #define XtNinitialState "initialState"
00286 #endif
00287 #define XtCSequence "Sequence"
00288 #define XtNgraphicRendition "graphicRendition"
00289 #define XtCRendition "Rendition"
00290 #define XtNitemization "itemization"
00291 #define XtCItemization "Itemization"
00292 #define XtRXeItemization "XeItemization"
00293 #define XtNkerningOffset "kerningOffset"
00294 #define XtCKerningOffset "KerningOffset"
00295 #define XtRKerningOffset "XeKerningOffset"
00296 #define XtNlineLayoutTable "lineLayoutTable"
00297 #define XtCLineLayoutTable "LineLayoutTable"
00298 #define XtRXeLineLayoutTable "XeLineLayoutTable"
00299 #define XtNlineSpacing "lineSpacing"
00300 #define XtCLineSpacing "LineSpacing"
00301 #define XtNindentation "indentation"
00302 #define XtCIndentation "Indentation"
00303 #define XtNproportional "proportional" // Don't use - has to do with vertical spacing
00304 #define XtCProportional "Proportional"
00305 #define XeNuseFixedWidthFont "useFixedWidthFont"
00306 #define XeCUseFixedWidthFont "UseFixedWidthFont"
00307 #define XtNcolumnWidth "columnWidth"
00308 #define XtCColumnWidth "ColumnWidth"
00309 #define XtNlayoutCallback "layoutCallback"
00310 #define XtCLayoutCallback "LayoutCallback"
00311 #define XtNsyntaxParserCallback "syntaxParserCallback"
00312 #define XtCSyntaxParserCallback "SyntaxParserCallback"
00313 #define XtNsyntaxHighlighting "syntaxHighlighting"
00314 #define XtCSyntaxHighlighting "SyntaxHighlighting"
00315 #define XtNhyperlinkCallback "hyperlinkCallback"
00316 #define XtCHyperlinkCallback "HyperlinkCallback"
00317 #define XtNtoggleWYSIWYGCallback "toggleWYSIWYGCallback"
00318 #define XtCToggleWYSIWYGCallback "ToggleWYSIWYGCallback"
00319
00320 #define XeNtabInterval "tabInterval"
00321 #define XeCTabInterval "TabInterval"
00322 #define XeNhideCursorWhenNoFocus "hideCursorWhenNoFocus"
00323 #define XeCHideCursorWhenNoFocus "HideCursorWhenNoFocus"
00324 #define XeNkeepEndVisable "keepEndVisable"
00325 #define XeCKeepEndVisable "KeepEndVisable"
00326 #define XeNenableContextMenu "enableContextMenu"
00327 #define XeCenableContextMenu "EnableContextMenu"
00328 #define XeNwordWrap "wordWrap"
00329 #define XeCWordWrap "WordWrap"
00330 #define XeNwysiwyg "wysiwyg"
00331 #define XeCWysiwyg "Wysiwig"
00332
00333
00334
00335 typedef struct _XeTextClassRec *XeTextWidgetClass;
00336 typedef struct _XeTextRec *XeTextWidget;
00337
00338 _XFUNCPROTOBEGIN
00339
00340 extern WidgetClass xeTextWidgetClass;
00341
00342
00343
00344
00345
00346
00347 void XeTextLayout (
00348 Widget
00349 );
00350
00351
00352 #define XeTextMakeEndVisible XeTextMakeEndVisable
00353
00354 void XeTextMakeEndVisable(Widget);
00355 void XeTextRemove(Widget);
00356 Widget XeCreateText(Widget, char *, Arg *, Cardinal);
00357 Widget XeCreateScrolledText(Widget, char *, Arg *, Cardinal);
00358
00359 _XFUNCPROTOEND
00360
00361
00362
00365 void XeTextSetWidthFromString (
00366 Widget widget,
00367 const MIUNICODE* str
00368 );
00369
00372 void XeTextSetWidthFromString (
00373 Widget widget,
00374 const char* str
00375 );
00376
00377
00393 void XeTextSetColor (
00394 Widget widget,
00395 int colorindex,
00396 const COLOR& color
00397 );
00398
00402 bool XeTextOffset2LinCol (
00403 Widget widget,
00404 int offset,
00405 int& line,
00406 int& col
00407 );
00408
00409 #endif // INC_MI32_TEXT_H