Go to the source code of this file.
|
| | WINE_DEFAULT_DEBUG_CHANNEL (richedit) |
| |
| | WINE_DECLARE_DEBUG_CHANNEL (richedit_style) |
| |
| BOOL | cfany_to_cf2w (CHARFORMAT2W *to, const CHARFORMAT2W *from) |
| |
| BOOL | cf2w_to_cfany (CHARFORMAT2W *to, const CHARFORMAT2W *from) |
| |
| ME_Style * | ME_MakeStyle (CHARFORMAT2W *style) |
| |
| void | ME_InitCharFormat2W (CHARFORMAT2W *pFmt) |
| |
| ME_Style * | ME_ApplyStyle (ME_TextEditor *editor, ME_Style *sSrc, CHARFORMAT2W *mod) |
| |
| void | ME_CopyCharFormat (CHARFORMAT2W *pDest, const CHARFORMAT2W *pSrc) |
| |
| static void | ME_DumpStyleEffect (char **p, const char *name, const CHARFORMAT2W *fmt, int mask) |
| |
| void | ME_DumpStyle (ME_Style *s) |
| |
| void | ME_DumpStyleToBuf (CHARFORMAT2W *pFmt, char buf[2048]) |
| |
| static void | ME_LogFontFromStyle (ME_Context *c, LOGFONTW *lf, const ME_Style *s) |
| |
| void | ME_CharFormatFromLogFont (HDC hDC, const LOGFONTW *lf, CHARFORMAT2W *fmt) |
| |
| static BOOL | ME_IsFontEqual (const LOGFONTW *p1, const LOGFONTW *p2) |
| |
| static void | release_font_cache (ME_FontCacheItem *item) |
| |
| void | select_style (ME_Context *c, ME_Style *s) |
| |
| void | ME_DestroyStyle (ME_Style *s) |
| |
| void | ME_AddRefStyle (ME_Style *s) |
| |
| void | ME_ReleaseStyle (ME_Style *s) |
| |
| ME_Style * | style_get_insert_style (ME_TextEditor *editor, ME_Cursor *cursor) |
| |
| void | ME_SaveTempStyle (ME_TextEditor *editor, ME_Style *style) |
| |
| void | ME_ClearTempStyle (ME_TextEditor *editor) |
| |
| void | ME_SetDefaultCharFormat (ME_TextEditor *editor, CHARFORMAT2W *mod) |
| |
◆ COPY_STYLE_ITEM
Value:
}
std::map< E_MODULE, HMODULE > mod
Definition at line 138 of file style.c.
◆ COPY_STYLE_ITEM_MEMCPY
Value:
CopyMemory(
fmt.member,
mod->member,
sizeof(
mod->member));\
}
Definition at line 144 of file style.c.
◆ cf2w_to_cfany()
Definition at line 79 of file style.c.
80{
83 {
87 t->cbSize =
sizeof(*t);
91 }
93 {
96 t->cbSize =
sizeof(*t);
100 }
102 {
104
106
108
110 t->cbSize =
sizeof(*t);
112 }
114 {
117 }
119}
#define WideCharToMultiByte
#define FIELD_OFFSET(t, f)
Referenced by editor_handle_message().
◆ cfany_to_cf2w()
◆ ME_AddRefStyle()
Definition at line 454 of file style.c.
455{
459 TRACE_(richedit_style)(
"ME_AddRefStyle %p, new refs=%d, total refs=%d\n",
s,
s->nRefs,
all_refs);
460}
Referenced by add_undo_insert_run(), editor_handle_message(), ME_ApplyStyle(), ME_RTFReadHook(), ME_SaveTempStyle(), ME_StreamIn(), para_num_init(), RTFUngetToken(), run_create(), and style_get_insert_style().
◆ ME_ApplyStyle()
Definition at line 156 of file style.c.
157{
160
174 }
178
180
181 fmt.dwEffects &= ~(
mod->dwMask);
182 fmt.dwEffects |=
mod->dwEffects &
mod->dwMask;
183 fmt.dwMask |=
mod->dwMask;
185 {
188 else
189 fmt.dwEffects &= ~CFE_AUTOCOLOR;
190 }
191
193
195 {
198 fmt.dwEffects &= ~CFE_UNDERLINE;
199 else
201 }
202
204 {
209 else
210 fmt.dwEffects &= ~CFE_BOLD;
211 }
212
214 {
216 {
217 TRACE_(richedit_style)(
"found existing style %p\n",
s);
220 }
221 }
222
226 TRACE_(richedit_style)(
"created new style %p\n",
s);
228}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
#define COPY_STYLE_ITEM(mask, member)
ME_Style * ME_MakeStyle(CHARFORMAT2W *style)
void ME_AddRefStyle(ME_Style *s)
#define COPY_STYLE_ITEM_MEMCPY(mask, member)
#define yHeightCharPtsMost
#define CFM_UNDERLINETYPE
#define CFU_UNDERLINENONE
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Referenced by ME_RTFCharAttrHook(), ME_SetCharFormat(), ME_SetDefaultCharFormat(), ME_SetSelectionCharFormat(), and para_num_init().
◆ ME_CharFormatFromLogFont()
Definition at line 331 of file style.c.
332{
333 int ry;
334
349}
void ME_InitCharFormat2W(CHARFORMAT2W *pFmt)
WCHAR lfFaceName[LF_FACESIZE]
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
Referenced by editor_handle_message().
◆ ME_ClearTempStyle()
◆ ME_CopyCharFormat()
◆ ME_DestroyStyle()
Definition at line 442 of file style.c.
443{
446 {
448 s->font_cache =
NULL;
449 }
452}
static void list_remove(struct list_entry *entry)
static void release_font_cache(ME_FontCacheItem *item)
HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc)
Referenced by ME_DestroyEditor(), and ME_ReleaseStyle().
◆ ME_DumpStyle()
Definition at line 243 of file style.c.
244{
248}
void ME_DumpStyleToBuf(CHARFORMAT2W *pFmt, char buf[2048])
GLenum GLuint GLenum GLsizei const GLchar * buf
◆ ME_DumpStyleEffect()
◆ ME_DumpStyleToBuf()
Definition at line 250 of file style.c.
251{
252
253
260 *
p++ = (*
q > 255) ?
'?' : *
q;
262 }
263 } else
265
268 else
270
273 else
275
278 else
280
281
289 {
292 else
294 }
295 else
298}
static void ME_DumpStyleEffect(char **p, const char *name, const CHARFORMAT2W *fmt, int mask)
GLdouble GLdouble GLdouble GLdouble q
Referenced by ME_DumpStyle(), and ME_KeyDown().
◆ ME_InitCharFormat2W()
◆ ME_IsFontEqual()
Definition at line 351 of file style.c.
352{
358}
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Referenced by select_style().
◆ ME_LogFontFromStyle()
Definition at line 302 of file style.c.
303{
306
308
310 if (
s->fmt.dwEffects &
s->fmt.dwMask &
CFM_BOLD)
324
329}
int ME_twips2pointsY(const ME_Context *c, int y)
Referenced by select_style().
◆ ME_MakeStyle()
◆ ME_ReleaseStyle()
Definition at line 462 of file style.c.
463{
467 TRACE_(richedit_style)(
"destroy style %p, total refs=%d\n",
s,
all_refs);
468 else
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");
474}
void ME_DestroyStyle(ME_Style *s)
Referenced by destroy_undo_item(), editor_handle_message(), editor_insert_oleobj(), handle_enter(), handle_wm_char(), ITextRange_fnSetText(), ME_ClearTempStyle(), ME_DestroyDisplayItem(), ME_DestroyEditor(), ME_InsertEndRowFromCursor(), ME_ReplaceSel(), ME_RTFCharAttrHook(), ME_RTFReadHook(), ME_SaveTempStyle(), ME_SetCharFormat(), ME_SetDefaultCharFormat(), ME_SetSelectionCharFormat(), ME_StreamIn(), para_num_clear(), and table_insert_end_para().
◆ ME_SaveTempStyle()
◆ ME_SetDefaultCharFormat()
◆ release_font_cache()
◆ select_style()
Definition at line 369 of file style.c.
370{
373 int i,
empty, age = 0x7FFFFFFF;
375
376 if (
c->current_style ==
s)
return;
377
379 {
381
383 c->editor->pFontCache[
i].nAge++;
385 {
386 item = &
c->editor->pFontCache[
i];
388 {
389 if (
item->nAge > age)
390 {
393 }
394 }
395
397 break;
398 }
399
401 {
402 item = &
c->editor->pFontCache[
i];
403 TRACE_(richedit_style)(
"font reused %d\n",
i );
405 }
406 else
407 {
411 {
412 TRACE_(richedit_style)(
"font deleted %d\n",
empty );
415 }
417 TRACE_(richedit_style)(
"font created %d\n",
empty );
420 }
421 s->font_cache =
item;
424 if (!
c->orig_font)
c->orig_font = old_font;
425 }
426 else
427 {
430 }
431
432 if (
c->current_style &&
c->current_style->font_cache)
433 {
435 c->current_style->font_cache =
NULL;
436 }
437 c->current_style =
s;
438
439 return;
440}
static const WCHAR empty[1]
static void ME_LogFontFromStyle(ME_Context *c, LOGFONTW *lf, const ME_Style *s)
static BOOL ME_IsFontEqual(const LOGFONTW *p1, const LOGFONTW *p2)
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
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
Referenced by draw_para_number(), draw_space(), draw_text_with_style(), ME_CharFromPointContext(), ME_DestroyContext(), ME_GetTextExtent(), para_num_init(), and shape_run().
◆ style_get_insert_style()
Definition at line 476 of file style.c.
477{
481
483 {
486 }
491 else
493
496}
BOOL ME_IsSelection(ME_TextEditor *editor)
int ME_GetSelection(ME_TextEditor *editor, ME_Cursor **from, ME_Cursor **to)
ME_Run * run_prev(ME_Run *run)
Referenced by editor_handle_message(), editor_insert_oleobj(), handle_enter(), handle_wm_char(), ITextRange_fnSetText(), ME_GetSelectionInsertStyle(), ME_InsertEndRowFromCursor(), ME_SetSelectionCharFormat(), and table_insert_end_para().
◆ WINE_DECLARE_DEBUG_CHANNEL()
| WINE_DECLARE_DEBUG_CHANNEL |
( |
richedit_style |
| ) |
|
◆ WINE_DEFAULT_DEBUG_CHANNEL()
| WINE_DEFAULT_DEBUG_CHANNEL |
( |
richedit |
| ) |
|
◆ all_refs