ReactOS 0.4.16-dev-927-g467dec4
list.c File Reference
#include "editor.h"
Include dependency graph for list.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (richedit_lists)
 
void ME_InsertBefore (ME_DisplayItem *diWhere, ME_DisplayItem *diWhat)
 
void ME_Remove (ME_DisplayItem *diWhere)
 
static BOOL ME_DITypesEqual (ME_DIType type, ME_DIType nTypeOrClass)
 
ME_DisplayItemME_FindItemBack (ME_DisplayItem *di, ME_DIType nTypeOrClass)
 
ME_DisplayItemME_FindItemBackOrHere (ME_DisplayItem *di, ME_DIType nTypeOrClass)
 
ME_DisplayItemME_FindItemFwd (ME_DisplayItem *di, ME_DIType nTypeOrClass)
 
static const charME_GetDITypeName (ME_DIType type)
 
void ME_DestroyDisplayItem (ME_DisplayItem *item)
 
ME_DisplayItemME_MakeDI (ME_DIType type)
 
void ME_DumpDocument (ME_TextBuffer *buffer)
 

Function Documentation

◆ ME_DestroyDisplayItem()

void ME_DestroyDisplayItem ( ME_DisplayItem item)

Definition at line 115 of file list.c.

116{
117 if (0)
118 TRACE("type=%s\n", ME_GetDITypeName(item->type));
119 if (item->type==diRun)
120 {
121 if (item->member.run.reobj)
122 {
123 list_remove(&item->member.run.reobj->entry);
124 ME_DeleteReObject(item->member.run.reobj);
125 }
126 heap_free( item->member.run.glyphs );
127 heap_free( item->member.run.clusters );
128 ME_ReleaseStyle(item->member.run.style);
129 }
131}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static const char * ME_GetDITypeName(ME_DIType type)
Definition: list.c:101
void ME_ReleaseStyle(ME_Style *item) DECLSPEC_HIDDEN
Definition: style.c:462
void ME_DeleteReObject(struct re_object *re_object) DECLSPEC_HIDDEN
Definition: richole.c:5821
@ diRun
Definition: editstr.h:86
static ATOM item
Definition: dde.c:856
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by ME_DestroyEditor(), ME_InternalDeleteText(), ME_PrepareParagraphForWrapping(), para_destroy(), para_join(), and run_join().

◆ ME_DITypesEqual()

static BOOL ME_DITypesEqual ( ME_DIType  type,
ME_DIType  nTypeOrClass 
)
static

Definition at line 45 of file list.c.

46{
47 switch (nTypeOrClass)
48 {
50 return type == diRun || type == diParagraph;
51 case diRunOrStartRow:
52 return type == diRun || type == diStartRow;
54 return type == diTextEnd || type == diParagraph;
56 return type == diStartRow || type == diParagraph;
58 return type == diStartRow || type == diParagraph || type == diTextEnd;
60 return type == diRun || type == diParagraph || type == diTextEnd;
61 default:
62 return type == nTypeOrClass;
63 }
64}
@ diStartRow
Definition: editstr.h:87
@ diTextEnd
Definition: editstr.h:88
@ diRunOrParagraphOrEnd
Definition: editstr.h:96
@ diParagraphOrEnd
Definition: editstr.h:95
@ diStartRowOrParagraphOrEnd
Definition: editstr.h:92
@ diRunOrParagraph
Definition: editstr.h:93
@ diRunOrStartRow
Definition: editstr.h:94
@ diStartRowOrParagraph
Definition: editstr.h:91
@ diParagraph
Definition: editstr.h:84
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by ME_FindItemBack(), ME_FindItemBackOrHere(), and ME_FindItemFwd().

◆ ME_DumpDocument()

void ME_DumpDocument ( ME_TextBuffer buffer)

Definition at line 142 of file list.c.

143{
144 /* FIXME this is useless, */
145 ME_DisplayItem *pItem = buffer->pFirst;
146 TRACE("DOCUMENT DUMP START\n");
147 while(pItem) {
148 switch(pItem->type)
149 {
150 case diTextStart:
151 TRACE("Start\n");
152 break;
153 case diCell:
154 TRACE("Cell(level=%d%s)\n", pItem->member.cell.nNestingLevel,
155 !pItem->member.cell.next_cell ? ", END" :
156 (!pItem->member.cell.prev_cell ? ", START" :""));
157 break;
158 case diParagraph:
159 TRACE("Paragraph(ofs=%d)\n", pItem->member.para.nCharOfs);
160 if (pItem->member.para.nFlags & MEPF_ROWSTART)
161 TRACE(" - (Table Row Start)\n");
162 if (pItem->member.para.nFlags & MEPF_ROWEND)
163 TRACE(" - (Table Row End)\n");
164 break;
165 case diStartRow:
166 TRACE(" - StartRow\n");
167 break;
168 case diRun:
169 TRACE(" - Run(%s, %d, flags=%x)\n", debugstr_run( &pItem->member.run ),
170 pItem->member.run.nCharOfs, pItem->member.run.nFlags);
171 break;
172 case diTextEnd:
173 TRACE("End(ofs=%d)\n", pItem->member.para.nCharOfs);
174 break;
175 default:
176 break;
177 }
178 pItem = pItem->next;
179 }
180 TRACE("DOCUMENT DUMP END\n");
181}
static const char * debugstr_run(const ME_Run *run)
Definition: editor.h:47
#define MEPF_ROWSTART
Definition: editstr.h:143
#define MEPF_ROWEND
Definition: editstr.h:144
@ diCell
Definition: editstr.h:85
@ diTextStart
Definition: editstr.h:83
GLuint buffer
Definition: glext.h:5915
struct tagME_Cell * next_cell
Definition: editstr.h:228
struct tagME_Cell * prev_cell
Definition: editstr.h:228
int nNestingLevel
Definition: editstr.h:222
union tagME_DisplayItem::@557 member
ME_DIType type
Definition: editstr.h:255
ME_Cell cell
Definition: editstr.h:260
struct tagME_DisplayItem * next
Definition: editstr.h:256
ME_Paragraph para
Definition: editstr.h:261
int nCharOfs
Definition: editstr.h:161
int nFlags
Definition: editstr.h:164

Referenced by ME_CheckCharOffsets().

◆ ME_FindItemBack()

ME_DisplayItem * ME_FindItemBack ( ME_DisplayItem di,
ME_DIType  nTypeOrClass 
)

Definition at line 66 of file list.c.

67{
68 if (!di)
69 return NULL;
70 di = di->prev;
71 while(di!=NULL) {
72 if (ME_DITypesEqual(di->type, nTypeOrClass))
73 return di;
74 di = di->prev;
75 }
76 return NULL;
77}
#define NULL
Definition: types.h:112
static BOOL ME_DITypesEqual(ME_DIType type, ME_DIType nTypeOrClass)
Definition: list.c:45
struct tagME_DisplayItem * prev
Definition: editstr.h:256

Referenced by cell_end_para(), para_end_row(), row_end_cursor(), row_from_cursor(), row_next_run(), row_prev_all_paras(), table_outer_para(), and table_row_start().

◆ ME_FindItemBackOrHere()

ME_DisplayItem * ME_FindItemBackOrHere ( ME_DisplayItem di,
ME_DIType  nTypeOrClass 
)

Definition at line 79 of file list.c.

80{
81 while(di!=NULL) {
82 if (ME_DITypesEqual(di->type, nTypeOrClass))
83 return di;
84 di = di->prev;
85 }
86 return NULL;
87}

◆ ME_FindItemFwd()

ME_DisplayItem * ME_FindItemFwd ( ME_DisplayItem di,
ME_DIType  nTypeOrClass 
)

Definition at line 89 of file list.c.

90{
91 if (!di) return NULL;
92 di = di->next;
93 while(di!=NULL) {
94 if (ME_DITypesEqual(di->type, nTypeOrClass))
95 return di;
96 di = di->next;
97 }
98 return NULL;
99}

Referenced by cell_first_para(), ME_CheckCharOffsets(), para_first_row(), row_end_cursor(), row_first_cursor(), row_first_run(), row_next(), row_next_all_paras(), row_next_run(), and table_row_end().

◆ ME_GetDITypeName()

static const char * ME_GetDITypeName ( ME_DIType  type)
static

Definition at line 101 of file list.c.

102{
103 switch(type)
104 {
105 case diParagraph: return "diParagraph";
106 case diRun: return "diRun";
107 case diCell: return "diCell";
108 case diTextStart: return "diTextStart";
109 case diTextEnd: return "diTextEnd";
110 case diStartRow: return "diStartRow";
111 default: return "?";
112 }
113}

Referenced by ME_DestroyDisplayItem().

◆ ME_InsertBefore()

void ME_InsertBefore ( ME_DisplayItem diWhere,
ME_DisplayItem diWhat 
)

Definition at line 26 of file list.c.

27{
28 diWhat->next = diWhere;
29 diWhat->prev = diWhere->prev;
30
31 diWhere->prev->next = diWhat;
32 diWhat->next->prev = diWhat;
33}

Referenced by ME_InsertRowStart(), ME_MakeFirstParagraph(), para_split(), run_insert(), and run_split().

◆ ME_MakeDI()

ME_DisplayItem * ME_MakeDI ( ME_DIType  type)

Definition at line 133 of file list.c.

134{
135 ME_DisplayItem *item = heap_alloc_zero(sizeof(*item));
136
137 item->type = type;
138 item->prev = item->next = NULL;
139 return item;
140}

Referenced by cell_create(), ME_MakeText(), para_create(), row_create(), and run_create().

◆ ME_Remove()

void ME_Remove ( ME_DisplayItem diWhere)

Definition at line 35 of file list.c.

36{
37 ME_DisplayItem *diNext = diWhere->next;
38 ME_DisplayItem *diPrev = diWhere->prev;
39 assert(diNext);
40 assert(diPrev);
41 diPrev->next = diNext;
42 diNext->prev = diPrev;
43}
#define assert(x)
Definition: debug.h:53

Referenced by ME_InternalDeleteText(), ME_PrepareParagraphForWrapping(), para_join(), and run_join().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( richedit_lists  )