test.c

Go to the documentation of this file.
00001 /*
00002  * File Name: test.c
00003  */
00004 
00005 /*
00006  * This file is part of liberscribble.
00007  *
00008  * liberscribble is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * liberscribble is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00020  */
00021 
00022 /**
00023  * Copyright (C) 2008 iRex Technologies B.V.
00024  * All rights reserved.
00025  */
00026  
00027 #include "scb.h"
00028 
00029 void trace_empty(const char *format, ...)
00030 {
00031 }
00032 
00033 //#define TRACE(x, args...) fprintf(stderr, "(SCB_TEST)" __FILE__ ":%d,%s() " x "\n", __LINE__, __FUNCTION__ , ##args)
00034 #define TRACE trace_empty
00035 
00036 // construct a doc
00037 // add pages
00038 // add strokes
00039 // add point
00040 // dump
00041 // remove 
00042 void testDoc()
00043 {
00044     // doc
00045     ScbDocPtr doc = scb_doc_new();
00046     if (NULL == doc)
00047     {
00048         TRACE("Could not construct a scribble document!");
00049         return;
00050     }
00051 
00052     // page list
00053     ScbPagesPtr pages = scb_doc_get_pages(doc);
00054 
00055     // add some pages
00056     {
00057         ScbPageId id;
00058         ScbPagePtr page = NULL;
00059         int i = 0; 
00060         for(; i < 5; ++i)
00061         {
00062             scb_page_id_from_int(&id, i);
00063             page = scb_page_new(&id);
00064             scb_pages_add_page(pages, page);
00065         }
00066         scb_pages_dump(pages);
00067     }
00068 
00069     scb_doc_free(doc);
00070 }
00071 
00072 int main(int argc, char * argv[])
00073 {
00074     testDoc();
00075     return 0;
00076 }
Generated by  doxygen 1.6.2-20100208