annotate src/X_supp.h @ 79:5bcb329a5157

Fix bug of core dump caused by forget to check if parent is NULL, root.
author Thinker K.F. Li <thinker@branda.to>
date Wed, 20 Aug 2008 23:47:18 +0800
parents 3645e29e4986
children ea758bb3bbe2
rev   line source
78
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
1 #ifndef __X_SUPP_H_
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
2 #define __X_SUPP_H_
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
3
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
4 #include <X11/Xlib.h>
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
5 #include "mb_timer.h"
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
6 #include "redraw_man.h"
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
7
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
8 typedef struct _X_MB_runtime X_MB_runtime_t;
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
9 struct _X_MB_runtime {
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
10 Display *display;
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
11 Window win;
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
12 Visual *visual;
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
13 cairo_surface_t *surface, *backend_surface;
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
14 cairo_t *cr, *backend_cr;
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
15 redraw_man_t *rdman;
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
16 mb_tman_t *tman;
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
17 int w, h;
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
18 };
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
19
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
20 extern void X_MB_handle_connection(Display *display,
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
21 redraw_man_t *rdman,
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
22 mb_tman_t *tman);
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
23 extern int X_MB_init(const char *display_name,
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
24 int w, int h, X_MB_runtime_t *xmb_rt);
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
25 extern void X_MB_destroy(X_MB_runtime_t *xmb_rt);
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
26
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
27
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
28 #endif