Heraia  0.1.8
data_interpretor.h
Go to the documentation of this file.
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /*
3  data_interpretor.h
4  heraia - an hexadecimal file editor and analyser based on ghex
5 
6  (C) Copyright 2005 - 2011 Olivier Delhomme
7  e-mail : heraia@delhomme.org
8  URL : http://heraia.tuxfamily.org
9 
10  This program is free software; you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 2, or (at your option)
13  any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
23 /**
24  * @file data_interpretor.h
25  * Header file for the data interpretor
26  */
27 
28 #ifndef _DATA_INTERPRETOR_H_
29 #define _DATA_INTERPRETOR_H_
30 
31 /**
32  * @note
33  * Naming :
34  * H stands for Heraia
35  * DI stands for Data_Interpretor
36  *
37  * @def H_DI_DISPLAYED
38  * Says whether data_interpretor is displayed or not
39  * @todo this is used at initialisation time. We can add a new option to the
40  * program in order to say wether we want the data interpretor to be
41  * visible or not (regardless of options saved ?)
42  *
43  * @def H_DI_BIG_ENDIAN
44  * Stands for big endian representation
45  *
46  * @def H_DI_MIDDLE_ENDIAN
47  * Stands for middle endian representation (http://en.wikipedia.org/wiki/Endianness#Middle-endian)
48  *
49  * @def H_DI_LITTLE_ENDIAN
50  * Stands for little endian representation (this is the default)
51  */
52 #define H_DI_DISPLAYED FALSE /* By default the Data Interpretor Window is not displayed */
53 
54 /* Little Endian, Middle Endian and Big Endian in a reverse order ;) */
55 #define H_DI_BIG_ENDIAN 2
56 #define H_DI_MIDDLE_ENDIAN 4
57 #define H_DI_LITTLE_ENDIAN 8
58 
59 extern guint which_endianness(heraia_struct_t *main_struct);
60 extern guint which_stream_size(heraia_struct_t *main_struct);
61 
62 extern void data_interpretor_init_interface(heraia_struct_t *main_struct);
63 extern void refresh_data_interpretor_window(GtkWidget *hexwidget, gpointer data);
64 
65 extern void add_tab_in_data_interpretor(GtkNotebook *notebook, tab_t *tab);
66 extern tab_t *add_new_tab_in_data_interpretor(GtkNotebook *notebook, guint index, const gchar *label, guint num_cols, ...);
67 extern void add_new_row_to_tab(tab_t *tab, decode_generic_t *row);
68 
69 extern gint di_get_selected_tab(heraia_struct_t *main_struct);
70 extern void di_set_selected_tab(heraia_struct_t *main_struct, gint selected_tab);
71 
72 extern gint di_get_stream_size(heraia_struct_t *main_struct);
73 extern void di_set_stream_size(heraia_struct_t *main_struct, gint stream_size);
74 
75 extern gint di_get_endianness(heraia_struct_t *main_struct);
76 extern void di_set_endianness(heraia_struct_t *main_struct, gint endianness);
77 
78 #endif /* _DATA_INTERPRETOR_H_ */
This is the main structure.
Definition: libheraia.h:332
Tabulation structure to be used in the GtkNoteBook of data_interpretor's window.
Definition: libheraia.h:190
tab_t * add_new_tab_in_data_interpretor(GtkNotebook *notebook, guint index, const gchar *label, guint num_cols,...)
Adds a new tab in the data interpretor window.
void add_tab_in_data_interpretor(GtkNotebook *notebook, tab_t *tab)
gint di_get_stream_size(heraia_struct_t *main_struct)
Gets the stream_size (if any) from data interpretor's window.
gint di_get_selected_tab(heraia_struct_t *main_struct)
Gets the selected tab (if any) from data interpretor's notebook.
void add_new_row_to_tab(tab_t *tab, decode_generic_t *row)
Adds a row to a particular tab.
void di_set_endianness(heraia_struct_t *main_struct, gint endianness)
Sets the endianness as stated by the second parameter.
void refresh_data_interpretor_window(GtkWidget *hexwidget, gpointer data)
Refreshes the data interpretor window with the new values.
void di_set_stream_size(heraia_struct_t *main_struct, gint stream_size)
Sets the stream size (if possible) to data interpretor's notebook.
guint which_endianness(heraia_struct_t *main_struct)
Determines which endianness is selected that is to say which radio button is active in the window...
guint which_stream_size(heraia_struct_t *main_struct)
returns stream size as selected in the spin button
void data_interpretor_init_interface(heraia_struct_t *main_struct)
Inits the data interpretor structure and window with default values.
Basic way to have as many as we want decoding functions corresponding to one label.
Definition: libheraia.h:176
void di_set_selected_tab(heraia_struct_t *main_struct, gint selected_tab)
Sets the selected tab (if possible) to data interpretor's notebook.
gint di_get_endianness(heraia_struct_t *main_struct)
Gets the endianness as selected in the radio group button.