87 t->cbSize =
sizeof(*t);
96 t->cbSize =
sizeof(*t);
110 t->cbSize =
sizeof(*t);
128 s->font_cache =
NULL;
131 s->script_cache =
NULL;
134 TRACE_(richedit_style)(
"ME_MakeStyle %p, total refs=%d\n",
s,
all_refs);
138 #define COPY_STYLE_ITEM(mask, member) \ 139 if (mod->dwMask & mask) { \ 141 fmt.member = mod->member;\ 144 #define COPY_STYLE_ITEM_MEMCPY(mask, member) \ 145 if (mod->dwMask & mask) { \ 147 CopyMemory(fmt.member, mod->member, sizeof(mod->member));\ 181 fmt.dwEffects &= ~(
mod->dwMask);
182 fmt.dwEffects |=
mod->dwEffects &
mod->dwMask;
183 fmt.dwMask |=
mod->dwMask;
217 TRACE_(richedit_style)(
"found existing style %p\n",
s);
226 TRACE_(richedit_style)(
"created new style %p\n",
s);
260 *
p++ = (*
q > 255) ?
'?' : *
q;
310 if (
s->fmt.dwEffects &
s->fmt.dwMask &
CFM_BOLD)
373 int i,
empty, age = 0x7FFFFFFF;
376 if (
c->current_style ==
s)
return;
383 c->editor->pFontCache[
i].nAge++;
386 item = &
c->editor->pFontCache[
i];
389 if (
item->nAge > age)
402 item = &
c->editor->pFontCache[
i];
403 TRACE_(richedit_style)(
"font reused %d\n",
i );
412 TRACE_(richedit_style)(
"font deleted %d\n",
empty );
417 TRACE_(richedit_style)(
"font created %d\n",
empty );
421 s->font_cache =
item;
424 if (!
c->orig_font)
c->orig_font = old_font;
432 if (
c->current_style &&
c->current_style->font_cache)
435 c->current_style->font_cache =
NULL;
437 c->current_style =
s;
448 s->font_cache =
NULL;
459 TRACE_(richedit_style)(
"ME_AddRefStyle %p, new refs=%d, total refs=%d\n",
s,
s->nRefs,
all_refs);
467 TRACE_(richedit_style)(
"destroy style %p, total refs=%d\n",
s,
all_refs);
469 TRACE_(richedit_style)(
"release style %p, new refs=%d, total refs=%d\n",
s,
s->nRefs,
all_refs);
470 if (!
all_refs)
TRACE(
"all style references freed (good!)\n");
484 return from->pRun->member.run.style;
void ME_DestroyStyle(ME_Style *s)
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define WideCharToMultiByte
void ME_SaveTempStyle(ME_TextEditor *editor, ME_Style *style)
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
void ME_ClearTempStyle(ME_TextEditor *editor)
static BOOL ME_IsFontEqual(const LOGFONTW *p1, const LOGFONTW *p2)
#define yHeightCharPtsMost
static void * heap_alloc(size_t len)
void ME_InitCharFormat2W(CHARFORMAT2W *pFmt)
#define COPY_STYLE_ITEM(mask, member)
static void release_font_cache(ME_FontCacheItem *item)
#define sprintf(buf, format,...)
BOOL cfany_to_cf2w(CHARFORMAT2W *to, const CHARFORMAT2W *from)
GLenum GLuint GLenum GLsizei const GLchar * buf
void ME_DumpStyle(ME_Style *s)
#define CFU_UNDERLINENONE
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
int ME_GetSelection(ME_TextEditor *editor, ME_Cursor **from, ME_Cursor **to)
ME_Style * ME_GetInsertStyle(ME_TextEditor *editor, int nCursor)
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
BOOL cf2w_to_cfany(CHARFORMAT2W *to, const CHARFORMAT2W *from)
ME_FontCacheItem * font_cache
static void ME_LogFontFromStyle(ME_Context *c, LOGFONTW *lf, const ME_Style *s)
GLdouble GLdouble GLdouble GLdouble q
static void ME_DumpStyleEffect(char **p, const char *name, const CHARFORMAT2W *fmt, int mask)
void ME_DumpStyleToBuf(CHARFORMAT2W *pFmt, char buf[2048])
void ME_AddRefStyle(ME_Style *s)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
void ME_ReleaseStyle(ME_Style *s)
void ME_MarkAllForWrapping(ME_TextEditor *editor) DECLSPEC_HIDDEN
SCRIPT_CACHE script_cache
void ME_CharFormatFromLogFont(HDC hDC, const LOGFONTW *lf, CHARFORMAT2W *fmt)
void ME_SetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *mod)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
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
void ME_CopyCharFormat(CHARFORMAT2W *pDest, const CHARFORMAT2W *pSrc)
#define FIELD_OFFSET(t, f)
int ME_twips2pointsY(const ME_Context *c, int y) DECLSPEC_HIDDEN
#define MultiByteToWideChar
BOOL ME_IsSelection(ME_TextEditor *editor)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
void select_style(ME_Context *c, ME_Style *s)
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
WCHAR lfFaceName[LF_FACESIZE]
HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc)
WINE_DECLARE_DEBUG_CHANNEL(richedit_style)
#define COPY_STYLE_ITEM_MEMCPY(mask, member)
ME_Style * ME_ApplyStyle(ME_TextEditor *editor, ME_Style *sSrc, CHARFORMAT2W *mod)
struct _charformat2w CHARFORMAT2W
WINE_DEFAULT_DEBUG_CHANNEL(richedit)
#define CFM_UNDERLINETYPE
ME_Style * ME_MakeStyle(CHARFORMAT2W *style)
ME_DisplayItem * ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
union tagME_DisplayItem::@521 member
static BOOL heap_free(void *mem)