mmledit.h
Go to the documentation of this file.00001
00019 #ifndef _MGUI_NCSCTRL_MLEDIT_H
00020 #define _MGUI_NCSCTRL_MLEDIT_H
00021
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025
00026
00027
00028
00029 typedef enum {
00030 CT_TEXT,
00031 CT_BMP,
00032 CT_ICON
00033 } ContentType;
00034
00035
00036 typedef enum {
00037 TF_PLAINTEXT,
00038 TF_RICHTEXT,
00039 TF_MEDIATEXT
00040 } TextFormat;
00041
00042
00043
00044 typedef struct _textnode
00045 {
00046 list_t list;
00047 StrBuffer content;
00048 DWORD addData;
00049 } TextNode;
00050
00051
00052 typedef struct _textmark
00053 {
00054 int pos_lnOff;
00055 TextNode *curNode;
00056 } TextMark;
00057
00058
00059 typedef struct _textdoc
00060 {
00061 list_t queue;
00062
00063
00064 unsigned char lnsep;
00065 int nDefLineSize;
00066 int nBlockSize;
00067
00068
00069 void (*init_fn) (struct _textdoc *, TextNode *, TextNode *);
00070
00071 void (*change_fn) (struct _textdoc *, BOOL bSel);
00072
00073 void (*change_cont) (struct _textdoc *, TextNode *node);
00074
00075 void (*del_fn) (struct _textdoc *, TextNode *);
00076 void *fn_data;
00077
00078
00079 TextMark insert;
00080 TextMark selection;
00081
00082 } TextDoc;
00083
00084
00085
00086
00087 typedef struct _status_data
00088 {
00089 DWORD flags;
00090
00091 int desCaretX;
00092
00093 int caretX;
00094 int caretY;
00095 int selX;
00096 int selY;
00097
00098 TextNode *maxNode;
00099 int maxLen;
00100 TextNode *secNode;
00101 int secLen;
00102
00103 int curItemY;
00104 int selItemY;
00105 } STATDATA;
00106 typedef STATDATA* PSTATDATA;
00107
00108
00109 typedef struct _bk_textnode
00110 {
00111 list_t list;
00112 StrBuffer content;
00113 } BkNode;
00114
00115 typedef struct _backup_data
00116 {
00117 STATDATA statData;
00118 TextMark bkIns;
00119 TextMark bkSel;
00120 int opType;
00121 list_t bkQueue;
00122 } BKDATA;
00123 typedef BKDATA* PBKDATA;
00124
00130
00131
00132
00133
00134 #define NCSCTRL_MLEDIT NCSCLASSNAME("mledit")
00135
00136 typedef struct _mMlEdit mMlEdit;
00137 typedef struct _mMlEditClass mMlEditClass;
00138 typedef struct _mMlEditRenderer mMlEditRenderer;
00139
00140
00141 #define mMlEditHeader(Class) \
00142 mEditHeader(Class) \
00143 TextDoc txtDoc; \
00144 StrBuffer teBuff; \
00145 int nrDiffLine; \
00146 int wNoChanged; \
00147 int wLastLine; \
00148 int hardLimit; \
00149 int curLen; \
00150 int nLineHeight; \
00151 int nLineAboveH; \
00152 int nLineBaseH; \
00153 unsigned char lnChar; \
00154 unsigned char caretShape; \
00155 char *title; \
00156 int titleIndent; \
00157 DWORD flags; \
00158 DWORD exFlags; \
00159 BOOL contDirty; \
00160 int desCaretX; \
00161 int caretX; \
00162 int caretY; \
00163 int selX; \
00164 int selY; \
00165 TextNode *maxNode; \
00166 int maxLen; \
00167 TextNode *secNode; \
00168 int secLen; \
00169 int curItemY; \
00170 int selItemY; \
00171 TextCopyPaste *cp;
00172
00238 struct _mMlEdit
00239 {
00240 mMlEditHeader(mMlEdit)
00241 };
00242
00243 #define mMlEditClassHeader(clsName, parentClass) \
00244 mEditClassHeader (clsName, parentClass) \
00245 int (*setTitle)(clsName *self, const char *title, int len); \
00246 int (*getTitle)(clsName *self, char *buffer, int len);
00247
00266 struct _mMlEditClass
00267 {
00268 mMlEditClassHeader(mMlEdit, mEdit)
00269 };
00270
00277 MGNCS_EXPORT extern mMlEditClass g_stmMlEditCls;
00278
00279
00280 #define mMlEditRendererHeader(clsName, parentClass) \
00281 mEditRendererHeader(clsName, parentClass) \
00282
00283
00289 struct _mMlEditRenderer
00290 {
00291 mMlEditRendererHeader(mMlEdit, mEdit)
00292 };
00293
00298 #define NCSS_MLEDIT_AUTOWRAP (0x0001<<NCSS_EDIT_SHIFT)
00299
00304 #define NCSS_MLEDIT_TITLE (0x0002<<NCSS_EDIT_SHIFT)
00305
00306 #define NCSS_MLEDIT_SHIFT (NCSS_EDIT_SHIFT+2)
00307
00309 enum mMlEditProp
00310 {
00311 NCSP_MLEDIT_LINECOUNT = NCSP_EDIT_MAX + 1,
00312 NCSP_MLEDIT_LINEHEIGHT,
00313 NCSP_MLEDIT_LINEFEEDISPCHAR,
00314 NCSP_MLEDIT_LINESEP,
00315 NCSP_MLEDIT_CARETSHAPE,
00316 NCSP_MLEDIT_NUMOFPARAGRAPHS,
00317 NCSP_MLEDIT_MAX
00318 };
00319
00320 enum mMlEditNotify
00321 {
00322 NCSN_MLEDIT_MAX = NCSN_EDIT_MAX + 1,
00323 };
00324
00326 enum ncsCaretShape
00327 {
00328 NCS_CARETSHAPE_LINE = 0,
00329 NCS_CARETSHAPE_BLOCK
00330 };
00331
00332
00333
00334 #define NCSF_MLEDIT_SELECT 0x0001
00335 #define NCSF_MLEDIT_FOCUSED 0x0002
00336 #define NCSF_MLEDIT_TMP 0x0004
00337 #define NCSF_MLEDIT_REPLACE 0x0008
00338 #define NCSF_MLEDIT_MOVE 0x0010
00339 #define NCSF_MLEDIT_NOCARET 0x0020
00340 #define NCSF_MLEDIT_EX_SETFOCUS 0x0040
00341 #define NCSF_MLEDIT_EX_KILLFOCUS 0x0080
00342
00345 #ifdef __cplusplus
00346 }
00347 #endif
00348
00349 #endif