| 95 cxBufferPutString(&buf, " \"title\":\""); |
95 cxBufferPutString(&buf, " \"title\":\""); |
| 96 cxBufferWrite(w->title.ptr, 1, w->title.length, &buf); |
96 cxBufferWrite(w->title.ptr, 1, w->title.length, &buf); |
| 97 cxBufferPutString(&buf, "\""); |
97 cxBufferPutString(&buf, "\""); |
| 98 } |
98 } |
| 99 |
99 |
| 100 size_t numchildren = cxListSize(w->widget.children); |
100 ui_serialize_children(&w->widget, &buf); |
| 101 if(numchildren > 0) { |
|
| 102 cxBufferPutString(&buf, ",\"children\":["); |
|
| 103 CxIterator i = cxListIterator(w->widget.children); |
|
| 104 cx_foreach(UiWidget *, child, i) { |
|
| 105 cxmutstr child_str = child->serialize(child); |
|
| 106 cxBufferWrite(child_str.ptr, 1, child_str.length, &buf); |
|
| 107 if(i.index+1 < numchildren) { |
|
| 108 cxBufferPut(&buf, ','); |
|
| 109 } |
|
| 110 } |
|
| 111 cxBufferPutString(&buf, "]"); |
|
| 112 } |
|
| 113 |
101 |
| 114 cxBufferPutString(&buf, "}\n"); |
102 cxBufferPutString(&buf, "}\n"); |
| 115 |
103 |
| 116 return cx_mutstrn(buf.space, buf.size); |
104 return cx_mutstrn(buf.space, buf.size); |
| 117 } |
105 } |