sync with trunk r46493
[reactos.git] / dll / win32 / riched20 / editstr.h
index edbeb13..9b8d645 100644 (file)
@@ -29,6 +29,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <limits.h>
 
 #define COBJMACROS
 #define NONAMELESSUNION
 
 #define COBJMACROS
 #define NONAMELESSUNION
 #include <commctrl.h>
 #include <ole2.h>
 #include <richole.h>
 #include <commctrl.h>
 #include <ole2.h>
 #include <richole.h>
+#include "imm.h"
+#include <textserv.h>
 
 #include "wine/debug.h"
 
 
 #include "wine/debug.h"
 
+#ifdef __i386__
+extern const struct ITextHostVtbl itextHostStdcallVtbl;
+#endif /* __i386__ */
+
 typedef struct tagME_String
 {
   WCHAR *szData;
 typedef struct tagME_String
 {
   WCHAR *szData;
@@ -90,7 +97,7 @@ typedef enum {
   diUndoPotentialEndTransaction, /* 20 - allows grouping typed chars for undo */
 } ME_DIType;
 
   diUndoPotentialEndTransaction, /* 20 - allows grouping typed chars for undo */
 } ME_DIType;
 
-#define SELECTIONBAR_WIDTH 9
+#define SELECTIONBAR_WIDTH 8
 
 /******************************** run flags *************************/
 #define MERF_STYLEFLAGS 0x0FFF
 
 /******************************** run flags *************************/
 #define MERF_STYLEFLAGS 0x0FFF
@@ -156,15 +163,8 @@ typedef struct tagME_Run
   int nAscent, nDescent; /* pixels above/below baseline */
   POINT pt; /* relative to para's position */
   REOBJECT *ole_obj; /* FIXME: should be a union with strText (at least) */
   int nAscent, nDescent; /* pixels above/below baseline */
   POINT pt; /* relative to para's position */
   REOBJECT *ole_obj; /* FIXME: should be a union with strText (at least) */
-  int nCR; int nLF;  /* for MERF_ENDPARA: number of \r and \n characters encoded by run */
 } ME_Run;
 
 } ME_Run;
 
-typedef struct tagME_Document {
-  struct tagME_DisplayItem *def_char_style;
-  struct tagME_DisplayItem *def_para_style;
-  int last_wrapped_line;
-} ME_Document;
-
 typedef struct tagME_Border
 {
   int width;
 typedef struct tagME_Border
 {
   int width;
@@ -189,10 +189,10 @@ typedef struct tagME_Paragraph
   int nCharOfs;
   int nFlags;
   POINT pt;
   int nCharOfs;
   int nFlags;
   POINT pt;
-  int nHeight;
+  int nHeight, nWidth;
   int nLastPaintYPos, nLastPaintHeight;
   int nRows;
   int nLastPaintYPos, nLastPaintHeight;
   int nRows;
-  struct tagME_DisplayItem *prev_para, *next_para, *document;
+  struct tagME_DisplayItem *prev_para, *next_para;
 } ME_Paragraph;
 
 typedef struct tagME_Cell /* v4.1 */
 } ME_Paragraph;
 
 typedef struct tagME_Cell /* v4.1 */
@@ -237,7 +237,6 @@ typedef struct tagME_DisplayItem
     ME_Row row;
     ME_Cell cell;
     ME_Paragraph para;
     ME_Row row;
     ME_Cell cell;
     ME_Paragraph para;
-    ME_Document doc; /* not used */
     ME_Style *ustyle; /* used by diUndoSetCharFormat */
   } member;
 } ME_DisplayItem;
     ME_Style *ustyle; /* used by diUndoSetCharFormat */
   } member;
 } ME_DisplayItem;
@@ -246,7 +245,7 @@ typedef struct tagME_UndoItem
 {
   ME_DisplayItem di;
   int nStart, nLen;
 {
   ME_DisplayItem di;
   int nStart, nLen;
-  int nCR, nLF;      /* used by diUndoSplitParagraph */
+  ME_String *eol_str; /* used by diUndoSplitParagraph */
 } ME_UndoItem;
 
 typedef struct tagME_TextBuffer
 } ME_UndoItem;
 
 typedef struct tagME_TextBuffer
@@ -258,6 +257,7 @@ typedef struct tagME_TextBuffer
 
 typedef struct tagME_Cursor
 {
 
 typedef struct tagME_Cursor
 {
+  ME_DisplayItem *pPara;
   ME_DisplayItem *pRun;
   int nOffset;
 } ME_Cursor;
   ME_DisplayItem *pRun;
   int nOffset;
 } ME_Cursor;
@@ -326,14 +326,18 @@ typedef struct tagME_FontCacheItem
 
 typedef struct tagME_TextEditor
 {
 
 typedef struct tagME_TextEditor
 {
-  HWND hWnd;
+  HWND hWnd, hwndParent;
+  ITextHost *texthost;
   BOOL bEmulateVersion10;
   ME_TextBuffer *pBuffer;
   ME_Cursor *pCursors;
   BOOL bEmulateVersion10;
   ME_TextBuffer *pBuffer;
   ME_Cursor *pCursors;
+  DWORD styleFlags;
+  DWORD exStyleFlags;
   int nCursors;
   SIZE sizeWindow;
   int nTotalLength, nLastTotalLength;
   int nCursors;
   SIZE sizeWindow;
   int nTotalLength, nLastTotalLength;
-  int nHeight;
+  int nTotalWidth, nLastTotalWidth;
+  int nAvailWidth; /* 0 = wrap to client area, else wrap width in twips */
   int nUDArrowX;
   int nSequence;
   COLORREF rgbBackColor;
   int nUDArrowX;
   int nSequence;
   COLORREF rgbBackColor;
@@ -350,10 +354,10 @@ typedef struct tagME_TextEditor
   ME_DisplayItem *pLastSelStartPara, *pLastSelEndPara;
   ME_FontCacheItem pFontCache[HFONT_CACHE_SIZE];
   int nZoomNumerator, nZoomDenominator;
   ME_DisplayItem *pLastSelStartPara, *pLastSelEndPara;
   ME_FontCacheItem pFontCache[HFONT_CACHE_SIZE];
   int nZoomNumerator, nZoomDenominator;
+  RECT prevClientRect;
   RECT rcFormat;
   RECT rcFormat;
-  BOOL bRedraw;
+  BOOL bDefaultFormatRect;
   BOOL bWordWrap;
   BOOL bWordWrap;
-  int nInvalidOfs;
   int nTextLimit;
   EDITWORDBREAKPROCW pfnWordBreak;
   LPRICHEDITOLECALLBACK lpOleCallback;
   int nTextLimit;
   EDITWORDBREAKPROCW pfnWordBreak;
   LPRICHEDITOLECALLBACK lpOleCallback;
@@ -366,6 +370,7 @@ typedef struct tagME_TextEditor
   BOOL AutoURLDetect_bEnable;
   WCHAR cPasswordMask;
   BOOL bHaveFocus;
   BOOL AutoURLDetect_bEnable;
   WCHAR cPasswordMask;
   BOOL bHaveFocus;
+  BOOL bDialogMode; /* Indicates that we are inside a dialog window */
   /*for IME */
   int imeStartIndex;
   DWORD selofs; /* The size of the selection bar on the left side of control */
   /*for IME */
   int imeStartIndex;
   DWORD selofs; /* The size of the selection bar on the left side of control */
@@ -374,8 +379,10 @@ typedef struct tagME_TextEditor
   /* Track previous notified selection */
   CHARRANGE notified_cr;
 
   /* Track previous notified selection */
   CHARRANGE notified_cr;
 
-  /* Cache previously set vertical scrollbar info */
-  SCROLLINFO vert_si;
+  /* Cache previously set scrollbar info */
+  SCROLLINFO vert_si, horz_si;
+
+  BOOL bMouseCaptured;
 } ME_TextEditor;
 
 typedef struct tagME_Context
 } ME_TextEditor;
 
 typedef struct tagME_Context
@@ -386,6 +393,7 @@ typedef struct tagME_Context
   RECT rcView;
   HBRUSH hbrMargin;
   SIZE dpi;
   RECT rcView;
   HBRUSH hbrMargin;
   SIZE dpi;
+  int nAvailWidth;
 
   /* those are valid inside ME_WrapTextParagraph and related */
   POINT ptFirstRun;
 
   /* those are valid inside ME_WrapTextParagraph and related */
   POINT ptFirstRun;
@@ -401,11 +409,12 @@ typedef struct tagME_WrapContext
   int nAvailWidth;
   int nRow;
   POINT pt;
   int nAvailWidth;
   int nRow;
   POINT pt;
-  BOOL bOverflown;
+  BOOL bOverflown, bWordWrap;
+  ME_DisplayItem *pPara;
   ME_DisplayItem *pRowStart;
   ME_DisplayItem *pRowStart;
-  
+
   ME_DisplayItem *pLastSplittableRun;
   POINT ptLastSplittableRun;
   ME_DisplayItem *pLastSplittableRun;
   POINT ptLastSplittableRun;
-} ME_WrapContext;  
+} ME_WrapContext;
 
 #endif
 
 #endif