src/X_supp.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <cairo.h>
#include <cairo-xlib.h>
#include "mb_redraw_man.h"
#include "mb_timer.h"
#include "mb_X_supp.h"

Go to the source code of this file.

Classes

struct  _X_kb_info
struct  _X_MB_runtime

Defines

#define ERR   -1
#define OK   0
#define ERR   -1
#define OK   0

Functions

static int keycode2sym (X_kb_info_t *kbinfo, unsigned int keycode)
static int X_kb_init (X_kb_info_t *kbinfo, Display *display, redraw_man_t *rdman)
static void X_kb_destroy (X_kb_info_t *kbinfo)
static void X_kb_handle_event (X_kb_info_t *kbinfo, XKeyEvent *xkey)
 Accept X keyboard events from handle_x_event() and dispatch it.
static unsigned int get_button_state (unsigned int state)
static unsigned int get_button (unsigned int button)
static void notify_shapes (redraw_man_t *rdman, shape_t *shape, co_aix x, co_aix y, int etype, unsigned int state, unsigned int button)
 Notify observers of the shape at specified position for mouse event.
static void handle_x_event (X_MB_runtime_t *rt)
 Dispatch all X events in the queue.
void X_MB_handle_connection (X_MB_runtime_t *rt)
 Handle connection coming data and timeout of timers.
static int X_init_connection (const char *display_name, int w, int h, Display **displayp, Visual **visualp, Window *winp)
static int X_MB_init (const char *display_name, int w, int h, X_MB_runtime_t *xmb_rt)
 Initialize a MadButterfy runtime for Xlib.
static void X_MB_destroy (X_MB_runtime_t *xmb_rt)
X_MB_runtime_tX_MB_new (const char *display_name, int w, int h)
void X_MB_free (X_MB_runtime_t *rt)
subject_tX_MB_kbevents (X_MB_runtime_t *xmb_rt)
redraw_man_tX_MB_rdman (X_MB_runtime_t *xmb_rt)
mb_tman_tX_MB_tman (X_MB_runtime_t *xmb_rt)
ob_factory_tX_MB_ob_factory (X_MB_runtime_t *xmb_rt)


Define Documentation

#define ERR   -1

Definition at line 344 of file X_supp.c.

#define ERR   -1

Definition at line 344 of file X_supp.c.

#define OK   0

Definition at line 345 of file X_supp.c.

#define OK   0

Definition at line 345 of file X_supp.c.


Function Documentation

static unsigned int get_button ( unsigned int  button  )  [static]

Definition at line 128 of file X_supp.c.

static unsigned int get_button_state ( unsigned int  state  )  [static]

Definition at line 115 of file X_supp.c.

static void handle_x_event ( X_MB_runtime_t rt  )  [static]

Dispatch all X events in the queue.

Definition at line 170 of file X_supp.c.

static void notify_shapes ( redraw_man_t rdman,
shape_t shape,
co_aix  x,
co_aix  y,
int  etype,
unsigned int  state,
unsigned int  button 
) [static]

Notify observers of the shape at specified position for mouse event.

Observers of parent shapes may be called if the subject is not with SUBF_STOP_PROPAGATE flag. The subject of mouse event for a shape is returned by sh_get_mouse_event_subject().

Definition at line 147 of file X_supp.c.

static int X_init_connection ( const char *  display_name,
int  w,
int  h,
Display **  displayp,
Visual **  visualp,
Window *  winp 
) [static]

Definition at line 347 of file X_supp.c.

static void X_MB_destroy ( X_MB_runtime_t xmb_rt  )  [static]

Definition at line 435 of file X_supp.c.

void X_MB_free ( X_MB_runtime_t rt  ) 

Definition at line 475 of file X_supp.c.

void X_MB_handle_connection ( X_MB_runtime_t rt  ) 

Handle connection coming data and timeout of timers.

Parameters:
display is a Display returned by XOpenDisplay().
rdman is a redraw manager.
tman is a timer manager.
The display is managed by specified rdman and tman. rdman draws on the display, and tman trigger actions according timers.

Definition at line 299 of file X_supp.c.

static int X_MB_init ( const char *  display_name,
int  w,
int  h,
X_MB_runtime_t xmb_rt 
) [static]

Initialize a MadButterfy runtime for Xlib.

It setups a runtime environment to run MadButterfly with Xlib. Users should specify width and height of the opening window.

Definition at line 400 of file X_supp.c.

subject_t* X_MB_kbevents ( X_MB_runtime_t xmb_rt  ) 

Definition at line 480 of file X_supp.c.

X_MB_runtime_t* X_MB_new ( const char *  display_name,
int  w,
int  h 
)

Definition at line 460 of file X_supp.c.

ob_factory_t* X_MB_ob_factory ( X_MB_runtime_t xmb_rt  ) 

Definition at line 492 of file X_supp.c.

redraw_man_t* X_MB_rdman ( X_MB_runtime_t xmb_rt  ) 

Definition at line 484 of file X_supp.c.

mb_tman_t* X_MB_tman ( X_MB_runtime_t xmb_rt  ) 

Definition at line 488 of file X_supp.c.

SourceForge.net Logo