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_flasher_t
struct  _stg_rtk_fig_t
struct  _stg_rtk_stroke_t
struct  stg_rtk_point_t
struct  stg_rtk_point_stroke_t
struct  stg_rtk_polygon_stroke_t
struct  stg_rtk_text_stroke_t
struct  stg_rtk_image_stroke_t
struct  _stg_rtk_region_t
struct  stg_rtk_menu_t
struct  _stg_rtk_menuitem_t
struct  _stg_rtk_tableitem_t
struct  _stg_rtk_table_t

Defines

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

Typedefs

typedef _stg_rtk_app_t stg_rtk_app_t
typedef _stg_rtk_canvas_t stg_rtk_canvas_t
typedef _stg_rtk_flasher_t stg_rtk_flasher_t
typedef GdkColor stg_rtk_color_t
typedef void(* stg_rtk_mouse_fn_t )(struct _stg_rtk_fig_t *fig, int event, int mode)
typedef _stg_rtk_fig_t stg_rtk_fig_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_region_t stg_rtk_region_t
typedef void(* stg_rtk_menuitem_fn_t )(struct _stg_rtk_menuitem_t *menuitem)
typedef _stg_rtk_menuitem_t stg_rtk_menuitem_t
typedef _stg_rtk_tableitem_t stg_rtk_tableitem_t
typedef _stg_rtk_table_t stg_rtk_table_t

Functions

int stg_rtk_initxx (int *argc, char ***argv)
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)
void stg_rtk_app_main_term (stg_rtk_app_t *app)
int stg_rtk_app_main_loop (stg_rtk_app_t *app)
stg_rtk_canvas_tstg_rtk_canvas_create (stg_rtk_app_t *app)
void stg_rtk_canvas_destroy (stg_rtk_canvas_t *canvas)
int stg_rtk_canvas_isclosed (stg_rtk_canvas_t *canvas)
void stg_rtk_canvas_title (stg_rtk_canvas_t *canvas, const char *title)
void stg_rtk_canvas_size (stg_rtk_canvas_t *canvas, int sizex, int sizey)
void stg_rtk_canvas_get_size (stg_rtk_canvas_t *canvas, int *sizex, int *sizey)
void stg_rtk_canvas_origin (stg_rtk_canvas_t *canvas, double ox, double oy)
void stg_rtk_canvas_get_origin (stg_rtk_canvas_t *canvas, double *ox, double *oy)
void stg_rtk_canvas_scale (stg_rtk_canvas_t *canvas, double sx, double sy)
void stg_rtk_canvas_get_scale (stg_rtk_canvas_t *canvas, double *sx, double *sy)
void stg_rtk_canvas_movemask (stg_rtk_canvas_t *canvas, int mask)
void stg_rtk_canvas_font (stg_rtk_canvas_t *canvas, const char *fontname)
void stg_rtk_canvas_bgcolor (stg_rtk_canvas_t *canvas, double r, double g, double b)
void stg_rtk_canvas_linewidth (stg_rtk_canvas_t *canvas, int width)
void stg_rtk_canvas_render (stg_rtk_canvas_t *canvas)
void stg_rtk_canvas_export_image (stg_rtk_canvas_t *canvas, const char *filename, int format)
int stg_rtk_canvas_movie_start (stg_rtk_canvas_t *canvas, const char *filename, double fps, double speed)
void stg_rtk_canvas_movie_frame (stg_rtk_canvas_t *canvas)
void stg_rtk_canvas_movie_stop (stg_rtk_canvas_t *canvas)
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_layer_show (stg_rtk_canvas_t *canvas, int layer, char show)
stg_rtk_fig_tstg_rtk_fig_create (stg_rtk_canvas_t *canvas, stg_rtk_fig_t *parent, int layer)
void stg_rtk_fig_destroy (stg_rtk_fig_t *fig)
void stg_rtk_fig_and_descendents_destroy (stg_rtk_fig_t *fig)
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_add_mouse_handler (stg_rtk_fig_t *fig, stg_rtk_mouse_fn_t callback)
void stg_rtk_fig_remove_mouse_handler (stg_rtk_fig_t *fig, stg_rtk_mouse_fn_t callback)
void stg_rtk_fig_clear (stg_rtk_fig_t *fig)
void stg_rtk_fig_show (stg_rtk_fig_t *fig, int show)
void stg_rtk_fig_movemask (stg_rtk_fig_t *fig, int mask)
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_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_get_origin (stg_rtk_fig_t *fig, double *ox, double *oy, double *oa)
void stg_rtk_fig_scale (stg_rtk_fig_t *fig, double scale)
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)
void stg_rtk_fig_linewidth (stg_rtk_fig_t *fig, int width)
void stg_rtk_fig_point (stg_rtk_fig_t *fig, double ox, double oy)
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_rectangle (stg_rtk_fig_t *fig, double ox, double oy, double oa, double sx, double sy, int filled)
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_polygon (stg_rtk_fig_t *fig, double ox, double oy, double oa, int point_count, double points[][2], int filled)
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_text (stg_rtk_fig_t *fig, double ox, double oy, double oa, const char *text)
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_blink (stg_rtk_fig_t *fig, int interval_ms, int flag)
stg_rtk_region_tstg_rtk_region_create (void)
void stg_rtk_region_destroy (stg_rtk_region_t *region)
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)
void stg_rtk_region_get_brect (stg_rtk_region_t *region, GdkRectangle *rect)
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_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)
stg_rtk_menuitem_tstg_rtk_menuitem_create (stg_rtk_menu_t *menu, const char *label, int check)
void stg_rtk_menuitem_set_callback (stg_rtk_menuitem_t *item, stg_rtk_menuitem_fn_t callback)
void stg_rtk_menuitem_destroy (stg_rtk_menuitem_t *item)
int stg_rtk_menuitem_isactivated (stg_rtk_menuitem_t *item)
void stg_rtk_menuitem_check (stg_rtk_menuitem_t *item, int check)
int stg_rtk_menuitem_ischecked (stg_rtk_menuitem_t *item)
int stg_rtk_menuitem_enable (stg_rtk_menuitem_t *item, int enable)
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)
void stg_rtk_tableitem_set_int (stg_rtk_tableitem_t *item, int value)
int stg_rtk_tableitem_get_int (stg_rtk_tableitem_t *item)

Define Documentation

#define STK_CANVAS_LAYERS   100
 

#define STK_MOVE_PAN   (1 << 0)
 

#define STK_MOVE_ZOOM   (1 << 1)
 

#define STK_MOVE_TRANS   (1 << 0)
 

#define STK_MOVE_ROT   (1 << 1)
 

#define STK_MOVE_SCALE   (1 << 2)
 

#define STK_EVENT_PRESS   1
 

#define STK_EVENT_MOTION   2
 

#define STK_EVENT_RELEASE   3
 

#define STK_EVENT_MOUSE_OVER   4
 

#define STK_EVENT_MOUSE_NOT_OVER   5
 

#define STK_IMAGE_FORMAT_JPEG   0
 

#define STK_IMAGE_FORMAT_PPM   1
 

#define STK_IMAGE_FORMAT_PNG   2
 

#define STK_IMAGE_FORMAT_PNM   3
 

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

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

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

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


Typedef Documentation

typedef struct _stg_rtk_app_t stg_rtk_app_t
 

typedef struct _stg_rtk_canvas_t stg_rtk_canvas_t
 

typedef struct _stg_rtk_flasher_t stg_rtk_flasher_t
 

typedef GdkColor stg_rtk_color_t
 

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

typedef struct _stg_rtk_fig_t stg_rtk_fig_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_region_t stg_rtk_region_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 struct _stg_rtk_tableitem_t stg_rtk_tableitem_t
 

typedef struct _stg_rtk_table_t stg_rtk_table_t
 


Function Documentation

int stg_rtk_initxx int *  argc,
char ***  argv
 

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  ) 
 

void stg_rtk_app_main_term stg_rtk_app_t app  ) 
 

int stg_rtk_app_main_loop stg_rtk_app_t app  ) 
 

stg_rtk_canvas_t* stg_rtk_canvas_create stg_rtk_app_t app  ) 
 

void stg_rtk_canvas_destroy stg_rtk_canvas_t canvas  ) 
 

int stg_rtk_canvas_isclosed stg_rtk_canvas_t canvas  ) 
 

void stg_rtk_canvas_title stg_rtk_canvas_t canvas,
const char *  title
 

void stg_rtk_canvas_size stg_rtk_canvas_t canvas,
int  sizex,
int  sizey
 

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

void stg_rtk_canvas_origin stg_rtk_canvas_t canvas,
double  ox,
double  oy
 

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

void stg_rtk_canvas_scale stg_rtk_canvas_t canvas,
double  sx,
double  sy
 

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

void stg_rtk_canvas_movemask stg_rtk_canvas_t canvas,
int  mask
 

void stg_rtk_canvas_font stg_rtk_canvas_t canvas,
const char *  fontname
 

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

void stg_rtk_canvas_linewidth stg_rtk_canvas_t canvas,
int  width
 

void stg_rtk_canvas_render stg_rtk_canvas_t canvas  ) 
 

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

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

void stg_rtk_canvas_movie_frame stg_rtk_canvas_t canvas  ) 
 

void stg_rtk_canvas_movie_stop stg_rtk_canvas_t canvas  ) 
 

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_layer_show stg_rtk_canvas_t canvas,
int  layer,
char  show
 

stg_rtk_fig_t* stg_rtk_fig_create stg_rtk_canvas_t canvas,
stg_rtk_fig_t parent,
int  layer
 

void stg_rtk_fig_destroy stg_rtk_fig_t fig  ) 
 

void stg_rtk_fig_and_descendents_destroy stg_rtk_fig_t fig  ) 
 

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_add_mouse_handler stg_rtk_fig_t fig,
stg_rtk_mouse_fn_t  callback
 

void stg_rtk_fig_remove_mouse_handler stg_rtk_fig_t fig,
stg_rtk_mouse_fn_t  callback
 

void stg_rtk_fig_clear stg_rtk_fig_t fig  ) 
 

void stg_rtk_fig_show stg_rtk_fig_t fig,
int  show
 

void stg_rtk_fig_movemask stg_rtk_fig_t fig,
int  mask
 

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_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_get_origin stg_rtk_fig_t fig,
double *  ox,
double *  oy,
double *  oa
 

void stg_rtk_fig_scale stg_rtk_fig_t fig,
double  scale
 

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
 

void stg_rtk_fig_linewidth stg_rtk_fig_t fig,
int  width
 

void stg_rtk_fig_point stg_rtk_fig_t fig,
double  ox,
double  oy
 

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_rectangle stg_rtk_fig_t fig,
double  ox,
double  oy,
double  oa,
double  sx,
double  sy,
int  filled
 

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_polygon stg_rtk_fig_t fig,
double  ox,
double  oy,
double  oa,
int  point_count,
double  points[][2],
int  filled
 

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_text stg_rtk_fig_t fig,
double  ox,
double  oy,
double  oa,
const char *  text
 

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_blink stg_rtk_fig_t fig,
int  interval_ms,
int  flag
 

stg_rtk_region_t* stg_rtk_region_create void   ) 
 

void stg_rtk_region_destroy stg_rtk_region_t region  ) 
 

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
 

void stg_rtk_region_get_brect stg_rtk_region_t region,
GdkRectangle *  rect
 

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_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  ) 
 

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

void stg_rtk_menuitem_set_callback stg_rtk_menuitem_t item,
stg_rtk_menuitem_fn_t  callback
 

void stg_rtk_menuitem_destroy stg_rtk_menuitem_t item  ) 
 

int stg_rtk_menuitem_isactivated stg_rtk_menuitem_t item  ) 
 

void stg_rtk_menuitem_check stg_rtk_menuitem_t item,
int  check
 

int stg_rtk_menuitem_ischecked stg_rtk_menuitem_t item  ) 
 

int stg_rtk_menuitem_enable stg_rtk_menuitem_t item,
int  enable
 

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
 

void stg_rtk_tableitem_set_int stg_rtk_tableitem_t item,
int  value
 

int stg_rtk_tableitem_get_int stg_rtk_tableitem_t item  ) 
 


Generated on Thu Aug 11 13:08:10 2005 for Stage by  doxygen 1.4.0