rtk.h File Reference

#include <stdio.h>
#include <math.h>
#include <gtk/gtk.h>

Go to the source code of this file.


Data Structures

struct  _stg_rtk_app_t
struct  _stg_rtk_canvas_t
struct  _stg_rtk_fig_t
struct  _stg_rtk_flasher_t
struct  _stg_rtk_menuitem_t
struct  _stg_rtk_region_t
struct  _stg_rtk_stroke_t
struct  _stg_rtk_table_t
struct  _stg_rtk_tableitem_t
struct  stg_rtk_image_stroke_t
struct  stg_rtk_menu_t
struct  stg_rtk_point_stroke_t
struct  stg_rtk_point_t
struct  stg_rtk_polygon_stroke_t
struct  stg_rtk_text_stroke_t

Defines

#define STK_B_RGB16(x)   (((x) << 3) & 0xF8)
#define STK_CANVAS_LAYERS   100
#define STK_EVENT_MOTION   2
#define STK_EVENT_MOUSE_NOT_OVER   5
#define STK_EVENT_MOUSE_OVER   4
#define STK_EVENT_PRESS   1
#define STK_EVENT_RELEASE   3
#define STK_G_RGB16(x)   (((x) >> 3) & 0xFC)
#define STK_IMAGE_FORMAT_JPEG   0
#define STK_IMAGE_FORMAT_PNG   2
#define STK_IMAGE_FORMAT_PNM   3
#define STK_IMAGE_FORMAT_PPM   1
#define STK_MOVE_PAN   (1 << 0)
#define STK_MOVE_ROT   (1 << 1)
#define STK_MOVE_SCALE   (1 << 2)
#define STK_MOVE_TRANS   (1 << 0)
#define STK_MOVE_ZOOM   (1 << 1)
#define STK_R_RGB16(x)   (((x) >> 8) & 0xF8)
#define STK_RGB16(r, g, b)   (((b) >> 3) | (((g) & 0xFC) << 3) | (((r) & 0xF8) << 8))

Typedefs

typedef _stg_rtk_app_t stg_rtk_app_t
typedef _stg_rtk_canvas_t stg_rtk_canvas_t
typedef GdkColor stg_rtk_color_t
typedef _stg_rtk_fig_t stg_rtk_fig_t
typedef _stg_rtk_flasher_t stg_rtk_flasher_t
typedef void(* stg_rtk_menuitem_fn_t )(struct _stg_rtk_menuitem_t *menuitem)
typedef _stg_rtk_menuitem_t stg_rtk_menuitem_t
typedef void(* stg_rtk_mouse_fn_t )(struct _stg_rtk_fig_t *fig, int event, int mode)
typedef _stg_rtk_region_t stg_rtk_region_t
typedef void(* stg_rtk_stroke_fn_t )(struct _stg_rtk_fig_t *fig, void *stroke)
typedef _stg_rtk_stroke_t stg_rtk_stroke_t
typedef _stg_rtk_table_t stg_rtk_table_t
typedef _stg_rtk_tableitem_t stg_rtk_tableitem_t

Functions

stg_rtk_app_tstg_rtk_app_create (void)
void stg_rtk_app_destroy (stg_rtk_app_t *app)
int stg_rtk_app_main (stg_rtk_app_t *app)
void stg_rtk_app_main_init (stg_rtk_app_t *app)
int stg_rtk_app_main_loop (stg_rtk_app_t *app)
void stg_rtk_app_main_term (stg_rtk_app_t *app)
void stg_rtk_canvas_bgcolor (stg_rtk_canvas_t *canvas, double r, double g, double b)
stg_rtk_canvas_tstg_rtk_canvas_create (stg_rtk_app_t *app)
void stg_rtk_canvas_destroy (stg_rtk_canvas_t *canvas)
void stg_rtk_canvas_export_image (stg_rtk_canvas_t *canvas, const char *filename, int format)
void stg_rtk_canvas_flash (stg_rtk_canvas_t *canvas, struct _stg_rtk_fig_t *fig, int duration, int kill)
void stg_rtk_canvas_flash_update (stg_rtk_canvas_t *canvas)
void stg_rtk_canvas_get_origin (stg_rtk_canvas_t *canvas, double *ox, double *oy)
void stg_rtk_canvas_get_scale (stg_rtk_canvas_t *canvas, double *sx, double *sy)
void stg_rtk_canvas_get_size (stg_rtk_canvas_t *canvas, int *sizex, int *sizey)
int stg_rtk_canvas_isclosed (stg_rtk_canvas_t *canvas)
void stg_rtk_canvas_layer_show (stg_rtk_canvas_t *canvas, int layer, char show)
void stg_rtk_canvas_linewidth (stg_rtk_canvas_t *canvas, int width)
void stg_rtk_canvas_movemask (stg_rtk_canvas_t *canvas, int mask)
void stg_rtk_canvas_movie_frame (stg_rtk_canvas_t *canvas)
int stg_rtk_canvas_movie_start (stg_rtk_canvas_t *canvas, const char *filename, double fps, double speed)
void stg_rtk_canvas_movie_stop (stg_rtk_canvas_t *canvas)
void stg_rtk_canvas_origin (stg_rtk_canvas_t *canvas, double ox, double oy)
void stg_rtk_canvas_render (stg_rtk_canvas_t *canvas)
void stg_rtk_canvas_scale (stg_rtk_canvas_t *canvas, double sx, double sy)
void stg_rtk_canvas_size (stg_rtk_canvas_t *canvas, int sizex, int sizey)
void stg_rtk_canvas_title (stg_rtk_canvas_t *canvas, const char *title)
void stg_rtk_fig_add_mouse_handler (stg_rtk_fig_t *fig, stg_rtk_mouse_fn_t callback)
void stg_rtk_fig_and_descendents_destroy (stg_rtk_fig_t *fig)
void stg_rtk_fig_arrow (stg_rtk_fig_t *fig, double ox, double oy, double oa, double len, double head)
void stg_rtk_fig_arrow_ex (stg_rtk_fig_t *fig, double ax, double ay, double bx, double by, double head)
void stg_rtk_fig_arrow_fancy (stg_rtk_fig_t *fig, double ox, double oy, double oa, double len, double head, double thickness, int filled)
void stg_rtk_fig_blink (stg_rtk_fig_t *fig, int interval_ms, int flag)
void stg_rtk_fig_clear (stg_rtk_fig_t *fig)
void stg_rtk_fig_color (stg_rtk_fig_t *fig, double r, double g, double b)
void stg_rtk_fig_color_rgb32 (stg_rtk_fig_t *fig, int color)
stg_rtk_fig_tstg_rtk_fig_create (stg_rtk_canvas_t *canvas, stg_rtk_fig_t *parent, int layer)
stg_rtk_fig_tstg_rtk_fig_create_ex (stg_rtk_canvas_t *canvas, stg_rtk_fig_t *parent, int layer, void *userdata)
void stg_rtk_fig_destroy (stg_rtk_fig_t *fig)
void stg_rtk_fig_destroy_later (stg_rtk_fig_t *fig, int life_ms)
void stg_rtk_fig_ellipse (stg_rtk_fig_t *fig, double ox, double oy, double oa, double sx, double sy, int filled)
void stg_rtk_fig_ellipse_arc (stg_rtk_fig_t *fig, double ox, double oy, double oa, double sx, double sy, double min_th, double max_th)
void stg_rtk_fig_get_origin (stg_rtk_fig_t *fig, double *ox, double *oy, double *oa)
void stg_rtk_fig_grid (stg_rtk_fig_t *fig, double ox, double oy, double dx, double dy, double sp)
void stg_rtk_fig_image (stg_rtk_fig_t *fig, double ox, double oy, double oa, double scale, int width, int height, int bpp, void *image, void *mask)
void stg_rtk_fig_line (stg_rtk_fig_t *fig, double ax, double ay, double bx, double by)
void stg_rtk_fig_line_ex (stg_rtk_fig_t *fig, double ox, double oy, double oa, double size)
void stg_rtk_fig_linewidth (stg_rtk_fig_t *fig, int width)
int stg_rtk_fig_mouse_over (stg_rtk_fig_t *fig)
int stg_rtk_fig_mouse_selected (stg_rtk_fig_t *fig)
void stg_rtk_fig_movemask (stg_rtk_fig_t *fig, int mask)
void stg_rtk_fig_origin (stg_rtk_fig_t *fig, double ox, double oy, double oa)
void stg_rtk_fig_origin_global (stg_rtk_fig_t *fig, double ox, double oy, double oa)
void stg_rtk_fig_point (stg_rtk_fig_t *fig, double ox, double oy)
void stg_rtk_fig_polygon (stg_rtk_fig_t *fig, double ox, double oy, double oa, int point_count, double points[][2], int filled)
void stg_rtk_fig_rectangle (stg_rtk_fig_t *fig, double ox, double oy, double oa, double sx, double sy, int filled)
void stg_rtk_fig_remove_mouse_handler (stg_rtk_fig_t *fig, stg_rtk_mouse_fn_t callback)
void stg_rtk_fig_scale (stg_rtk_fig_t *fig, double scale)
void stg_rtk_fig_show (stg_rtk_fig_t *fig, int show)
void stg_rtk_fig_text (stg_rtk_fig_t *fig, double ox, double oy, double oa, const char *text)
void stg_rtk_fig_text_bubble (stg_rtk_fig_t *fig, double ox, double oy, double oa, const char *text, double bx, double by)
int stg_rtk_initxx (int *argc, char ***argv)
stg_rtk_menu_tstg_rtk_menu_create (stg_rtk_canvas_t *canvas, const char *label)
stg_rtk_menu_tstg_rtk_menu_create_sub (stg_rtk_menu_t *menu, const char *label)
void stg_rtk_menu_destroy (stg_rtk_menu_t *menu)
void stg_rtk_menuitem_check (stg_rtk_menuitem_t *item, int check)
stg_rtk_menuitem_tstg_rtk_menuitem_create (stg_rtk_menu_t *menu, const char *label, int check)
void stg_rtk_menuitem_destroy (stg_rtk_menuitem_t *item)
int stg_rtk_menuitem_enable (stg_rtk_menuitem_t *item, int enable)
int stg_rtk_menuitem_isactivated (stg_rtk_menuitem_t *item)
int stg_rtk_menuitem_ischecked (stg_rtk_menuitem_t *item)
void stg_rtk_menuitem_set_callback (stg_rtk_menuitem_t *item, stg_rtk_menuitem_fn_t callback)
stg_rtk_region_tstg_rtk_region_create (void)
void stg_rtk_region_destroy (stg_rtk_region_t *region)
void stg_rtk_region_get_brect (stg_rtk_region_t *region, GdkRectangle *rect)
void stg_rtk_region_set_empty (stg_rtk_region_t *region)
void stg_rtk_region_set_union (stg_rtk_region_t *regiona, stg_rtk_region_t *regionb)
void stg_rtk_region_set_union_rect (stg_rtk_region_t *region, int ax, int ay, int bx, int by)
int stg_rtk_region_test_empty (stg_rtk_region_t *region)
int stg_rtk_region_test_intersect (stg_rtk_region_t *regiona, stg_rtk_region_t *regionb)
stg_rtk_table_tstg_rtk_table_create (stg_rtk_app_t *app, int width, int height)
void stg_rtk_table_destroy (stg_rtk_table_t *table)
stg_rtk_tableitem_tstg_rtk_tableitem_create_int (stg_rtk_table_t *table, const char *label, int low, int high)
int stg_rtk_tableitem_get_int (stg_rtk_tableitem_t *item)
void stg_rtk_tableitem_set_int (stg_rtk_tableitem_t *item, int value)

Define Documentation

#define STK_B_RGB16  )     (((x) << 3) & 0xF8)
 

#define STK_CANVAS_LAYERS   100
 

#define STK_EVENT_MOTION   2
 

#define STK_EVENT_MOUSE_NOT_OVER   5
 

#define STK_EVENT_MOUSE_OVER   4
 

#define STK_EVENT_PRESS   1
 

#define STK_EVENT_RELEASE   3
 

#define STK_G_RGB16  )     (((x) >> 3) & 0xFC)
 

#define STK_IMAGE_FORMAT_JPEG   0
 

#define STK_IMAGE_FORMAT_PNG   2
 

#define STK_IMAGE_FORMAT_PNM   3
 

#define STK_IMAGE_FORMAT_PPM   1
 

#define STK_MOVE_PAN   (1 << 0)
 

#define STK_MOVE_ROT   (1 << 1)
 

#define STK_MOVE_SCALE   (1 << 2)
 

#define STK_MOVE_TRANS   (1 << 0)
 

#define STK_MOVE_ZOOM   (1 << 1)
 

#define STK_R_RGB16  )     (((x) >> 8) & 0xF8)
 

#define STK_RGB16 r,
g,
 )     (((b) >> 3) | (((g) & 0xFC) << 3) | (((r) & 0xF8) << 8))
 


Typedef Documentation

typedef struct _stg_rtk_app_t stg_rtk_app_t
 

typedef struct _stg_rtk_canvas_t stg_rtk_canvas_t
 

typedef GdkColor stg_rtk_color_t
 

typedef struct _stg_rtk_fig_t stg_rtk_fig_t
 

typedef struct _stg_rtk_flasher_t stg_rtk_flasher_t
 

typedef void(* stg_rtk_menuitem_fn_t)(struct _stg_rtk_menuitem_t *menuitem)
 

typedef struct _stg_rtk_menuitem_t stg_rtk_menuitem_t
 

typedef void(* stg_rtk_mouse_fn_t)(struct _stg_rtk_fig_t *fig, int event, int mode)
 

typedef struct _stg_rtk_region_t stg_rtk_region_t
 

typedef void(* stg_rtk_stroke_fn_t)(struct _stg_rtk_fig_t *fig, void *stroke)
 

typedef struct _stg_rtk_stroke_t stg_rtk_stroke_t
 

typedef struct _stg_rtk_table_t stg_rtk_table_t
 

typedef struct _stg_rtk_tableitem_t stg_rtk_tableitem_t
 


Function Documentation

stg_rtk_app_t* stg_rtk_app_create void   ) 
 

void stg_rtk_app_destroy stg_rtk_app_t app  ) 
 

int stg_rtk_app_main stg_rtk_app_t app  ) 
 

void stg_rtk_app_main_init stg_rtk_app_t app  ) 
 

int stg_rtk_app_main_loop stg_rtk_app_t app  ) 
 

void stg_rtk_app_main_term stg_rtk_app_t app  ) 
 

void stg_rtk_canvas_bgcolor stg_rtk_canvas_t canvas,
double  r,
double  g,
double  b
 

stg_rtk_canvas_t* stg_rtk_canvas_create stg_rtk_app_t app  ) 
 

void stg_rtk_canvas_destroy stg_rtk_canvas_t canvas  ) 
 

void stg_rtk_canvas_export_image stg_rtk_canvas_t canvas,
const char *  filename,
int  format
 

void stg_rtk_canvas_flash stg_rtk_canvas_t canvas,
struct _stg_rtk_fig_t fig,
int  duration,
int  kill
 

void stg_rtk_canvas_flash_update stg_rtk_canvas_t canvas  ) 
 

void stg_rtk_canvas_get_origin stg_rtk_canvas_t canvas,
double *  ox,
double *  oy
 

void stg_rtk_canvas_get_scale stg_rtk_canvas_t canvas,
double *  sx,
double *  sy
 

void stg_rtk_canvas_get_size stg_rtk_canvas_t canvas,
int *  sizex,
int *  sizey
 

int stg_rtk_canvas_isclosed stg_rtk_canvas_t canvas  ) 
 

void stg_rtk_canvas_layer_show stg_rtk_canvas_t canvas,
int  layer,
char  show
 

void stg_rtk_canvas_linewidth stg_rtk_canvas_t canvas,
int  width
 

void stg_rtk_canvas_movemask stg_rtk_canvas_t canvas,
int  mask
 

void stg_rtk_canvas_movie_frame stg_rtk_canvas_t canvas  ) 
 

int stg_rtk_canvas_movie_start stg_rtk_canvas_t canvas,
const char *  filename,
double  fps,
double  speed
 

void stg_rtk_canvas_movie_stop stg_rtk_canvas_t canvas  ) 
 

void stg_rtk_canvas_origin stg_rtk_canvas_t canvas,
double  ox,
double  oy
 

void stg_rtk_canvas_render stg_rtk_canvas_t canvas  ) 
 

void stg_rtk_canvas_scale stg_rtk_canvas_t canvas,
double  sx,
double  sy
 

void stg_rtk_canvas_size stg_rtk_canvas_t canvas,
int  sizex,
int  sizey
 

void stg_rtk_canvas_title stg_rtk_canvas_t canvas,
const char *  title
 

void stg_rtk_fig_add_mouse_handler stg_rtk_fig_t fig,
stg_rtk_mouse_fn_t  callback
 

void stg_rtk_fig_and_descendents_destroy stg_rtk_fig_t fig  ) 
 

void stg_rtk_fig_arrow stg_rtk_fig_t fig,
double  ox,
double  oy,
double  oa,
double  len,
double  head
 

void stg_rtk_fig_arrow_ex stg_rtk_fig_t fig,
double  ax,
double  ay,
double  bx,
double  by,
double  head
 

void stg_rtk_fig_arrow_fancy stg_rtk_fig_t fig,
double  ox,
double  oy,
double  oa,
double  len,
double  head,
double  thickness,
int  filled
 

void stg_rtk_fig_blink stg_rtk_fig_t fig,
int  interval_ms,
int  flag
 

void stg_rtk_fig_clear stg_rtk_fig_t fig  ) 
 

void stg_rtk_fig_color stg_rtk_fig_t fig,
double  r,
double  g,
double  b
 

void stg_rtk_fig_color_rgb32 stg_rtk_fig_t fig,
int  color
 

stg_rtk_fig_t* stg_rtk_fig_create stg_rtk_canvas_t canvas,
stg_rtk_fig_t parent,
int  layer
 

stg_rtk_fig_t* stg_rtk_fig_create_ex stg_rtk_canvas_t canvas,
stg_rtk_fig_t parent,
int  layer,
void *  userdata
 

void stg_rtk_fig_destroy stg_rtk_fig_t fig  ) 
 

void stg_rtk_fig_destroy_later stg_rtk_fig_t fig,
int  life_ms
 

void stg_rtk_fig_ellipse stg_rtk_fig_t fig,
double  ox,
double  oy,
double  oa,
double  sx,
double  sy,
int  filled
 

void stg_rtk_fig_ellipse_arc stg_rtk_fig_t fig,
double  ox,
double  oy,
double  oa,
double  sx,
double  sy,
double  min_th,
double  max_th
 

void stg_rtk_fig_get_origin stg_rtk_fig_t fig,
double *  ox,
double *  oy,
double *  oa
 

void stg_rtk_fig_grid stg_rtk_fig_t fig,
double  ox,
double  oy,
double  dx,
double  dy,
double  sp
 

void stg_rtk_fig_image stg_rtk_fig_t fig,
double  ox,
double  oy,
double  oa,
double  scale,
int  width,
int  height,
int  bpp,
void *  image,
void *  mask
 

void stg_rtk_fig_line stg_rtk_fig_t fig,
double  ax,
double  ay,
double  bx,
double  by
 

void stg_rtk_fig_line_ex stg_rtk_fig_t fig,
double  ox,
double  oy,
double  oa,
double  size
 

void stg_rtk_fig_linewidth stg_rtk_fig_t fig,
int  width
 

int stg_rtk_fig_mouse_over stg_rtk_fig_t fig  ) 
 

int stg_rtk_fig_mouse_selected stg_rtk_fig_t fig  ) 
 

void stg_rtk_fig_movemask stg_rtk_fig_t fig,
int  mask
 

void stg_rtk_fig_origin stg_rtk_fig_t fig,
double  ox,
double  oy,
double  oa
 

void stg_rtk_fig_origin_global stg_rtk_fig_t fig,
double  ox,
double  oy,
double  oa
 

void stg_rtk_fig_point stg_rtk_fig_t fig,
double  ox,
double  oy
 

void stg_rtk_fig_polygon stg_rtk_fig_t fig,
double  ox,
double  oy,
double  oa,
int  point_count,
double  points[][2],
int  filled
 

void stg_rtk_fig_rectangle stg_rtk_fig_t fig,
double  ox,
double  oy,
double  oa,
double  sx,
double  sy,
int  filled
 

void stg_rtk_fig_remove_mouse_handler stg_rtk_fig_t fig,
stg_rtk_mouse_fn_t  callback
 

void stg_rtk_fig_scale stg_rtk_fig_t fig,
double  scale
 

void stg_rtk_fig_show stg_rtk_fig_t fig,
int  show
 

void stg_rtk_fig_text stg_rtk_fig_t fig,
double  ox,
double  oy,
double  oa,
const char *  text
 

void stg_rtk_fig_text_bubble stg_rtk_fig_t fig,
double  ox,
double  oy,
double  oa,
const char *  text,
double  bx,
double  by
 

int stg_rtk_initxx int *  argc,
char ***  argv
 

stg_rtk_menu_t* stg_rtk_menu_create stg_rtk_canvas_t canvas,
const char *  label
 

stg_rtk_menu_t* stg_rtk_menu_create_sub stg_rtk_menu_t menu,
const char *  label
 

void stg_rtk_menu_destroy stg_rtk_menu_t menu  ) 
 

void stg_rtk_menuitem_check stg_rtk_menuitem_t item,
int  check
 

stg_rtk_menuitem_t* stg_rtk_menuitem_create stg_rtk_menu_t menu,
const char *  label,
int  check
 

void stg_rtk_menuitem_destroy stg_rtk_menuitem_t item  ) 
 

int stg_rtk_menuitem_enable stg_rtk_menuitem_t item,
int  enable
 

int stg_rtk_menuitem_isactivated stg_rtk_menuitem_t item  ) 
 

int stg_rtk_menuitem_ischecked stg_rtk_menuitem_t item  ) 
 

void stg_rtk_menuitem_set_callback stg_rtk_menuitem_t item,
stg_rtk_menuitem_fn_t  callback
 

stg_rtk_region_t* stg_rtk_region_create void   ) 
 

void stg_rtk_region_destroy stg_rtk_region_t region  ) 
 

void stg_rtk_region_get_brect stg_rtk_region_t region,
GdkRectangle *  rect
 

void stg_rtk_region_set_empty stg_rtk_region_t region  ) 
 

void stg_rtk_region_set_union stg_rtk_region_t regiona,
stg_rtk_region_t regionb
 

void stg_rtk_region_set_union_rect stg_rtk_region_t region,
int  ax,
int  ay,
int  bx,
int  by
 

int stg_rtk_region_test_empty stg_rtk_region_t region  ) 
 

int stg_rtk_region_test_intersect stg_rtk_region_t regiona,
stg_rtk_region_t regionb
 

stg_rtk_table_t* stg_rtk_table_create stg_rtk_app_t app,
int  width,
int  height
 

void stg_rtk_table_destroy stg_rtk_table_t table  ) 
 

stg_rtk_tableitem_t* stg_rtk_tableitem_create_int stg_rtk_table_t table,
const char *  label,
int  low,
int  high
 

int stg_rtk_tableitem_get_int stg_rtk_tableitem_t item  ) 
 

void stg_rtk_tableitem_set_int stg_rtk_tableitem_t item,
int  value
 


Generated on Thu Dec 13 13:55:22 2007 for Stage by  doxygen 1.4.6