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 SCBPOINTS_H_ 00024 #define SCBPOINTS_H_ 00025 #include <glib.h> 00026 #include "scbpoint.h" 00027 00028 #ifdef __cplusplus 00029 extern "C" 00030 { 00031 #endif 00032 00033 // use two arrays so that we can easily expose the points to GTK/GDK and X11 00034 // without allocating any other memory 00035 typedef struct _ScbPoints 00036 { 00037 GArray* points; 00038 GArray* pressures; 00039 }ScbPoints; 00040 typedef ScbPoints * ScbPointsPtr; 00041 00042 // allocate an array with initSize 00043 gboolean scb_points_new(ScbPointsPtr points, const int initSize); 00044 00045 // release the array and all items in the array 00046 void scb_points_free(ScbPointsPtr points); 00047 00048 // push point back to array 00049 void scb_points_append(ScbPointsPtr points, ScbDevPointPtr point); 00050 00051 // how many points does the array contain 00052 int scb_points_get_count(ScbPointsPtr ptr); 00053 00054 // retrieve data &ScbPoint[0]. output 00055 ScbPointPtr scb_points_get_data(ScbPointsPtr points); 00056 00057 // dump 00058 void scb_points_dump(ScbPointsPtr points); 00059 00060 #ifdef __cplusplus 00061 } 00062 #endif 00063 00064 #endif
1.5.6