00001 /* 00002 * This file is part of liberscribble. 00003 * 00004 * liberscribble 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 * liberscribble 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 DRIVER_H_ 00024 #define DRIVER_H_ 00025 00026 // use kernel driver to fast draw pixel 00027 // internal use 00028 #include <sys/time.h> 00029 #include "scbconfig.h" 00030 #include "scbpoint.h" 00031 #include <liberdm/erdm.h> 00032 #include <glib.h> 00033 00034 #ifdef __cplusplus 00035 extern "C" 00036 { 00037 #endif 00038 00039 typedef struct _DrvPointInfo 00040 { 00041 unsigned short x; 00042 unsigned short y; 00043 unsigned char size; 00044 unsigned char color; 00045 unsigned char pen_down; 00046 }DrvPointInfo; 00047 00048 typedef struct _DrvPointsBuf 00049 { 00050 unsigned int count; 00051 DrvPointInfo points [SCB_DEF_FAST_DRAW_BUF_LEN]; 00052 } DrvPointsBuf; 00053 typedef DrvPointsBuf * DrvPointsBufPtr; 00054 00055 // for ioctl request 00056 void scb_driver_init(); 00057 void scb_driver_close(); 00058 void scb_driver_draw(DrvPointsBufPtr ptr); 00059 00060 // fast draw control 00061 typedef struct _FastDrawContext 00062 { 00063 struct timeval t1, t2; // start end 00064 DrvPointsBuf points; 00065 }FastDrawContext; 00066 00067 void scb_fast_draw_reset_context(); 00068 gboolean scb_fast_draw_now(); 00069 void scb_fast_draw_record(const ScbDevPointPtr ptr, 00070 const unsigned char size, 00071 const unsigned char color, 00072 const unsigned char pen_down); 00073 void scb_fast_draw(); 00074 void scb_fast_draw_points(DrvPointsBufPtr ptr); 00075 00076 #ifdef __cplusplus 00077 } 00078 #endif 00079 00080 00081 #endif
1.5.6