ReactOS  0.4.14-dev-606-g14ebc0b
editor.h File Reference
#include "editstr.h"
Include dependency graph for editor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RUN_IS_HIDDEN(run)
 
#define InitFormatEtc(fe, cf, med)
 
#define CP_UNICODE   1200
 
#define TXTHOST_VTABLE(This)   (This)->lpVtbl
 
#define ITextHost_TxGetDC(This)   TXTHOST_VTABLE(This)->TxGetDC(This)
 
#define ITextHost_TxReleaseDC(This, a)   TXTHOST_VTABLE(This)->TxReleaseDC(This,a)
 
#define ITextHost_TxShowScrollBar(This, a, b)   TXTHOST_VTABLE(This)->TxShowScrollBar(This,a,b)
 
#define ITextHost_TxEnableScrollBar(This, a, b)   TXTHOST_VTABLE(This)->TxEnableScrollBar(This,a,b)
 
#define ITextHost_TxSetScrollRange(This, a, b, c, d)   TXTHOST_VTABLE(This)->TxSetScrollRange(This,a,b,c,d)
 
#define ITextHost_TxSetScrollPos(This, a, b, c)   TXTHOST_VTABLE(This)->TxSetScrollPos(This,a,b,c)
 
#define ITextHost_TxInvalidateRect(This, a, b)   TXTHOST_VTABLE(This)->TxInvalidateRect(This,a,b)
 
#define ITextHost_TxViewChange(This, a)   TXTHOST_VTABLE(This)->TxViewChange(This,a)
 
#define ITextHost_TxCreateCaret(This, a, b, c)   TXTHOST_VTABLE(This)->TxCreateCaret(This,a,b,c)
 
#define ITextHost_TxShowCaret(This, a)   TXTHOST_VTABLE(This)->TxShowCaret(This,a)
 
#define ITextHost_TxSetCaretPos(This, a, b)   TXTHOST_VTABLE(This)->TxSetCaretPos(This,a,b)
 
#define ITextHost_TxSetTimer(This, a, b)   TXTHOST_VTABLE(This)->TxSetTimer(This,a,b)
 
#define ITextHost_TxKillTimer(This, a)   TXTHOST_VTABLE(This)->TxKillTimer(This,a)
 
#define ITextHost_TxScrollWindowEx(This, a, b, c, d, e, f, g)   TXTHOST_VTABLE(This)->TxScrollWindowEx(This,a,b,c,d,e,f,g)
 
#define ITextHost_TxSetCapture(This, a)   TXTHOST_VTABLE(This)->TxSetCapture(This,a)
 
#define ITextHost_TxSetFocus(This)   TXTHOST_VTABLE(This)->TxSetFocus(This)
 
#define ITextHost_TxSetCursor(This, a, b)   TXTHOST_VTABLE(This)->TxSetCursor(This,a,b)
 
#define ITextHost_TxScreenToClient(This, a)   TXTHOST_VTABLE(This)->TxScreenToClient(This,a)
 
#define ITextHost_TxClientToScreen(This, a)   TXTHOST_VTABLE(This)->TxClientToScreen(This,a)
 
#define ITextHost_TxActivate(This, a)   TXTHOST_VTABLE(This)->TxActivate(This,a)
 
#define ITextHost_TxDeactivate(This, a)   TXTHOST_VTABLE(This)->TxDeactivate(This,a)
 
#define ITextHost_TxGetClientRect(This, a)   TXTHOST_VTABLE(This)->TxGetClientRect(This,a)
 
#define ITextHost_TxGetViewInset(This, a)   TXTHOST_VTABLE(This)->TxGetViewInset(This,a)
 
#define ITextHost_TxGetCharFormat(This, a)   TXTHOST_VTABLE(This)->TxGetCharFormat(This,a)
 
#define ITextHost_TxGetParaFormat(This, a)   TXTHOST_VTABLE(This)->TxGetParaFormat(This,a)
 
#define ITextHost_TxGetSysColor(This, a)   TXTHOST_VTABLE(This)->TxGetSysColor(This,a)
 
#define ITextHost_TxGetBackStyle(This, a)   TXTHOST_VTABLE(This)->TxGetBackStyle(This,a)
 
#define ITextHost_TxGetMaxLength(This, a)   TXTHOST_VTABLE(This)->TxGetMaxLength(This,a)
 
#define ITextHost_TxGetScrollBars(This, a)   TXTHOST_VTABLE(This)->TxGetScrollBars(This,a)
 
#define ITextHost_TxGetPasswordChar(This, a)   TXTHOST_VTABLE(This)->TxGetPasswordChar(This,a)
 
#define ITextHost_TxGetAcceleratorPos(This, a)   TXTHOST_VTABLE(This)->TxGetAcceleratorPos(This,a)
 
#define ITextHost_TxGetExtent(This, a)   TXTHOST_VTABLE(This)->TxGetExtent(This,a)
 
#define ITextHost_OnTxCharFormatChange(This, a)   TXTHOST_VTABLE(This)->OnTxCharFormatChange(This,a)
 
#define ITextHost_OnTxParaFormatChange(This, a)   TXTHOST_VTABLE(This)->OnTxParaFormatChange(This,a)
 
#define ITextHost_TxGetPropertyBits(This, a, b)   TXTHOST_VTABLE(This)->TxGetPropertyBits(This,a,b)
 
#define ITextHost_TxNotify(This, a, b)   TXTHOST_VTABLE(This)->TxNotify(This,a,b)
 
#define ITextHost_TxImmGetContext(This)   TXTHOST_VTABLE(This)->TxImmGetContext(This)
 
#define ITextHost_TxImmReleaseContext(This, a)   TXTHOST_VTABLE(This)->TxImmReleaseContext(This,a)
 
#define ITextHost_TxGetSelectionBarWidth(This, a)   TXTHOST_VTABLE(This)->TxGetSelectionBarWidth(This,a)
 

Functions

static WCHARget_text (const ME_Run *run, int offset)
 
static const chardebugstr_run (const ME_Run *run)
 
ME_StyleME_MakeStyle (CHARFORMAT2W *style) DECLSPEC_HIDDEN
 
void ME_AddRefStyle (ME_Style *item) DECLSPEC_HIDDEN
 
void ME_DestroyStyle (ME_Style *item) DECLSPEC_HIDDEN
 
void ME_ReleaseStyle (ME_Style *item) DECLSPEC_HIDDEN
 
ME_StyleME_GetInsertStyle (ME_TextEditor *editor, int nCursor) DECLSPEC_HIDDEN
 
ME_StyleME_ApplyStyle (ME_TextEditor *ed, ME_Style *sSrc, CHARFORMAT2W *style) DECLSPEC_HIDDEN
 
void select_style (ME_Context *c, ME_Style *s) DECLSPEC_HIDDEN
 
void ME_InitCharFormat2W (CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN
 
void ME_SaveTempStyle (ME_TextEditor *editor, ME_Style *style) DECLSPEC_HIDDEN
 
void ME_ClearTempStyle (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void ME_DumpStyleToBuf (CHARFORMAT2W *pFmt, char buf[2048]) DECLSPEC_HIDDEN
 
void ME_DumpStyle (ME_Style *s) DECLSPEC_HIDDEN
 
BOOL cfany_to_cf2w (CHARFORMAT2W *to, const CHARFORMAT2W *from) DECLSPEC_HIDDEN
 
BOOL cf2w_to_cfany (CHARFORMAT2W *to, const CHARFORMAT2W *from) DECLSPEC_HIDDEN
 
void ME_CopyCharFormat (CHARFORMAT2W *pDest, const CHARFORMAT2W *pSrc) DECLSPEC_HIDDEN
 
void ME_CharFormatFromLogFont (HDC hDC, const LOGFONTW *lf, CHARFORMAT2W *fmt) DECLSPEC_HIDDEN
 
void ME_InsertBefore (ME_DisplayItem *diWhere, ME_DisplayItem *diWhat) DECLSPEC_HIDDEN
 
void ME_Remove (ME_DisplayItem *diWhere) DECLSPEC_HIDDEN
 
BOOL ME_NextRun (ME_DisplayItem **para, ME_DisplayItem **run, BOOL all_para) DECLSPEC_HIDDEN
 
BOOL ME_PrevRun (ME_DisplayItem **para, ME_DisplayItem **run, BOOL all_para) DECLSPEC_HIDDEN
 
ME_DisplayItemME_FindItemBack (ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
 
ME_DisplayItemME_FindItemFwd (ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
 
ME_DisplayItemME_FindItemBackOrHere (ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
 
ME_DisplayItemME_MakeDI (ME_DIType type) DECLSPEC_HIDDEN
 
void ME_DestroyDisplayItem (ME_DisplayItem *item) DECLSPEC_HIDDEN
 
void ME_DumpDocument (ME_TextBuffer *buffer) DECLSPEC_HIDDEN
 
void destroy_para (ME_TextEditor *editor, ME_DisplayItem *item) DECLSPEC_HIDDEN
 
ME_StringME_MakeStringN (LPCWSTR szText, int nMaxChars) DECLSPEC_HIDDEN
 
ME_StringME_MakeStringR (WCHAR cRepeat, int nMaxChars) DECLSPEC_HIDDEN
 
ME_StringME_MakeStringConst (const WCHAR *str, int len) DECLSPEC_HIDDEN
 
ME_StringME_MakeStringEmpty (int len) DECLSPEC_HIDDEN
 
void ME_DestroyString (ME_String *s) DECLSPEC_HIDDEN
 
BOOL ME_AppendString (ME_String *s, const WCHAR *append, int len) DECLSPEC_HIDDEN
 
ME_StringME_VSplitString (ME_String *orig, int nVPos) DECLSPEC_HIDDEN
 
int ME_FindNonWhitespaceV (const ME_String *s, int nVChar) DECLSPEC_HIDDEN
 
int ME_CallWordBreakProc (ME_TextEditor *editor, WCHAR *str, INT len, INT start, INT code) DECLSPEC_HIDDEN
 
void ME_StrDeleteV (ME_String *s, int nVChar, int nChars) DECLSPEC_HIDDEN
 
BOOL ME_InsertString (ME_String *s, int ofs, const WCHAR *insert, int len) DECLSPEC_HIDDEN
 
LPWSTR ME_ToUnicode (LONG codepage, LPVOID psz, INT *len) DECLSPEC_HIDDEN
 
void ME_EndToUnicode (LONG codepage, LPVOID psz) DECLSPEC_HIDDEN
 
static int ME_IsWSpace (WCHAR ch)
 
static int ME_CharCompare (WCHAR a, WCHAR b, int caseSensitive)
 
int ME_ReverseFindNonWhitespaceV (const ME_String *s, int nVChar) DECLSPEC_HIDDEN
 
int ME_ReverseFindWhitespaceV (const ME_String *s, int nVChar) DECLSPEC_HIDDEN
 
ME_DisplayItemME_RowStart (ME_DisplayItem *item) DECLSPEC_HIDDEN
 
ME_DisplayItemME_FindRowWithNumber (ME_TextEditor *editor, int nRow) DECLSPEC_HIDDEN
 
int ME_RowNumberFromCharOfs (ME_TextEditor *editor, int nOfs) DECLSPEC_HIDDEN
 
ME_DisplayItemME_MakeRun (ME_Style *s, int nFlags) DECLSPEC_HIDDEN
 
ME_DisplayItemME_InsertRunAtCursor (ME_TextEditor *editor, ME_Cursor *cursor, ME_Style *style, const WCHAR *str, int len, int flags) DECLSPEC_HIDDEN
 
void ME_CheckCharOffsets (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void ME_PropagateCharOffset (ME_DisplayItem *p, int shift) DECLSPEC_HIDDEN
 
int ME_CharFromPointContext (ME_Context *c, int cx, ME_Run *run, BOOL closest, BOOL visual_order) DECLSPEC_HIDDEN
 
int ME_CharFromPoint (ME_TextEditor *editor, int cx, ME_Run *run, BOOL closest, BOOL visual_order) DECLSPEC_HIDDEN
 
int ME_PointFromCharContext (ME_Context *c, ME_Run *pRun, int nOffset, BOOL visual_order) DECLSPEC_HIDDEN
 
int ME_PointFromChar (ME_TextEditor *editor, ME_Run *pRun, int nOffset, BOOL visual_order) DECLSPEC_HIDDEN
 
BOOL ME_CanJoinRuns (const ME_Run *run1, const ME_Run *run2) DECLSPEC_HIDDEN
 
void ME_JoinRuns (ME_TextEditor *editor, ME_DisplayItem *p) DECLSPEC_HIDDEN
 
ME_DisplayItemME_SplitRunSimple (ME_TextEditor *editor, ME_Cursor *cursor) DECLSPEC_HIDDEN
 
void ME_UpdateRunFlags (ME_TextEditor *editor, ME_Run *run) DECLSPEC_HIDDEN
 
SIZE ME_GetRunSizeCommon (ME_Context *c, const ME_Paragraph *para, ME_Run *run, int nLen, int startx, int *pAscent, int *pDescent) DECLSPEC_HIDDEN
 
void ME_CursorFromCharOfs (ME_TextEditor *editor, int nCharOfs, ME_Cursor *pCursor) DECLSPEC_HIDDEN
 
void ME_RunOfsFromCharOfs (ME_TextEditor *editor, int nCharOfs, ME_DisplayItem **ppPara, ME_DisplayItem **ppRun, int *pOfs) DECLSPEC_HIDDEN
 
int ME_CharOfsFromRunOfs (ME_TextEditor *editor, const ME_DisplayItem *pPara, const ME_DisplayItem *pRun, int nOfs) DECLSPEC_HIDDEN
 
void ME_SkipAndPropagateCharOffset (ME_DisplayItem *p, int shift) DECLSPEC_HIDDEN
 
void ME_SetCharFormat (ME_TextEditor *editor, ME_Cursor *start, ME_Cursor *end, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN
 
void ME_SetSelectionCharFormat (ME_TextEditor *editor, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN
 
void ME_GetCharFormat (ME_TextEditor *editor, const ME_Cursor *from, const ME_Cursor *to, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN
 
void ME_GetSelectionCharFormat (ME_TextEditor *editor, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN
 
void ME_GetDefaultCharFormat (ME_TextEditor *editor, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN
 
void ME_SetDefaultCharFormat (ME_TextEditor *editor, CHARFORMAT2W *mod) DECLSPEC_HIDDEN
 
void ME_SetCursorToStart (ME_TextEditor *editor, ME_Cursor *cursor) DECLSPEC_HIDDEN
 
int set_selection_cursors (ME_TextEditor *editor, int from, int to) DECLSPEC_HIDDEN
 
BOOL ME_MoveCursorWords (ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs) DECLSPEC_HIDDEN
 
void hide_caret (ME_TextEditor *ed) DECLSPEC_HIDDEN
 
void show_caret (ME_TextEditor *ed) DECLSPEC_HIDDEN
 
void update_caret (ME_TextEditor *ed) DECLSPEC_HIDDEN
 
void create_caret (ME_TextEditor *ed) DECLSPEC_HIDDEN
 
BOOL ME_CharFromPos (ME_TextEditor *editor, int x, int y, ME_Cursor *cursor, BOOL *isExact) DECLSPEC_HIDDEN
 
void ME_LButtonDown (ME_TextEditor *editor, int x, int y, int clickNum) DECLSPEC_HIDDEN
 
void ME_MouseMove (ME_TextEditor *editor, int x, int y) DECLSPEC_HIDDEN
 
BOOL ME_DeleteTextAtCursor (ME_TextEditor *editor, int nCursor, int nChars) DECLSPEC_HIDDEN
 
void ME_InsertTextFromCursor (ME_TextEditor *editor, int nCursor, const WCHAR *str, int len, ME_Style *style) DECLSPEC_HIDDEN
 
void ME_InsertEndRowFromCursor (ME_TextEditor *editor, int nCursor) DECLSPEC_HIDDEN
 
int ME_MoveCursorChars (ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs, BOOL final_eop) DECLSPEC_HIDDEN
 
BOOL ME_ArrowKey (ME_TextEditor *ed, int nVKey, BOOL extend, BOOL ctrl) DECLSPEC_HIDDEN
 
int ME_GetCursorOfs (const ME_Cursor *cursor) DECLSPEC_HIDDEN
 
int ME_GetSelectionOfs (ME_TextEditor *editor, int *from, int *to) DECLSPEC_HIDDEN
 
int ME_GetSelection (ME_TextEditor *editor, ME_Cursor **from, ME_Cursor **to) DECLSPEC_HIDDEN
 
BOOL ME_IsSelection (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void ME_DeleteSelection (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void ME_SendSelChange (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void ME_InsertOLEFromCursor (ME_TextEditor *editor, const REOBJECT *reo, int nCursor) DECLSPEC_HIDDEN
 
BOOL ME_InternalDeleteText (ME_TextEditor *editor, ME_Cursor *start, int nChars, BOOL bForce) DECLSPEC_HIDDEN
 
int ME_GetTextLength (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
int ME_GetTextLengthEx (ME_TextEditor *editor, const GETTEXTLENGTHEX *how) DECLSPEC_HIDDEN
 
ME_StyleME_GetSelectionInsertStyle (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void ME_GetCursorCoordinates (ME_TextEditor *editor, ME_Cursor *pCursor, int *x, int *y, int *height) DECLSPEC_HIDDEN
 
void ME_InitContext (ME_Context *c, ME_TextEditor *editor, HDC hDC) DECLSPEC_HIDDEN
 
void ME_DestroyContext (ME_Context *c) DECLSPEC_HIDDEN
 
BOOL ME_WrapMarkedParagraphs (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void ME_InvalidateParagraphRange (ME_TextEditor *editor, ME_DisplayItem *start_para, ME_DisplayItem *last_para) DECLSPEC_HIDDEN
 
void ME_SendRequestResize (ME_TextEditor *editor, BOOL force) DECLSPEC_HIDDEN
 
ME_DisplayItemME_GetParagraph (ME_DisplayItem *run) DECLSPEC_HIDDEN
 
void ME_GetSelectionParas (ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayItem **para_end) DECLSPEC_HIDDEN
 
void ME_MakeFirstParagraph (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
ME_DisplayItemME_SplitParagraph (ME_TextEditor *editor, ME_DisplayItem *rp, ME_Style *style, const WCHAR *eol_str, int eol_len, int paraFlags) DECLSPEC_HIDDEN
 
ME_DisplayItemME_JoinParagraphs (ME_TextEditor *editor, ME_DisplayItem *tp, BOOL keepFirstParaFormat) DECLSPEC_HIDDEN
 
void ME_DumpParaStyle (ME_Paragraph *s) DECLSPEC_HIDDEN
 
void ME_DumpParaStyleToBuf (const PARAFORMAT2 *pFmt, char buf[2048]) DECLSPEC_HIDDEN
 
BOOL ME_SetSelectionParaFormat (ME_TextEditor *editor, const PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN
 
void ME_GetSelectionParaFormat (ME_TextEditor *editor, PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN
 
void ME_MarkAllForWrapping (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void ME_SetDefaultParaFormat (ME_TextEditor *editor, PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN
 
void para_num_init (ME_Context *c, ME_Paragraph *para) DECLSPEC_HIDDEN
 
void para_num_clear (struct para_num *pn) DECLSPEC_HIDDEN
 
int get_total_width (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void mark_para_rewrap (ME_TextEditor *editor, ME_DisplayItem *para) DECLSPEC_HIDDEN
 
ME_DisplayItemget_di_from_para (ME_Paragraph *para) DECLSPEC_HIDDEN
 
void add_marked_para (ME_TextEditor *editor, ME_DisplayItem *para) DECLSPEC_HIDDEN
 
void remove_marked_para (ME_TextEditor *editor, ME_DisplayItem *para) DECLSPEC_HIDDEN
 
void ME_PaintContent (ME_TextEditor *editor, HDC hDC, const RECT *rcUpdate) DECLSPEC_HIDDEN
 
void ME_Repaint (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void ME_RewrapRepaint (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void ME_UpdateRepaint (ME_TextEditor *editor, BOOL update_now) DECLSPEC_HIDDEN
 
void ME_EnsureVisible (ME_TextEditor *editor, ME_Cursor *pCursor) DECLSPEC_HIDDEN
 
void ME_InvalidateSelection (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
BOOL ME_SetZoom (ME_TextEditor *editor, int numerator, int denominator) DECLSPEC_HIDDEN
 
int ME_twips2pointsX (const ME_Context *c, int x) DECLSPEC_HIDDEN
 
int ME_twips2pointsY (const ME_Context *c, int y) DECLSPEC_HIDDEN
 
void ME_ScrollAbs (ME_TextEditor *editor, int x, int y) DECLSPEC_HIDDEN
 
void ME_HScrollAbs (ME_TextEditor *editor, int x) DECLSPEC_HIDDEN
 
void ME_VScrollAbs (ME_TextEditor *editor, int y) DECLSPEC_HIDDEN
 
void ME_ScrollUp (ME_TextEditor *editor, int cy) DECLSPEC_HIDDEN
 
void ME_ScrollDown (ME_TextEditor *editor, int cy) DECLSPEC_HIDDEN
 
void ME_ScrollLeft (ME_TextEditor *editor, int cx) DECLSPEC_HIDDEN
 
void ME_ScrollRight (ME_TextEditor *editor, int cx) DECLSPEC_HIDDEN
 
void ME_UpdateScrollBar (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
int ME_GetParaBorderWidth (const ME_Context *c, int flags) DECLSPEC_HIDDEN
 
LRESULT CreateIRichEditOle (IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *ppvObj) DECLSPEC_HIDDEN
 
void ME_DrawOLE (ME_Context *c, int x, int y, ME_Run *run, BOOL selected) DECLSPEC_HIDDEN
 
void ME_GetOLEObjectSize (const ME_Context *c, ME_Run *run, SIZE *pSize) DECLSPEC_HIDDEN
 
void ME_CopyReObject (REOBJECT *dst, const REOBJECT *src, DWORD flags) DECLSPEC_HIDDEN
 
void ME_DeleteReObject (struct re_object *re_object) DECLSPEC_HIDDEN
 
ME_TextEditorME_MakeEditor (ITextHost *texthost, BOOL bEmulateVersion10) DECLSPEC_HIDDEN
 
void ME_DestroyEditor (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
LRESULT ME_HandleMessage (ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode, HRESULT *phresult) DECLSPEC_HIDDEN
 
void ME_SendOldNotify (ME_TextEditor *editor, int nCode) DECLSPEC_HIDDEN
 
int ME_GetTextW (ME_TextEditor *editor, WCHAR *buffer, int buflen, const ME_Cursor *start, int srcChars, BOOL bCRLF, BOOL bEOP) DECLSPEC_HIDDEN
 
void ME_RTFCharAttrHook (struct _RTF_Info *info) DECLSPEC_HIDDEN
 
void ME_RTFParAttrHook (struct _RTF_Info *info) DECLSPEC_HIDDEN
 
void ME_RTFTblAttrHook (struct _RTF_Info *info) DECLSPEC_HIDDEN
 
void ME_RTFSpecialCharHook (struct _RTF_Info *info) DECLSPEC_HIDDEN
 
void ME_StreamInFill (ME_InStream *stream) DECLSPEC_HIDDEN
 
void ME_ReplaceSel (ME_TextEditor *editor, BOOL can_undo, const WCHAR *str, int len) DECLSPEC_HIDDEN
 
int set_selection (ME_TextEditor *editor, int to, int from) DECLSPEC_HIDDEN
 
BOOL ME_IsInTable (ME_DisplayItem *pItem) DECLSPEC_HIDDEN
 
ME_DisplayItemME_InsertTableRowStartFromCursor (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
ME_DisplayItemME_InsertTableRowStartAtParagraph (ME_TextEditor *editor, ME_DisplayItem *para) DECLSPEC_HIDDEN
 
ME_DisplayItemME_InsertTableCellFromCursor (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
ME_DisplayItemME_InsertTableRowEndFromCursor (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
ME_DisplayItemME_GetTableRowEnd (ME_DisplayItem *para) DECLSPEC_HIDDEN
 
ME_DisplayItemME_GetTableRowStart (ME_DisplayItem *para) DECLSPEC_HIDDEN
 
ME_DisplayItemME_GetOuterParagraph (ME_DisplayItem *para) DECLSPEC_HIDDEN
 
void ME_CheckTablesForCorruption (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void ME_ProtectPartialTableDeletion (ME_TextEditor *editor, ME_Cursor *c, int *nChars) DECLSPEC_HIDDEN
 
ME_DisplayItemME_AppendTableRow (ME_TextEditor *editor, ME_DisplayItem *table_row) DECLSPEC_HIDDEN
 
void ME_TabPressedInTable (ME_TextEditor *editor, BOOL bSelectedRow) DECLSPEC_HIDDEN
 
void ME_MoveCursorFromTableRowStartParagraph (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
struct RTFTableME_MakeTableDef (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void ME_InitTableDef (ME_TextEditor *editor, struct RTFTable *tableDef) DECLSPEC_HIDDEN
 
ITextHost * ME_CreateTextHost (HWND hwnd, CREATESTRUCTW *cs, BOOL bEmulateVersion10) DECLSPEC_HIDDEN
 
BOOL add_undo_insert_run (ME_TextEditor *, int pos, const WCHAR *str, int len, int flags, ME_Style *style) DECLSPEC_HIDDEN
 
BOOL add_undo_delete_run (ME_TextEditor *, int pos, int len) DECLSPEC_HIDDEN
 
BOOL add_undo_set_para_fmt (ME_TextEditor *, const ME_Paragraph *para) DECLSPEC_HIDDEN
 
BOOL add_undo_set_char_fmt (ME_TextEditor *, int pos, int len, const CHARFORMAT2W *fmt) DECLSPEC_HIDDEN
 
BOOL add_undo_join_paras (ME_TextEditor *, int pos) DECLSPEC_HIDDEN
 
BOOL add_undo_split_para (ME_TextEditor *, const ME_Paragraph *para, ME_String *eol_str, const ME_Cell *cell) DECLSPEC_HIDDEN
 
void ME_CommitUndo (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void ME_ContinueCoalescingTransaction (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void ME_CommitCoalescingUndo (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
BOOL ME_Undo (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
BOOL ME_Redo (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
void ME_EmptyUndoStack (ME_TextEditor *editor) DECLSPEC_HIDDEN
 
LRESULT ME_StreamOutRange (ME_TextEditor *editor, DWORD dwFormat, const ME_Cursor *start, int nChars, EDITSTREAM *stream) DECLSPEC_HIDDEN
 
LRESULT ME_StreamOut (ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream) DECLSPEC_HIDDEN
 
HRESULT ME_GetDataObject (ME_TextEditor *editor, const ME_Cursor *start, int nChars, LPDATAOBJECT *lplpdataobj) DECLSPEC_HIDDEN
 
void release_typelib (void) DECLSPEC_HIDDEN
 

Variables

HANDLE me_heap DECLSPEC_HIDDEN
 

Macro Definition Documentation

◆ CP_UNICODE

#define CP_UNICODE   1200

Definition at line 95 of file editor.h.

◆ InitFormatEtc

#define InitFormatEtc (   fe,
  cf,
  med 
)
Value:
{\
(fe).cfFormat=cf;\
(fe).dwAspect=DVASPECT_CONTENT;\
(fe).ptd=NULL;\
(fe).tymed=med;\
(fe).lindex=-1;\
};
smooth NULL
Definition: ftsmooth.c:416
static DWORD tymed
Definition: url.c:174

Definition at line 32 of file editor.h.

◆ ITextHost_OnTxCharFormatChange

#define ITextHost_OnTxCharFormatChange (   This,
  a 
)    TXTHOST_VTABLE(This)->OnTxCharFormatChange(This,a)

Definition at line 319 of file editor.h.

◆ ITextHost_OnTxParaFormatChange

#define ITextHost_OnTxParaFormatChange (   This,
  a 
)    TXTHOST_VTABLE(This)->OnTxParaFormatChange(This,a)

Definition at line 320 of file editor.h.

◆ ITextHost_TxActivate

#define ITextHost_TxActivate (   This,
  a 
)    TXTHOST_VTABLE(This)->TxActivate(This,a)

Definition at line 306 of file editor.h.

◆ ITextHost_TxClientToScreen

#define ITextHost_TxClientToScreen (   This,
  a 
)    TXTHOST_VTABLE(This)->TxClientToScreen(This,a)

Definition at line 305 of file editor.h.

◆ ITextHost_TxCreateCaret

#define ITextHost_TxCreateCaret (   This,
  a,
  b,
  c 
)    TXTHOST_VTABLE(This)->TxCreateCaret(This,a,b,c)

Definition at line 295 of file editor.h.

◆ ITextHost_TxDeactivate

#define ITextHost_TxDeactivate (   This,
  a 
)    TXTHOST_VTABLE(This)->TxDeactivate(This,a)

Definition at line 307 of file editor.h.

◆ ITextHost_TxEnableScrollBar

#define ITextHost_TxEnableScrollBar (   This,
  a,
  b 
)    TXTHOST_VTABLE(This)->TxEnableScrollBar(This,a,b)

Definition at line 290 of file editor.h.

◆ ITextHost_TxGetAcceleratorPos

#define ITextHost_TxGetAcceleratorPos (   This,
  a 
)    TXTHOST_VTABLE(This)->TxGetAcceleratorPos(This,a)

Definition at line 317 of file editor.h.

◆ ITextHost_TxGetBackStyle

#define ITextHost_TxGetBackStyle (   This,
  a 
)    TXTHOST_VTABLE(This)->TxGetBackStyle(This,a)

Definition at line 313 of file editor.h.

◆ ITextHost_TxGetCharFormat

#define ITextHost_TxGetCharFormat (   This,
  a 
)    TXTHOST_VTABLE(This)->TxGetCharFormat(This,a)

Definition at line 310 of file editor.h.

◆ ITextHost_TxGetClientRect

#define ITextHost_TxGetClientRect (   This,
  a 
)    TXTHOST_VTABLE(This)->TxGetClientRect(This,a)

Definition at line 308 of file editor.h.

◆ ITextHost_TxGetDC

#define ITextHost_TxGetDC (   This)    TXTHOST_VTABLE(This)->TxGetDC(This)

Definition at line 287 of file editor.h.

◆ ITextHost_TxGetExtent

#define ITextHost_TxGetExtent (   This,
  a 
)    TXTHOST_VTABLE(This)->TxGetExtent(This,a)

Definition at line 318 of file editor.h.

◆ ITextHost_TxGetMaxLength

#define ITextHost_TxGetMaxLength (   This,
  a 
)    TXTHOST_VTABLE(This)->TxGetMaxLength(This,a)

Definition at line 314 of file editor.h.

◆ ITextHost_TxGetParaFormat

#define ITextHost_TxGetParaFormat (   This,
  a 
)    TXTHOST_VTABLE(This)->TxGetParaFormat(This,a)

Definition at line 311 of file editor.h.

◆ ITextHost_TxGetPasswordChar

#define ITextHost_TxGetPasswordChar (   This,
  a 
)    TXTHOST_VTABLE(This)->TxGetPasswordChar(This,a)

Definition at line 316 of file editor.h.

◆ ITextHost_TxGetPropertyBits

#define ITextHost_TxGetPropertyBits (   This,
  a,
  b 
)    TXTHOST_VTABLE(This)->TxGetPropertyBits(This,a,b)

Definition at line 321 of file editor.h.

◆ ITextHost_TxGetScrollBars

#define ITextHost_TxGetScrollBars (   This,
  a 
)    TXTHOST_VTABLE(This)->TxGetScrollBars(This,a)

Definition at line 315 of file editor.h.

◆ ITextHost_TxGetSelectionBarWidth

#define ITextHost_TxGetSelectionBarWidth (   This,
  a 
)    TXTHOST_VTABLE(This)->TxGetSelectionBarWidth(This,a)

Definition at line 325 of file editor.h.

◆ ITextHost_TxGetSysColor

#define ITextHost_TxGetSysColor (   This,
  a 
)    TXTHOST_VTABLE(This)->TxGetSysColor(This,a)

Definition at line 312 of file editor.h.

◆ ITextHost_TxGetViewInset

#define ITextHost_TxGetViewInset (   This,
  a 
)    TXTHOST_VTABLE(This)->TxGetViewInset(This,a)

Definition at line 309 of file editor.h.

◆ ITextHost_TxImmGetContext

#define ITextHost_TxImmGetContext (   This)    TXTHOST_VTABLE(This)->TxImmGetContext(This)

Definition at line 323 of file editor.h.

◆ ITextHost_TxImmReleaseContext

#define ITextHost_TxImmReleaseContext (   This,
  a 
)    TXTHOST_VTABLE(This)->TxImmReleaseContext(This,a)

Definition at line 324 of file editor.h.

◆ ITextHost_TxInvalidateRect

#define ITextHost_TxInvalidateRect (   This,
  a,
  b 
)    TXTHOST_VTABLE(This)->TxInvalidateRect(This,a,b)

Definition at line 293 of file editor.h.

◆ ITextHost_TxKillTimer

#define ITextHost_TxKillTimer (   This,
  a 
)    TXTHOST_VTABLE(This)->TxKillTimer(This,a)

Definition at line 299 of file editor.h.

◆ ITextHost_TxNotify

#define ITextHost_TxNotify (   This,
  a,
  b 
)    TXTHOST_VTABLE(This)->TxNotify(This,a,b)

Definition at line 322 of file editor.h.

◆ ITextHost_TxReleaseDC

#define ITextHost_TxReleaseDC (   This,
  a 
)    TXTHOST_VTABLE(This)->TxReleaseDC(This,a)

Definition at line 288 of file editor.h.

◆ ITextHost_TxScreenToClient

#define ITextHost_TxScreenToClient (   This,
  a 
)    TXTHOST_VTABLE(This)->TxScreenToClient(This,a)

Definition at line 304 of file editor.h.

◆ ITextHost_TxScrollWindowEx

#define ITextHost_TxScrollWindowEx (   This,
  a,
  b,
  c,
  d,
  e,
  f,
  g 
)    TXTHOST_VTABLE(This)->TxScrollWindowEx(This,a,b,c,d,e,f,g)

Definition at line 300 of file editor.h.

◆ ITextHost_TxSetCapture

#define ITextHost_TxSetCapture (   This,
  a 
)    TXTHOST_VTABLE(This)->TxSetCapture(This,a)

Definition at line 301 of file editor.h.

◆ ITextHost_TxSetCaretPos

#define ITextHost_TxSetCaretPos (   This,
  a,
  b 
)    TXTHOST_VTABLE(This)->TxSetCaretPos(This,a,b)

Definition at line 297 of file editor.h.

◆ ITextHost_TxSetCursor

#define ITextHost_TxSetCursor (   This,
  a,
  b 
)    TXTHOST_VTABLE(This)->TxSetCursor(This,a,b)

Definition at line 303 of file editor.h.

◆ ITextHost_TxSetFocus

#define ITextHost_TxSetFocus (   This)    TXTHOST_VTABLE(This)->TxSetFocus(This)

Definition at line 302 of file editor.h.

◆ ITextHost_TxSetScrollPos

#define ITextHost_TxSetScrollPos (   This,
  a,
  b,
  c 
)    TXTHOST_VTABLE(This)->TxSetScrollPos(This,a,b,c)

Definition at line 292 of file editor.h.

◆ ITextHost_TxSetScrollRange

#define ITextHost_TxSetScrollRange (   This,
  a,
  b,
  c,
  d 
)    TXTHOST_VTABLE(This)->TxSetScrollRange(This,a,b,c,d)

Definition at line 291 of file editor.h.

◆ ITextHost_TxSetTimer

#define ITextHost_TxSetTimer (   This,
  a,
  b 
)    TXTHOST_VTABLE(This)->TxSetTimer(This,a,b)

Definition at line 298 of file editor.h.

◆ ITextHost_TxShowCaret

#define ITextHost_TxShowCaret (   This,
  a 
)    TXTHOST_VTABLE(This)->TxShowCaret(This,a)

Definition at line 296 of file editor.h.

◆ ITextHost_TxShowScrollBar

#define ITextHost_TxShowScrollBar (   This,
  a,
  b 
)    TXTHOST_VTABLE(This)->TxShowScrollBar(This,a,b)

Definition at line 289 of file editor.h.

◆ ITextHost_TxViewChange

#define ITextHost_TxViewChange (   This,
  a 
)    TXTHOST_VTABLE(This)->TxViewChange(This,a)

Definition at line 294 of file editor.h.

◆ RUN_IS_HIDDEN

#define RUN_IS_HIDDEN (   run)
Value:
((run)->style->fmt.dwMask & CFM_HIDDEN \
&& (run)->style->fmt.dwEffects & CFE_HIDDEN)
#define CFM_HIDDEN
Definition: richedit.h:340
#define CFE_HIDDEN
Definition: richedit.h:418
Arabic default style
Definition: afstyles.h:93

Definition at line 29 of file editor.h.

◆ TXTHOST_VTABLE

#define TXTHOST_VTABLE (   This)    (This)->lpVtbl

Definition at line 284 of file editor.h.

Function Documentation

◆ add_marked_para()

void add_marked_para ( ME_TextEditor editor,
ME_DisplayItem para 
)

Definition at line 112 of file para.c.

113 {
114  ME_DisplayItem *iter = editor->first_marked_para;
115 
116  if (!iter)
117  {
118  editor->first_marked_para = di;
119  return;
120  }
121  while (iter)
122  {
123  if (iter == di)
124  return;
125  else if (di->member.para.nCharOfs < iter->member.para.nCharOfs)
126  {
127  if (iter == editor->first_marked_para)
128  editor->first_marked_para = di;
129  di->member.para.next_marked = iter;
130  iter->member.para.prev_marked = di;
131  break;
132  }
133  else if (di->member.para.nCharOfs >= iter->member.para.nCharOfs)
134  {
135  if (!iter->member.para.next_marked || di->member.para.nCharOfs < iter->member.para.next_marked->member.para.nCharOfs)
136  {
137  if (iter->member.para.next_marked)
138  {
139  di->member.para.next_marked = iter->member.para.next_marked;
140  iter->member.para.next_marked->member.para.prev_marked = di;
141  }
142  di->member.para.prev_marked = iter;
143  iter->member.para.next_marked = di;
144  break;
145  }
146  }
147  iter = iter->member.para.next_marked;
148  }
149 }
ME_Paragraph para
Definition: editstr.h:266
struct tagME_DisplayItem * prev_marked
Definition: editstr.h:222
struct tagME_DisplayItem * next_marked
Definition: editstr.h:222
ME_DisplayItem * first_marked_para
Definition: editstr.h:437
union tagME_DisplayItem::@521 member

Referenced by mark_para_rewrap(), and ME_MakeFirstParagraph().

◆ add_undo_delete_run()

BOOL add_undo_delete_run ( ME_TextEditor ,
int  pos,
int  len 
)

Definition at line 204 of file undo.c.

205 {
206  struct undo_item *undo = add_undo( editor, undo_delete_run );
207  if (!undo) return FALSE;
208 
209  undo->u.delete_run.pos = pos;
210  undo->u.delete_run.len = len;
211 
212  return TRUE;
213 }
static struct undo_item * add_undo(ME_TextEditor *editor, enum undo_type type)
Definition: undo.c:72
#define TRUE
Definition: types.h:120
union undo_item::@522 u
struct delete_run_item delete_run
Definition: editstr.h:352
GLenum GLsizei len
Definition: glext.h:6722

Referenced by ME_InsertRunAtCursor().

◆ add_undo_insert_run()

BOOL add_undo_insert_run ( ME_TextEditor ,
int  pos,
const WCHAR str,
int  len,
int  flags,
ME_Style style 
)

Definition at line 131 of file undo.c.

132 {
133  struct undo_item *undo = add_undo( editor, undo_insert_run );
134  if (!undo) return FALSE;
135 
136  undo->u.insert_run.str = heap_alloc( (len + 1) * sizeof(WCHAR) );
137  if (!undo->u.insert_run.str)
138  {
139  ME_EmptyUndoStack( editor );
140  return FALSE;
141  }
142  memcpy( undo->u.insert_run.str, str, len * sizeof(WCHAR) );
143  undo->u.insert_run.str[len] = 0;
144  undo->u.insert_run.pos = pos;
145  undo->u.insert_run.len = len;
146  undo->u.insert_run.flags = flags;
147  undo->u.insert_run.style = style;
149  return TRUE;
150 }
static struct undo_item * add_undo(ME_TextEditor *editor, enum undo_type type)
Definition: undo.c:72
#define TRUE
Definition: types.h:120
union undo_item::@522 u
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
struct insert_run_item insert_run
Definition: editstr.h:351
const WCHAR * str
__wchar_t WCHAR
Definition: xmlstorage.h:180
void ME_AddRefStyle(ME_Style *item) DECLSPEC_HIDDEN
Definition: style.c:454
GLbitfield flags
Definition: glext.h:7161
void ME_EmptyUndoStack(ME_TextEditor *editor)
Definition: undo.c:53
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
Arabic default style
Definition: afstyles.h:93

Referenced by ME_InternalDeleteText().

◆ add_undo_join_paras()

BOOL add_undo_join_paras ( ME_TextEditor ,
int  pos 
)

Definition at line 176 of file undo.c.

177 {
178  struct undo_item *undo = add_undo( editor, undo_join_paras );
179  if (!undo) return FALSE;
180 
181  undo->u.join_paras.pos = pos;
182  return TRUE;
183 }
struct join_paras_item join_paras
Definition: editstr.h:353
static struct undo_item * add_undo(ME_TextEditor *editor, enum undo_type type)
Definition: undo.c:72
#define TRUE
Definition: types.h:120
union undo_item::@522 u

Referenced by ME_SplitParagraph().

◆ add_undo_set_char_fmt()

BOOL add_undo_set_char_fmt ( ME_TextEditor ,
int  pos,
int  len,
const CHARFORMAT2W fmt 
)

Definition at line 164 of file undo.c.

165 {
166  struct undo_item *undo = add_undo( editor, undo_set_char_fmt );
167  if (!undo) return FALSE;
168 
169  undo->u.set_char_fmt.pos = pos;
170  undo->u.set_char_fmt.len = len;
171  undo->u.set_char_fmt.fmt = *fmt;
172 
173  return TRUE;
174 }
struct set_char_fmt_item set_char_fmt
Definition: editstr.h:356
static struct undo_item * add_undo(ME_TextEditor *editor, enum undo_type type)
Definition: undo.c:72
#define TRUE
Definition: types.h:120
union undo_item::@522 u
const char * fmt
Definition: wsprintf.c:30
GLenum GLsizei len
Definition: glext.h:6722

Referenced by ME_SetCharFormat().

◆ add_undo_set_para_fmt()

BOOL add_undo_set_para_fmt ( ME_TextEditor ,
const ME_Paragraph para 
)

Definition at line 152 of file undo.c.

153 {
154  struct undo_item *undo = add_undo( editor, undo_set_para_fmt );
155  if (!undo) return FALSE;
156 
157  undo->u.set_para_fmt.pos = para->nCharOfs;
158  undo->u.set_para_fmt.fmt = para->fmt;
159  undo->u.set_para_fmt.border = para->border;
160 
161  return TRUE;
162 }
static struct undo_item * add_undo(ME_TextEditor *editor, enum undo_type type)
Definition: undo.c:72
#define TRUE
Definition: types.h:120
union undo_item::@522 u
struct set_para_fmt_item set_para_fmt
Definition: editstr.h:355
ME_BorderRect border
Definition: editstr.h:212
PARAFORMAT2 fmt
Definition: editstr.h:208

Referenced by ME_JoinParagraphs(), ME_PlayUndoItem(), and ME_SetParaFormat().

◆ add_undo_split_para()

BOOL add_undo_split_para ( ME_TextEditor ,
const ME_Paragraph para,
ME_String eol_str,
const ME_Cell cell 
)

Definition at line 185 of file undo.c.

186 {
187  struct undo_item *undo = add_undo( editor, undo_split_para );
188  if (!undo) return FALSE;
189 
190  undo->u.split_para.pos = para->nCharOfs - eol_str->nLen;
191  undo->u.split_para.eol_str = eol_str;
192  undo->u.split_para.fmt = para->fmt;
193  undo->u.split_para.border = para->border;
194  undo->u.split_para.flags = para->prev_para->member.para.nFlags & ~MEPF_CELL;
195 
196  if (cell)
197  {
198  undo->u.split_para.cell_border = cell->border;
199  undo->u.split_para.cell_right_boundary = cell->nRightBoundary;
200  }
201  return TRUE;
202 }
static struct undo_item * add_undo(ME_TextEditor *editor, enum undo_type type)
Definition: undo.c:72
#define TRUE
Definition: types.h:120
union undo_item::@522 u
struct tagME_DisplayItem * prev_para
Definition: editstr.h:221
struct split_para_item split_para
Definition: editstr.h:354
#define MEPF_CELL
Definition: editstr.h:147
int nLen
Definition: editstr.h:61
ME_BorderRect border
Definition: editstr.h:212
ME_BorderRect border
Definition: editstr.h:229
int nRightBoundary
Definition: editstr.h:228
PARAFORMAT2 fmt
Definition: editstr.h:208

Referenced by ME_JoinParagraphs().

◆ cf2w_to_cfany()

BOOL cf2w_to_cfany ( CHARFORMAT2W to,
const CHARFORMAT2W from 
)

Definition at line 79 of file style.c.

80 {
81  assert(from->cbSize == sizeof(CHARFORMAT2W));
82  if (to->cbSize == sizeof(CHARFORMATA))
83  {
84  CHARFORMATA *t = (CHARFORMATA *)to;
85  CopyMemory(t, from, FIELD_OFFSET(CHARFORMATA, szFaceName));
86  WideCharToMultiByte(CP_ACP, 0, from->szFaceName, -1, t->szFaceName, sizeof(t->szFaceName), NULL, NULL);
87  t->cbSize = sizeof(*t); /* it was overwritten by CopyMemory */
88  t->dwMask &= CFM_ALL;
89  t->dwEffects &= CFM_EFFECTS;
90  return TRUE;
91  }
92  if (to->cbSize == sizeof(CHARFORMATW))
93  {
94  CHARFORMATW *t = (CHARFORMATW *)to;
95  CopyMemory(t, from, sizeof(*t));
96  t->cbSize = sizeof(*t); /* it was overwritten by CopyMemory */
97  t->dwMask &= CFM_ALL;
98  t->dwEffects &= CFM_EFFECTS;
99  return TRUE;
100  }
101  if (to->cbSize == sizeof(CHARFORMAT2A))
102  {
103  CHARFORMAT2A *t = (CHARFORMAT2A *)to;
104  /* copy the A structure without face name */
105  CopyMemory(t, from, FIELD_OFFSET(CHARFORMATA, szFaceName));
106  /* convert face name */
107  WideCharToMultiByte(CP_ACP, 0, from->szFaceName, -1, t->szFaceName, sizeof(t->szFaceName), NULL, NULL);
108  /* copy the rest of the 2A structure to 2W */
109  CopyMemory(&t->wWeight, &from->wWeight, sizeof(CHARFORMAT2W)-FIELD_OFFSET(CHARFORMAT2W,wWeight));
110  t->cbSize = sizeof(*t); /* it was overwritten by CopyMemory */
111  return TRUE;
112  }
113  if (to->cbSize == sizeof(CHARFORMAT2W))
114  {
115  CopyMemory(to, from, sizeof(CHARFORMAT2W));
116  return TRUE;
117  }
118  return FALSE;
119 }
#define TRUE
Definition: types.h:120
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
GLdouble GLdouble t
Definition: gl.h:2047
#define assert(x)
Definition: debug.h:53
#define CFM_EFFECTS
Definition: richedit.h:364
smooth NULL
Definition: ftsmooth.c:416
#define CopyMemory
Definition: winbase.h:1640
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define CFM_ALL
Definition: richedit.h:387
CardRegion * from
Definition: spigame.cpp:19

Referenced by ME_HandleMessage().

◆ cfany_to_cf2w()

BOOL cfany_to_cf2w ( CHARFORMAT2W to,
const CHARFORMAT2W from 
)

Definition at line 36 of file style.c.

37 {
38  if (from->cbSize == sizeof(CHARFORMATA))
39  {
41  CopyMemory(to, f, FIELD_OFFSET(CHARFORMATA, szFaceName));
42  to->cbSize = sizeof(CHARFORMAT2W);
43  if (f->dwMask & CFM_FACE) {
44  MultiByteToWideChar(CP_ACP, 0, f->szFaceName, -1, to->szFaceName, ARRAY_SIZE(to->szFaceName));
45  }
46  return TRUE;
47  }
48  if (from->cbSize == sizeof(CHARFORMATW))
49  {
51  CopyMemory(to, f, sizeof(*f));
52  /* theoretically, we don't need to zero the remaining memory */
53  ZeroMemory(&to->wWeight, sizeof(CHARFORMAT2W)-FIELD_OFFSET(CHARFORMAT2W, wWeight));
54  to->cbSize = sizeof(CHARFORMAT2W);
55  return TRUE;
56  }
57  if (from->cbSize == sizeof(CHARFORMAT2A))
58  {
60  /* copy the A structure without face name */
61  CopyMemory(to, f, FIELD_OFFSET(CHARFORMATA, szFaceName));
62  /* convert face name */
63  if (f->dwMask & CFM_FACE)
64  MultiByteToWideChar(CP_ACP, 0, f->szFaceName, -1, to->szFaceName, ARRAY_SIZE(to->szFaceName));
65  /* copy the rest of the 2A structure to 2W */
66  CopyMemory(&to->wWeight, &f->wWeight, sizeof(CHARFORMAT2A)-FIELD_OFFSET(CHARFORMAT2A, wWeight));
67  to->cbSize = sizeof(CHARFORMAT2W);
68  return TRUE;
69  }
70  if (from->cbSize == sizeof(CHARFORMAT2W))
71  {
72  CopyMemory(to, from, sizeof(CHARFORMAT2W));
73  return TRUE;
74  }
75 
76  return FALSE;
77 }
#define TRUE
Definition: types.h:120
WORD wWeight
Definition: richedit.h:314
#define CP_ACP
Definition: compat.h:99
#define CFM_FACE
Definition: richedit.h:360
#define ZeroMemory
Definition: winbase.h:1642
GLfloat f
Definition: glext.h:7540
#define CopyMemory
Definition: winbase.h:1640
WCHAR szFaceName[LF_FACESIZE]
Definition: richedit.h:313
#define ARRAY_SIZE(a)
Definition: main.h:24
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define MultiByteToWideChar
Definition: compat.h:100
struct _charformat2w CHARFORMAT2W
CardRegion * from
Definition: spigame.cpp:19

Referenced by handle_EM_SETCHARFORMAT(), and ME_MakeFirstParagraph().

◆ create_caret()

void create_caret ( ME_TextEditor ed)

Definition at line 272 of file caret.c.

273 {
274  int x, y, height;
275 
276  ME_GetCursorCoordinates(editor, &editor->pCursors[0], &x, &y, &height);
277  ITextHost_TxCreateCaret(editor->texthost, NULL, 0, height);
278  editor->caret_height = height;
279  editor->caret_hidden = TRUE;
280 }
#define TRUE
Definition: types.h:120
#define ITextHost_TxCreateCaret(This, a, b, c)
Definition: editor.h:295
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
void ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor, int *x, int *y, int *height)
Definition: caret.c:221
smooth NULL
Definition: ftsmooth.c:416
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by ME_HandleMessage(), and update_caret().

◆ CreateIRichEditOle()

LRESULT CreateIRichEditOle ( IUnknown outer_unk,
ME_TextEditor editor,
LPVOID ppvObj 
)

Definition at line 5688 of file richole.c.

5689 {
5690  IRichEditOleImpl *reo;
5691 
5692  reo = heap_alloc(sizeof(IRichEditOleImpl));
5693  if (!reo)
5694  return 0;
5695 
5696  reo->IUnknown_inner.lpVtbl = &reo_unk_vtbl;
5697  reo->IRichEditOle_iface.lpVtbl = &revt;
5698  reo->ITextDocument2Old_iface.lpVtbl = &tdvt;
5699  reo->ref = 1;
5700  reo->editor = editor;
5701  reo->txtSel = NULL;
5702 
5703  TRACE("Created %p\n",reo);
5704  list_init(&reo->rangelist);
5705  list_init(&reo->clientsites);
5706  if (outer_unk)
5707  reo->outer_unk = outer_unk;
5708  else
5709  reo->outer_unk = &reo->IUnknown_inner;
5710  *ppvObj = &reo->IUnknown_inner;
5711 
5712  return 1;
5713 }
ITextSelectionImpl * txtSel
Definition: richole.c:217
ME_TextEditor * editor
Definition: richole.c:216
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
IUnknown IUnknown_inner
Definition: richole.c:210
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
ITextDocument2Old ITextDocument2Old_iface
Definition: richole.c:212
struct list clientsites
Definition: richole.c:220
static const ITextDocument2OldVtbl tdvt
Definition: richole.c:4550
struct list rangelist
Definition: richole.c:219
IRichEditOle IRichEditOle_iface
Definition: richole.c:211
static const IRichEditOleVtbl revt
Definition: richole.c:1510
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
IUnknown * outer_unk
Definition: richole.c:213
static const IUnknownVtbl reo_unk_vtbl
Definition: richole.c:1006

Referenced by insert_static_object(), ITextServicesImpl_QueryInterface(), and ME_HandleMessage().

◆ debugstr_run()

static const char* debugstr_run ( const ME_Run run)
inlinestatic

Definition at line 46 of file editor.h.

47 {
48  return debugstr_wn( get_text( run, 0 ), run->len );
49 }
int len
Definition: editstr.h:167
static WCHAR * get_text(const ME_Run *run, int offset)
Definition: editor.h:41
#define debugstr_wn
Definition: kernel32.h:33

Referenced by itemize_para(), ME_CheckCharOffsets(), ME_DumpDocument(), ME_InternalDeleteText(), ME_JoinParagraphs(), ME_MaximizeSplit(), ME_PropagateCharOffset(), ME_SplitByBacktracking(), and split_run_extents().

◆ destroy_para()

void destroy_para ( ME_TextEditor editor,
ME_DisplayItem item 
)

Definition at line 48 of file para.c.

49 {
50  assert(item->type == diParagraph);
51 
52  if (item->member.para.nWidth == editor->nTotalWidth)
53  {
54  item->member.para.nWidth = 0;
55  editor->nTotalWidth = get_total_width(editor);
56  }
57  editor->total_rows -= item->member.para.nRows;
58  ME_DestroyString(item->member.para.text);
59  para_num_clear( &item->member.para.para_num );
60  remove_marked_para(editor, item);
62 }
void para_num_clear(struct para_num *pn)
Definition: para.c:442
#define assert(x)
Definition: debug.h:53
void ME_DestroyDisplayItem(ME_DisplayItem *item) DECLSPEC_HIDDEN
Definition: list.c:160
void remove_marked_para(ME_TextEditor *editor, ME_DisplayItem *di)
Definition: para.c:82
int get_total_width(ME_TextEditor *editor)
Definition: para.c:64
void ME_DestroyString(ME_String *s) DECLSPEC_HIDDEN
Definition: string.c:96
static ATOM item
Definition: dde.c:856

Referenced by ME_DestroyEditor(), and ME_JoinParagraphs().

◆ get_di_from_para()

ME_DisplayItem* get_di_from_para ( ME_Paragraph para)

Definition at line 32 of file para.c.

33 {
35 }
#define offsetof(TYPE, MEMBER)
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247

Referenced by ME_InsertRunAtCursor(), ME_SetCharFormat(), ME_SetParaFormat(), and para_num_clear_list().

◆ get_text()

◆ get_total_width()

int get_total_width ( ME_TextEditor editor)

Definition at line 64 of file para.c.

65 {
66  ME_Paragraph *para;
67  int total_width = 0;
68 
69  if (editor->pBuffer->pFirst && editor->pBuffer->pLast)
70  {
71  para = &editor->pBuffer->pFirst->next->member.para;
72  while (para != &editor->pBuffer->pLast->member.para && para->next_para)
73  {
74  total_width = max(total_width, para->nWidth);
75  para = &para->next_para->member.para;
76  }
77  }
78 
79  return total_width;
80 }
#define max(a, b)
Definition: svc.c:63
ME_Paragraph para
Definition: editstr.h:266
ME_DisplayItem * pFirst
Definition: editstr.h:272
struct tagME_DisplayItem * next
Definition: editstr.h:261
ME_TextBuffer * pBuffer
Definition: editstr.h:390
ME_DisplayItem * pLast
Definition: editstr.h:272
struct tagME_DisplayItem * next_para
Definition: editstr.h:221
union tagME_DisplayItem::@521 member

Referenced by destroy_para(), and ME_WrapMarkedParagraphs().

◆ hide_caret()

void hide_caret ( ME_TextEditor ed)

Definition at line 288 of file caret.c.

289 {
290  /* calls to HideCaret are cumulative; do so only once */
291  if (!editor->caret_hidden)
292  {
293  ITextHost_TxShowCaret(editor->texthost, FALSE);
294  editor->caret_hidden = TRUE;
295  }
296 }
#define TRUE
Definition: types.h:120
#define ITextHost_TxShowCaret(This, a)
Definition: editor.h:296

Referenced by ME_ArrowKey(), ME_HandleMessage(), and update_caret().

◆ mark_para_rewrap()

void mark_para_rewrap ( ME_TextEditor editor,
ME_DisplayItem para 
)

Definition at line 26 of file para.c.

27 {
28  para->member.para.nFlags |= MEPF_REWRAP;
29  add_marked_para(editor, para);
30 }
void add_marked_para(ME_TextEditor *editor, ME_DisplayItem *di)
Definition: para.c:112
ME_Paragraph para
Definition: editstr.h:266
#define MEPF_REWRAP
Definition: editstr.h:145
union tagME_DisplayItem::@521 member

Referenced by handle_enter(), ME_InsertRunAtCursor(), ME_InternalDeleteText(), ME_JoinParagraphs(), ME_JoinRuns(), ME_MarkForWrapping(), ME_PlayUndoItem(), ME_SetCharFormat(), ME_SetParaFormat(), ME_SplitParagraph(), ME_SplitRunSimple(), and para_num_clear_list().

◆ ME_AddRefStyle()

void ME_AddRefStyle ( ME_Style item)

Definition at line 454 of file style.c.

455 {
456  assert(s->nRefs>0); /* style with 0 references isn't supposed to exist */
457  s->nRefs++;
458  all_refs++;
459  TRACE_(richedit_style)("ME_AddRefStyle %p, new refs=%d, total refs=%d\n", s, s->nRefs, all_refs);
460 }
#define assert(x)
Definition: debug.h:53
#define TRACE_(x)
Definition: compat.h:66
static int all_refs
Definition: style.c:26
GLdouble s
Definition: gl.h:2039

Referenced by add_undo_insert_run(), ME_ApplyStyle(), ME_GetInsertStyle(), ME_HandleMessage(), ME_MakeRun(), ME_RTFReadHook(), ME_SaveTempStyle(), ME_StreamIn(), para_num_init(), and RTFUngetToken().

◆ ME_AppendString()

BOOL ME_AppendString ( ME_String s,
const WCHAR append,
int  len 
)

Definition at line 126 of file string.c.

127 {
128  return ME_InsertString( s, s->nLen, append, len );
129 }
static void append(struct dump_context *dc, const void *data, unsigned size)
Definition: minidump.c:380
BOOL ME_InsertString(ME_String *s, int ofs, const WCHAR *insert, int len)
Definition: string.c:103
GLenum GLsizei len
Definition: glext.h:6722
GLdouble s
Definition: gl.h:2039

Referenced by ME_JoinParagraphs(), and ME_SplitParagraph().

◆ ME_AppendTableRow()

ME_DisplayItem* ME_AppendTableRow ( ME_TextEditor editor,
ME_DisplayItem table_row 
)

Definition at line 407 of file table.c.

409 {
410  WCHAR endl = '\r', tab = '\t';
411  ME_DisplayItem *run;
412  PARAFORMAT2 *pFmt;
413  int i;
414 
415  assert(table_row);
416  assert(table_row->type == diParagraph);
417  if (!editor->bEmulateVersion10) { /* v4.1 */
418  ME_DisplayItem *insertedCell, *para, *cell, *prevTableEnd;
419  cell = ME_FindItemFwd(ME_GetTableRowStart(table_row), diCell);
420  prevTableEnd = ME_GetTableRowEnd(table_row);
421  para = prevTableEnd->member.para.next_para;
422  run = ME_FindItemFwd(para, diRun);
423  editor->pCursors[0].pPara = para;
424  editor->pCursors[0].pRun = run;
425  editor->pCursors[0].nOffset = 0;
426  editor->pCursors[1] = editor->pCursors[0];
427  para = ME_InsertTableRowStartFromCursor(editor);
428  insertedCell = ME_FindItemFwd(para, diCell);
429  /* Copy cell properties */
430  insertedCell->member.cell.nRightBoundary = cell->member.cell.nRightBoundary;
431  insertedCell->member.cell.border = cell->member.cell.border;
432  while (cell->member.cell.next_cell) {
433  cell = cell->member.cell.next_cell;
434  para = ME_InsertTableCellFromCursor(editor);
435  insertedCell = ME_FindItemBack(para, diCell);
436  /* Copy cell properties */
437  insertedCell->member.cell.nRightBoundary = cell->member.cell.nRightBoundary;
438  insertedCell->member.cell.border = cell->member.cell.border;
439  };
440  para = ME_InsertTableRowEndFromCursor(editor);
441  para->member.para.fmt = prevTableEnd->member.para.fmt;
442  /* return the table row start for the inserted paragraph */
444  } else { /* v1.0 - 3.0 */
445  run = ME_FindItemBack(table_row->member.para.next_para, diRun);
446  pFmt = &table_row->member.para.fmt;
447  assert(pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE);
448  editor->pCursors[0].pPara = table_row;
449  editor->pCursors[0].pRun = run;
450  editor->pCursors[0].nOffset = 0;
451  editor->pCursors[1] = editor->pCursors[0];
452  ME_InsertTextFromCursor(editor, 0, &endl, 1, run->member.run.style);
453  run = editor->pCursors[0].pRun;
454  for (i = 0; i < pFmt->cTabCount; i++) {
455  ME_InsertTextFromCursor(editor, 0, &tab, 1, run->member.run.style);
456  }
457  return table_row->member.para.next_para;
458  }
459 }
ME_DIType type
Definition: editstr.h:260
ME_Paragraph para
Definition: editstr.h:266
ME_DisplayItem * ME_InsertTableCellFromCursor(ME_TextEditor *editor)
Definition: table.c:121
ME_DisplayItem * ME_GetTableRowStart(ME_DisplayItem *para)
Definition: table.c:154
void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, const WCHAR *str, int len, ME_Style *style)
Definition: caret.c:550
#define assert(x)
Definition: debug.h:53
SHORT cTabCount
Definition: richedit.h:674
ME_Style * style
Definition: editstr.h:164
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
basic_ostream< _CharT, _Traits > &_STLP_CALL endl(basic_ostream< _CharT, _Traits > &__os)
Definition: _ostream.h:357
ME_DisplayItem * ME_InsertTableRowStartFromCursor(ME_TextEditor *editor)
Definition: table.c:79
ME_DisplayItem * ME_InsertTableRowEndFromCursor(ME_TextEditor *editor)
Definition: table.c:129
Definition: editstr.h:91
#define PFE_TABLE
Definition: richedit.h:944
DWORD dwMask
Definition: richedit.h:667
__wchar_t WCHAR
Definition: xmlstorage.h:180
ME_DisplayItem * pPara
Definition: editstr.h:279
ME_BorderRect border
Definition: editstr.h:229
#define PFM_TABLE
Definition: richedit.h:870
int nRightBoundary
Definition: editstr.h:228
int nOffset
Definition: editstr.h:281
Definition: editstr.h:90
ME_Cell cell
Definition: editstr.h:265
WORD wEffects
Definition: richedit.h:669
BOOL bEmulateVersion10
Definition: editstr.h:389
ME_Cursor * pCursors
Definition: editstr.h:391
PARAFORMAT2 fmt
Definition: editstr.h:208
struct tagME_DisplayItem * next_para
Definition: editstr.h:221
ME_DisplayItem * pRun
Definition: editstr.h:280
struct tagME_DisplayItem * next_cell
Definition: editstr.h:233
ME_DisplayItem * ME_FindItemFwd(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
Definition: list.c:134
ME_DisplayItem * ME_GetTableRowEnd(ME_DisplayItem *para)
Definition: table.c:136
ME_DisplayItem * ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
Definition: list.c:111
union tagME_DisplayItem::@521 member

Referenced by handle_enter(), and ME_SelectOrInsertNextCell().

◆ ME_ApplyStyle()

ME_Style* ME_ApplyStyle ( ME_TextEditor ed,
ME_Style sSrc,
CHARFORMAT2W style 
)

Definition at line 156 of file style.c.

157 {
158  CHARFORMAT2W fmt = sSrc->fmt;
159  ME_Style *s;
160 
161  assert(mod->cbSize == sizeof(CHARFORMAT2W));
162  COPY_STYLE_ITEM(CFM_ANIMATION, bAnimation);
163  COPY_STYLE_ITEM(CFM_BACKCOLOR, crBackColor);
164  COPY_STYLE_ITEM(CFM_CHARSET, bCharSet);
165  COPY_STYLE_ITEM(CFM_COLOR, crTextColor);
166  COPY_STYLE_ITEM_MEMCPY(CFM_FACE, szFaceName);
167  COPY_STYLE_ITEM(CFM_KERNING, wKerning);
168  COPY_STYLE_ITEM(CFM_LCID, lcid);
170  COPY_STYLE_ITEM(CFM_REVAUTHOR, bRevAuthor);
171  if (mod->dwMask & CFM_SIZE) {
172  fmt.dwMask |= CFM_SIZE;
173  fmt.yHeight = min(mod->yHeight, yHeightCharPtsMost * 20);
174  }
175  COPY_STYLE_ITEM(CFM_SPACING, sSpacing);
176  COPY_STYLE_ITEM(CFM_STYLE, sStyle);
177  COPY_STYLE_ITEM(CFM_WEIGHT, wWeight);
178  /* FIXME: this is not documented this way, but that's the more logical */
179  COPY_STYLE_ITEM(CFM_FACE, bPitchAndFamily);
180 
181  fmt.dwEffects &= ~(mod->dwMask);
182  fmt.dwEffects |= mod->dwEffects & mod->dwMask;
183  fmt.dwMask |= mod->dwMask;
184  if (mod->dwMask & CFM_COLOR)
185  {
186  if (mod->dwEffects & CFE_AUTOCOLOR)
187  fmt.dwEffects |= CFE_AUTOCOLOR;
188  else
189  fmt.dwEffects &= ~CFE_AUTOCOLOR;
190  }
191 
192  COPY_STYLE_ITEM(CFM_UNDERLINETYPE, bUnderlineType);
193  /* If the CFM_UNDERLINE effect is not specified, set it appropriately */
194  if ((mod->dwMask & CFM_UNDERLINETYPE) && !(mod->dwMask & CFM_UNDERLINE))
195  {
196  fmt.dwMask |= CFM_UNDERLINE;
197  if (mod->bUnderlineType == CFU_UNDERLINENONE)
198  fmt.dwEffects &= ~CFE_UNDERLINE;
199  else
200  fmt.dwEffects |= CFE_UNDERLINE;
201  }
202 
203  if (mod->dwMask & CFM_BOLD && !(mod->dwMask & CFM_WEIGHT))
204  {
205  fmt.wWeight = (mod->dwEffects & CFE_BOLD) ? FW_BOLD : FW_NORMAL;
206  } else if (mod->dwMask & CFM_WEIGHT && !(mod->dwMask & CFM_BOLD)) {
207  if (mod->wWeight > FW_NORMAL)
208  fmt.dwEffects |= CFE_BOLD;
209  else
210  fmt.dwEffects &= ~CFE_BOLD;
211  }
212 
213  LIST_FOR_EACH_ENTRY(s, &editor->style_list, ME_Style, entry)
214  {
215  if (!memcmp( &s->fmt, &fmt, sizeof(fmt) ))
216  {
217  TRACE_(richedit_style)("found existing style %p\n", s);
218  ME_AddRefStyle( s );
219  return s;
220  }
221  }
222 
223  s = ME_MakeStyle( &fmt );
224  if (s)
225  list_add_head( &editor->style_list, &s->entry );
226  TRACE_(richedit_style)("created new style %p\n", s);
227  return s;
228 }
#define CFM_KERNING
Definition: richedit.h:352
#define CFE_AUTOCOLOR
Definition: richedit.h:414
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define CFE_UNDERLINE
Definition: richedit.h:408
#define CFM_REVAUTHOR
Definition: richedit.h:347
#define CFM_FACE
Definition: richedit.h:360
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
#define assert(x)
Definition: debug.h:53
#define CFM_ANIMATION
Definition: richedit.h:350
#define CFM_STYLE
Definition: richedit.h:351
#define yHeightCharPtsMost
Definition: richedit.h:214
#define COPY_STYLE_ITEM(mask, member)
Definition: style.c:138
#define CFE_BOLD
Definition: richedit.h:406
#define CFU_UNDERLINENONE
Definition: richedit.h:427
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define CFM_COLOR
Definition: richedit.h:361
#define CFM_UNDERLINE
Definition: richedit.h:334
#define CFM_LCID
Definition: richedit.h:356
#define TRACE_(x)
Definition: compat.h:66
#define CFM_SIZE
Definition: richedit.h:362
#define CFM_OFFSET
Definition: richedit.h:359
#define CFM_SPACING
Definition: richedit.h:353
void ME_AddRefStyle(ME_Style *s)
Definition: style.c:454
uint32_t entry
Definition: isohybrid.c:63
GLdouble s
Definition: gl.h:2039
#define FW_BOLD
Definition: wingdi.h:377
#define CFM_BOLD
Definition: richedit.h:332
#define min(a, b)
Definition: monoChain.cc:55
#define CFM_WEIGHT
Definition: richedit.h:354
#define FW_NORMAL
Definition: wingdi.h:372
#define CFM_BACKCOLOR
Definition: richedit.h:357
int yOffset
Definition: appswitch.c:59
#define COPY_STYLE_ITEM_MEMCPY(mask, member)
Definition: style.c:144
#define CFM_UNDERLINETYPE
Definition: richedit.h:355
ME_Style * ME_MakeStyle(CHARFORMAT2W *style)
Definition: style.c:121
CHARFORMAT2W fmt
Definition: editstr.h:77
Definition: dsound.c:943
#define CFM_CHARSET
Definition: richedit.h:358
static int mod
Definition: i386-dis.c:1273

Referenced by ME_RTFCharAttrHook(), ME_SetCharFormat(), ME_SetDefaultCharFormat(), ME_SetSelectionCharFormat(), and para_num_init().

◆ ME_ArrowKey()

BOOL ME_ArrowKey ( ME_TextEditor ed,
int  nVKey,
BOOL  extend,
BOOL  ctrl 
)

Definition at line 1585 of file caret.c.

1586 {
1587  int nCursor = 0;
1588  ME_Cursor *p = &editor->pCursors[nCursor];
1589  ME_Cursor tmp_curs = *p;
1590  BOOL success = FALSE;
1591 
1592  ME_CheckCharOffsets(editor);
1593  switch(nVKey) {
1594  case VK_LEFT:
1595  editor->bCaretAtEnd = FALSE;
1596  if (ctrl)
1597  success = ME_MoveCursorWords(editor, &tmp_curs, -1);
1598  else
1599  success = ME_MoveCursorChars(editor, &tmp_curs, -1, extend);
1600  break;
1601  case VK_RIGHT:
1602  editor->bCaretAtEnd = FALSE;
1603  if (ctrl)
1604  success = ME_MoveCursorWords(editor, &tmp_curs, +1);
1605  else
1606  success = ME_MoveCursorChars(editor, &tmp_curs, +1, extend);
1607  break;
1608  case VK_UP:
1609  ME_MoveCursorLines(editor, &tmp_curs, -1, extend);
1610  break;
1611  case VK_DOWN:
1612  ME_MoveCursorLines(editor, &tmp_curs, +1, extend);
1613  break;
1614  case VK_PRIOR:
1615  ME_ArrowPageUp(editor, &tmp_curs);
1616  break;
1617  case VK_NEXT:
1618  ME_ArrowPageDown(editor, &tmp_curs);
1619  break;
1620  case VK_HOME: {
1621  if (ctrl)
1622  ME_ArrowCtrlHome(editor, &tmp_curs);
1623  else
1624  ME_ArrowHome(editor, &tmp_curs);
1625  editor->bCaretAtEnd = FALSE;
1626  break;
1627  }
1628  case VK_END:
1629  if (ctrl)
1630  ME_ArrowCtrlEnd(editor, &tmp_curs);
1631  else
1632  ME_ArrowEnd(editor, &tmp_curs);
1633  break;
1634  }
1635 
1636  if (!extend)
1637  editor->pCursors[1] = tmp_curs;
1638  *p = tmp_curs;
1639 
1640  ME_InvalidateSelection(editor);
1641  ME_Repaint(editor);
1642  hide_caret(editor);
1643  ME_EnsureVisible(editor, &tmp_curs);
1644  update_caret(editor);
1645  ME_SendSelChange(editor);
1646  return success;
1647 }
void ME_InvalidateSelection(ME_TextEditor *editor) DECLSPEC_HIDDEN
Definition: paint.c:1317
static void ME_ArrowCtrlEnd(ME_TextEditor *editor, ME_Cursor *pCursor)
Definition: caret.c:1527
void ME_CheckCharOffsets(ME_TextEditor *editor) DECLSPEC_HIDDEN
Definition: run.c:101
static void ME_ArrowHome(ME_TextEditor *editor, ME_Cursor *pCursor)
Definition: caret.c:1476
#define VK_LEFT
Definition: winuser.h:2199
#define VK_DOWN
Definition: winuser.h:2202
#define VK_PRIOR
Definition: winuser.h:2195
static void ME_MoveCursorLines(ME_TextEditor *editor, ME_Cursor *pCursor, int nRelOfs, BOOL extend)
Definition: caret.c:1278
#define VK_NEXT
Definition: winuser.h:2196
#define VK_HOME
Definition: winuser.h:2198
#define VK_UP
Definition: winuser.h:2200
unsigned int BOOL
Definition: ntddk_ex.h:94
void ME_Repaint(ME_TextEditor *editor) DECLSPEC_HIDDEN
Definition: paint.c:106
static void ME_ArrowEnd(ME_TextEditor *editor, ME_Cursor *pCursor)
Definition: caret.c:1502
static void ME_ArrowPageDown(ME_TextEditor *editor, ME_Cursor *pCursor)
Definition: caret.c:1418
#define ctrl
Definition: input.c:1762
BOOL ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs)
Definition: caret.c:754
void ME_SendSelChange(ME_TextEditor *editor)
Definition: caret.c:1553
static void ME_ArrowPageUp(ME_TextEditor *editor, ME_Cursor *pCursor)
Definition: caret.c:1364
#define success(from, fromstr, to, tostr)
#define VK_RIGHT
Definition: winuser.h:2201
void ME_EnsureVisible(ME_TextEditor *editor, ME_Cursor *pCursor) DECLSPEC_HIDDEN
Definition: paint.c:1275
int ME_MoveCursorChars(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs, BOOL final_eop)
Definition: caret.c:675
void update_caret(ME_TextEditor *editor)
Definition: caret.c:298
static void ME_ArrowCtrlHome(ME_TextEditor *editor, ME_Cursor *pCursor)
Definition: caret.c:1496
GLfloat GLfloat p
Definition: glext.h:8902
#define VK_END
Definition: winuser.h:2197
void hide_caret(ME_TextEditor *editor)
Definition: caret.c:288

Referenced by ME_KeyDown().

◆ ME_CallWordBreakProc()

int ME_CallWordBreakProc ( ME_TextEditor editor,
WCHAR str,
INT  len,
INT  start,
INT  code 
)

Definition at line 192 of file string.c.

193 {
194  if (!editor->pfnWordBreak) {
195  return ME_WordBreakProc(str, start, len, code);
196  } else if (!editor->bEmulateVersion10) {
197  /* MSDN lied about the third parameter for EditWordBreakProc being the number
198  * of characters, it is actually the number of bytes of the string. */
199  return editor->pfnWordBreak(str, start, len * sizeof(WCHAR), code);
200  } else {
201  int result;
203  NULL, 0, NULL, NULL);
204  char *buffer = heap_alloc(buffer_size);
205  if (!buffer) return 0;
209  heap_free(buffer);
210  return result;
211  }
212 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
GLuint buffer
Definition: glext.h:5915
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static int ME_WordBreakProc(LPWSTR s, INT start, INT len, INT code)
Definition: string.c:162
static void buffer_size(GLcontext *ctx, GLuint *width, GLuint *height)
Definition: swimpl.c:927
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLsizei len
Definition: glext.h:6722
BOOL bEmulateVersion10
Definition: editstr.h:389
GLuint start
Definition: gl.h:1545
GLuint64EXT * result
Definition: glext.h:11304
EDITWORDBREAKPROCW pfnWordBreak
Definition: editstr.h:421
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by ME_MoveCursorWords().

◆ ME_CanJoinRuns()

BOOL ME_CanJoinRuns ( const ME_Run run1,
const ME_Run run2 
)

Definition at line 35 of file run.c.

36 {
37  if ((run1->nFlags | run2->nFlags) & MERF_NOJOIN)
38  return FALSE;
39  if (run1->style != run2->style)
40  return FALSE;
41  if ((run1->nFlags & MERF_STYLEFLAGS) != (run2->nFlags & MERF_STYLEFLAGS))
42  return FALSE;
43  return TRUE;
44 }
#define TRUE
Definition: types.h:120
ME_Style * style
Definition: editstr.h:164
#define MERF_STYLEFLAGS
Definition: editstr.h:107
int nFlags
Definition: editstr.h:169
#define MERF_NOJOIN
Definition: editstr.h:135

Referenced by ME_PrepareParagraphForWrapping().

◆ ME_CharCompare()

static int ME_CharCompare ( WCHAR  a,
WCHAR  b,
int  caseSensitive 
)
inlinestatic

Definition at line 106 of file editor.h.

107 {
108  return caseSensitive ? (a == b) : (towupper(a) == towupper(b));
109 }
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define towupper(c)
Definition: wctype.h:99
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by ME_FindText().

◆ ME_CharFormatFromLogFont()

void ME_CharFormatFromLogFont ( HDC  hDC,
const LOGFONTW lf,
CHARFORMAT2W fmt 
)

Definition at line 331 of file style.c.

332 {
333  int ry;
334 
337  lstrcpyW(fmt->szFaceName, lf->lfFaceName);
338  fmt->dwEffects = 0;
340  fmt->wWeight = lf->lfWeight;
341  fmt->yHeight = -lf->lfHeight*1440/ry;
342  if (lf->lfWeight > FW_NORMAL) fmt->dwEffects |= CFM_BOLD;
343  if (lf->lfItalic) fmt->dwEffects |= CFM_ITALIC;
344  if (lf->lfUnderline) fmt->dwEffects |= CFM_UNDERLINE;
345  fmt->bUnderlineType = CFU_UNDERLINE;
346  if (lf->lfStrikeOut) fmt->dwEffects |= CFM_STRIKEOUT;
347  fmt->bPitchAndFamily = lf->lfPitchAndFamily;
348  fmt->bCharSet = lf->lfCharSet;
349 }
BYTE lfPitchAndFamily
Definition: dimm.idl:71
#define CFU_UNDERLINE
Definition: richedit.h:428
LONG lfHeight
Definition: dimm.idl:59
BYTE lfCharSet
Definition: dimm.idl:67
#define CFM_FACE
Definition: richedit.h:360
#define CFM_ITALIC
Definition: richedit.h:333
void ME_InitCharFormat2W(CHARFORMAT2W *pFmt)
Definition: style.c:150
#define CFM_UNDERLINE
Definition: richedit.h:334
#define CFM_SIZE
Definition: richedit.h:362
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define CFM_STRIKEOUT
Definition: richedit.h:335
static HDC hDC
Definition: 3dtext.c:33
#define lstrcpyW
Definition: compat.h:414
#define CFM_BOLD
Definition: richedit.h:332
BYTE lfStrikeOut
Definition: dimm.idl:66
BYTE lfItalic
Definition: dimm.idl:64
#define CFM_WEIGHT
Definition: richedit.h:354
#define FW_NORMAL
Definition: wingdi.h:372
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
#define LOGPIXELSY
Definition: wingdi.h:718
LONG lfWeight
Definition: dimm.idl:63
BYTE lfUnderline
Definition: dimm.idl:65
#define CFM_UNDERLINETYPE
Definition: richedit.h:355
Definition: dsound.c:943
#define CFM_CHARSET
Definition: richedit.h:358

Referenced by ME_HandleMessage().

◆ ME_CharFromPoint()

int ME_CharFromPoint ( ME_TextEditor editor,
int  cx,
ME_Run run,
BOOL  closest,
BOOL  visual_order 
)

Definition at line 521 of file run.c.

522 {
523  ME_Context c;
524  int ret;
525 
526  ME_InitContext( &c, editor, ITextHost_TxGetDC( editor->texthost ) );
527  ret = ME_CharFromPointContext( &c, cx, run, closest, visual_order );
529  return ret;
530 }
void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC)
Definition: context.c:23
#define ITextHost_TxGetDC(This)
Definition: editor.h:287
const GLubyte * c
Definition: glext.h:8905
void ME_DestroyContext(ME_Context *c)
Definition: context.c:44
int ret
ITextHost * texthost
Definition: editstr.h:387
int ME_CharFromPointContext(ME_Context *c, int cx, ME_Run *run, BOOL closest, BOOL visual_order)
Definition: run.c:462
_Out_opt_ int * cx
Definition: commctrl.h:581
#define c
Definition: ke_i.h:80

Referenced by ME_FindRunInRow().

◆ ME_CharFromPointContext()

int ME_CharFromPointContext ( ME_Context c,
int  cx,
ME_Run run,
BOOL  closest,
BOOL  visual_order 
)

Definition at line 462 of file run.c.

463 {
464  ME_String *mask_text = NULL;
465  WCHAR *str;
466  int fit = 0;
467  SIZE sz, sz2, sz3;
468  if (!run->len || cx <= 0)
469  return 0;
470 
471  if (run->nFlags & (MERF_TAB | MERF_ENDCELL))
472  {
473  if (!closest || cx < run->nWidth / 2) return 0;
474  return 1;
475  }
476 
477  if (run->nFlags & MERF_GRAPHICS)
478  {
479  SIZE sz;
480  ME_GetOLEObjectSize(c, run, &sz);
481  if (!closest || cx < sz.cx / 2) return 0;
482  return 1;
483  }
484 
485  if (run->para->nFlags & MEPF_COMPLEX)
486  {
487  int cp, trailing;
488  if (visual_order && run->script_analysis.fRTL) cx = run->nWidth - cx - 1;
489 
490  ScriptXtoCP( cx, run->len, run->num_glyphs, run->clusters, run->vis_attrs, run->advances, &run->script_analysis,
491  &cp, &trailing );
492  TRACE("x %d cp %d trailing %d (run width %d) rtl %d log order %d\n", cx, cp, trailing, run->nWidth,
494  return closest ? cp + trailing : cp;
495  }
496 
497  if (c->editor->cPasswordMask)
498  {
499  mask_text = ME_MakeStringR( c->editor->cPasswordMask, run->len );
500  str = mask_text->szData;
501  }
502  else
503  str = get_text( run, 0 );
504 
505  select_style(c, run->style);
506  GetTextExtentExPointW(c->hDC, str, run->len,
507  cx, &fit, NULL, &sz);
508  if (closest && fit != run->len)
509  {
510  GetTextExtentPoint32W(c->hDC, str, fit, &sz2);
511  GetTextExtentPoint32W(c->hDC, str, fit + 1, &sz3);
512  if (cx >= (sz2.cx+sz3.cx)/2)
513  fit = fit + 1;
514  }
515 
516  ME_DestroyString( mask_text );
517 
518  return fit;
519 }
WCHAR * szData
Definition: editstr.h:60
#define MERF_GRAPHICS
Definition: editstr.h:109
struct tagME_Paragraph * para
Definition: editstr.h:165
WORD * clusters
Definition: editstr.h:181
ME_Style * style
Definition: editstr.h:164
#define MERF_TAB
Definition: editstr.h:111
HRESULT WINAPI ScriptXtoCP(int iX, int cChars, int cGlyphs, const WORD *pwLogClust, const SCRIPT_VISATTR *psva, const int *piAdvance, const SCRIPT_ANALYSIS *psa, int *piCP, int *piTrailing)
Definition: usp10.c:2854
BOOL WINAPI GetTextExtentExPointW(_In_ HDC hdc, _In_reads_(cchString) LPCWSTR lpszString, _In_ int cchString, _In_ int nMaxExtent, _Out_opt_ LPINT lpnFit, _Out_writes_to_opt_(cchString, *lpnFit) LPINT lpnDx, _Out_ LPSIZE lpSize)
void select_style(ME_Context *c, ME_Style *s) DECLSPEC_HIDDEN
Definition: style.c:369
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize) DECLSPEC_HIDDEN
Definition: richole.c:5727
LONG cx
Definition: windef.h:334
int len
Definition: editstr.h:167
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
const GLubyte * c
Definition: glext.h:8905
ME_String * ME_MakeStringR(WCHAR cRepeat, int nMaxChars) DECLSPEC_HIDDEN
Definition: string.c:85
int nFlags
Definition: editstr.h:169
int nWidth
Definition: editstr.h:168
#define MERF_ENDCELL
Definition: editstr.h:113
static WCHAR * get_text(const ME_Run *run, int offset)
Definition: editor.h:41
void ME_DestroyString(ME_String *s) DECLSPEC_HIDDEN
Definition: string.c:96
int * advances
Definition: editstr.h:178
int num_glyphs
Definition: editstr.h:175
WORD fLogicalOrder
Definition: usp10.h:144
SCRIPT_ANALYSIS script_analysis
Definition: editstr.h:174
_Out_opt_ int * cx
Definition: commctrl.h:581
POINT cp
Definition: magnifier.c:59
#define MEPF_COMPLEX
Definition: editstr.h:150
SCRIPT_VISATTR * vis_attrs
Definition: editstr.h:177
BOOL WINAPI GetTextExtentPoint32W(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE psizl)

Referenced by find_split_point(), and ME_CharFromPoint().

◆ ME_CharFromPos()

BOOL ME_CharFromPos ( ME_TextEditor editor,
int  x,
int  y,
ME_Cursor cursor,
BOOL isExact 
)

Definition at line 1077 of file caret.c.

1079 {
1080  RECT rc;
1081  BOOL bResult;
1082 
1083  ITextHost_TxGetClientRect(editor->texthost, &rc);
1084  if (x < 0 || y < 0 || x >= rc.right || y >= rc.bottom) {
1085  if (isExact) *isExact = FALSE;
1086  return FALSE;
1087  }
1088  x += editor->horz_si.nPos;
1089  y += editor->vert_si.nPos;
1090  bResult = ME_FindPixelPos(editor, x, y, cursor, NULL, FALSE);
1091  if (isExact) *isExact = bResult;
1092  return TRUE;
1093 }
#define TRUE
Definition: types.h:120
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define ITextHost_TxGetClientRect(This, a)
Definition: editor.h:308
LONG right
Definition: windef.h:308
SCROLLINFO vert_si
Definition: editstr.h:443
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
static BOOL ME_FindPixelPos(ME_TextEditor *editor, int x, int y, ME_Cursor *result, BOOL *is_eol, BOOL final_eop)
Definition: caret.c:1010
ITextHost * texthost
Definition: editstr.h:387
const char cursor[]
Definition: icontest.c:13
SCROLLINFO horz_si
Definition: editstr.h:443
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
LONG bottom
Definition: windef.h:309

Referenced by ME_HandleMessage(), ME_LinkNotify(), and ME_SetCursor().

◆ ME_CharOfsFromRunOfs()

int ME_CharOfsFromRunOfs ( ME_TextEditor editor,
const ME_DisplayItem pPara,
const ME_DisplayItem pRun,
int  nOfs 
)

Definition at line 156 of file run.c.

158 {
159  assert(pRun && pRun->type == diRun);
160  assert(pPara && pPara->type == diParagraph);
161  return pPara->member.para.nCharOfs + pRun->member.run.nCharOfs + nOfs;
162 }
ME_DIType type
Definition: editstr.h:260
ME_Paragraph para
Definition: editstr.h:266
#define assert(x)
Definition: debug.h:53
int nCharOfs
Definition: editstr.h:166
Definition: editstr.h:91
union tagME_DisplayItem::@521 member

Referenced by ME_HandleMessage().

◆ ME_CheckCharOffsets()

void ME_CheckCharOffsets ( ME_TextEditor editor)

Definition at line 101 of file run.c.

102 {
103  ME_DisplayItem *p = editor->pBuffer->pFirst;
104  int ofs = 0, ofsp = 0;
105 
106  if (!TRACE_ON(richedit_check))
107  return;
108 
109  TRACE_(richedit_check)("Checking begin\n");
110  if(TRACE_ON(richedit_lists))
111  {
112  TRACE_(richedit_lists)("---\n");
113  ME_DumpDocument(editor->pBuffer);
114  }
115  do {
117  switch(p->type) {
118  case diTextEnd:
119  TRACE_(richedit_check)("tend, real ofsp = %d, counted = %d\n", p->member.para.nCharOfs, ofsp+ofs);
120  assert(ofsp+ofs == p->member.para.nCharOfs);
121  TRACE_(richedit_check)("Checking finished\n");
122  return;
123  case diParagraph:
124  TRACE_(richedit_check)("para, real ofsp = %d, counted = %d\n", p->member.para.nCharOfs, ofsp+ofs);
125  assert(ofsp+ofs == p->member.para.nCharOfs);
126  ofsp = p->member.para.nCharOfs;
127  ofs = 0;
128  break;
129  case diRun:
130  TRACE_(richedit_check)("run, real ofs = %d (+ofsp = %d), counted = %d, len = %d, txt = %s, flags=%08x, fx&mask = %08x\n",
131  p->member.run.nCharOfs, p->member.run.nCharOfs+ofsp, ofsp+ofs,
132  p->member.run.len, debugstr_run( &p->member.run ),
133  p->member.run.nFlags,
134  p->member.run.style->fmt.dwMask & p->member.run.style->fmt.dwEffects);
135  assert(ofs == p->member.run.nCharOfs);
136  assert(p->member.run.len);
137  ofs += p->member.run.len;
138  break;
139  case diCell:
140  TRACE_(richedit_check)("cell\n");
141  break;
142  default:
143  assert(0);
144  }
145  } while(1);
146  TRACE_(richedit_check)("Checking finished\n");
147 }
#define assert(x)
Definition: debug.h:53
void ME_DumpDocument(ME_TextBuffer *buffer) DECLSPEC_HIDDEN
Definition: list.c:187
static const char * debugstr_run(const ME_Run *run)
Definition: editor.h:46
ME_DisplayItem * pFirst
Definition: editstr.h:272
ME_TextBuffer * pBuffer
Definition: editstr.h:390
Definition: editstr.h:91
#define TRACE_(x)
Definition: compat.h:66
Definition: editstr.h:90
ME_DisplayItem * ME_FindItemFwd(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
Definition: list.c:134
GLfloat GLfloat p
Definition: glext.h:8902
#define TRACE_ON(x)
Definition: compat.h:65

Referenced by ME_ArrowKey(), ME_InternalDeleteText(), ME_JoinParagraphs(), ME_JoinRuns(), ME_KeyDown(), ME_MakeEditor(), and split_run_extents().

◆ ME_CheckTablesForCorruption()

void ME_CheckTablesForCorruption ( ME_TextEditor editor)

Definition at line 192 of file table.c.

193 {
194  if(TRACE_ON(richedit_lists))
195  {
196  TRACE("---\n");
197  ME_DumpDocument(editor->pBuffer);
198  }
199 #ifndef NDEBUG
200  {
201  ME_DisplayItem *p, *pPrev;
202  pPrev = editor->pBuffer->pFirst;
203  p = pPrev->next;
204  if (!editor->bEmulateVersion10) /* v4.1 */
205  {
206  while (p->type == diParagraph)
207  {
208  assert(p->member.para.fmt.dwMask & PFM_TABLE);
209  assert(p->member.para.fmt.dwMask & PFM_TABLEROWDELIMITER);
210  if (p->member.para.pCell)
211  {
212  assert(p->member.para.nFlags & MEPF_CELL);
213  assert(p->member.para.fmt.wEffects & PFE_TABLE);
214  }
215  if (p->member.para.pCell != pPrev->member.para.pCell)
216  {
217  /* There must be a diCell in between the paragraphs if pCell changes. */
219  assert(pCell);
221  }
222  if (p->member.para.nFlags & MEPF_ROWEND)
223  {
224  /* ROWEND must come after a cell. */
225  assert(pPrev->member.para.pCell);
226  assert(p->member.para.pCell
227  == pPrev->member.para.pCell->member.cell.parent_cell);
228  assert(p->member.para.fmt.wEffects & PFE_TABLEROWDELIMITER);
229  }
230  else if (p->member.para.pCell)
231  {
232  assert(!(p->member.para.fmt.wEffects & PFE_TABLEROWDELIMITER));
233  assert(pPrev->member.para.pCell ||
234  pPrev->member.para.nFlags & MEPF_ROWSTART);
235  if (pPrev->member.para.pCell &&
236  !(pPrev->member.para.nFlags & MEPF_ROWSTART))
237  {
238  assert(p->member.para.pCell->member.cell.parent_cell
239  == pPrev->member.para.pCell->member.cell.parent_cell);
240  if (pPrev->member.para.pCell != p->member.para.pCell)
241  assert(pPrev->member.para.pCell
242  == p->member.para.pCell->member.cell.prev_cell);
243  }
244  }
245  else if (!(p->member.para.nFlags & MEPF_ROWSTART))
246  {
247  assert(!(p->member.para.fmt.wEffects & PFE_TABLEROWDELIMITER));
248  /* ROWSTART must be followed by a cell. */
249  assert(!(p->member.para.nFlags & MEPF_CELL));
250  /* ROWSTART must be followed by a cell. */
251  assert(!(pPrev->member.para.nFlags & MEPF_ROWSTART));
252  }
253  pPrev = p;
254  p = p->member.para.next_para;
255  }
256  } else { /* v1.0 - 3.0 */
257  while (p->type == diParagraph)
258  {
259  assert(!(p->member.para.nFlags & (MEPF_ROWSTART|MEPF_ROWEND|MEPF_CELL)));
260  assert(p->member.para.fmt.dwMask & PFM_TABLE);
261  assert(!(p->member.para.fmt.wEffects & PFE_TABLEROWDELIMITER));
262  assert(!p->member.para.pCell);
263  p = p->member.para.next_para;
264  }
265  return;
266  }
267  assert(p->type == diTextEnd);
268  assert(!pPrev->member.para.pCell);
269  }
270 #endif
271 }
#define MEPF_ROWEND
Definition: editstr.h:149
ME_Paragraph para
Definition: editstr.h:266
struct tagME_DisplayItem * pCell
Definition: editstr.h:211
#define assert(x)
Definition: debug.h:53
void ME_DumpDocument(ME_TextBuffer *buffer) DECLSPEC_HIDDEN
Definition: list.c:187
#define PFM_TABLEROWDELIMITER
Definition: richedit.h:868
ME_DisplayItem * pFirst
Definition: editstr.h:272
struct tagME_DisplayItem * next
Definition: editstr.h:261
#define MEPF_CELL
Definition: editstr.h:147
ME_TextBuffer * pBuffer
Definition: editstr.h:390
Definition: editstr.h:91
#define PFE_TABLE
Definition: richedit.h:944
#define TRACE(s)
Definition: solgame.cpp:4
#define MEPF_ROWSTART
Definition: editstr.h:148
#define PFM_TABLE
Definition: richedit.h:870
#define PFE_TABLEROWDELIMITER
Definition: richedit.h:942
Definition: editstr.h:90
BOOL bEmulateVersion10
Definition: editstr.h:389
GLfloat GLfloat p
Definition: glext.h:8902
#define TRACE_ON(x)
Definition: compat.h:65
ME_DisplayItem * ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
Definition: list.c:111
union tagME_DisplayItem::@521 member

Referenced by handle_enter(), ME_Redo(), ME_StreamIn(), and ME_Undo().

◆ ME_ClearTempStyle()

void ME_ClearTempStyle ( ME_TextEditor editor)

Definition at line 523 of file style.c.

524 {
525  if (!editor->pBuffer->pCharStyle) return;
527  editor->pBuffer->pCharStyle = NULL;
528 }
ME_Style * pCharStyle
Definition: editstr.h:273
ME_TextBuffer * pBuffer
Definition: editstr.h:390
smooth NULL
Definition: ftsmooth.c:416
void ME_ReleaseStyle(ME_Style *s)
Definition: style.c:462

Referenced by ME_DestroyEditor(), ME_HandleMessage(), ME_ReplaceSel(), ME_SendSelChange(), and ME_StreamIn().

◆ ME_CommitCoalescingUndo()

void ME_CommitCoalescingUndo ( ME_TextEditor editor)

Commits preceding changes into a undo transaction that can be expanded.

This function allows the transaction to be reopened with ME_ContinueCoalescingTransaction in order to continue the transaction. If an undo item is added to the undo stack as a result of a change without the transaction being reopened, then the transaction will be ended, and the changes will become a part of the next transaction.

This is used to allow typed characters to be grouped together since each typed character results in a single event, and each event adding undo items must be committed. Using this function as opposed to ME_CommitUndo allows multiple events to be grouped, and undone together.

Definition at line 301 of file undo.c.

302 {
303  struct undo_item *item;
304  struct list *head;
305 
306  if (editor->nUndoMode == umIgnore)
307  return;
308 
309  assert(editor->nUndoMode == umAddToUndo);
310 
311  head = list_head( &editor->undo_stack );
312  if (!head) return;
313 
314  /* no need to commit empty transactions */
315  item = LIST_ENTRY( head, struct undo_item, entry );
316  if (item->type == undo_end_transaction ||
318  return;
319 
321 }
static struct undo_item * add_undo(ME_TextEditor *editor, enum undo_type type)
Definition: undo.c:72
struct outqueuenode * head
Definition: adnsresfilter.c:66
#define assert(x)
Definition: debug.h:53
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
struct list undo_stack
Definition: editstr.h:406
uint32_t entry
Definition: isohybrid.c:63
Definition: _list.h:228
static ATOM item
Definition: dde.c:856
ME_UndoMode nUndoMode
Definition: editstr.h:410
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by handle_enter(), ME_Char(), and ME_KeyDown().

◆ ME_CommitUndo()

void ME_CommitUndo ( ME_TextEditor editor)

Commits preceding changes into a transaction that can be undone together.

This should be called after all the changes occur associated with an event so that the group of changes can be undone atomically as a transaction.

This will have no effect the undo mode is set to ignore changes, or if no changes preceded calling this function before the last time it was called.

This can also be used to conclude a coalescing transaction (used for grouping typed characters).

Definition at line 227 of file undo.c.

228 {
229  struct undo_item *item;
230  struct list *head;
231 
232  if (editor->nUndoMode == umIgnore)
233  return;
234 
235  assert(editor->nUndoMode == umAddToUndo);
236 
237  /* no transactions, no need to commit */
238  head = list_head( &editor->undo_stack );
239  if (!head) return;
240 
241  /* no need to commit empty transactions */
242  item = LIST_ENTRY( head, struct undo_item, entry );
243  if (item->type == undo_end_transaction) return;
244 
246  {
247  item->type = undo_end_transaction;
248  return;
249  }
250 
251  add_undo( editor, undo_end_transaction );
252 }
static struct undo_item * add_undo(ME_TextEditor *editor, enum undo_type type)
Definition: undo.c:72
struct outqueuenode * head
Definition: adnsresfilter.c:66
#define assert(x)
Definition: debug.h:53
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
struct list undo_stack
Definition: editstr.h:406
uint32_t entry
Definition: isohybrid.c:63
Definition: _list.h:228
static ATOM item
Definition: dde.c:856
ME_UndoMode nUndoMode
Definition: editstr.h:410
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by copy_or_cut(), handle_EM_SETCHARFORMAT(), handle_enter(), IRichEditOle_fnInsertObject(), ME_Char(), ME_HandleMessage(), ME_KeyDown(), ME_ReplaceSel(), ME_StreamIn(), ME_WmCreate(), and paste_emf().

◆ ME_ContinueCoalescingTransaction()

void ME_ContinueCoalescingTransaction ( ME_TextEditor editor)

Groups subsequent changes with previous ones for an undo if coalescing.

Has no effect if the previous changes were followed by a ME_CommitUndo. This function will only have an affect if the previous changes were followed by a call to ME_CommitCoalescingUndo, which allows the transaction to be continued.

This allows multiple consecutively typed characters to be grouped together to be undone by a single undo operation.

Definition at line 265 of file undo.c.

266 {
267  struct undo_item *item;
268  struct list *head;
269 
270  if (editor->nUndoMode == umIgnore)
271  return;
272 
273  assert(editor->nUndoMode == umAddToUndo);
274 
275  head = list_head( &editor->undo_stack );
276  if (!head) return;
277 
278  item = LIST_ENTRY( head, struct undo_item, entry );
280  {
281  list_remove( &item->entry );
282  editor->nUndoStackSize--;
284  }
285 }
struct outqueuenode * head
Definition: adnsresfilter.c:66
#define assert(x)
Definition: debug.h:53
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
int nUndoStackSize
Definition: editstr.h:408
struct list undo_stack
Definition: editstr.h:406
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
static void destroy_undo_item(struct undo_item *undo)
Definition: undo.c:25
uint32_t entry
Definition: isohybrid.c:63
Definition: _list.h:228
static ATOM item
Definition: dde.c:856
ME_UndoMode nUndoMode
Definition: editstr.h:410
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by handle_enter(), ME_Char(), and ME_KeyDown().

◆ ME_CopyCharFormat()

void ME_CopyCharFormat ( CHARFORMAT2W pDest,
const CHARFORMAT2W pSrc 
)

Definition at line 230 of file style.c.

231 {
232  /* using this with non-2W structs is forbidden */
233  assert(pSrc->cbSize == sizeof(CHARFORMAT2W));
234  assert(pDest->cbSize == sizeof(CHARFORMAT2W));
235  *pDest = *pSrc;
236 }
#define assert(x)
Definition: debug.h:53

Referenced by ME_GetDefaultCharFormat(), ME_GetRunCharFormat(), and ME_GetSelectionCharFormat().

◆ ME_CopyReObject()

void ME_CopyReObject ( REOBJECT dst,
const REOBJECT src,
DWORD  flags 
)

Definition at line 5907 of file richole.c.

5908 {
5909  *dst = *src;
5910  dst->poleobj = NULL;
5911  dst->pstg = NULL;
5912  dst->polesite = NULL;
5913 
5914  if ((flags & REO_GETOBJ_POLEOBJ) && src->poleobj)
5915  {
5916  dst->poleobj = src->poleobj;
5917  IOleObject_AddRef(dst->poleobj);
5918  }
5919  if ((flags & REO_GETOBJ_PSTG) && src->pstg)
5920  {
5921  dst->pstg = src->pstg;
5922  IStorage_AddRef(dst->pstg);
5923  }
5924  if ((flags & REO_GETOBJ_POLESITE) && src->polesite)
5925  {
5926  dst->polesite = src->polesite;
5927  IOleClientSite_AddRef(dst->polesite);
5928  }
5929 }
smooth NULL
Definition: ftsmooth.c:416
GLbitfield flags
Definition: glext.h:7161
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340

Referenced by create_re_object(), and IRichEditOle_fnGetObject().

◆ ME_CreateTextHost()

ITextHost* ME_CreateTextHost ( HWND  hwnd,
CREATESTRUCTW cs,
BOOL  bEmulateVersion10 
)

Definition at line 44 of file txthost.c.

45 {
46  ITextHostImpl *texthost;
47 
48  texthost = CoTaskMemAlloc(sizeof(*texthost));
49  if (!texthost) return NULL;
50 
51  texthost->ITextHost_iface.lpVtbl = &textHostVtbl;
52  texthost->ref = 1;
53  texthost->hWnd = hwnd;
54  texthost->bEmulateVersion10 = bEmulateVersion10;
55  memset( &texthost->para_fmt, 0, sizeof(texthost->para_fmt) );
56  texthost->para_fmt.cbSize = sizeof(texthost->para_fmt);
57  texthost->para_fmt.dwMask = PFM_ALIGNMENT;
58  texthost->para_fmt.wAlignment = PFA_LEFT;
59  if (cs->style & ES_RIGHT)
60  texthost->para_fmt.wAlignment = PFA_RIGHT;
61  if (cs->style & ES_CENTER)
62  texthost->para_fmt.wAlignment = PFA_CENTER;
63 
64  return &texthost->ITextHost_iface;
65 }
#define PFA_RIGHT
Definition: richedit.h:922
#define ES_CENTER
Definition: pedump.c:665
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WORD wAlignment
Definition: richedit.h:673
#define PFM_ALIGNMENT
Definition: richedit.h:841
uint32_t cs
Definition: isohybrid.c:75
#define ES_RIGHT
Definition: pedump.c:666
LONG ref
Definition: txthost.c:36
HWND hWnd
Definition: txthost.c:37
smooth NULL
Definition: ftsmooth.c:416
DWORD dwMask
Definition: richedit.h:667
#define PFA_CENTER
Definition: richedit.h:923
ITextHost ITextHost_iface
Definition: txthost.c:35
PARAFORMAT2 para_fmt
Definition: txthost.c:39
BOOL bEmulateVersion10
Definition: txthost.c:38
static const ITextHostVtbl textHostVtbl
Definition: txthost.c:42
#define PFA_LEFT
Definition: richedit.h:921
UINT cbSize
Definition: richedit.h:666
#define memset(x, y, z)
Definition: compat.h:39
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404

Referenced by create_windowed_editor().

◆ ME_CursorFromCharOfs()

void ME_CursorFromCharOfs ( ME_TextEditor editor,
int  nCharOfs,
ME_Cursor pCursor 
)

Definition at line 171 of file run.c.

172 {
173  ME_RunOfsFromCharOfs(editor, nCharOfs, &pCursor->pPara,
174  &pCursor->pRun, &pCursor->nOffset);
175 }
void ME_RunOfsFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem **ppPara, ME_DisplayItem **ppRun, int *pOfs)
Definition: run.c:184
ME_DisplayItem * pPara
Definition: editstr.h:279
int nOffset
Definition: editstr.h:281
ME_DisplayItem * pRun
Definition: editstr.h:280

Referenced by fnTextSrv_TxGetText(), get_textfont_prop_for_pos(), IRichEditOle_fnGetClipboardData(), IRichEditOle_fnGetObject(), ITextRange_fnGetChar(), ITextRange_fnGetText(), ITextRange_fnScrollIntoView(), ITextRange_fnSetText(), ME_FindText(), ME_GetSelectionType(), ME_HandleMessage(), ME_InternalDeleteText(), ME_PlayUndoItem(), ME_StreamIn(), set_selection_cursors(), set_textfont_prop(), and textrange_set_font().

◆ ME_DeleteReObject()

void ME_DeleteReObject ( struct re_object re_object)

Definition at line 5899 of file richole.c.

5900 {
5901  if (reobj->obj.poleobj) IOleObject_Release(reobj->obj.poleobj);
5902  if (reobj->obj.pstg) IStorage_Release(reobj->obj.pstg);
5903  if (reobj->obj.polesite) IOleClientSite_Release(reobj->obj.polesite);
5904  heap_free(reobj);
5905 }
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by ME_DestroyDisplayItem().

◆ ME_DeleteSelection()

void ME_DeleteSelection ( ME_TextEditor editor)

Definition at line 1539 of file caret.c.

1540 {
1541  int from, to;
1542  int nStartCursor = ME_GetSelectionOfs(editor, &from, &to);
1543  int nEndCursor = nStartCursor ^ 1;
1544  ME_DeleteTextAtCursor(editor, nStartCursor, to - from);
1545  editor->pCursors[nEndCursor] = editor->pCursors[nStartCursor];
1546 }
int ME_GetSelectionOfs(ME_TextEditor *editor, int *from, int *to)
Definition: caret.c:42
BOOL ME_DeleteTextAtCursor(ME_TextEditor *editor, int nCursor, int nChars)
Definition: caret.c:465
ME_Cursor * pCursors
Definition: editstr.h:391
CardRegion * from
Definition: spigame.cpp:19

Referenced by ME_HandleMessage(), ME_InsertEndRowFromCursor(), ME_InsertOLEFromCursor(), ME_InsertTextFromCursor(), and ME_KeyDown().

◆ ME_DeleteTextAtCursor()

BOOL ME_DeleteTextAtCursor ( ME_TextEditor editor,
int  nCursor,
int  nChars 
)

Definition at line 465 of file caret.c.

466 {
467  assert(nCursor>=0 && nCursor<editor->nCursors);
468  /* text operations set modified state */
469  editor->nModifyStep = 1;
470  return ME_InternalDeleteText(editor, &editor->pCursors[nCursor],
471  nChars, FALSE);
472 }
#define assert(x)
Definition: debug.h:53
BOOL ME_InternalDeleteText(ME_TextEditor *editor, ME_Cursor *start, int nChars, BOOL bForce)
Definition: caret.c:315
ME_Cursor * pCursors
Definition: editstr.h:391

Referenced by ME_DeleteSelection(), and ME_KeyDown().

◆ ME_DestroyContext()

void ME_DestroyContext ( ME_Context c)

Definition at line 44 of file context.c.

45 {
46  select_style( c, NULL );
47  if (c->hDC) ITextHost_TxReleaseDC( c->editor->texthost, c->hDC );
48 }
#define ITextHost_TxReleaseDC(This, a)
Definition: editor.h:288
void select_style(ME_Context *c, ME_Style *s) DECLSPEC_HIDDEN
Definition: style.c:369
smooth NULL
Definition: ftsmooth.c:416
const GLubyte * c
Definition: glext.h:8905

Referenced by ME_CharFromPoint(), ME_GetCursorCoordinates(), ME_InvalidateParagraphRange(), ME_MakeFirstParagraph(), ME_PaintContent(), ME_PointFromChar(), ME_WrapMarkedParagraphs(), and stream_out_graphics().

◆ ME_DestroyDisplayItem()

void ME_DestroyDisplayItem ( ME_DisplayItem item)

Definition at line 160 of file list.c.

161 {
162  if (0)
163  TRACE("type=%s\n", ME_GetDITypeName(item->type));
164  if (item->type==diRun)
165  {
166  if (item->member.run.reobj)
167  {
168  list_remove(&item->member.run.reobj->entry);
169  ME_DeleteReObject(item->member.run.reobj);
170  }
171  heap_free( item->member.run.glyphs );
172  heap_free( item->member.run.clusters );
173  ME_ReleaseStyle(item->member.run.style);
174  }
175  heap_free(item);
176 }
static const char * ME_GetDITypeName(ME_DIType type)
Definition: list.c:146
void ME_DeleteReObject(struct re_object *re_object) DECLSPEC_HIDDEN
Definition: richole.c:5899
Definition: editstr.h:91
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
void ME_ReleaseStyle(ME_Style *item) DECLSPEC_HIDDEN
Definition: style.c:462
static ATOM item
Definition: dde.c:856
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by destroy_para(), ME_DestroyEditor(), ME_InternalDeleteText(), ME_JoinParagraphs(), ME_JoinRuns(), and ME_PrepareParagraphForWrapping().

◆ ME_DestroyEditor()

void ME_DestroyEditor ( ME_TextEditor editor)

Definition at line 3190 of file editor.c.

3191 {
3192  ME_DisplayItem *p = editor->pBuffer->pFirst, *pNext = NULL;
3193  ME_Style *s, *cursor2;
3194  int i;
3195 
3196  ME_ClearTempStyle(editor);
3197  ME_EmptyUndoStack(editor);
3198  editor->pBuffer->pFirst = NULL;
3199  while(p) {
3200  pNext = p->next;
3201  if (p->type == diParagraph)
3202  destroy_para(editor, p);
3203  else
3205  p = pNext;
3206  }
3207 
3208  LIST_FOR_EACH_ENTRY_SAFE( s, cursor2, &editor->style_list, ME_Style, entry )
3209  ME_DestroyStyle( s );
3210 
3212  for (i=0; i<HFONT_CACHE_SIZE; i++)
3213  {
3214  if (editor->pFontCache[i].hFont)
3215  DeleteObject(editor->pFontCache[i].hFont);
3216  }
3217  if (editor->rgbBackColor != -1)
3218  DeleteObject(editor->hbrBackground);
3219  if(editor->lpOleCallback)
3220  IRichEditOleCallback_Release(editor->lpOleCallback);
3221  ITextHost_Release(editor->texthost);
3222  if (editor->reOle)
3223  {
3224  IUnknown_Release(editor->reOle);
3225  editor->reOle = NULL;
3226  }
3227  OleUninitialize();
3228 
3229  heap_free(editor->pBuffer);
3230  heap_free(editor->pCursors);
3231  heap_free(editor);
3232 }
struct list style_list
Definition: editstr.h:449
IUnknown * reOle
Definition: editstr.h:388
void ME_DestroyStyle(ME_Style *item) DECLSPEC_HIDDEN
Definition: style.c:442
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
void ME_ClearTempStyle(ME_TextEditor *editor) DECLSPEC_HIDDEN
Definition: style.c:523
ME_DisplayItem * pFirst
Definition: editstr.h:272
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HBRUSH hbrBackground
Definition: editstr.h:402
void ME_DestroyDisplayItem(ME_DisplayItem *item) DECLSPEC_HIDDEN
Definition: list.c:160
ME_TextBuffer * pBuffer
Definition: editstr.h:390
smooth NULL
Definition: ftsmooth.c:416
void destroy_para(ME_TextEditor *editor, ME_DisplayItem *item) DECLSPEC_HIDDEN
Definition: para.c:48
ME_FontCacheItem pFontCache[HFONT_CACHE_SIZE]
Definition: editstr.h:414
ME_Style * pDefaultStyle
Definition: editstr.h:274
void ME_ReleaseStyle(ME_Style *item) DECLSPEC_HIDDEN
Definition: style.c:462
ITextHost * texthost
Definition: editstr.h:387
COLORREF rgbBackColor
Definition: editstr.h:401
uint32_t entry
Definition: isohybrid.c:63
GLdouble s
Definition: gl.h:2039
LPRICHEDITOLECALLBACK lpOleCallback
Definition: editstr.h:422
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
ME_Cursor * pCursors
Definition: editstr.h:391
#define HFONT_CACHE_SIZE
Definition: editstr.h:73
GLfloat GLfloat p
Definition: glext.h:8902
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:230
void ME_EmptyUndoStack(ME_TextEditor *editor) DECLSPEC_HIDDEN
Definition: undo.c:53
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by ITextServicesImpl_Release(), and ME_HandleMessage().

◆ ME_DestroyString()

void ME_DestroyString ( ME_String s)

Definition at line 96 of file string.c.

97 {
98  if (!s) return;
99  if (s->free) s->free( s );
100  heap_free( s );
101 }
GLdouble s
Definition: gl.h:2039
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by destroy_para(), destroy_undo_item(), draw_text(), ME_CharFromPointContext(), ME_GetRunSizeCommon(), ME_PointFromCharContext(), and para_num_clear().

◆ ME_DestroyStyle()

void ME_DestroyStyle ( ME_Style item)

Definition at line 442 of file style.c.

443 {
444  list_remove( &s->entry );
445  if (s->font_cache)
446  {
447  release_font_cache( s->font_cache );
448  s->font_cache = NULL;
449  }
450  ScriptFreeCache( &s->script_cache );
451  heap_free(s);
452 }
static void release_font_cache(ME_FontCacheItem *item)
Definition: style.c:360
smooth NULL
Definition: ftsmooth.c:416
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
GLdouble s
Definition: gl.h:2039
HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc)
Definition: usp10.c:1080
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by ME_DestroyEditor(), and ME_ReleaseStyle().

◆ ME_DrawOLE()

void ME_DrawOLE ( ME_Context c,
int  x,
int  y,
ME_Run run,
BOOL  selected 
)

Definition at line 5804 of file richole.c.

5805 {
5806  IDataObject* ido;
5807  FORMATETC fmt;
5808  STGMEDIUM stgm;
5809  DIBSECTION dibsect;
5810  ENHMETAHEADER emh;
5811  HDC hMemDC;
5812  SIZE sz;
5813  BOOL has_size;
5814  HBITMAP old_bm;
5815  RECT rc;
5816 
5817  assert(run->nFlags & MERF_GRAPHICS);
5818  assert(run->reobj);
5819  if (IOleObject_QueryInterface(run->reobj->obj.poleobj, &IID_IDataObject, (void**)&ido) != S_OK)
5820  {
5821  FIXME("Couldn't get interface\n");
5822  return;
5823  }
5824  has_size = run->reobj->obj.sizel.cx != 0 || run->reobj->obj.sizel.cy != 0;
5825  fmt.cfFormat = CF_BITMAP;
5826  fmt.ptd = NULL;
5827  fmt.dwAspect = DVASPECT_CONTENT;
5828  fmt.lindex = -1;
5829  fmt.tymed = TYMED_GDI;
5830  if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
5831  {
5832  fmt.cfFormat = CF_ENHMETAFILE;
5833  fmt.tymed = TYMED_ENHMF;
5834  if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
5835  {
5836  FIXME("Couldn't get storage medium\n");
5837  IDataObject_Release(ido);
5838  return;
5839  }
5840  }
5841  IDataObject_Release(ido);
5842 
5843  switch (stgm.tymed)
5844  {
5845  case TYMED_GDI:
5846  GetObjectW(stgm.u.hBitmap, sizeof(dibsect), &dibsect);
5847  hMemDC = CreateCompatibleDC(c->hDC);
5848  old_bm = SelectObject(hMemDC, stgm.u.hBitmap);
5849  if (has_size)
5850  {
5851  convert_sizel(c, &run->reobj->obj.sizel, &sz);
5852  } else {
5853  sz.cx = dibsect.dsBm.bmWidth;
5854  sz.cy = dibsect.dsBm.bmHeight;
5855  }
5856  if (c->editor->nZoomNumerator != 0)
5857  {
5858  sz.cx = MulDiv(sz.cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5859  sz.cy = MulDiv(sz.cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5860  }
5861  StretchBlt(c->hDC, x, y - sz.cy, sz.cx, sz.cy,
5862  hMemDC, 0, 0, dibsect.dsBm.bmWidth, dibsect.dsBm.bmHeight, SRCCOPY);
5863 
5864  SelectObject(hMemDC, old_bm);
5865  DeleteDC(hMemDC);
5866  break;
5867  case TYMED_ENHMF:
5868  GetEnhMetaFileHeader(stgm.u.hEnhMetaFile, sizeof(emh), &emh);
5869  if (has_size)
5870  {
5871  convert_sizel(c, &run->reobj->obj.sizel, &sz);
5872  } else {
5873  sz.cx = emh.rclBounds.right - emh.rclBounds.left;
5874  sz.cy = emh.rclBounds.bottom - emh.rclBounds.top;
5875  }
5876  if (c->editor->nZoomNumerator != 0)
5877  {
5878  sz.cx = MulDiv(sz.cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5879  sz.cy = MulDiv(sz.cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5880  }
5881 
5882  rc.left = x;
5883  rc.top = y - sz.cy;
5884  rc.right = x + sz.cx;
5885  rc.bottom = y;
5886  PlayEnhMetaFile(c->hDC, stgm.u.hEnhMetaFile, &rc);
5887  break;
5888  default:
5889  FIXME("Unsupported tymed %d\n", stgm.tymed);
5890  selected = FALSE;
5891  break;
5892  }
5893  ReleaseStgMedium(&stgm);
5894 
5895  if (selected && !c->editor->bHideSelection)
5896  PatBlt(c->hDC, x, y - sz.cy, sz.cx, sz.cy, DSTINVERT);
5897 }
#define CF_ENHMETAFILE
Definition: constants.h:409
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
struct re_object * reobj
Definition: editstr.h:172
static HDC
Definition: imagelist.c:92
#define MERF_GRAPHICS
Definition: editstr.h:109
const char * fmt
Definition: wsprintf.c:30
LONG top
Definition: windef.h:307
long bottom
Definition: polytest.cpp:53
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
#define assert(x)
Definition: debug.h:53
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
const GUID IID_IDataObject
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
long right
Definition: polytest.cpp:53
unsigned int BOOL
Definition: ntddk_ex.h:94
long top
Definition: polytest.cpp:53
static char selected[MAX_PATH+1]
Definition: dirdlg.c:7
#define FIXME(fmt,...)
Definition: debug.h:110
#define CF_BITMAP
Definition: constants.h:397
smooth NULL
Definition: ftsmooth.c:416
LONG cx
Definition: windef.h:334
long left
Definition: polytest.cpp:53
#define DSTINVERT
Definition: wingdi.h:326
BOOL WINAPI PlayEnhMetaFile(_In_ HDC, _In_ HENHMETAFILE, _In_ LPCRECT)
const GLubyte * c
Definition: glext.h:8905
int nFlags
Definition: editstr.h:169
UINT WINAPI GetEnhMetaFileHeader(_In_ HENHMETAFILE hemf, _In_ UINT nSize, _Out_writes_bytes_opt_(nSize) LPENHMETAHEADER lpEnhMetaHeader)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
RECTL rclBounds
Definition: wingdi.h:2321
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI DeleteDC(_In_ HDC)
BITMAP dsBm
Definition: wingdi.h:1668
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
static void convert_sizel(const ME_Context *c, const SIZEL *szl, SIZE *sz)
Definition: richole.c:5715
LONG bottom
Definition: windef.h:309
static HBITMAP
Definition: button.c:44
LONG cy
Definition: windef.h:335
Definition: dsound.c:943
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
#define SRCCOPY
Definition: wingdi.h:332

Referenced by ME_DrawRun().

◆ ME_DumpDocument()

void ME_DumpDocument ( ME_TextBuffer buffer)

Definition at line 187 of file list.c.

188 {
189  /* FIXME this is useless, */
190  ME_DisplayItem *pItem = buffer->pFirst;
191  TRACE("DOCUMENT DUMP START\n");
192  while(pItem) {
193  switch(pItem->type)
194  {
195  case diTextStart:
196  TRACE("Start\n");
197  break;
198  case diCell:
199  TRACE("Cell(level=%d%s)\n", pItem->member.cell.nNestingLevel,
200  !pItem->member.cell.next_cell ? ", END" :
201  (!pItem->member.cell.prev_cell ? ", START" :""));
202  break;
203  case diParagraph:
204  TRACE("Paragraph(ofs=%d)\n", pItem->member.para.nCharOfs);
205  if (pItem->member.para.nFlags & MEPF_ROWSTART)
206  TRACE(" - (Table Row Start)\n");
207  if (pItem->member.para.nFlags & MEPF_ROWEND)
208  TRACE(" - (Table Row End)\n");
209  break;
210  case diStartRow:
211  TRACE(" - StartRow\n");
212  break;
213  case diRun:
214  TRACE(" - Run(%s, %d, flags=%x)\n", debugstr_run( &pItem->member.run ),
215  pItem->member.run.nCharOfs, pItem->member.run.nFlags);
216  break;
217  case diTextEnd:
218  TRACE("End(ofs=%d)\n", pItem->member.para.nCharOfs);
219  break;
220  default:
221  break;
222  }
223  pItem = pItem->next;
224  }
225  TRACE("DOCUMENT DUMP END\n");
226 }
ME_DIType type
Definition: editstr.h:260
#define MEPF_ROWEND
Definition: editstr.h:149
ME_Paragraph para
Definition: editstr.h:266
GLuint buffer
Definition: glext.h:5915
int nCharOfs
Definition: editstr.h:166
int nNestingLevel
Definition: editstr.h:227
static const char * debugstr_run(const ME_Run *run)
Definition: editor.h:46
struct tagME_DisplayItem * next
Definition: editstr.h:261
Definition: editstr.h:91
#define TRACE(s)
Definition: solgame.cpp:4
int nFlags
Definition: editstr.h:169
#define MEPF_ROWSTART
Definition: editstr.h:148
Definition: editstr.h:90
ME_Cell cell
Definition: editstr.h:265
struct tagME_DisplayItem * next_cell
Definition: editstr.h:233
union tagME_DisplayItem::@521 member
struct tagME_DisplayItem * prev_cell
Definition: editstr.h:233

Referenced by ME_CheckCharOffsets(), and ME_CheckTablesForCorruption().

◆ ME_DumpParaStyle()

void ME_DumpParaStyle ( ME_Paragraph s)

◆ ME_DumpParaStyleToBuf()

void ME_DumpParaStyleToBuf ( const PARAFORMAT2 pFmt,
char  buf[2048] 
)

Definition at line 819 of file para.c.

820 {
821  char *p;
822  p = buf;
823 
824 #define DUMP(mask, name, fmt, field) \
825  if (pFmt->dwMask & (mask)) p += sprintf(p, "%-22s" fmt "\n", name, pFmt->field); \
826  else p += sprintf(p, "%-22sN/A\n", name);
827 
828 /* we take for granted that PFE_xxx is the hiword of the corresponding PFM_xxx */
829 #define DUMP_EFFECT(mask, name) \
830  p += sprintf(p, "%-22s%s\n", name, (pFmt->dwMask & (mask)) ? ((pFmt->wEffects & ((mask) >> 16)) ? "yes" : "no") : "N/A");
831 
832  DUMP(PFM_NUMBERING, "Numbering:", "%u", wNumbering);
833  DUMP_EFFECT(PFM_DONOTHYPHEN, "Disable auto-hyphen:");
834  DUMP_EFFECT(PFM_KEEP, "No page break in para:");
835  DUMP_EFFECT(PFM_KEEPNEXT, "No page break in para & next:");
836  DUMP_EFFECT(PFM_NOLINENUMBER, "No line number:");
837  DUMP_EFFECT(PFM_NOWIDOWCONTROL, "No widow & orphan:");
838  DUMP_EFFECT(PFM_PAGEBREAKBEFORE, "Page break before:");
839  DUMP_EFFECT(PFM_RTLPARA, "RTL para:");
840  DUMP_EFFECT(PFM_SIDEBYSIDE, "Side by side:");
841  DUMP_EFFECT(PFM_TABLE, "Table:");
842  DUMP(PFM_OFFSETINDENT, "Offset indent:", "%d", dxStartIndent);
843  DUMP(PFM_STARTINDENT, "Start indent:", "%d", dxStartIndent);
844  DUMP(PFM_RIGHTINDENT, "Right indent:", "%d", dxRightIndent);
845  DUMP(PFM_OFFSET, "Offset:", "%d", dxOffset);
846  if (pFmt->dwMask & PFM_ALIGNMENT) {
847  switch (pFmt->wAlignment) {
848  case PFA_LEFT : p += sprintf(p, "Alignment: left\n"); break;
849  case PFA_RIGHT : p += sprintf(p, "Alignment: right\n"); break;
850  case PFA_CENTER : p += sprintf(p, "Alignment: center\n"); break;
851  case PFA_JUSTIFY: p += sprintf(p, "Alignment: justify\n"); break;
852  default : p += sprintf(p, "Alignment: incorrect %d\n", pFmt->wAlignment); break;
853  }
854  }
855  else p += sprintf(p, "Alignment: N/A\n");
856  DUMP(PFM_TABSTOPS, "Tab Stops:", "%d", cTabCount);
857  if (pFmt->dwMask & PFM_TABSTOPS) {
858  int i;
859  p += sprintf(p, "\t");
860  for (i = 0; i < pFmt->cTabCount; i++) p += sprintf(p, "%x ", pFmt->rgxTabs[i]);
861  p += sprintf(p, "\n");
862  }
863  DUMP(PFM_SPACEBEFORE, "Space Before:", "%d", dySpaceBefore);
864  DUMP(PFM_SPACEAFTER, "Space After:", "%d", dySpaceAfter);
865  DUMP(PFM_LINESPACING, "Line spacing:", "%d", dyLineSpacing);
866  DUMP(PFM_STYLE, "Text style:", "%d", sStyle);
867  DUMP(PFM_LINESPACING, "Line spacing rule:", "%u", bLineSpacingRule);
868  /* bOutlineLevel should be 0 */
869  DUMP(PFM_SHADING, "Shading Weight:", "%u", wShadingWeight);
870  DUMP(PFM_SHADING, "Shading Style:", "%u", wShadingStyle);
871  DUMP(PFM_NUMBERINGSTART, "Numbering Start:", "%u", wNumberingStart);
872  DUMP(PFM_NUMBERINGSTYLE, "Numbering Style:", "0x%x", wNumberingStyle);
873  DUMP(PFM_NUMBERINGTAB, "Numbering Tab:", "%u", wNumberingStyle);
874  DUMP(PFM_BORDER, "Border Space:", "%u", wBorderSpace);
875  DUMP(PFM_BORDER, "Border Width:", "%u", wBorderWidth);
876  DUMP(PFM_BORDER, "Borders:", "%u", wBorders);
877 
878 #undef DUMP
879 #undef DUMP_EFFECT
880 }
#define PFA_RIGHT
Definition: richedit.h:922
#define PFM_SPACEBEFORE
Definition: richedit.h:847
#define PFM_RTLPARA
Definition: richedit.h:856
#define PFM_BORDER
Definition: richedit.h:851
#define PFM_STYLE
Definition: richedit.h:850
#define PFM_SIDEBYSIDE
Definition: richedit.h:863
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define PFM_NUMBERINGSTYLE
Definition: richedit.h:853
#define PFM_TABSTOPS
Definition: richedit.h:842
#define PFM_NUMBERINGSTART
Definition: richedit.h:855
WORD wAlignment
Definition: richedit.h:673
#define PFM_SPACEAFTER
Definition: richedit.h:848
#define PFM_ALIGNMENT
Definition: richedit.h:841
SHORT cTabCount
Definition: richedit.h:674
#define PFM_LINESPACING
Definition: richedit.h:849
#define PFM_NUMBERING
Definition: richedit.h:843
LONG rgxTabs[MAX_TAB_STOPS]
Definition: richedit.h:675
#define PFM_OFFSETINDENT
Definition: richedit.h:844
#define sprintf(buf, format,...)
Definition: sprintf.c:55
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define PFM_STARTINDENT
Definition: richedit.h:838
DWORD dwMask
Definition: richedit.h:667
#define PFA_CENTER
Definition: richedit.h:923
#define PFM_NOWIDOWCONTROL
Definition: richedit.h:861
#define PFM_TABLE
Definition: richedit.h:870
#define PFM_SHADING
Definition: richedit.h:852
#define PFM_RIGHTINDENT
Definition: richedit.h:839
#define PFM_KEEPNEXT
Definition: richedit.h:858
#define PFM_DONOTHYPHEN
Definition: richedit.h:862
#define PFM_NOLINENUMBER
Definition: richedit.h:860
#define DUMP_EFFECT(mask, name)
#define PFM_NUMBERINGTAB
Definition: richedit.h:854
#define PFA_JUSTIFY
Definition: richedit.h:924
#define PFM_KEEP
Definition: richedit.h:857
#define PFA_LEFT
Definition: richedit.h:921
GLfloat GLfloat p
Definition: glext.h:8902
#define PFM_OFFSET
Definition: richedit.h:840
#define DUMP(mask, name, fmt, field)
#define PFM_PAGEBREAKBEFORE
Definition: richedit.h:859

◆ ME_DumpStyle()

void ME_DumpStyle ( ME_Style s)

Definition at line 243 of file style.c.

244 {
245  char buf[2048];
246  ME_DumpStyleToBuf(&s->fmt, buf);
247  TRACE_(richedit_style)("%s\n", buf);
248 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define TRACE_(x)
Definition: compat.h:66
void ME_DumpStyleToBuf(CHARFORMAT2W *pFmt, char buf[2048])
Definition: style.c:250
GLdouble s
Definition: gl.h:2039

◆ ME_DumpStyleToBuf()

void ME_DumpStyleToBuf ( CHARFORMAT2W pFmt,
char  buf[2048] 
)

Definition at line 250 of file style.c.

251 {
252  /* FIXME only CHARFORMAT styles implemented */
253  /* this function sucks, doesn't check for buffer overruns but it's "good enough" as for debug code */
254  char *p;
255  p = buf;
256  p += sprintf(p, "Font face: ");
257  if (pFmt->dwMask & CFM_FACE) {
258  WCHAR *q = pFmt->szFaceName;
259  while(*q) {
260  *p++ = (*q > 255) ? '?' : *q;
261  q++;
262  }
263  } else
264  p += sprintf(p, "N/A");
265 
266  if (pFmt->dwMask & CFM_SIZE)
267  p += sprintf(p, "\nFont size: %d\n", pFmt->yHeight);
268  else
269  p += sprintf(p, "\nFont size: N/A\n");
270 
271  if (pFmt->dwMask & CFM_OFFSET)
272  p += sprintf(p, "Char offset: %d\n", pFmt->yOffset);
273  else
274  p += sprintf(p, "Char offset: N/A\n");
275 
276  if (pFmt->dwMask & CFM_CHARSET)
277  p += sprintf(p, "Font charset: %d\n", (int)pFmt->bCharSet);
278  else
279  p += sprintf(p, "Font charset: N/A\n");
280 
281  /* I'm assuming CFM_xxx and CFE_xxx are the same values, fortunately it IS true wrt used flags*/
282  ME_DumpStyleEffect(&p, "Font bold:", pFmt, CFM_BOLD);
283  ME_DumpStyleEffect(&p, "Font italic:", pFmt, CFM_ITALIC);
284  ME_DumpStyleEffect(&p, "Font underline:", pFmt, CFM_UNDERLINE);
285  ME_DumpStyleEffect(&p, "Font strikeout:", pFmt, CFM_STRIKEOUT);
286  ME_DumpStyleEffect(&p, "Hidden text:", pFmt, CFM_HIDDEN);
287  p += sprintf(p, "Text color: ");
288  if (pFmt->dwMask & CFM_COLOR)
289  {
290  if (pFmt->dwEffects & CFE_AUTOCOLOR)
291  p += sprintf(p, "auto\n");
292  else
293  p += sprintf(p, "%06x\n", (int)pFmt->crTextColor);
294  }
295  else
296  p += sprintf(p, "N/A\n");
297  ME_DumpStyleEffect(&p, "Text protected:", pFmt, CFM_PROTECTED);
298 }
#define CFE_AUTOCOLOR
Definition: richedit.h:414
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define CFM_FACE
Definition: richedit.h:360
#define CFM_PROTECTED
Definition: richedit.h:336
#define CFM_ITALIC
Definition: richedit.h:333
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define CFM_COLOR
Definition: richedit.h:361
DWORD dwEffects
Definition: richedit.h:307
#define CFM_UNDERLINE
Definition: richedit.h:334
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CFM_SIZE
Definition: richedit.h:362
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
static void ME_DumpStyleEffect(char **p, const char *name, const CHARFORMAT2W *fmt, int mask)
Definition: style.c:238
#define CFM_OFFSET
Definition: richedit.h:359
WCHAR szFaceName[LF_FACESIZE]
Definition: richedit.h:313
#define CFM_STRIKEOUT
Definition: richedit.h:335
COLORREF crTextColor
Definition: richedit.h:310
#define CFM_HIDDEN
Definition: richedit.h:340
#define CFM_BOLD
Definition: richedit.h:332
BYTE bCharSet
Definition: richedit.h:311
DWORD dwMask
Definition: richedit.h:306
GLfloat GLfloat p
Definition: glext.h:8902
LONG yHeight
Definition: richedit.h:308
#define CFM_CHARSET
Definition: richedit.h:358
LONG yOffset
Definition: richedit.h:309

Referenced by ME_DumpStyle(), and ME_KeyDown().

◆ ME_EmptyUndoStack()

void ME_EmptyUndoStack ( ME_TextEditor editor)

Definition at line 53 of file undo.c.

54 {
55  struct undo_item *cursor, *cursor2;
56  if (editor->nUndoMode == umIgnore)
57  return;
58 
59  TRACE("Emptying undo stack\n");
60 
61  editor->nUndoStackSize = 0;
62 
63  LIST_FOR_EACH_ENTRY_SAFE( cursor, cursor2, &editor->undo_stack, struct undo_item, entry )
64  {
65  list_remove( &cursor->entry );
67  }
68 
69  empty_redo_stack( editor );
70 }
static void empty_redo_stack(ME_TextEditor *editor)
Definition: undo.c:43
int nUndoStackSize
Definition: editstr.h:408
struct list undo_stack
Definition: editstr.h:406
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
static void destroy_undo_item(struct undo_item *undo)
Definition: undo.c:25
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
const char cursor[]
Definition: icontest.c:13
ME_UndoMode nUndoMode
Definition: editstr.h:410

Referenced by add_undo_insert_run(), fnTextSrv_TxSetText(), ME_DestroyEditor(), ME_HandleMessage(), ME_ReplaceSel(), and ME_StreamIn().

◆ ME_EndToUnicode()

void ME_EndToUnicode ( LONG  codepage,
LPVOID  psz 
)

Definition at line 236 of file string.c.

237 {
238  if (codepage != CP_UNICODE)
239  heap_free( psz );
240 }
int codepage
Definition: win_iconv.c:156
#define CP_UNICODE
Definition: stg_prop.c:74
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by ME_HandleMessage(), and ME_SetText().

◆ ME_EnsureVisible()

void ME_EnsureVisible ( ME_TextEditor editor,
ME_Cursor pCursor 
)

Definition at line 1275 of file paint.c.

1276 {
1277  ME_Run *pRun = &pCursor->pRun->member.run;
1278  ME_DisplayItem *pRow = ME_FindItemBack(pCursor->pRun, diStartRow);
1279  ME_DisplayItem *pPara = pCursor->pPara;
1280  int x, y, yheight;
1281 
1282  assert(pRow);
1283  assert(pPara);
1284 
1285  if (editor->styleFlags & ES_AUTOHSCROLL)
1286  {
1287  x = pRun->pt.x + ME_PointFromChar(editor, pRun, pCursor->nOffset, TRUE);
1288  if (x > editor->horz_si.nPos + editor->sizeWindow.cx)
1289  x = x + 1 - editor->sizeWindow.cx;
1290  else if (x > editor->horz_si.nPos)
1291  x = editor->horz_si.nPos;
1292 
1293  if (~editor->styleFlags & ES_AUTOVSCROLL)
1294  {
1295  ME_HScrollAbs(editor, x);
1296  return;
1297  }
1298  } else {
1299  if (~editor->styleFlags & ES_AUTOVSCROLL)
1300  return;
1301  x = editor->horz_si.nPos;
1302  }
1303 
1304  y = pPara->member.para.pt.y + pRow->member.row.pt.y;
1305  yheight = pRow->member.row.nHeight;
1306 
1307  if (y < editor->vert_si.nPos)
1308  ME_ScrollAbs(editor, x, y);
1309  else if (y + yheight > editor->vert_si.nPos + editor->sizeWindow.cy)
1310  ME_ScrollAbs(editor, x, y + yheight - editor->sizeWindow.cy);
1311  else if (x != editor->horz_si.nPos)
1312  ME_ScrollAbs(editor, x, editor->vert_si.nPos);
1313 }
ME_Paragraph para
Definition: editstr.h:266
#define TRUE
Definition: types.h:120
void ME_ScrollAbs(ME_TextEditor *editor, int x, int y)
Definition: paint.c:1043
long y
Definition: polytest.cpp:48
DWORD styleFlags
Definition: editstr.h:392
long x
Definition: polytest.cpp:48
#define assert(x)
Definition: debug.h:53
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset, BOOL visual_order) DECLSPEC_HIDDEN
Definition: run.c:598
SCROLLINFO vert_si
Definition: editstr.h:443
POINT pt
Definition: editstr.h:243
LONG cx
Definition: windef.h:334
#define ES_AUTOVSCROLL
Definition: pedump.c:671
ME_DisplayItem * pPara
Definition: editstr.h:279
int nOffset
Definition: editstr.h:281
POINT pt
Definition: editstr.h:171
void ME_HScrollAbs(ME_TextEditor *editor, int x)
Definition: paint.c:1106
SCROLLINFO horz_si
Definition: editstr.h:443
ME_DisplayItem * pRun
Definition: editstr.h:280
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
LONG cy
Definition: windef.h:335
#define ES_AUTOHSCROLL
Definition: pedump.c:672
ME_DisplayItem * ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
Definition: list.c:111
union tagME_DisplayItem::@521 member
int nHeight
Definition: editstr.h:238

Referenced by ME_ArrowKey(), ME_HandleMessage(), ME_MouseMove(), and ME_UpdateRepaint().

◆ ME_FindItemBack()

◆ ME_FindItemBackOrHere()

ME_DisplayItem* ME_FindItemBackOrHere ( ME_DisplayItem di,
ME_DIType  nTypeOrClass 
)

Definition at line 124 of file list.c.

125 {
126  while(di!=NULL) {
127  if (ME_DITypesEqual(di->type, nTypeOrClass))
128  return di;
129  di = di->prev;
130  }
131  return NULL;
132 }
ME_DIType type
Definition: editstr.h:260
smooth NULL
Definition: ftsmooth.c:416
static BOOL ME_DITypesEqual(ME_DIType type, ME_DIType nTypeOrClass)
Definition: list.c:45
struct tagME_DisplayItem * prev
Definition: editstr.h:261

Referenced by ME_GetParagraph(), and ME_RowStart().

◆ ME_FindItemFwd()

ME_DisplayItem* ME_FindItemFwd ( ME_DisplayItem di,
ME_DIType  nTypeOrClass 
)

Definition at line 134 of file list.c.

135 {
136  if (!di) return NULL;
137  di = di->next;
138  while(di!=NULL) {
139  if (ME_DITypesEqual(di->type, nTypeOrClass))
140  return di;
141  di = di->next;
142  }
143  return NULL;
144 }
ME_DIType type
Definition: editstr.h:260
struct tagME_DisplayItem * next
Definition: editstr.h:261