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 // 00024 // C++ Interface: ScribbleDefine 00025 // 00026 // Description: 00027 // 00028 // 00029 // Author: Jian Shen, (C) 2006 00030 // 00031 // Copyright: See COPYING file that comes with this distribution 00032 // 00033 // 00034 #ifndef _SCRIBBLEDEFINE_H 00035 #define _SCRIBBLEDEFINE_H 00036 00037 #ifdef __cplusplus 00038 extern "C" 00039 { 00040 #endif 00041 00042 #include <gtk/gtk.h> 00043 #include <gdk/gdkx.h> 00044 00045 #include "ink.h" 00046 #include "FileManager.h" 00047 00048 #include <liberdm/erdm.h> 00049 #include <liberipc/eripc.h> 00050 #include <liberipc/eripctoolbar.h> 00051 #include <liberipc/eripcviewer.h> 00052 #include <liberipc/eripcpagebar.h> 00053 00054 #define PIXELBUFSIZE 25 00055 00056 typedef struct _PointInfo 00057 { 00058 unsigned short x; 00059 unsigned short y; 00060 unsigned char size; 00061 unsigned char color; 00062 unsigned char pen_down; 00063 }PointInfo; 00064 00065 typedef struct _PointsBuf 00066 { 00067 unsigned int count; 00068 PointInfo points [PIXELBUFSIZE]; 00069 } PointsBuf; 00070 00071 #define FBIO_IOCTL_BASE 'v' 00072 //x represent pensize 00073 #define FBIO_DRAWPIXELS _IOW(FBIO_IOCTL_BASE, 3, PointsBuf) 00074 00075 struct color 00076 { 00077 unsigned char b; 00078 unsigned char g; 00079 unsigned char r; 00080 unsigned char a; 00081 }; 00082 00083 typedef struct _ScribbleCoreCtx 00084 { 00085 //points buffer,avoid frequently flushing screen 00086 PointsBuf pointsBuf; 00087 //ink data to hold the strokes. 00088 PtrInk pink; 00089 //deleted ink file 00090 PtrInk pDelInk; 00091 //current stroke 00092 PtrStroke pCurrStroke; 00093 //has saved? 00094 gboolean bNeedSave; 00095 } ScribbleCoreCtx; 00096 00097 typedef ScribbleCoreCtx *PScribbleCoreCtx; 00098 00099 typedef enum { 00100 SIZE_1PIX=1, 00101 SIZE_3PIX=3, 00102 SIZE_5PIX=5, 00103 SIZE_7PIX=7, 00104 }PEN_SIZE;//pen size ,in pixels 00105 00106 //context for scribble UI 00107 typedef struct _ScribbleUICtx 00108 { 00109 FileManager fileManager; 00110 //scribble core ctx 00111 ScribbleCoreCtx scribbleCoreCtx; 00112 00113 //is pen_down?? 00114 gboolean pen_down; 00115 /* Backing pixmap for drawing area */ 00116 GdkPixmap *pixmap; 00117 //initial background pixmap. 00118 GdkPixmap *initBgPixMap; 00119 //last template name. 00120 const char *sLastTmplImg; 00121 00122 GtkWidget *drawing_area; 00123 00124 //handler to framebuffer; 00125 int fbdev; 00126 //last point in the screen 00127 GdkPoint lastPoint; 00128 } ScribbleUICtx; 00129 00130 typedef ScribbleUICtx *PScribbleUICtx; 00131 00132 #ifdef __cplusplus 00133 } 00134 #endif 00135 00136 #endif
1.5.6