driver.h

Go to the documentation of this file.
00001 #ifndef DRIVER_H_
00002 #define DRIVER_H_
00003 
00004 /**
00005  * File Name: driver.h
00006  */
00007 
00008 /*
00009  * This file is part of liberscribble.
00010  *
00011  * liberscribble is free software: you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation, either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * liberscribble is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00023  */
00024 
00025 /**
00026  * Copyright (C) 2008 iRex Technologies B.V.
00027  * All rights reserved.
00028  */
00029  
00030 
00031 //----------------------------------------------------------------------------
00032 // Include Files
00033 //----------------------------------------------------------------------------
00034 
00035 // system include files, between < >
00036 #include <glib.h>
00037 
00038 #ifdef ENABLE_DRIVER
00039 #include <sys/time.h>
00040 #endif
00041 
00042 // ereader include files, between < >
00043 
00044 // local include files, between " "
00045 #include "scbconfig.h"
00046 #include "scbpoint.h"
00047 
00048 G_BEGIN_DECLS
00049 
00050 
00051 //----------------------------------------------------------------------------
00052 // Definitions
00053 //---------------------------------------------------------------------------- 
00054 
00055 
00056 //----------------------------------------------------------------------------
00057 // Forward Declarations
00058 //----------------------------------------------------------------------------
00059 
00060 
00061 //----------------------------------------------------------------------------
00062 // Type Declarations
00063 //----------------------------------------------------------------------------
00064 
00065 typedef struct _DrvPointInfo
00066 {
00067     unsigned short x;
00068     unsigned short y;
00069     unsigned char  size;
00070     unsigned char  color;
00071     unsigned char  pen_down;
00072 } DrvPointInfo;
00073 
00074 typedef struct _DrvPointsBuf
00075 {
00076     unsigned int count;
00077     DrvPointInfo points [ERSCRIBBLE_DEF_DRIVER_DRAW_BUF_LEN];
00078 } DrvPointsBuf;
00079 
00080 typedef DrvPointsBuf * DrvPointsBufPtr;
00081 
00082 typedef struct _FastDrawContext
00083 {
00084 #ifdef ENABLE_DRIVER
00085     struct timeval  t1, t2;         // start end
00086 #endif
00087     DrvPointsBuf    points;
00088 } FastDrawContext;
00089 
00090 
00091 //----------------------------------------------------------------------------
00092 // Global Constants
00093 //----------------------------------------------------------------------------
00094 
00095 
00096 //============================================================================
00097 // Public Functions
00098 //============================================================================
00099 
00100 void erscribble_driver_init();
00101 void erscribble_driver_close();
00102 
00103 void erscribble_driver_draw_reset_context();
00104 
00105 gboolean erscribble_driver_draw_now();
00106 
00107 void erscribble_driver_draw_record(const ScbDevPointPtr ptr, 
00108                                    const unsigned char size, 
00109                                    const unsigned char color,
00110                                    const unsigned char pen_down);
00111 
00112 void erscribble_driver_draw();
00113 
00114 void erscribble_driver_draw_points(DrvPointsBufPtr ptr);
00115 
00116 void erscribble_driver_update_display();
00117 
00118 
00119 G_END_DECLS
00120 
00121 #endif
Generated by  doxygen 1.6.2-20100208