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 Header: ink_rw.h 00025 * 00026 * Description: 00027 * brief- the reader/writer API for ink data structure. 00028 * 00029 * Author: Jian Shen, (C) 2006 00030 * 00031 * Copyright: See COPYING file that comes with this distribution 00032 * 00033 */ 00034 00035 #ifndef _INK_RW_H 00036 #define _INK_RW_H 00037 00038 #include <libermanifest/ermanifest.h> 00039 00040 #include "ink.h" 00041 00042 #ifdef __cplusplus 00043 extern "C" 00044 { 00045 #endif 00046 00047 //read ink object from ink file. 00048 extern PtrInk file_read_ink(const char *inkfile); 00049 00050 //write ink object to ink file 00051 extern unsigned char file_write_ink (PtrInk ink, const char *inkfile); 00052 00053 00054 /* Reference .irx fomat 00055 00056 <?xml version="1.0" ?> 00057 <version> 00058 <number>1.0</number> 00059 <organization>iRex Technologies</organization> 00060 </version> 00061 <screen> 00062 <units>px</units> 00063 <dpi>160</dpi> 00064 </screen> 00065 <pages> 00066 <page backgroundcolor="#FFFFFF" id="0"> 00067 <orientation>0</orientation> 00068 <width>768</width> 00069 <height>935</height> 00070 <strokes> 00071 <stroke layer="0" color="#000000" pensize="3" 00072 linestyle="solid"> 00073 000 00074 10 3 0 00075 </stroke> 00076 <stroke layer="0" color="#000000" pensize="1" 00077 linestyle="solid"> 00078 20 25 0 00079 30 30 0 00080 </stroke> 00081 </strokes> 00082 </page> 00083 </pages> 00084 */ 00085 00086 // read ink object from xml handle.the new ink should be free after use. 00087 // if successed return 1, else return 0 00088 extern PtrInk xml_read_ink(erManifest *pXmlHandle,const char* sPageName); 00089 00090 //write header information to .irx 00091 extern int xml_write_irxHead(erManifest *pErManiHandle); 00092 00093 // write one page to xml. under xpath.(end without'/') 00094 extern gboolean xml_write_ink (erManifest *pXmlHandle,const char* xpath, 00095 const PtrInk pink,const char* sPageName); 00096 00097 #ifdef __cplusplus 00098 } 00099 #endif 00100 00101 #endif
1.5.6