279 uic_reg_var(ctx, name, UI_VAR_RANGE, r); |
279 uic_reg_var(ctx, name, UI_VAR_RANGE, r); |
280 } |
280 } |
281 return r; |
281 return r; |
282 } |
282 } |
283 |
283 |
|
284 UIEXPORT UiGeneric* ui_generic_new(UiContext *ctx, char *name) { |
|
285 UiGeneric *g = ui_malloc(ctx, sizeof(UiGeneric)); |
|
286 memset(g, 0, sizeof(UiGeneric)); |
|
287 if(name) { |
|
288 uic_reg_var(ctx, name, UI_VAR_GENERIC, g); |
|
289 } |
|
290 return g; |
|
291 } |
|
292 |
284 |
293 |
285 void ui_int_set(UiInteger* i, int64_t value) { |
294 void ui_int_set(UiInteger* i, int64_t value) { |
286 if (i && i->set) { |
295 if (i && i->set) { |
287 i->set(i, value); |
296 i->set(i, value); |
288 } |
297 } |
387 void uic_list_copy(UiList *from, UiList *to) { |
396 void uic_list_copy(UiList *from, UiList *to) { |
388 to->update = from->update; |
397 to->update = from->update; |
389 to->obj = from->obj; |
398 to->obj = from->obj; |
390 } |
399 } |
391 |
400 |
|
401 void uic_generic_copy(UiGeneric *from, UiGeneric *to) { |
|
402 to->get = from->get; |
|
403 to->get_type = from->get_type; |
|
404 to->set = from->set; |
|
405 to->obj = from->obj; |
|
406 } |
392 |
407 |
393 void uic_int_save(UiInteger *i) { |
408 void uic_int_save(UiInteger *i) { |
394 if(!i->obj) return; |
409 if(!i->obj) return; |
395 i->value = i->get(i); |
410 i->value = i->get(i); |
396 } |
411 } |