Heraia  0.1.8
stat.h
Go to the documentation of this file.
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /*
3  stat.h
4  an heraia plugin to calculate some stats on the opened file
5  done as an example
6 
7  (C) Copyright 2007 - 2010 Olivier Delhomme
8  e-mail : heraia@delhomme.org
9  URL : http://heraia.tuxfamily.org
10 
11  This program is free software; you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation; either version 2, or (at your option)
14  any later version.
15 
16  This program is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with this program; if not, write to the Free Software
23  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 */
25 /**
26  * @file stat.h
27  * Contains everything needed from stat.c : structures and defines
28  */
29 #ifndef _PLUGIN_STAT_H_
30 #define _PLUGIN_STAT_H_
31 
32 #include <libheraia.h>
33 
34 #define API_VERSION 1
35 #define PLUGIN_TYPE HERAIA_PLUGIN_ACTION
36 
37 #define PLUGIN_NAME "stat"
38 #define PLUGIN_VERSION "1.1"
39 #define PLUGIN_SUMMARY "stat"
40 #define PLUGIN_DESCRIPTION N_("Does some stats on the opened file")
41 #define PLUGIN_AUTHOR "Olivier Delhomme <heraia@delhomme.org>"
42 #define PLUGIN_HOMEPAGE "http://heraia.tuxfamily.org/"
43 
44 
45 typedef struct
46 {
47  guint64 max; /**< maximum value */
48  guint64 min; /**< minimum value */
49  guint64 mean; /**< mean value */
50  guint nb_val; /**< number of different values */
52 
53 
54 /**
55  * This is the stat structure
56  */
57 typedef struct
58 {
59  guint64 histo1D[256]; /**< The values for the 1D histogram */
60  guint64 histo2D[256][256]; /**< The values for the 2D histogram */
61  histo_infos_t *infos_1D; /**< stores mathematical datas on the histogram (1D) */
62  histo_infos_t *infos_2D; /**< stores mathematical datas on the histogram (2D) */
63  GdkPixbuf *pixbuf_1D; /**< Pixbuf to be displayed (1D) */
64  GdkPixbuf *pixbuf_2D; /**< Pixbuf to be displayed (2D) */
65  gchar *dirname; /**< last openned directory where files were saved */
66 } stat_t;
67 
68 
69 /**
70  * The plugin interface functions
71  */
72 extern void init(heraia_struct_t *); /**< When the application initialy starts up */
73 extern void quit(void); /**< When the application exits */
74 extern void run (GtkWidget *, gpointer); /**< To run anything everytime the plugin is called */
75 extern void refresh(heraia_struct_t *, void *); /**< Called every refresh time (New file & cursor move) */
77 
78 #endif /* _PLUGIN_STAT_H_ */
This is the main structure.
Definition: libheraia.h:332
gchar * dirname
last openned directory where files were saved
Definition: stat.h:65
void init(heraia_struct_t *)
The plugin interface functions.
Definition: stat.c:117
guint nb_val
number of different values
Definition: stat.h:50
void run(GtkWidget *, gpointer)
To run anything everytime the plugin is called.
Definition: stat.c:173
heraia_plugin_t * heraia_plugin_init(heraia_plugin_t *)
Initialisation plugin function called when the plugin is loaded (some sort of pre-init) ...
Definition: stat.c:64
guint64 max
maximum value
Definition: stat.h:47
void refresh(heraia_struct_t *, void *)
Called every refresh time (New file & cursor move)
Definition: stat.c:226
histo_infos_t * infos_1D
stores mathematical datas on the histogram (1D)
Definition: stat.h:61
GdkPixbuf * pixbuf_1D
Pixbuf to be displayed (1D)
Definition: stat.h:63
guint64 min
minimum value
Definition: stat.h:48
This is the stat structure.
Definition: stat.h:57
Complete plugin structure.
Definition: plugin.h:141
void quit(void)
When the application exits.
Definition: stat.c:161
GdkPixbuf * pixbuf_2D
Pixbuf to be displayed (2D)
Definition: stat.h:64
This file contains all the definitions and includes all other .h files.
guint64 mean
mean value
Definition: stat.h:49
histo_infos_t * infos_2D
stores mathematical datas on the histogram (2D)
Definition: stat.h:62