00001 /* 00002 * This file is part of scribble. 00003 * 00004 * scribble is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * scribble is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00023 #ifndef _INK_H 00024 #define _INK_H 00025 00026 #ifdef __cplusplus 00027 extern "C" 00028 { 00029 #endif 00030 00031 #include <gtk/gtk.h> 00032 00033 typedef struct _Ink *PtrInk; 00034 typedef struct _Stroke *PtrStroke; 00035 typedef struct _InkPoint *PtrInkPoint; 00036 00037 typedef struct _Ink 00038 { 00039 int nStrokes; 00040 PtrStroke firstStroke; 00041 PtrStroke lastStroke; 00042 } Ink; 00043 00044 00045 typedef struct _Stroke 00046 { 00047 //for defining the stroke area 00048 int min_x; 00049 int min_y; 00050 int max_x; 00051 int max_y; 00052 00054 int iPenSize; 00055 GdkColor gdkColor;//only save it's rgb value 00056 00057 int nPoints; 00058 PtrInkPoint firstPoint; 00059 PtrInkPoint lastPoint; 00060 PtrStroke nextStroke; 00061 } Stroke; 00062 00063 typedef struct _InkPoint 00064 { 00065 int x; 00066 int y; 00067 PtrInkPoint nextPoint; 00068 } InkPoint; 00069 00070 extern PtrInk construct_ink (); 00071 extern void destroy_ink (PtrInk ink); 00072 00073 extern PtrStroke construct_stroke (); 00074 extern PtrStroke destroy_stroke (PtrStroke stroke); 00075 00076 extern PtrInkPoint construct_point (); 00077 extern PtrInkPoint destroy_point (PtrInkPoint point); 00078 00079 extern unsigned char ink_add_stroke (PtrInk ink, PtrStroke stroke); 00080 extern int get_num_of_strokes (PtrInk ink); 00081 00082 extern unsigned char ink_add_point (PtrStroke stroke, PtrInkPoint point); 00083 extern int get_num_of_points (PtrStroke stroke); 00084 00085 #ifdef __cplusplus 00086 } 00087 #endif 00088 00089 #endif /* _INK_H */
1.5.6