ui/common/context.c

branch
newapi
changeset 392
df62b7205bd3
parent 387
80edb1a93f7a
child 406
0ebf9d7b23e8
equal deleted inserted replaced
391:fc0df448dfbc 392:df62b7205bd3
60 ctx->allocator = mp->allocator; 60 ctx->allocator = mp->allocator;
61 ctx->obj = toplevel; 61 ctx->obj = toplevel;
62 ctx->vars = cxHashMapCreate(mp->allocator, CX_STORE_POINTERS, 16); 62 ctx->vars = cxHashMapCreate(mp->allocator, CX_STORE_POINTERS, 16);
63 63
64 ctx->documents = cxLinkedListCreate(mp->allocator, cx_cmp_intptr, CX_STORE_POINTERS); 64 ctx->documents = cxLinkedListCreate(mp->allocator, cx_cmp_intptr, CX_STORE_POINTERS);
65 ctx->group_widgets = cxLinkedListCreate(mp->allocator, NULL, sizeof(UiGroupWidget)); 65 ctx->group_widgets = cxLinkedListCreate(mp->allocator, cx_cmp_ptr, sizeof(UiGroupWidget));
66 ctx->groups = cxArrayListCreate(mp->allocator, cx_cmp_int, sizeof(int), 32); 66 ctx->groups = cxArrayListCreate(mp->allocator, cx_cmp_int, sizeof(int), 32);
67 67
68 ctx->attach_document = uic_context_attach_document; 68 ctx->attach_document = uic_context_attach_document;
69 ctx->detach_document2 = uic_context_detach_document2; 69 ctx->detach_document2 = uic_context_detach_document2;
70 70
329 UiList *t = to->value; 329 UiList *t = to->value;
330 if (f->obj) { 330 if (f->obj) {
331 t->obj = f->obj; 331 t->obj = f->obj;
332 t->update = f->update; 332 t->update = f->update;
333 t->getselection = f->getselection; 333 t->getselection = f->getselection;
334 t->setselection = f->setselection;
334 } 335 }
335 336
336 UiVar tmp = *from; 337 UiVar tmp = *from;
337 *from = *to; 338 *from = *to;
338 *to = tmp; 339 *to = tmp;
554 } 555 }
555 556
556 cxListAdd(ctx->group_widgets, &gw); 557 cxListAdd(ctx->group_widgets, &gw);
557 } 558 }
558 559
560 void uic_remove_group_widget(UiContext *ctx, void *widget) {
561 (void)cxListFindRemove(ctx->group_widgets, widget);
562 }
563
559 UIEXPORT void *ui_allocator(UiContext *ctx) { 564 UIEXPORT void *ui_allocator(UiContext *ctx) {
560 return (void*)ctx->allocator; 565 return (void*)ctx->allocator;
561 } 566 }
562 567
563 void* ui_cx_mempool(UiContext *ctx) { 568 void* ui_cx_mempool(UiContext *ctx) {

mercurial