ReactOS  0.4.13-dev-259-g5ca9c9c
editor.h File Reference
#include "editstr.h"
#include "wine/unicode.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
 
HFONT ME_SelectStyleFont (ME_Context *c, ME_Style *s) DECLSPEC_HIDDEN
 
void ME_UnselectStyleFont (ME_Context *c, ME_Style *s, HFONT hOldFont) 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 ME_SetSelection (ME_TextEditor *editor, int from, int to) DECLSPEC_HIDDEN
 
BOOL ME_MoveCursorWords (ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs) DECLSPEC_HIDDEN
 
void ME_HideCaret (ME_TextEditor *ed) DECLSPEC_HIDDEN
 
void ME_ShowCaret (ME_TextEditor *ed) DECLSPEC_HIDDEN
 
void ME_MoveCaret (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
 
void ME_GetITextDocument2OldInterface (IRichEditOle *iface, LPVOID *ppvObj) 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
 
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 97 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:173

Definition at line 33 of file editor.h.

◆ ITextHost_OnTxCharFormatChange

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

Definition at line 320 of file editor.h.

◆ ITextHost_OnTxParaFormatChange

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

Definition at line 321 of file editor.h.

◆ ITextHost_TxActivate

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

Definition at line 307 of file editor.h.

◆ ITextHost_TxClientToScreen

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

Definition at line 306 of file editor.h.

◆ ITextHost_TxCreateCaret

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

Definition at line 296 of file editor.h.

◆ ITextHost_TxDeactivate

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

Definition at line 308 of file editor.h.

◆ ITextHost_TxEnableScrollBar

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

Definition at line 291 of file editor.h.

◆ ITextHost_TxGetAcceleratorPos

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

Definition at line 318 of file editor.h.

◆ ITextHost_TxGetBackStyle

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

Definition at line 314 of file editor.h.

◆ ITextHost_TxGetCharFormat

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

Definition at line 311 of file editor.h.

◆ ITextHost_TxGetClientRect

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

Definition at line 309 of file editor.h.

◆ ITextHost_TxGetDC

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

Definition at line 288 of file editor.h.

◆ ITextHost_TxGetExtent

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

Definition at line 319 of file editor.h.

◆ ITextHost_TxGetMaxLength

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

Definition at line 315 of file editor.h.

◆ ITextHost_TxGetParaFormat

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

Definition at line 312 of file editor.h.

◆ ITextHost_TxGetPasswordChar

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

Definition at line 317 of file editor.h.

◆ ITextHost_TxGetPropertyBits

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

Definition at line 322 of file editor.h.

◆ ITextHost_TxGetScrollBars

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

Definition at line 316 of file editor.h.

◆ ITextHost_TxGetSelectionBarWidth

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

Definition at line 326 of file editor.h.

◆ ITextHost_TxGetSysColor

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

Definition at line 313 of file editor.h.

◆ ITextHost_TxGetViewInset

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

Definition at line 310 of file editor.h.

◆ ITextHost_TxImmGetContext

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

Definition at line 324 of file editor.h.

◆ ITextHost_TxImmReleaseContext

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

Definition at line 325 of file editor.h.

◆ ITextHost_TxInvalidateRect

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

Definition at line 294 of file editor.h.

◆ ITextHost_TxKillTimer

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

Definition at line 300 of file editor.h.

◆ ITextHost_TxNotify

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

Definition at line 323 of file editor.h.

◆ ITextHost_TxReleaseDC

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

Definition at line 289 of file editor.h.

◆ ITextHost_TxScreenToClient

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

Definition at line 305 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 301 of file editor.h.

◆ ITextHost_TxSetCapture

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

Definition at line 302 of file editor.h.

◆ ITextHost_TxSetCaretPos

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

Definition at line 298 of file editor.h.

◆ ITextHost_TxSetCursor

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

Definition at line 304 of file editor.h.

◆ ITextHost_TxSetFocus

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

Definition at line 303 of file editor.h.

◆ ITextHost_TxSetScrollPos

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

Definition at line 293 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 292 of file editor.h.

◆ ITextHost_TxSetTimer

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

Definition at line 299 of file editor.h.

◆ ITextHost_TxShowCaret

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

Definition at line 297 of file editor.h.

◆ ITextHost_TxShowScrollBar

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

Definition at line 290 of file editor.h.

◆ ITextHost_TxViewChange

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

Definition at line 295 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 30 of file editor.h.

◆ TXTHOST_VTABLE

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

Definition at line 285 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
union tagME_DisplayItem::@503 member
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

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::@504 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::@504 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:435
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::@504 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::@504 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::@504 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::@504 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  return TRUE;
89  }
90  if (to->cbSize == sizeof(CHARFORMATW))
91  {
92  CHARFORMATW *t = (CHARFORMATW *)to;
93  CopyMemory(t, from, sizeof(*t));
94  t->cbSize = sizeof(*t); /* it was overwritten by CopyMemory */
95  return TRUE;
96  }
97  if (to->cbSize == sizeof(CHARFORMAT2A))
98  {
99  CHARFORMAT2A *t = (CHARFORMAT2A *)to;
100  /* copy the A structure without face name */
101  CopyMemory(t, from, FIELD_OFFSET(CHARFORMATA, szFaceName));
102  /* convert face name */
103  WideCharToMultiByte(CP_ACP, 0, from->szFaceName, -1, t->szFaceName, sizeof(t->szFaceName), NULL, NULL);
104  /* copy the rest of the 2A structure to 2W */
105  CopyMemory(&t->wWeight, &from->wWeight, sizeof(CHARFORMAT2W)-FIELD_OFFSET(CHARFORMAT2W,wWeight));
106  t->cbSize = sizeof(*t); /* it was overwritten by CopyMemory */
107  return TRUE;
108  }
109  if (to->cbSize == sizeof(CHARFORMAT2W))
110  {
111  CopyMemory(to, from, sizeof(CHARFORMAT2W));
112  return TRUE;
113  }
114  return FALSE;
115 }
#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
smooth NULL
Definition: ftsmooth.c:416
#define CopyMemory
Definition: winbase.h:1633
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
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:1635
GLfloat f
Definition: glext.h:7540
#define CopyMemory
Definition: winbase.h:1633
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 ME_HandleMessage(), and ME_MakeFirstParagraph().

◆ CreateIRichEditOle()

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

Definition at line 5693 of file richole.c.

5694 {
5695  IRichEditOleImpl *reo;
5696 
5697  reo = heap_alloc(sizeof(IRichEditOleImpl));
5698  if (!reo)
5699  return 0;
5700 
5701  reo->IUnknown_inner.lpVtbl = &reo_unk_vtbl;
5702  reo->IRichEditOle_iface.lpVtbl = &revt;
5703  reo->ITextDocument2Old_iface.lpVtbl = &tdvt;
5704  reo->ref = 1;
5705  reo->editor = editor;
5706  reo->txtSel = NULL;
5707 
5708  TRACE("Created %p\n",reo);
5709  list_init(&reo->rangelist);
5710  list_init(&reo->clientsites);
5711  if (outer_unk)
5712  reo->outer_unk = outer_unk;
5713  else
5714  reo->outer_unk = &reo->IUnknown_inner;
5715  *ppvObj = &reo->IRichEditOle_iface;
5716 
5717  return 1;
5718 }
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:4555
struct list rangelist
Definition: richole.c:219
IRichEditOle IRichEditOle_iface
Definition: richole.c:211
static const IRichEditOleVtbl revt
Definition: richole.c:1500
__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 47 of file editor.h.

48 {
49  return debugstr_wn( get_text( run, 0 ), run->len );
50 }
int len
Definition: editstr.h:167
static WCHAR * get_text(const ME_Run *run, int offset)
Definition: editor.h:42
#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:443
#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
union tagME_DisplayItem::@503 member
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

Referenced by destroy_para(), and ME_WrapMarkedParagraphs().

◆ 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
union tagME_DisplayItem::@503 member
#define MEPF_REWRAP
Definition: editstr.h:145

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 435 of file style.c.

436 {
437  assert(s->nRefs>0); /* style with 0 references isn't supposed to exist */
438  s->nRefs++;
439  all_refs++;
440  TRACE_(richedit_style)("ME_AddRefStyle %p, new refs=%d, total refs=%d\n", s, s->nRefs, all_refs);
441 }
#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
union tagME_DisplayItem::@503 member
void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, const WCHAR *str, int len, ME_Style *style)
Definition: caret.c:536
#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

Referenced by handle_enter(), and ME_SelectOrInsertNextCell().

◆ ME_ApplyStyle()

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

Definition at line 152 of file style.c.

153 {
154  CHARFORMAT2W fmt = sSrc->fmt;
155  ME_Style *s;
156 
157  assert(mod->cbSize == sizeof(CHARFORMAT2W));
158  COPY_STYLE_ITEM(CFM_ANIMATION, bAnimation);
159  COPY_STYLE_ITEM(CFM_BACKCOLOR, crBackColor);
160  COPY_STYLE_ITEM(CFM_CHARSET, bCharSet);
161  COPY_STYLE_ITEM(CFM_COLOR, crTextColor);
162  COPY_STYLE_ITEM_MEMCPY(CFM_FACE, szFaceName);
163  COPY_STYLE_ITEM(CFM_KERNING, wKerning);
164  COPY_STYLE_ITEM(CFM_LCID, lcid);
166  COPY_STYLE_ITEM(CFM_REVAUTHOR, bRevAuthor);
167  if (mod->dwMask & CFM_SIZE) {
168  fmt.dwMask |= CFM_SIZE;
169  fmt.yHeight = min(mod->yHeight, yHeightCharPtsMost * 20);
170  }
171  COPY_STYLE_ITEM(CFM_SPACING, sSpacing);
172  COPY_STYLE_ITEM(CFM_STYLE, sStyle);
173  COPY_STYLE_ITEM(CFM_WEIGHT, wWeight);
174  /* FIXME: this is not documented this way, but that's the more logical */
175  COPY_STYLE_ITEM(CFM_FACE, bPitchAndFamily);
176 
177  fmt.dwEffects &= ~(mod->dwMask);
178  fmt.dwEffects |= mod->dwEffects & mod->dwMask;
179  fmt.dwMask |= mod->dwMask;
180  if (mod->dwMask & CFM_COLOR)
181  {
182  if (mod->dwEffects & CFE_AUTOCOLOR)
183  fmt.dwEffects |= CFE_AUTOCOLOR;
184  else
185  fmt.dwEffects &= ~CFE_AUTOCOLOR;
186  }
187 
188  COPY_STYLE_ITEM(CFM_UNDERLINETYPE, bUnderlineType);
189  /* If the CFM_UNDERLINE effect is not specified, set it appropriately */
190  if ((mod->dwMask & CFM_UNDERLINETYPE) && !(mod->dwMask & CFM_UNDERLINE))
191  {
192  fmt.dwMask |= CFM_UNDERLINE;
193  if (mod->bUnderlineType == CFU_UNDERLINENONE)
194  fmt.dwEffects &= ~CFE_UNDERLINE;
195  else
196  fmt.dwEffects |= CFE_UNDERLINE;
197  }
198 
199  if (mod->dwMask & CFM_BOLD && !(mod->dwMask & CFM_WEIGHT))
200  {
201  fmt.wWeight = (mod->dwEffects & CFE_BOLD) ? FW_BOLD : FW_NORMAL;
202  } else if (mod->dwMask & CFM_WEIGHT && !(mod->dwMask & CFM_BOLD)) {
203  if (mod->wWeight > FW_NORMAL)
204  fmt.dwEffects |= CFE_BOLD;
205  else
206  fmt.dwEffects &= ~CFE_BOLD;
207  }
208 
209  LIST_FOR_EACH_ENTRY(s, &editor->style_list, ME_Style, entry)
210  {
211  if (!memcmp( &s->fmt, &fmt, sizeof(fmt) ))
212  {
213  TRACE_(richedit_style)("found existing style %p\n", s);
214  ME_AddRefStyle( s );
215  return s;
216  }
217  }
218 
219  s = ME_MakeStyle( &fmt );
220  if (s)
221  list_add_head( &editor->style_list, &s->entry );
222  TRACE_(richedit_style)("created new style %p\n", s);
223  return s;
224 }
#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:134
#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:435
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:140
#define CFM_UNDERLINETYPE
Definition: richedit.h:355
ME_Style * ME_MakeStyle(CHARFORMAT2W *style)
Definition: style.c:117
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 1573 of file caret.c.

1574 {
1575  int nCursor = 0;
1576  ME_Cursor *p = &editor->pCursors[nCursor];
1577  ME_Cursor tmp_curs = *p;
1578  BOOL success = FALSE;
1579 
1580  ME_CheckCharOffsets(editor);
1581  switch(nVKey) {
1582  case VK_LEFT:
1583  editor->bCaretAtEnd = FALSE;
1584  if (ctrl)
1585  success = ME_MoveCursorWords(editor, &tmp_curs, -1);
1586  else
1587  success = ME_MoveCursorChars(editor, &tmp_curs, -1, extend);
1588  break;
1589  case VK_RIGHT:
1590  editor->bCaretAtEnd = FALSE;
1591  if (ctrl)
1592  success = ME_MoveCursorWords(editor, &tmp_curs, +1);
1593  else
1594  success = ME_MoveCursorChars(editor, &tmp_curs, +1, extend);
1595  break;
1596  case VK_UP:
1597  ME_MoveCursorLines(editor, &tmp_curs, -1, extend);
1598  break;
1599  case VK_DOWN:
1600  ME_MoveCursorLines(editor, &tmp_curs, +1, extend);
1601  break;
1602  case VK_PRIOR:
1603  ME_ArrowPageUp(editor, &tmp_curs);
1604  break;
1605  case VK_NEXT:
1606  ME_ArrowPageDown(editor, &tmp_curs);
1607  break;
1608  case VK_HOME: {
1609  if (ctrl)
1610  ME_ArrowCtrlHome(editor, &tmp_curs);
1611  else
1612  ME_ArrowHome(editor, &tmp_curs);
1613  editor->bCaretAtEnd = FALSE;
1614  break;
1615  }
1616  case VK_END:
1617  if (ctrl)
1618  ME_ArrowCtrlEnd(editor, &tmp_curs);
1619  else
1620  ME_ArrowEnd(editor, &tmp_curs);
1621  break;
1622  }
1623 
1624  if (!extend)
1625  editor->pCursors[1] = tmp_curs;
1626  *p = tmp_curs;
1627 
1628  ME_InvalidateSelection(editor);
1629  ME_Repaint(editor);
1630  ITextHost_TxShowCaret(editor->texthost, FALSE);
1631  ME_EnsureVisible(editor, &tmp_curs);
1632  ME_ShowCaret(editor);
1633  ME_SendSelChange(editor);
1634  return success;
1635 }
void ME_InvalidateSelection(ME_TextEditor *editor) DECLSPEC_HIDDEN
Definition: paint.c:1327
static void ME_ArrowCtrlEnd(ME_TextEditor *editor, ME_Cursor *pCursor)
Definition: caret.c:1515
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:1464
#define VK_LEFT
Definition: winuser.h:2178
void ME_ShowCaret(ME_TextEditor *ed)
Definition: caret.c:285
#define VK_DOWN
Definition: winuser.h:2181
#define VK_PRIOR
Definition: winuser.h:2174
static void ME_MoveCursorLines(ME_TextEditor *editor, ME_Cursor *pCursor, int nRelOfs, BOOL extend)
Definition: caret.c:1266
#define VK_NEXT
Definition: winuser.h:2175
#define VK_HOME
Definition: winuser.h:2177
#define VK_UP
Definition: winuser.h:2179
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ITextHost_TxShowCaret(This, a)
Definition: editor.h:297
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:1490
static void ME_ArrowPageDown(ME_TextEditor *editor, ME_Cursor *pCursor)
Definition: caret.c:1406
#define ctrl
Definition: input.c:1669
BOOL ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs)
Definition: caret.c:740
void ME_SendSelChange(ME_TextEditor *editor)
Definition: caret.c:1541
static void ME_ArrowPageUp(ME_TextEditor *editor, ME_Cursor *pCursor)
Definition: caret.c:1352
#define success(from, fromstr, to, tostr)
#define VK_RIGHT
Definition: winuser.h:2180
void ME_EnsureVisible(ME_TextEditor *editor, ME_Cursor *pCursor) DECLSPEC_HIDDEN
Definition: paint.c:1285
int ME_MoveCursorChars(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs, BOOL final_eop)
Definition: caret.c:661
static void ME_ArrowCtrlHome(ME_TextEditor *editor, ME_Cursor *pCursor)
Definition: caret.c:1484
GLfloat GLfloat p
Definition: glext.h:8902
#define VK_END
Definition: winuser.h:2176

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 108 of file editor.h.

109 {
110  return caseSensitive ? (a == b) : (toupperW(a) == toupperW(b));
111 }
#define b
Definition: ke_i.h:79
WINE_UNICODE_INLINE WCHAR toupperW(WCHAR ch)
Definition: unicode.h:141
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
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 327 of file style.c.

328 {
329  int ry;
330 
333  lstrcpyW(fmt->szFaceName, lf->lfFaceName);
334  fmt->dwEffects = 0;
336  fmt->wWeight = lf->lfWeight;
337  fmt->yHeight = -lf->lfHeight*1440/ry;
338  if (lf->lfWeight > FW_NORMAL) fmt->dwEffects |= CFM_BOLD;
339  if (lf->lfItalic) fmt->dwEffects |= CFM_ITALIC;
340  if (lf->lfUnderline) fmt->dwEffects |= CFM_UNDERLINE;
341  fmt->bUnderlineType = CFU_UNDERLINE;
342  if (lf->lfStrikeOut) fmt->dwEffects |= CFM_STRIKEOUT;
343  fmt->bPitchAndFamily = lf->lfPitchAndFamily;
344  fmt->bCharSet = lf->lfCharSet;
345 }
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:146
#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:406
#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 523 of file run.c.

524 {
525  ME_Context c;
526  int ret;
527 
528  ME_InitContext( &c, editor, ITextHost_TxGetDC( editor->texthost ) );
529  ret = ME_CharFromPointContext( &c, cx, run, closest, visual_order );
531  return ret;
532 }
void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC)
Definition: context.c:23
#define ITextHost_TxGetDC(This)
Definition: editor.h:288
const GLubyte * c
Definition: glext.h:8905
void ME_DestroyContext(ME_Context *c)
Definition: context.c:42
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:570
#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  HGDIOBJ hOldFont;
468  SIZE sz, sz2, sz3;
469  if (!run->len || cx <= 0)
470  return 0;
471 
472  if (run->nFlags & (MERF_TAB | MERF_ENDCELL))
473  {
474  if (!closest || cx < run->nWidth / 2) return 0;
475  return 1;
476  }
477 
478  if (run->nFlags & MERF_GRAPHICS)
479  {
480  SIZE sz;
481  ME_GetOLEObjectSize(c, run, &sz);
482  if (!closest || cx < sz.cx / 2) return 0;
483  return 1;
484  }
485 
486  if (run->para->nFlags & MEPF_COMPLEX)
487  {
488  int cp, trailing;
489  if (visual_order && run->script_analysis.fRTL) cx = run->nWidth - cx - 1;
490 
491  ScriptXtoCP( cx, run->len, run->num_glyphs, run->clusters, run->vis_attrs, run->advances, &run->script_analysis,
492  &cp, &trailing );
493  TRACE("x %d cp %d trailing %d (run width %d) rtl %d log order %d\n", cx, cp, trailing, run->nWidth,
495  return closest ? cp + trailing : cp;
496  }
497 
498  if (c->editor->cPasswordMask)
499  {
500  mask_text = ME_MakeStringR( c->editor->cPasswordMask, run->len );
501  str = mask_text->szData;
502  }
503  else
504  str = get_text( run, 0 );
505 
506  hOldFont = ME_SelectStyleFont(c, run->style);
507  GetTextExtentExPointW(c->hDC, str, run->len,
508  cx, &fit, NULL, &sz);
509  if (closest && fit != run->len)
510  {
511  GetTextExtentPoint32W(c->hDC, str, fit, &sz2);
512  GetTextExtentPoint32W(c->hDC, str, fit + 1, &sz3);
513  if (cx >= (sz2.cx+sz3.cx)/2)
514  fit = fit + 1;
515  }
516 
517  ME_DestroyString( mask_text );
518 
519  ME_UnselectStyleFont(c, run->style, hOldFont);
520  return fit;
521 }
HFONT ME_SelectStyleFont(ME_Context *c, ME_Style *s) DECLSPEC_HIDDEN
Definition: style.c:356
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
void ME_UnselectStyleFont(ME_Context *c, ME_Style *s, HFONT hOldFont) DECLSPEC_HIDDEN
Definition: style.c:416
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:2852
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)
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:5732
LONG cx
Definition: windef.h:319
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:42
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:570
POINT cp
Definition: magnifier.c:61
#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 1063 of file caret.c.

1065 {
1066  RECT rc;
1067  BOOL bResult;
1068 
1069  ITextHost_TxGetClientRect(editor->texthost, &rc);
1070  if (x < 0 || y < 0 || x >= rc.right || y >= rc.bottom) {
1071  if (isExact) *isExact = FALSE;
1072  return FALSE;
1073  }
1074  x += editor->horz_si.nPos;
1075  y += editor->vert_si.nPos;
1076  bResult = ME_FindPixelPos(editor, x, y, cursor, NULL, FALSE);
1077  if (isExact) *isExact = bResult;
1078  return TRUE;
1079 }
#define TRUE
Definition: types.h:120
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define ITextHost_TxGetClientRect(This, a)
Definition: editor.h:309
LONG right
Definition: windef.h:293
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:996
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:294

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
union tagME_DisplayItem::@503 member
#define assert(x)
Definition: debug.h:53
int nCharOfs
Definition: editstr.h:166
Definition: editstr.h:91

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:47
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
union tagME_DisplayItem::@503 member
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

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

◆ ME_ClearTempStyle()

void ME_ClearTempStyle ( ME_TextEditor editor)

Definition at line 504 of file style.c.

505 {
506  if (!editor->pBuffer->pCharStyle) return;
508  editor->pBuffer->pCharStyle = NULL;
509 }
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:443

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_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 226 of file style.c.

227 {
228  /* using this with non-2W structs is forbidden */
229  assert(pSrc->cbSize == sizeof(CHARFORMAT2W));
230  assert(pDest->cbSize == sizeof(CHARFORMAT2W));
231  *pDest = *pSrc;
232 }
#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 5912 of file richole.c.

5913 {
5914  *dst = *src;
5915  dst->poleobj = NULL;
5916  dst->pstg = NULL;
5917  dst->polesite = NULL;
5918 
5919  if ((flags & REO_GETOBJ_POLEOBJ) && src->poleobj)
5920  {
5921  dst->poleobj = src->poleobj;
5922  IOleObject_AddRef(dst->poleobj);
5923  }
5924  if ((flags & REO_GETOBJ_PSTG) && src->pstg)
5925  {
5926  dst->pstg = src->pstg;
5927  IStorage_AddRef(dst->pstg);
5928  }
5929  if ((flags & REO_GETOBJ_POLESITE) && src->polesite)
5930  {
5931  dst->polesite = src->polesite;
5932  IOleClientSite_AddRef(dst->polesite);
5933  }
5934 }
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 46 of file txthost.c.

47 {
48  ITextHostImpl *texthost;
49 
50  texthost = CoTaskMemAlloc(sizeof(*texthost));
51  if (!texthost) return NULL;
52 
53  texthost->ITextHost_iface.lpVtbl = &textHostVtbl;
54  texthost->ref = 1;
55  texthost->hWnd = hwnd;
56  texthost->bEmulateVersion10 = bEmulateVersion10;
57  memset( &texthost->para_fmt, 0, sizeof(texthost->para_fmt) );
58  texthost->para_fmt.cbSize = sizeof(texthost->para_fmt);
59  texthost->para_fmt.dwMask = PFM_ALIGNMENT;
60  texthost->para_fmt.wAlignment = PFA_LEFT;
61  if (cs->style & ES_RIGHT)
62  texthost->para_fmt.wAlignment = PFA_RIGHT;
63  if (cs->style & ES_CENTER)
64  texthost->para_fmt.wAlignment = PFA_CENTER;
65 
66  return &texthost->ITextHost_iface;
67 }
#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:38
HWND hWnd
Definition: txthost.c:39
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:37
PARAFORMAT2 para_fmt
Definition: txthost.c:41
BOOL bEmulateVersion10
Definition: txthost.c:40
static const ITextHostVtbl textHostVtbl
Definition: txthost.c:44
#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:406

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_SetSelection(), ME_StreamIn(), set_textfont_prop(), and textrange_set_font().

◆ ME_DeleteReObject()

void ME_DeleteReObject ( struct re_object re_object)

Definition at line 5904 of file richole.c.

5905 {
5906  if (reobj->obj.poleobj) IOleObject_Release(reobj->obj.poleobj);
5907  if (reobj->obj.pstg) IStorage_Release(reobj->obj.pstg);
5908  if (reobj->obj.polesite) IOleClientSite_Release(reobj->obj.polesite);
5909  heap_free(reobj);
5910 }
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 1527 of file caret.c.

1528 {
1529  int from, to;
1530  int nStartCursor = ME_GetSelectionOfs(editor, &from, &to);
1531  int nEndCursor = nStartCursor ^ 1;
1532  ME_DeleteTextAtCursor(editor, nStartCursor, to - from);
1533  editor->pCursors[nEndCursor] = editor->pCursors[nStartCursor];
1534 }
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:451
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 451 of file caret.c.

452 {
453  assert(nCursor>=0 && nCursor<editor->nCursors);
454  /* text operations set modified state */
455  editor->nModifyStep = 1;
456  return ME_InternalDeleteText(editor, &editor->pCursors[nCursor],
457  nChars, FALSE);
458 }
#define assert(x)
Definition: debug.h:53
BOOL ME_InternalDeleteText(ME_TextEditor *editor, ME_Cursor *start, int nChars, BOOL bForce)
Definition: caret.c:301
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 42 of file context.c.

43 {
44  if (c->hDC) ITextHost_TxReleaseDC(c->editor->texthost, c->hDC);
45 }
#define ITextHost_TxReleaseDC(This, a)
Definition: editor.h:289
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:5904
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:443
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 3188 of file editor.c.

3189 {
3190  ME_DisplayItem *p = editor->pBuffer->pFirst, *pNext = NULL;
3191  ME_Style *s, *cursor2;
3192  int i;
3193 
3194  ME_ClearTempStyle(editor);
3195  ME_EmptyUndoStack(editor);
3196  editor->pBuffer->pFirst = NULL;
3197  while(p) {
3198  pNext = p->next;
3199  if (p->type == diParagraph)
3200  destroy_para(editor, p);
3201  else
3203  p = pNext;
3204  }
3205 
3206  LIST_FOR_EACH_ENTRY_SAFE( s, cursor2, &editor->style_list, ME_Style, entry )
3207  ME_DestroyStyle( s );
3208 
3210  for (i=0; i<HFONT_CACHE_SIZE; i++)
3211  {
3212  if (editor->pFontCache[i].hFont)
3213  DeleteObject(editor->pFontCache[i].hFont);
3214  }
3215  if (editor->rgbBackColor != -1)
3216  DeleteObject(editor->hbrBackground);
3217  if(editor->lpOleCallback)
3218  IRichEditOleCallback_Release(editor->lpOleCallback);
3219  ITextHost_Release(editor->texthost);
3220  if (editor->reOle)
3221  {
3222  IRichEditOle_Release(editor->reOle);
3223  editor->reOle = NULL;
3224  }
3225  OleUninitialize();
3226 
3227  heap_free(editor->pBuffer);
3228  heap_free(editor->pCursors);
3229  heap_free(editor);
3230 }
struct list style_list
Definition: editstr.h:447
void ME_DestroyStyle(ME_Style *item) DECLSPEC_HIDDEN
Definition: style.c:423
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
void ME_ClearTempStyle(ME_TextEditor *editor) DECLSPEC_HIDDEN
Definition: style.c:504
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
IRichEditOle * reOle
Definition: editstr.h:388
void ME_ReleaseStyle(ME_Style *item) DECLSPEC_HIDDEN
Definition: style.c:443
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:233
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 423 of file style.c.

424 {
425  list_remove( &s->entry );
426  if (s->font_cache)
427  {
428  release_font_cache( s->font_cache );
429  s->font_cache = NULL;
430  }
431  ScriptFreeCache( &s->script_cache );
432  heap_free(s);
433 }
static void release_font_cache(ME_FontCacheItem *item)
Definition: style.c:407
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:1078
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 5809 of file richole.c.

5810 {
5811  IDataObject* ido;
5812  FORMATETC fmt;
5813  STGMEDIUM stgm;
5814  DIBSECTION dibsect;
5815  ENHMETAHEADER emh;
5816  HDC hMemDC;
5817  SIZE sz;
5818  BOOL has_size;
5819  HBITMAP old_bm;
5820  RECT rc;
5821 
5822  assert(run->nFlags & MERF_GRAPHICS);
5823  assert(run->reobj);
5824  if (IOleObject_QueryInterface(run->reobj->obj.poleobj, &IID_IDataObject, (void**)&ido) != S_OK)
5825  {
5826  FIXME("Couldn't get interface\n");
5827  return;
5828  }
5829  has_size = run->reobj->obj.sizel.cx != 0 || run->reobj->obj.sizel.cy != 0;
5830  fmt.cfFormat = CF_BITMAP;
5831  fmt.ptd = NULL;
5832  fmt.dwAspect = DVASPECT_CONTENT;
5833  fmt.lindex = -1;
5834  fmt.tymed = TYMED_GDI;
5835  if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
5836  {
5837  fmt.cfFormat = CF_ENHMETAFILE;
5838  fmt.tymed = TYMED_ENHMF;
5839  if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
5840  {
5841  FIXME("Couldn't get storage medium\n");
5842  IDataObject_Release(ido);
5843  return;
5844  }
5845  }
5846  IDataObject_Release(ido);
5847 
5848  switch (stgm.tymed)
5849  {
5850  case TYMED_GDI:
5851  GetObjectW(stgm.u.hBitmap, sizeof(dibsect), &dibsect);
5852  hMemDC = CreateCompatibleDC(c->hDC);
5853  old_bm = SelectObject(hMemDC, stgm.u.hBitmap);
5854  if (has_size)
5855  {
5856  convert_sizel(c, &run->reobj->obj.sizel, &sz);
5857  } else {
5858  sz.cx = dibsect.dsBm.bmWidth;
5859  sz.cy = dibsect.dsBm.bmHeight;
5860  }
5861  if (c->editor->nZoomNumerator != 0)
5862  {
5863  sz.cx = MulDiv(sz.cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5864  sz.cy = MulDiv(sz.cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5865  }
5866  StretchBlt(c->hDC, x, y - sz.cy, sz.cx, sz.cy,
5867  hMemDC, 0, 0, dibsect.dsBm.bmWidth, dibsect.dsBm.bmHeight, SRCCOPY);
5868 
5869  SelectObject(hMemDC, old_bm);
5870  DeleteDC(hMemDC);
5871  break;
5872  case TYMED_ENHMF:
5873  GetEnhMetaFileHeader(stgm.u.hEnhMetaFile, sizeof(emh), &emh);
5874  if (has_size)
5875  {
5876  convert_sizel(c, &run->reobj->obj.sizel, &sz);
5877  } else {
5878  sz.cx = emh.rclBounds.right - emh.rclBounds.left;
5879  sz.cy = emh.rclBounds.bottom - emh.rclBounds.top;
5880  }
5881  if (c->editor->nZoomNumerator != 0)
5882  {
5883  sz.cx = MulDiv(sz.cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5884  sz.cy = MulDiv(sz.cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5885  }
5886 
5887  rc.left = x;
5888  rc.top = y - sz.cy;
5889  rc.right = x + sz.cx;
5890  rc.bottom = y;
5891  PlayEnhMetaFile(c->hDC, stgm.u.hEnhMetaFile, &rc);
5892  break;
5893  default:
5894  FIXME("Unsupported tymed %d\n", stgm.tymed);
5895  selected = FALSE;
5896  break;
5897  }
5898  ReleaseStgMedium(&stgm);
5899 
5900  if (selected && !c->editor->bHideSelection)
5901  PatBlt(c->hDC, x, y - sz.cy, sz.cx, sz.cy, DSTINVERT);
5902 }
#define CF_ENHMETAFILE
Definition: constants.h:409
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2036
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:292
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:291
LONG right
Definition: windef.h:293
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:319
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:2300
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI DeleteDC(_In_ HDC)
BITMAP dsBm
Definition: wingdi.h:1647
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:5720
LONG bottom
Definition: windef.h:294
static HBITMAP
Definition: button.c:44
LONG cy
Definition: windef.h:320
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
union tagME_DisplayItem::@503 member
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:47
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
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 820 of file para.c.

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

240 {
241  char buf[2048];
242  ME_DumpStyleToBuf(&s->fmt, buf);
243  TRACE_(richedit_style)("%s\n", buf);
244 }
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:246
GLdouble s
Definition: gl.h:2039

◆ ME_DumpStyleToBuf()

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

Definition at line 246 of file style.c.

247 {
248  /* FIXME only CHARFORMAT styles implemented */
249  /* this function sucks, doesn't check for buffer overruns but it's "good enough" as for debug code */
250  char *p;
251  p = buf;
252  p += sprintf(p, "Font face: ");
253  if (pFmt->dwMask & CFM_FACE) {
254  WCHAR *q = pFmt->szFaceName;
255  while(*q) {
256  *p++ = (*q > 255) ? '?' : *q;
257  q++;
258  }
259  } else
260  p += sprintf(p, "N/A");
261 
262  if (pFmt->dwMask & CFM_SIZE)
263  p += sprintf(p, "\nFont size: %d\n", pFmt->yHeight);
264  else
265  p += sprintf(p, "\nFont size: N/A\n");
266 
267  if (pFmt->dwMask & CFM_OFFSET)
268  p += sprintf(p, "Char offset: %d\n", pFmt->yOffset);
269  else
270  p += sprintf(p, "Char offset: N/A\n");
271 
272  if (pFmt->dwMask & CFM_CHARSET)
273  p += sprintf(p, "Font charset: %d\n", (int)pFmt->bCharSet);
274  else
275  p += sprintf(p, "Font charset: N/A\n");
276 
277  /* I'm assuming CFM_xxx and CFE_xxx are the same values, fortunately it IS true wrt used flags*/
278  ME_DumpStyleEffect(&p, "Font bold:", pFmt, CFM_BOLD);
279  ME_DumpStyleEffect(&p, "Font italic:", pFmt, CFM_ITALIC);
280  ME_DumpStyleEffect(&p, "Font underline:", pFmt, CFM_UNDERLINE);
281  ME_DumpStyleEffect(&p, "Font strikeout:", pFmt, CFM_STRIKEOUT);
282  ME_DumpStyleEffect(&p, "Hidden text:", pFmt, CFM_HIDDEN);
283  p += sprintf(p, "Text color: ");
284  if (pFmt->dwMask & CFM_COLOR)
285  {
286  if (pFmt->dwEffects & CFE_AUTOCOLOR)
287  p += sprintf(p, "auto\n");
288  else
289  p += sprintf(p, "%06x\n", (int)pFmt->crTextColor);
290  }
291  else
292  p += sprintf(p, "N/A\n");
293  ME_DumpStyleEffect(&p, "Text protected:", pFmt, CFM_PROTECTED);
294 }
#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:234
#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:81
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 1285 of file paint.c.

1286 {
1287  ME_Run *pRun = &pCursor->pRun->member.run;
1288  ME_DisplayItem *pRow = ME_FindItemBack(pCursor->pRun, diStartRow);
1289  ME_DisplayItem *pPara = pCursor->pPara;
1290  int x, y, yheight;
1291 
1292  assert(pRow);
1293  assert(pPara);
1294 
1295  if (editor->styleFlags & ES_AUTOHSCROLL)
1296  {
1297  x = pRun->pt.x + ME_PointFromChar(editor, pRun, pCursor->nOffset, TRUE);
1298  if (x > editor->horz_si.nPos + editor->sizeWindow.cx)
1299  x = x + 1 - editor->sizeWindow.cx;
1300  else if (x > editor->horz_si.nPos)
1301  x = editor->horz_si.nPos;
1302 
1303  if (~editor->styleFlags & ES_AUTOVSCROLL)
1304  {
1305  ME_HScrollAbs(editor, x);
1306  return;
1307  }
1308  } else {
1309  if (~editor->styleFlags & ES_AUTOVSCROLL)
1310  return;
1311  x = editor->horz_si.nPos;
1312  }
1313 
1314  y = pPara->member.para.pt.y + pRow->member.row.pt.y;
1315  yheight = pRow->member.row.nHeight;
1316 
1317  if (y < editor->vert_si.nPos)
1318  ME_ScrollAbs(editor, x, y);
1319  else if (y + yheight > editor->vert_si.nPos + editor->sizeWindow.cy)
1320  ME_ScrollAbs(editor, x, y + yheight - editor->sizeWindow.cy);
1321  else if (x != editor->horz_si.nPos)
1322  ME_ScrollAbs(editor, x, editor->vert_si.nPos);
1323 }
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:1053
long y
Definition: polytest.cpp:48
DWORD styleFlags
Definition: editstr.h:392
long x
Definition: polytest.cpp:48
union tagME_DisplayItem::@503 member
#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:599
SCROLLINFO vert_si
Definition: editstr.h:443
POINT pt
Definition: editstr.h:243
LONG cx
Definition: windef.h:319
#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:1116
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:320
#define ES_AUTOHSCROLL
Definition: pedump.c:672
ME_DisplayItem * ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
Definition: list.c:111
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
smooth NULL
Definition: ftsmooth.c:416
static BOOL ME_DITypesEqual(ME_DIType type, ME_DIType nTypeOrClass)
Definition: list.c:45

Referenced by adjust_para_y(), handle_enter(), ME_AppendTableRow(), ME_ArrowEnd(), ME_ArrowHome(), ME_ArrowPageDown(), ME_ArrowPageUp(), ME_Char(), ME_CheckCharOffsets(), ME_DrawTableBorders(), ME_ExtendAnchorSelection(), ME_FindPixelPos(), ME_FindPixelPosInTableRow(), ME_FindRowWithNumber(), ME_FindRunInRow(), ME_FindText(), ME_GetCharFormat(), ME_GetCursorCoordinates(), ME_GetTableRowEnd(), ME_GetTextW(), ME_HandleMessage(), ME_InsertEndParaFromCursor(), ME_InsertRunAtCursor(), ME_InsertTableRowStartAtParagraph(), ME_InsertTextFromCursor(), ME_InternalDeleteText(), ME_InvalidateSelection(), ME_JoinParagraphs(), ME_MoveCursorChars(), ME_MoveCursorFromTableRowStartParagraph(), ME_MoveCursorLines(), ME_MoveCursorWords(), ME_PropagateCharOffset(), ME_ProtectPartialTableDeletion(), ME_RowNumberFromCharOfs(), ME_RTFSpecialCharHook(), ME_RunOfsFromCharOfs(), ME_SelectByType(), ME_SelectOrInsertNextCell(), ME_SetCharFormat(), ME_SetCursorToStart(), ME_SkipAndPropagateCharOffset(), ME_SplitParagraph(), ME_StreamIn(), ME_StreamOutRTFFontAndColorTbl(), ME_StreamOutText(), ME_UpdateLinkAttribute(), and ME_UpdateSelectionLinkAttribute().

◆ ME_FindNonWhitespaceV()

int ME_FindNonWhitespaceV ( const ME_String s,
int  nVChar 
)

◆ ME_FindRowWithNumber()

ME_DisplayItem* ME_FindRowWithNumber ( ME_TextEditor editor,
int  nRow 
)

Definition at line 44 of file row.c.

45 {
47  int nCount = 0;
48 
49  while (item->type == diParagraph &&
50  nCount + item->member.para.nRows <= nRow)
51  {
52  nCount += item->member.para.nRows;
53  item = item->member.para.next_para;
54  }
55  if (item->type != diParagraph)
56