# HG changeset patch # User Thinker K.F. Li # Date 1232619047 -28800 # Node ID e8a784a306d0ac73d3a210a215714aeeb4f89778 # Parent f24129d4f0f914829b558b1f40cbf57ca8a61cea Initialize an image loader for X runtime diff -r f24129d4f0f9 -r e8a784a306d0 include/mb_X_supp.h --- a/include/mb_X_supp.h Thu Jan 15 17:00:58 2009 +0800 +++ b/include/mb_X_supp.h Thu Jan 22 18:10:47 2009 +0800 @@ -5,6 +5,7 @@ #include "mb_types.h" #include "mb_timer.h" #include "mb_redraw_man.h" +#include "mb_img_ldr.h" /*! \ingroup xkb * @{ @@ -30,5 +31,6 @@ extern redraw_man_t *X_MB_rdman(X_MB_runtime_t *xmb_rt); extern mb_tman_t *X_MB_tman(X_MB_runtime_t *xmb_rt); extern ob_factory_t *X_MB_ob_factory(X_MB_runtime_t *xmb_rt); +extern mb_img_ldr_t *X_MB_img_ldr(X_MB_runtime_t *xmb_rt); #endif diff -r f24129d4f0f9 -r e8a784a306d0 src/X_supp.c --- a/src/X_supp.c Thu Jan 15 17:00:58 2009 +0800 +++ b/src/X_supp.c Thu Jan 22 18:10:47 2009 +0800 @@ -35,6 +35,7 @@ cairo_t *cr, *backend_cr; redraw_man_t *rdman; mb_tman_t *tman; + mb_img_ldr_t *img_ldr; int w, h; X_kb_info_t kbinfo; @@ -449,6 +450,8 @@ xmb_rt->tman = mb_tman_new(); + xmb_rt->img_ldr = simple_mb_img_ldr_new("./"); + #ifndef ONLY_MOUSE_MOVE_RAW xmb_rt->last = NULL; #endif @@ -467,6 +470,9 @@ if(xmb_rt->tman) mb_tman_free(xmb_rt->tman); + if(xmb_rt->img_ldr) + MB_IMG_LDR_FREE(xmb_rt->img_ldr); + if(xmb_rt->cr) cairo_destroy(xmb_rt->cr); if(xmb_rt->backend_cr) @@ -521,3 +527,11 @@ factory = rdman_get_ob_factory(xmb_rt->rdman); return factory; } + +mb_img_ldr_t *X_MB_img_ldr(X_MB_runtime_t *xmb_rt) { + X_MB_runtime_t *img_ldr; + + img_ldr = xmb_rt->img_ldr; + + return img_ldr; +}