| 394 } |
394 } |
| 395 } |
395 } |
| 396 } |
396 } |
| 397 } |
397 } |
| 398 |
398 |
| 399 void ui_image_set(UiGeneric *g, void *img) { |
399 char* ui_text_get(UiText* s) { |
| 400 // TODO: ref? |
400 if (s) { |
| |
401 return s->get ? s->get(s) : s->value.ptr; |
| |
402 } |
| |
403 else { |
| |
404 return 0; |
| |
405 } |
| |
406 } |
| |
407 |
| |
408 void ui_generic_set_image(UiGeneric *g, void *img) { |
| 401 if(g->set) { |
409 if(g->set) { |
| 402 g->set(g, img, UI_IMAGE_OBJECT_TYPE); |
410 g->set(g, img, UI_IMAGE_OBJECT_TYPE); |
| 403 } else { |
411 } else { |
| |
412 if(g->value) { |
| |
413 ui_image_unref(g->value); |
| |
414 } |
| |
415 ui_image_ref(img); |
| 404 g->value = img; |
416 g->value = img; |
| 405 g->type = UI_IMAGE_OBJECT_TYPE; |
417 g->type = UI_IMAGE_OBJECT_TYPE; |
| 406 } |
418 } |
| 407 } |
419 } |
| 408 |
420 |
| 409 void* ui_image_get(UiGeneric *g) { |
421 void* ui_generic_get_image(UiGeneric *g) { |
| 410 if(g->type) { |
422 if(g->type) { |
| 411 if(!strcmp(g->type, UI_IMAGE_OBJECT_TYPE)) { |
423 if(!strcmp(g->type, UI_IMAGE_OBJECT_TYPE)) { |
| 412 return g->value; |
424 return g->value; |
| 413 } else { |
425 } else { |
| 414 return NULL; |
426 return NULL; |
| 415 } |
427 } |
| 416 } |
428 } |
| 417 return g->value; |
429 return g->value; |
| 418 } |
|
| 419 |
|
| 420 |
|
| 421 char* ui_text_get(UiText* s) { |
|
| 422 if (s) { |
|
| 423 return s->get ? s->get(s) : s->value.ptr; |
|
| 424 } |
|
| 425 else { |
|
| 426 return 0; |
|
| 427 } |
|
| 428 } |
430 } |
| 429 |
431 |
| 430 |
432 |
| 431 // private functions |
433 // private functions |
| 432 void uic_int_copy(UiInteger *from, UiInteger *to) { |
434 void uic_int_copy(UiInteger *from, UiInteger *to) { |