2 * Acess2 Window Manager v3
3 * - By John Hodge (thePowersGang)
5 * renderer/widget/image.c
10 #include "./colours.h"
11 #include "../../include/image.h"
13 void Widget_Image_Render(tWindow *Window, tElement *Element)
17 Element->CachedX, Element->CachedY,
18 Element->CachedW, Element->CachedH,
23 void Widget_Image_UpdateText(tElement *Element, const char *Text)
25 if(Element->Data) free(Element->Data);
26 Element->Data = Image_Load( Text );
28 // Element->Flags &= ~ELEFLAG_FIXEDSIZE;
32 Element->CachedW = ((tImage*)Element->Data)->Width;
33 Element->CachedH = ((tImage*)Element->Data)->Height;
35 Element->MinW = ((tImage*)Element->Data)->Width;
36 Element->MinH = ((tImage*)Element->Data)->Width;
38 Widget_UpdateMinDims(Element->Parent);
40 // NOTE: Doesn't update Element->Text because it's not really needed here
43 DEFWIDGETTYPE(ELETYPE_IMAGE,
44 WIDGETTYPE_FLAG_NOCHILDREN,
45 .Render = Widget_Image_Render,
46 .UpdateText = Widget_Image_UpdateText