rtkprivate.h
Go to the documentation of this file.00001 00002 00003 #ifndef STKPRIVATE_H 00004 #define STKPRIVATE_H 00005 00006 #if HAVE_CONFIG_H 00007 #include <config.h> 00008 #endif 00009 00010 #if HAVE_STDINT_H 00011 #include <stdint.h> 00012 #endif 00013 #include <sys/types.h> 00014 00015 // Boolean macros 00016 #ifndef TRUE 00017 #define TRUE 1 00018 #endif 00019 #ifndef FALSE 00020 #define FALSE 0 00021 #endif 00022 00023 // Error macros 00024 #define PRINT_ERR(m) printf("\rstg_rtk error : %s %s\n "m"\n", \ 00025 __FILE__, __FUNCTION__) 00026 #define PRINT_ERR1(m, a) printf("\rstg_rtk error : %s %s\n "m"\n", \ 00027 __FILE__, __FUNCTION__, a) 00028 #define PRINT_ERR2(m, a, b) printf("\rstg_rtk error : %s %s\n "m"\n", \ 00029 __FILE__, __FUNCTION__, a, b) 00030 00031 // Warning macros 00032 #define PRINT_WARN(m) printf("\rstg_rtk warning : %s %s\n "m"\n", \ 00033 __FILE__, __FUNCTION__) 00034 #define PRINT_WARN1(m, a) printf("\rstg_rtk warning : %s %s\n "m"\n", \ 00035 __FILE__, __FUNCTION__, a) 00036 #define PRINT_WARN2(m, a, b) printf("\rstg_rtk warning : %s %s\n "m"\n", \ 00037 __FILE__, __FUNCTION__, a, b) 00038 #define PRINT_WARN3(m, a, b, c) printf("\rstg_rtk warning : %s %s\n "m"\n", \ 00039 __FILE__, __FUNCTION__, a, b, c) 00040 00041 // Message macros 00042 #define PRINT_MSG(m) printf("stg_rtk msg : %s :\n "m"\n", __FILE__) 00043 #define PRINT_MSG1(m, a) printf("stg_rtk msg : %s :\n "m"\n", __FILE__, a) 00044 #define PRINT_MSG2(m, a, b) printf("stg_rtk msg : %s :\n "m"\n", __FILE__, a, b) 00045 00046 // DEBUG macros 00047 #ifdef DEBUG 00048 #define PRINT_DEBUG(m) printf("\rstg_rtk debug : %s %s\n "m"\n", \ 00049 __FILE__, __FUNCTION__) 00050 #define PRINT_DEBUG1(m, a) printf("\rstg_rtk debug : %s %s\n "m"\n", \ 00051 __FILE__, __FUNCTION__, a) 00052 #define PRINT_DEBUG2(m, a, b) printf("\rstg_rtk debug : %s %s\n "m"\n", \ 00053 __FILE__, __FUNCTION__, a, b) 00054 #define PRINT_DEBUG3(m, a, b, c) printf("\rstg_rtk debug : %s %s\n "m"\n", \ 00055 __FILE__, __FUNCTION__, a, b, c) 00056 #else 00057 #define PRINT_DEBUG(m) 00058 #define PRINT_DEBUG1(m, a) 00059 #define PRINT_DEBUG2(m, a, b) 00060 #define PRINT_DEBUG3(m, a, b, c) 00061 #endif 00062 00063 // Figures use these functions to add/remove themself from the canvas. 00064 extern void stg_rtk_canvas_add_fig(stg_rtk_canvas_t *canvas, stg_rtk_fig_t *fig); 00065 extern void stg_rtk_canvas_del_fig(stg_rtk_canvas_t *canvas, stg_rtk_fig_t *fig); 00066 00067 // Re-calculate all the figures in a canvas (private). 00068 extern void stg_rtk_canvas_calc(stg_rtk_canvas_t *canvas); 00069 00070 // Grab an image from the server 00071 extern uint16_t *stg_rtk_canvas_get_image_rgb16(stg_rtk_canvas_t *canvas, int sizex, int sizey); 00072 00073 // Grab an image from the server 00074 extern uint8_t *stg_rtk_canvas_get_image_rgb24(stg_rtk_canvas_t *canvas); 00075 00076 // Private figure functions 00077 extern void stg_rtk_fig_dirty(stg_rtk_fig_t *fig); 00078 extern void stg_rtk_fig_calc(stg_rtk_fig_t *fig); 00079 extern void stg_rtk_fig_calc_selection(stg_rtk_fig_t *fig); 00080 extern void stg_rtk_fig_render(stg_rtk_fig_t *fig); 00081 extern void stg_rtk_fig_render_xfig(stg_rtk_fig_t *fig); 00082 extern int stg_rtk_fig_hittest(stg_rtk_fig_t *fig, int dx, int dy); 00083 extern void stg_rtk_fig_on_mouse(stg_rtk_fig_t *fig, int event, int mode); 00084 00085 00086 // Append an item to a linked list 00087 #define STK_LIST_APPEND(head, item) \ 00088 item->prev = head;\ 00089 item->next = NULL;\ 00090 if (head == NULL)\ 00091 head = item;\ 00092 else\ 00093 {\ 00094 while (item->prev->next)\ 00095 item->prev = item->prev->next;\ 00096 item->prev->next = item;\ 00097 } 00098 00099 // Remove an item from a linked list 00100 #define STK_LIST_REMOVE(head, item) \ 00101 if (item->prev)\ 00102 item->prev->next = item->next;\ 00103 if (item->next)\ 00104 item->next->prev = item->prev;\ 00105 if (item == head)\ 00106 head = item->next; 00107 00108 // Append an item to a linked list 00109 #define STK_LIST_APPENDX(head, list, item) \ 00110 item->list##_##prev = head;\ 00111 item->list##_##next = NULL;\ 00112 if (head == NULL)\ 00113 head = item;\ 00114 else\ 00115 {\ 00116 while (item->list##_##prev->list##_##next)\ 00117 item->list##_##prev = item->list##_##prev->list##_##next;\ 00118 item->list##_##prev->list##_##next = item;\ 00119 } 00120 00121 // Remove an item from a linked list 00122 #define STK_LIST_REMOVEX(head, list, item) \ 00123 if (item->list##_##prev)\ 00124 item->list##_##prev->list##_##next = item->list##_##next;\ 00125 if (item->list##_##next)\ 00126 item->list##_##next->list##_##prev = item->list##_##prev;\ 00127 if (item == head)\ 00128 head = item->list##_##next; 00129 00130 #endif
Generated on Thu Dec 13 13:55:21 2007 for Stage by 1.4.6