changeset 259:e8a784a306d0

Initialize an image loader for X runtime
author Thinker K.F. Li <thinker@branda.to>
date Thu, 22 Jan 2009 18:10:47 +0800
parents f24129d4f0f9
children 29acbd8a0dd0
files include/mb_X_supp.h src/X_supp.c
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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;
+}