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 - 2010 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 * @file stat.h 00027 * Contains everything needed from stat.c : structures and defines 00028 */ 00029 #ifndef _PLUGIN_STAT_H_ 00030 #define _PLUGIN_STAT_H_ 00031 00032 #include <libheraia.h> 00033 00034 #define API_VERSION 1 00035 #define PLUGIN_TYPE HERAIA_PLUGIN_ACTION 00036 00037 #define PLUGIN_NAME "stat" 00038 #define PLUGIN_VERSION "1.1" 00039 #define PLUGIN_SUMMARY "stat" 00040 #define PLUGIN_DESCRIPTION N_("Does some stats on the opened file") 00041 #define PLUGIN_AUTHOR "Olivier Delhomme <heraia@delhomme.org>" 00042 #define PLUGIN_HOMEPAGE "http://heraia.tuxfamily.org/" 00043 00044 00045 typedef struct 00046 { 00047 guint64 max; /**< maximum value */ 00048 guint64 min; /**< minimum value */ 00049 guint64 mean; /**< mean value */ 00050 guint nb_val; /**< number of different values */ 00051 } histo_infos_t; 00052 00053 00054 /** 00055 * This is the stat structure 00056 */ 00057 typedef struct 00058 { 00059 guint64 histo1D[256]; /**< The values for the 1D histogram */ 00060 guint64 histo2D[256][256]; /**< The values for the 2D histogram */ 00061 histo_infos_t *infos_1D; /**< stores mathematical datas on the histogram (1D) */ 00062 histo_infos_t *infos_2D; /**< stores mathematical datas on the histogram (2D) */ 00063 GdkPixbuf *pixbuf_1D; /**< Pixbuf to be displayed (1D) */ 00064 GdkPixbuf *pixbuf_2D; /**< Pixbuf to be displayed (2D) */ 00065 gchar *dirname; /**< last openned directory where files were saved */ 00066 } stat_t; 00067 00068 00069 /** 00070 * The plugin interface functions 00071 */ 00072 extern void init(heraia_struct_t *); /**< When the application initialy starts up */ 00073 extern void quit(void); /**< When the application exits */ 00074 extern void run (GtkWidget *, gpointer); /**< To run anything everytime the plugin is called */ 00075 extern void refresh(heraia_struct_t *, void *); /**< Called every refresh time (New file & cursor move) */ 00076 extern heraia_plugin_t *heraia_plugin_init(heraia_plugin_t *); 00077 00078 #endif /* _PLUGIN_STAT_H_ */