stat.h

Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /*
00003   stat.h
00004   an heraia plugin to calculate some stats on the opened file
00005   done as an example
00006  
00007   (C) Copyright 2007 - 2008 Olivier Delhomme
00008   e-mail : heraia@delhomme.org
00009   URL    : http://heraia.tuxfamily.org
00010  
00011   This program 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, or  (at your option) 
00014   any later version.
00015  
00016   This program 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, write to the Free Software
00023   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
00024 */
00025 
00026 #ifndef _PLUGIN_STAT_H_
00027 #define _PLUGIN_STAT_H_
00028 
00029 #include <libheraia.h>
00030 
00031 #define API_VERSION 1
00032 #define PLUGIN_TYPE HERAIA_PLUGIN_ACTION
00033 
00034 #define PLUGIN_NAME "stat"
00035 #define PLUGIN_VERSION "1"
00036 #define PLUGIN_SUMMARY "stat"
00037 #define PLUGIN_DESCRIPTION "Does some stats on the opened file"
00038 #define PLUGIN_AUTHOR "Olivier Delhomme <heraia@delhomme.org>"
00039 #define PLUGIN_HOMEPAGE "http://heraia.tuxfamily.org/"
00040 
00041 typedef struct
00042 {
00043         guint64 max;   /* maximum value              */
00044         guint64 min;   /* minimum value              */
00045         guint64 mean;  /* mean value                 */
00046         guint nb_val;  /* number of different values */
00047 } histo_infos_t;
00048 
00049 
00050 /**
00051  *  This is the stat structure
00052  */
00053 typedef struct 
00054 {
00055         guint64 histo1D[256];        /* The values for the 1D histogram                 */
00056         guint64 histo2D[256][256];   /* The values for the 2D histogram                 */
00057         histo_infos_t *infos_1D;     /* stores mathematical datas on the histogram (1D) */
00058         histo_infos_t *infos_2D;     /* stores mathematical datas on the histogram (2D) */
00059         GdkPixbuf *pixbuf_1D;        /* Pixbuf to be displayed (1D)                     */
00060         GdkPixbuf *pixbuf_2D;        /* Pixbuf to be displayed (2D)                     */
00061 } stat_t;
00062 
00063 
00064 /** 
00065  *  The plugin interface functions
00066  */
00067 extern void init(heraia_window_t *);            /* When the application initialy starts up */
00068 extern void quit(void);                         /* When the application exits */
00069 extern void run (GtkWidget *, gpointer);        /* To run anything everytime the plugin is called */
00070 extern void refresh(heraia_window_t *, void *); /* Called every refresh time (New file & cursor move) */
00071 extern heraia_plugin_t *heraia_plugin_init(heraia_plugin_t *);
00072 
00073 #endif /* _PLUGIN_STAT_H_ */

Generated on Sat Feb 14 11:44:16 2009 for Heraia by  doxygen 1.5.6