341 t->setextent(t, t->extent); |
344 t->setextent(t, t->extent); |
342 t->setrange(t, t->min, t->max); |
345 t->setrange(t, t->min, t->max); |
343 t->set(t, t->value); |
346 t->set(t, t->value); |
344 break; |
347 break; |
345 } |
348 } |
|
349 case UI_VAR_GENERIC: { |
|
350 UiGeneric *f = fromvalue; |
|
351 UiGeneric *t = to->value; |
|
352 if(!f->obj) break; |
|
353 uic_generic_copy(f, t); |
|
354 t->set(t, t->value, t->type); |
|
355 break; |
|
356 } |
346 } |
357 } |
347 } |
358 } |
348 |
359 |
349 void uic_save_var2(UiVar *var) { |
360 void uic_save_var2(UiVar *var) { |
350 switch(var->type) { |
361 switch(var->type) { |
353 case UI_VAR_DOUBLE: uic_double_save(var->value); break; |
364 case UI_VAR_DOUBLE: uic_double_save(var->value); break; |
354 case UI_VAR_STRING: uic_string_save(var->value); break; |
365 case UI_VAR_STRING: uic_string_save(var->value); break; |
355 case UI_VAR_TEXT: uic_text_save(var->value); break; |
366 case UI_VAR_TEXT: uic_text_save(var->value); break; |
356 case UI_VAR_LIST: break; |
367 case UI_VAR_LIST: break; |
357 case UI_VAR_RANGE: uic_range_save(var->value); break; |
368 case UI_VAR_RANGE: uic_range_save(var->value); break; |
|
369 case UI_VAR_GENERIC: uic_generic_save(var->value); break; |
358 } |
370 } |
359 } |
371 } |
360 |
372 |
361 void uic_unbind_var(UiVar *var) { |
373 void uic_unbind_var(UiVar *var) { |
362 switch(var->type) { |
374 switch(var->type) { |
365 case UI_VAR_DOUBLE: uic_double_unbind(var->value); break; |
377 case UI_VAR_DOUBLE: uic_double_unbind(var->value); break; |
366 case UI_VAR_STRING: uic_string_unbind(var->value); break; |
378 case UI_VAR_STRING: uic_string_unbind(var->value); break; |
367 case UI_VAR_TEXT: uic_text_unbind(var->value); break; |
379 case UI_VAR_TEXT: uic_text_unbind(var->value); break; |
368 case UI_VAR_LIST: uic_list_unbind(var->value); break; |
380 case UI_VAR_LIST: uic_list_unbind(var->value); break; |
369 case UI_VAR_RANGE: uic_range_unbind(var->value); break; |
381 case UI_VAR_RANGE: uic_range_unbind(var->value); break; |
|
382 case UI_VAR_GENERIC: uic_generic_unbind(var->value); break; |
370 } |
383 } |
371 } |
384 } |
372 |
385 |
373 void uic_reg_var(UiContext *ctx, char *name, UiVarType type, void *value) { |
386 void uic_reg_var(UiContext *ctx, char *name, UiVarType type, void *value) { |
374 // TODO: do we need/want this? Why adding vars to a context after |
387 // TODO: do we need/want this? Why adding vars to a context after |