#include "stat.h"
Go to the source code of this file.
Functions | |
static void | stat_window_connect_signals (heraia_plugin_t *plugin) |
static void | statw_close_clicked (GtkWidget *widget, gpointer data) |
static void | destroy_stat_window (GtkWidget *widget, GdkEvent *event, gpointer data) |
static void | statw_save_as_clicked (GtkWidget *widget, gpointer data) |
static gchar * | stat_select_file_to_save (void) |
static void | histo_radiobutton_toggled (GtkWidget *widget, gpointer data) |
static gboolean | delete_stat_window_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
static void | realize_some_numerical_stat (heraia_window_t *main_struct, heraia_plugin_t *plugin) |
static void | init_stats_histos (heraia_plugin_t *plugin) |
static void | populate_stats_histos (heraia_window_t *main_struct, heraia_plugin_t *plugin) |
static void | calc_infos_histo_1D (stat_t *extra) |
static void | calc_infos_histo_2D (stat_t *extra) |
static void | init_stats_pixbufs (stat_t *extra) |
static void | make_pixbufs_from_histos (stat_t *extra) |
static void | plot_in_pixbuf (GdkPixbuf *pixbuf, gint64 x, gint64 y, guchar red, guchar green, guchar blue, guchar alpha) |
static void | do_pixbuf_1D_from_histo1D (stat_t *extra) |
static void | do_pixbuf_2D_from_histo2D (stat_t *extra, guint max_2D) |
heraia_plugin_t * | heraia_plugin_init (heraia_plugin_t *plugin) |
void | init (heraia_window_t *main_struct) |
void | quit (void) |
void | run (GtkWidget *widget, gpointer data) |
void | refresh (heraia_window_t *main_struct, void *data) |
static void | line_in_pixbuf (GdkPixbuf *pixbuf, gint64 x, gint64 y) |
static void calc_infos_histo_1D | ( | stat_t * | extra | ) | [static] |
Seeks the histo1D struct to find the maximum value
Definition at line 451 of file stat.c.
References stat_t::histo1D, stat_t::infos_1D, histo_infos_t::max, histo_infos_t::mean, histo_infos_t::min, and histo_infos_t::nb_val.
Referenced by make_pixbufs_from_histos().
static void calc_infos_histo_2D | ( | stat_t * | extra | ) | [static] |
Seeks the histo2D struct to find the maximum value
Definition at line 491 of file stat.c.
References stat_t::histo1D, stat_t::histo2D, stat_t::infos_2D, histo_infos_t::max, histo_infos_t::mean, histo_infos_t::min, and histo_infos_t::nb_val.
Referenced by make_pixbufs_from_histos().
static gboolean delete_stat_window_event | ( | GtkWidget * | widget, | |
GdkEvent * | event, | |||
gpointer | data | |||
) | [static] |
Usefull functions for the stat plugin those may be included in an another .c source file ?! Signals handlers
Definition at line 205 of file stat.c.
References statw_close_clicked().
Referenced by stat_window_connect_signals().
static void destroy_stat_window | ( | GtkWidget * | widget, | |
GdkEvent * | event, | |||
gpointer | data | |||
) | [static] |
Definition at line 213 of file stat.c.
References statw_close_clicked().
Referenced by stat_window_connect_signals().
static void do_pixbuf_1D_from_histo1D | ( | stat_t * | extra | ) | [static] |
Fills the pixbuf with the corresponding data from the histo1D struct
Definition at line 617 of file stat.c.
References stat_t::histo1D, stat_t::infos_1D, line_in_pixbuf(), histo_infos_t::max, and stat_t::pixbuf_1D.
Referenced by make_pixbufs_from_histos().
static void do_pixbuf_2D_from_histo2D | ( | stat_t * | extra, | |
guint | max_2D | |||
) | [static] |
Fills the pixbuf with the corresponding data from the histo2D struct It is really hard to make something very visible (to make colors look really different between to height values)
Definition at line 641 of file stat.c.
References stat_t::histo2D, stat_t::infos_2D, histo_infos_t::max, histo_infos_t::mean, stat_t::pixbuf_2D, and plot_in_pixbuf().
Referenced by make_pixbufs_from_histos().
heraia_plugin_t* heraia_plugin_init | ( | heraia_plugin_t * | plugin | ) |
Initialisation plugin called when the plugin is loaded (some sort of pre-init)
Definition at line 50 of file stat.c.
References API_VERSION, plugin_info_t::api_version, plugin_info_t::author, plugin_info_t::description, window_prop_t::displayed, plugin_filter_t::export, plugin_filter_t::extensions, heraia_plugin_t::extra, heraia_plugin_t::filter, HERAIA_PRIORITY_DEFAULT, plugin_info_t::homepage, plugin_filter_t::import, heraia_plugin_t::info, stat_t::infos_1D, stat_t::infos_2D, init(), heraia_plugin_t::init_proc, plugin_info_t::name, PLUGIN_AUTHOR, PLUGIN_DESCRIPTION, PLUGIN_HOMEPAGE, PLUGIN_NAME, PLUGIN_STATE_INITIALIZING, PLUGIN_SUMMARY, PLUGIN_TYPE, PLUGIN_VERSION, plugin_info_t::priority, quit(), heraia_plugin_t::quit_proc, refresh(), heraia_plugin_t::refresh_proc, run(), heraia_plugin_t::run_proc, heraia_plugin_t::state, plugin_info_t::summary, plugin_info_t::type, plugin_info_t::version, heraia_plugin_t::win_prop, window_prop_t::x, heraia_plugin_t::xml, and window_prop_t::y.
Referenced by get_plugin_init_symbol().
static void histo_radiobutton_toggled | ( | GtkWidget * | widget, | |
gpointer | data | |||
) | [static] |
Definition at line 288 of file stat.c.
References heraia_plugin_t::extra, stat_t::pixbuf_1D, stat_t::pixbuf_2D, and heraia_plugin_t::xml.
Referenced by stat_window_connect_signals().
void init | ( | heraia_window_t * | main_struct | ) |
The real init function of the plugin
Definition at line 102 of file stat.c.
References plugin_info_t::author, heraia_plugin_t::cmi_entry, window_prop_t::displayed, find_plugin_by_name(), heraia_plugin_t::info, load_plugin_glade_xml(), log_message(), plugin_info_t::name, PLUGIN_NAME, heraia_window_t::plugins_list, stat_window_connect_signals(), heraia_plugin_t::win_prop, and heraia_plugin_t::xml.
Referenced by heraia_plugin_init().
static void init_stats_histos | ( | heraia_plugin_t * | plugin | ) | [static] |
Inits the histograms
Definition at line 391 of file stat.c.
References heraia_plugin_t::extra, stat_t::histo1D, and stat_t::histo2D.
Referenced by populate_stats_histos().
static void init_stats_pixbufs | ( | stat_t * | extra | ) | [static] |
Inits the image buffers
Definition at line 534 of file stat.c.
References stat_t::pixbuf_1D, and stat_t::pixbuf_2D.
Referenced by make_pixbufs_from_histos().
static void line_in_pixbuf | ( | GdkPixbuf * | pixbuf, | |
gint64 | x, | |||
gint64 | y | |||
) | [static] |
Prints a line of pixels in the corresponding pixbuf (1D histo)
Definition at line 587 of file stat.c.
Referenced by do_pixbuf_1D_from_histo1D().
static void make_pixbufs_from_histos | ( | stat_t * | extra | ) | [static] |
Makes the pixbufs from the histograms values
Definition at line 551 of file stat.c.
References calc_infos_histo_1D(), calc_infos_histo_2D(), do_pixbuf_1D_from_histo1D(), do_pixbuf_2D_from_histo2D(), stat_t::infos_1D, stat_t::infos_2D, init_stats_pixbufs(), and histo_infos_t::max.
Referenced by populate_stats_histos().
static void plot_in_pixbuf | ( | GdkPixbuf * | pixbuf, | |
gint64 | x, | |||
gint64 | y, | |||
guchar | red, | |||
guchar | green, | |||
guchar | blue, | |||
guchar | alpha | |||
) | [static] |
Prints a pixel in the corresponding pixbuf
Definition at line 567 of file stat.c.
Referenced by do_pixbuf_2D_from_histo2D().
static void populate_stats_histos | ( | heraia_window_t * | main_struct, | |
heraia_plugin_t * | plugin | |||
) | [static] |
Populates the histograms
Definition at line 411 of file stat.c.
References heraia_window_t::current_DW, data_window_t::current_hexwidget, heraia_plugin_t::extra, ghex_file_size(), stat_t::histo1D, stat_t::histo2D, init_stats_histos(), make_pixbufs_from_histos(), stat_t::pixbuf_1D, stat_t::pixbuf_2D, and heraia_plugin_t::xml.
Referenced by realize_some_numerical_stat().
void quit | ( | void | ) |
Normaly this is called when the plugin is unloaded One may wait it's entire life for this to be called !! ;)
Definition at line 144 of file stat.c.
References PLUGIN_NAME.
Referenced by heraia_plugin_init().
static void realize_some_numerical_stat | ( | heraia_window_t * | main_struct, | |
heraia_plugin_t * | plugin | |||
) | [static] |
Do some stats on the selected file (entire file is used)
Definition at line 343 of file stat.c.
References add_text_to_textview(), heraia_plugin_t::extra, heraia_window_t::filename, stat_t::infos_1D, stat_t::infos_2D, kill_text_from_textview(), log_message(), histo_infos_t::max, histo_infos_t::mean, histo_infos_t::min, histo_infos_t::nb_val, populate_stats_histos(), and heraia_plugin_t::xml.
Referenced by run().
void refresh | ( | heraia_window_t * | main_struct, | |
void * | data | |||
) |
The refresh function Called when a new file is loaded or when the cursor is moved Here we want to refresh the plugin only if a new file is loaded AND if the plugin is allready displayed (running)
Definition at line 182 of file stat.c.
References heraia_window_t::event, HERAIA_REFRESH_NEW_FILE, PLUGIN_STATE_RUNNING, heraia_plugin_t::run_proc, and heraia_plugin_t::state.
Referenced by heraia_plugin_init().
void run | ( | GtkWidget * | widget, | |
gpointer | data | |||
) |
This function is called via a signal handler when the menu entry is toggled
Definition at line 153 of file stat.c.
References heraia_plugin_t::cmi_entry, find_plugin_by_name(), PLUGIN_NAME, PLUGIN_STATE_NONE, PLUGIN_STATE_RUNNING, heraia_window_t::plugins_list, realize_some_numerical_stat(), show_hide_widget(), heraia_plugin_t::state, heraia_plugin_t::win_prop, and heraia_plugin_t::xml.
Referenced by heraia_plugin_init().
static gchar * stat_select_file_to_save | ( | void | ) | [static] |
static void stat_window_connect_signals | ( | heraia_plugin_t * | plugin | ) | [static] |
Connects all the signals to the correct functions
Definition at line 311 of file stat.c.
References delete_stat_window_event(), destroy_stat_window(), histo_radiobutton_toggled(), statw_close_clicked(), statw_save_as_clicked(), and heraia_plugin_t::xml.
Referenced by init().
static void statw_close_clicked | ( | GtkWidget * | widget, | |
gpointer | data | |||
) | [static] |
What to do when the window is closed
Definition at line 222 of file stat.c.
References heraia_plugin_t::cmi_entry, show_hide_widget(), heraia_plugin_t::win_prop, and heraia_plugin_t::xml.
Referenced by delete_stat_window_event(), destroy_stat_window(), and stat_window_connect_signals().
static void statw_save_as_clicked | ( | GtkWidget * | widget, | |
gpointer | data | |||
) | [static] |
What to do when the save as button is clicked
Definition at line 237 of file stat.c.
References stat_select_file_to_save(), and heraia_plugin_t::xml.
Referenced by stat_window_connect_signals().