scbpoints.h

Go to the documentation of this file.
00001 #ifndef SCBPOINTS_H_
00002 #define SCBPOINTS_H_
00003 
00004 /*
00005  * File Name  : scbpoints.h
00006  * 
00007  * Description: Scribble library points array definition
00008  */
00009 
00010 /*
00011  * This file is part of liberscribble.
00012  *
00013  * liberscribble is free software: you can redistribute it and/or modify
00014  * it under the terms of the GNU General Public License as published by
00015  * the Free Software Foundation, either version 2 of the License, or
00016  * (at your option) any later version.
00017  *
00018  * liberscribble is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00025  */
00026 
00027 /**
00028  * Copyright (C) 2008 iRex Technologies B.V.
00029  * All rights reserved.
00030  */
00031  
00032 
00033 //----------------------------------------------------------------------------
00034 // Include Files
00035 //----------------------------------------------------------------------------
00036 
00037 // system include files, between < >
00038 #include <glib.h>
00039 
00040 // ereader include files, between < >
00041 
00042 // local include files, between " "
00043 #include "scbpoint.h"
00044 
00045 G_BEGIN_DECLS
00046 
00047 
00048 //----------------------------------------------------------------------------
00049 // Definitions
00050 //---------------------------------------------------------------------------- 
00051 
00052 
00053 //----------------------------------------------------------------------------
00054 // Forward Declarations
00055 //----------------------------------------------------------------------------
00056 
00057 
00058 //----------------------------------------------------------------------------
00059 // Type Declarations
00060 //----------------------------------------------------------------------------    
00061     
00062 // Scribble points array
00063 // Two arrays are used so that the points can be easily exported to GTK/GDK and X11
00064 // without allocating any other memory
00065 typedef struct _ScbPoints
00066 {
00067     GArray* points;         /**< Array of the coordintate points */ 
00068     GArray* pressures;      /**< Array of the pressures corresponding to each point */
00069 } ScbPoints;
00070 
00071 typedef ScbPoints * ScbPointsPtr;
00072 
00073 
00074 //----------------------------------------------------------------------------
00075 // Global Constants
00076 //----------------------------------------------------------------------------
00077 
00078 
00079 //============================================================================
00080 // Public Functions
00081 //============================================================================
00082 
00083 // Create a points array with given size
00084 // @param points the pointer of the ScbPoints intance
00085 // @param initSize the size used for allocating memory
00086 // @return return TRUE if the points array is successfully created, otherwise return FALSE
00087 gboolean erscribble_points_new(ScbPointsPtr points, const int initSize);
00088 
00089 // Release the points array and all items in it
00090 // @param points the array to be freed
00091 void erscribble_points_free(ScbPointsPtr points);
00092 
00093 // Append a new point to the rear of the array
00094 // @param points the scribble points array
00095 // @param point the point to be appended
00096 void erscribble_points_append(ScbPointsPtr points, ScbDevPointPtr point);
00097 
00098 // Get the number of points in the array
00099 // @param ptr the scribble points array
00100 // @return return the number of points
00101 int erscribble_points_get_count(ScbPointsPtr ptr);
00102 
00103 // Get the start address of the points array
00104 // @param points the scribble points array
00105 // @return return the pointer of the first item in the array
00106 ScbPointPtr erscribble_points_get_data(ScbPointsPtr points);
00107 
00108 // Dump the data of points
00109 // This function can be used for debug
00110 void erscribble_points_dump(ScbPointsPtr points);
00111 
00112 
00113 G_END_DECLS
00114 
00115 #endif
Generated by  doxygen 1.6.2-20100208