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_render(stg_rtk_fig_t *fig); 00080 extern void stg_rtk_fig_render_xfig(stg_rtk_fig_t *fig); 00081 extern int stg_rtk_fig_hittest(stg_rtk_fig_t *fig, int dx, int dy); 00082 extern void stg_rtk_fig_on_mouse(stg_rtk_fig_t *fig, int event, int mode); 00083 00084 00085 // Append an item to a linked list 00086 #define STK_LIST_APPEND(head, item) \ 00087 item->prev = head;\ 00088 item->next = NULL;\ 00089 if (head == NULL)\ 00090 head = item;\ 00091 else\ 00092 {\ 00093 while (item->prev->next)\ 00094 item->prev = item->prev->next;\ 00095 item->prev->next = item;\ 00096 } 00097 00098 // Remove an item from a linked list 00099 #define STK_LIST_REMOVE(head, item) \ 00100 if (item->prev)\ 00101 item->prev->next = item->next;\ 00102 if (item->next)\ 00103 item->next->prev = item->prev;\ 00104 if (item == head)\ 00105 head = item->next; 00106 00107 // Append an item to a linked list 00108 #define STK_LIST_APPENDX(head, list, item) \ 00109 item->list##_##prev = head;\ 00110 item->list##_##next = NULL;\ 00111 if (head == NULL)\ 00112 head = item;\ 00113 else\ 00114 {\ 00115 while (item->list##_##prev->list##_##next)\ 00116 item->list##_##prev = item->list##_##prev->list##_##next;\ 00117 item->list##_##prev->list##_##next = item;\ 00118 } 00119 00120 // Remove an item from a linked list 00121 #define STK_LIST_REMOVEX(head, list, item) \ 00122 if (item->list##_##prev)\ 00123 item->list##_##prev->list##_##next = item->list##_##next;\ 00124 if (item->list##_##next)\ 00125 item->list##_##next->list##_##prev = item->list##_##prev;\ 00126 if (item == head)\ 00127 head = item->list##_##next; 00128 00129 #endif
Generated on Thu Aug 11 13:08:10 2005 for Stage by 1.4.0