X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=Usermode%2FApplications%2Faxwin2_src%2FWM%2Fimage.c;fp=Usermode%2FApplications%2Faxwin2_src%2FWM%2Fimage.c;h=eab1d0eeb702d3503ea4b16644ddba947ddde885;hb=92517b68b7582251f69db7e062d5e5a4c773791f;hp=0000000000000000000000000000000000000000;hpb=ea71e58b0c3eca3744824fbd7e282ce47abfe334;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin2_src/WM/image.c b/Usermode/Applications/axwin2_src/WM/image.c new file mode 100644 index 00000000..eab1d0ee --- /dev/null +++ b/Usermode/Applications/axwin2_src/WM/image.c @@ -0,0 +1,51 @@ +/* + * Acess GUI (AxWin) Version 2 + * By John Hodge (thePowersGang) + * + * Window Manager and Widget Control + */ +#include "common.h" +#include +#include +#include + +// === IMPORTS === +extern tImage *Image_SIF_Parse(void *Buffer, size_t Size); + +// === CODE === +/** + * \brief Open an image from a URI + */ +tImage *Image_Load(const char *URI) +{ + #if 0 + tURI *uri; + int filesize; + void *buf; + tImage *img; + void *fp; + + uri = URI_Parse(URI); + + fp = URI_Open(URI_MODE_READ, uri); + if(!fp) return NULL; + free(uri); + + filesize = URI_GetSize(fp); + buf = malloc( filesize ); + if(!buf) { + URI_Close(fp); + return NULL; + } + + URI_Read(fp, filesize, buf); + URI_Close(fp); + + img = Image_SIF_Parse(buf, filesize); + free(buf); + + return img; + #else + return NULL; + #endif +}