data_interpretor.c

Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
00002 /*
00003   data_interpretor.c
00004   heraia - an hexadecimal file editor and analyser based on ghex
00005 
00006   (C) Copyright 2005 - 2009 Olivier Delhomme
00007   e-mail : heraia@delhomme.org
00008   URL    : http://heraia.tuxfamily.org
00009 
00010   This program is free software; you can redistribute it and/or modify
00011   it under the terms of the GNU General Public License as published by
00012   the Free Software Foundation; either version 2, or  (at your option)
00013   any later version.
00014 
00015   This program is distributed in the hope that it will be useful,
00016   but WITHOUT ANY WARRANTY;  without even the implied warranty of
00017   MERCHANTABILITY  or  FITNESS FOR A PARTICULAR PURPOSE.  See the
00018   GNU General Public License for more details.
00019 
00020   You should have received a copy of the GNU General Public License
00021   along with this program; if not, write to the Free Software
00022   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
00023 /**
00024  * @file data_interpretor.c
00025  * Here one may find tools to manage the data_interpretor window
00026  */
00027 #include <libheraia.h>
00028 
00029 static guint which_endianness(heraia_window_t *main_window);
00030 static guint which_stream_size(heraia_window_t *main_window);
00031 static void interpret(doc_t *doc, decode_t *decode_struct, decode_parameters_t *decode_parameters, guint length);
00032 static void close_data_interpretor_window(GtkWidget *widget, gpointer data);
00033 static void connect_data_interpretor_signals(heraia_window_t *main_window);
00034 static void refresh_one_row(doc_t *doc, decode_generic_t *row,  guint nb_cols, decode_parameters_t *decode_parameters);
00035 static void refresh_one_tab(doc_t *doc, data_window_t *dw, tab_t *tab, decode_parameters_t *decode_parameters);
00036 static void refresh_all_tabs(doc_t *doc, data_window_t *dw, decode_parameters_t *decode_parameters);
00037 static void add_default_tabs(heraia_window_t *main_window);
00038 
00039 /**
00040  * @fn guint which_endianness(heraia_window_t *main_window)
00041  *  Determines which endianness is selected that is to say
00042  *  which radio button is active in the window
00043  * @param main_window : main structure
00044  * @return Something of the following, depending on what selected the user :
00045  *         - H_DI_LITTLE_ENDIAN for little endian encoding (default answer)
00046  *         - H_DI_BIG_ENDIAN for big endian encoding
00047  *         - H_DI_MIDDLE_ENDIAN for middle endian encoding
00048  */
00049 static guint which_endianness(heraia_window_t *main_window)
00050 {
00051         GtkRadioButton *rb = GTK_RADIO_BUTTON(heraia_get_widget(main_window->xmls->main, "diw_rb_little_endian"));
00052         GtkWidget *activated = NULL;
00053         const gchar *widget_name = NULL;
00054 
00055         activated = gtk_radio_button_get_active_from_widget(rb);
00056         widget_name = gtk_widget_get_name(activated);
00057 
00058         if (g_ascii_strcasecmp(widget_name, "diw_rb_little_endian") == 0)
00059                 {
00060                         return H_DI_LITTLE_ENDIAN;
00061                 }
00062         else if (g_ascii_strcasecmp(widget_name, "diw_rb_big_endian") == 0)
00063                 {
00064                         return H_DI_BIG_ENDIAN;
00065                 }
00066         else if (g_ascii_strcasecmp(widget_name, "diw_rb_middle_endian") == 0)
00067                 {
00068                         return H_DI_MIDDLE_ENDIAN;
00069                 }
00070         else
00071                 return H_DI_LITTLE_ENDIAN;  /* default interpretation case */
00072 }
00073 
00074 
00075 /**
00076  * returns stream size as selected in the spin button
00077  * @param main_window : main structure
00078  * @return returns the value of the spin button or 1 if this value is not valid
00079  */
00080 static guint which_stream_size(heraia_window_t *main_window)
00081 {
00082    GtkWidget *spin_button = NULL;
00083    guint stream_size = 1;
00084 
00085    if (main_window != NULL && main_window->xmls != NULL && main_window->xmls->main != NULL)
00086    {
00087            spin_button = heraia_get_widget(main_window->xmls->main, "stream_size_spin_button");
00088 
00089            stream_size = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin_button));
00090 
00091            if (stream_size >= 1)
00092            {
00093                    return stream_size;
00094            }
00095            else
00096            {
00097                    return 1;
00098            }
00099    }
00100    else
00101    {
00102            return 1;
00103    }
00104 }
00105 
00106 
00107 /**
00108  *   Here we do interpret a something according to the decode_it function and we
00109  *   write down the result in a widget designated "entry"
00110  *  @warning We are assuming that main_window != NULL and main_window->xml != NULL
00111  *
00112  *  @param main_window : main structure
00113  *  @param decode : a decode_t structure that contains function, entry and error message
00114  *  @param decode_parameters : structure that passes some arguments to the
00115  *            decoding functions
00116  *  @param length : the length of the data to be decoded (guint)
00117  */
00118 static void interpret(doc_t *doc, decode_t *decode_struct, decode_parameters_t *decode_parameters, guint length)
00119 {
00120         gint result = 0;    /** used to test different results of function calls                            */
00121         guchar *c = NULL;   /** the character under the cursor                                              */
00122         gchar *text = NULL; /** decoded text                                                                */
00123         DecodeFunc decode_it = NULL; /** A DecodeFunc which is a function to be called to decode the stream */
00124 
00125         c = (guchar *) g_malloc0(sizeof(guchar) * length);
00126 
00127         result = ghex_get_data(doc->hex_widget, length, decode_parameters->endianness, c);
00128 
00129         if (result == TRUE)
00130                 {
00131                         decode_it = decode_struct->func;
00132                         
00133                         text = decode_it(c, (gpointer) decode_parameters);
00134 
00135                         if (text != NULL)
00136                                 {
00137                                         gtk_entry_set_text(GTK_ENTRY(decode_struct->entry), text);
00138                                 }
00139                         else
00140                                 {
00141                                         text = g_strdup_printf("Something's wrong!");
00142                                         gtk_entry_set_text(GTK_ENTRY(decode_struct->entry), text);
00143                                 }
00144                 }
00145         else
00146                 {
00147                         if (decode_struct->err_msg != NULL)
00148                         {
00149                                 text = g_strdup_printf(decode_struct->err_msg, length);
00150                         }
00151                         else
00152                         {
00153                                 text = g_strdup_printf("Cannot interpret as a %d byte(s)", length);
00154                         }
00155                         gtk_entry_set_text(GTK_ENTRY(decode_struct->entry), text);
00156                 }
00157 
00158         g_free(c);
00159         g_free(text);
00160 }
00161 
00162 
00163 /**
00164  * @fn void close_data_interpretor_window(GtkWidget *widget, gpointer data)
00165  *  "Emulates" the user click on the main window menu entry called DIMenu
00166  *  whose aim is to display or hide the data interpretor window
00167  * @param widget : the widget caller (may be NULL here)
00168  * @param data : a gpointer to the main structure : main_window, this must NOT
00169  *        be NULL !
00170  */
00171 static void close_data_interpretor_window(GtkWidget *widget, gpointer data)
00172 {
00173         heraia_window_t *main_window = (heraia_window_t *) data;
00174 
00175         if (main_window != NULL && main_window->xmls != NULL  && main_window->xmls->main)
00176                 {
00177                         g_signal_emit_by_name(heraia_get_widget(main_window->xmls->main, "DIMenu"), "activate");
00178                 }
00179 }
00180 
00181 
00182 /**
00183  * This function refreshes one row of the tab
00184  * @param dw : current data window
00185  * @param row : the row that we want to refresh
00186  * @param nb_cols : number of columns in this particular row (this IS the same
00187  *                  for all rows in that tab
00188  * @param decode_parameters : structure that passes some arguments to the
00189  *        decoding functions
00190  */
00191 static void refresh_one_row(doc_t *doc, decode_generic_t *row,  guint nb_cols, decode_parameters_t *decode_parameters)
00192 {
00193         decode_t *decode = NULL;   /**< entry, function and message */
00194         guint i = 0 ;
00195 
00196         while ( i < nb_cols)
00197         {
00198                 decode = g_ptr_array_index(row->decode_array, i);
00199 
00200                 if (row->fixed_size == FALSE)
00201                 {
00202                         row->data_size = decode_parameters->stream_size;
00203                 }
00204 
00205                 interpret(doc, decode, decode_parameters, row->data_size);
00206                 i++;
00207         }
00208 }
00209 
00210 /**
00211  * This function refreshes one entire tab (row by row)
00212  * @param dw : current data window
00213  * @param tab : the tab to refresh
00214  * @param decode_parameters : structure that passes some arguments to the
00215  *        decoding functions
00216  */
00217 static void refresh_one_tab(doc_t *doc, data_window_t *dw, tab_t *tab, decode_parameters_t *decode_parameters)
00218 {
00219         decode_generic_t *row = NULL; /**< the row we want to refresh */
00220         guint i = 0;
00221 
00222         while (i < tab->nb_rows)
00223         {
00224                 row = g_ptr_array_index(tab->rows, i);
00225                 refresh_one_row(doc, row, tab->nb_cols-1, decode_parameters);
00226                 i++;
00227         }
00228 }
00229 
00230 /**
00231  * Refreshes all tabs
00232  * @param dw : current data window
00233  * @param decode_parameters : structure that passes some arguments to the
00234  *        decoding functions
00235  */
00236 static void refresh_all_tabs(doc_t *doc, data_window_t *dw, decode_parameters_t *decode_parameters)
00237 {
00238         tab_t *tab = NULL;
00239         guint i = 0;
00240 
00241         while (i < dw->nb_tabs)
00242         {
00243                 tab = g_ptr_array_index(dw->tabs, i);
00244                 refresh_one_tab(doc, dw, tab, decode_parameters);
00245                 i++;
00246         }
00247 
00248 }
00249 
00250 /**
00251  * @fn void refresh_data_interpretor_window(GtkWidget *widget, gpointer data)
00252  *  Refreshes the data interpretor window with the new values
00253  * @param widget : the widget caller (may be NULL here)
00254  * @param data : a gpointer to the main structure : main_window, this must NOT
00255  *        be NULL !
00256  * @todo if speed is a matter, think about taking off this decode_parameters
00257  *       structure from here.
00258  */
00259 void refresh_data_interpretor_window(GtkWidget *widget, gpointer data)
00260 {
00261         heraia_window_t *main_window = (heraia_window_t *) data;  /** data interpretor window structure */
00262         decode_parameters_t *decode_parameters = NULL;
00263         guint endianness = 0;
00264         guint stream_size = 0;
00265 
00266         if (main_window != NULL &&
00267                 main_window->current_doc != NULL &&
00268                 main_window->current_DW != NULL &&
00269                 main_window->win_prop->main_dialog->displayed == TRUE)
00270                 {
00271                         endianness = which_endianness(main_window);    /** Endianness is computed only once here  */
00272                         stream_size =  which_stream_size(main_window); /** stream size is computed only once here */
00273 
00274                         decode_parameters = new_decode_parameters_t(endianness, stream_size);
00275 
00276                         refresh_all_tabs(main_window->current_doc, main_window->current_DW, decode_parameters);
00277 
00278                         g_free(decode_parameters);
00279                 }
00280 }
00281 
00282 
00283 /**
00284  * @fn void connect_data_interpretor_signals(heraia_window_t *main_window)
00285  *  Connects data interpretor window's signals to the
00286  *  right functions
00287  * @param main_window : main structure
00288  */
00289 static void connect_data_interpretor_signals(heraia_window_t *main_window)
00290 {
00291         /* When data interpretor's window is killed or destroyed */
00292         g_signal_connect(G_OBJECT(heraia_get_widget(main_window->xmls->main, "data_interpretor_window")), "delete_event",
00293                                          G_CALLBACK(delete_dt_window_event), main_window);
00294 
00295         g_signal_connect(G_OBJECT(heraia_get_widget(main_window->xmls->main, "data_interpretor_window")), "destroy",
00296                                      G_CALLBACK(destroy_dt_window), main_window);
00297 
00298         /* Menu "close" */
00299         g_signal_connect(G_OBJECT(heraia_get_widget(main_window->xmls->main, "diw_close_menu")), "activate",
00300                                          G_CALLBACK(close_data_interpretor_window), main_window);
00301 
00302         /* Radio Button "Little Endian" */
00303         g_signal_connect(G_OBJECT(heraia_get_widget(main_window->xmls->main, "diw_rb_little_endian")), "toggled",
00304                                          G_CALLBACK(refresh_data_interpretor_window), main_window);
00305 
00306         /* Radio Button "Big Endian" */
00307         g_signal_connect(G_OBJECT(heraia_get_widget(main_window->xmls->main, "diw_rb_big_endian")), "toggled",
00308                                          G_CALLBACK(refresh_data_interpretor_window), main_window);
00309 
00310         /* Radio Button "Middle Endian" */
00311         g_signal_connect(G_OBJECT(heraia_get_widget(main_window->xmls->main, "diw_rb_middle_endian")), "toggled",
00312                                          G_CALLBACK(refresh_data_interpretor_window), main_window);
00313 
00314         /* Spin button */
00315         g_signal_connect(G_OBJECT(heraia_get_widget(main_window->xmls->main, "stream_size_spin_button")), "value-changed",
00316                                          G_CALLBACK(refresh_data_interpretor_window), main_window);
00317 
00318 }
00319 
00320 /**
00321  * @fn void data_interpretor_init_interface(heraia_window_t *main_window)
00322  *  Inits the data interpretor structure and window with default values
00323  *  @warning Should be called only once at program's beginning
00324  */
00325 void data_interpretor_init_interface(heraia_window_t *main_window)
00326 {
00327         data_window_t *dw = NULL;
00328 
00329         if (main_window != NULL)
00330                 {
00331                         /* Signals connections */
00332                         connect_data_interpretor_signals(main_window);
00333 
00334                         dw = main_window->current_DW;
00335 
00336                         if (dw != NULL)
00337                                 {
00338                                         dw->diw = heraia_get_widget(main_window->xmls->main, "data_interpretor_window");
00339 
00340                                         /* Here init all defaults tabs */
00341                                         add_default_tabs(main_window);
00342                                 }
00343                 }
00344 }
00345 
00346 /**
00347  * Adds a new tab in the data interpretor window
00348  * @param notebook : the notebook to which we want to add this new tab
00349  * @param index : index of this new tab. If you rely on this make sure it's
00350  *                a primary key !
00351  * @param label : label of the tab
00352  * @param nb_cols : number of columns (including the first column of labels)
00353  * @param ... : nb_cols arguments that will be the labels of the columns
00354  */
00355 tab_t *add_new_tab_in_data_interpretor(GtkNotebook *notebook, guint index, gchar *label, guint nb_cols, ...)
00356 {
00357         tab_t *tab = NULL;            /**< tab structure that will remember everything !                     */
00358         va_list args;                 /**< va_list arguments passed to create a new tab with those columns   */
00359         guint i = 0;
00360         gchar *col_label = NULL;      /**< used to fetch atguments                                           */
00361         GPtrArray *col_labels = NULL; /**< used to remember the columns labels (the arguments in GtkWidgets) */
00362         GPtrArray *vboxes = NULL;     /**< used to remember vboxes (in order to be able to pack things later */
00363         GtkWidget *child = NULL;      /**< notebook tab's child container                                    */
00364         GtkWidget *hpaned = NULL;     /**< used for hpaned creation                                          */
00365         GtkWidget *hpaned2 = NULL;    /**< in case that we have more than 2 arguments                        */
00366         GtkWidget *vbox = NULL;       /**< used for vbox creation                                            */
00367         GtkWidget *vbox_label = NULL; /**< used for label creation in the new vboxes                         */
00368 
00369         col_labels = g_ptr_array_new();
00370         vboxes = g_ptr_array_new();
00371 
00372         va_start(args, nb_cols);
00373         for (i = 0 ; i < nb_cols ; i++)
00374         {
00375                 col_label = (gchar *) va_arg(args, int);
00376                 vbox_label = gtk_label_new(col_label);
00377                 gtk_misc_set_padding(GTK_MISC(vbox_label), 3, 3);       /* properties for the labels */
00378                 gtk_misc_set_alignment(GTK_MISC(vbox_label), 0.5, 0.5);
00379                 g_ptr_array_add(col_labels, (gpointer) vbox_label);
00380         }
00381         va_end(args);
00382 
00383         tab = (tab_t *) g_malloc0(sizeof(tab_t));
00384 
00385     i = 0;
00386     hpaned = gtk_hpaned_new();
00387         gtk_container_set_border_width(GTK_CONTAINER(hpaned), 2); /* properties for the hpaned */
00388         child = hpaned;
00389         vbox = gtk_vbox_new(FALSE, 2);
00390         gtk_box_set_homogeneous(GTK_BOX(vbox), FALSE);
00391         g_ptr_array_add(vboxes, vbox);
00392         gtk_paned_add1(GTK_PANED(hpaned), (gpointer) vbox);
00393         vbox_label = g_ptr_array_index(col_labels, i);
00394         gtk_box_pack_start(GTK_BOX(vbox), vbox_label, FALSE, FALSE, 3);
00395 
00396         i++;
00397         while (i < nb_cols-1)
00398         {
00399                 hpaned2 = gtk_hpaned_new();
00400                 gtk_container_set_border_width(GTK_CONTAINER(hpaned2), 2); /* properties for the hpaned */
00401                 gtk_paned_add2(GTK_PANED(hpaned), hpaned2);
00402                 hpaned = hpaned2;                  /* translation */
00403                 vbox = gtk_vbox_new(FALSE, 2);
00404                 gtk_box_set_homogeneous(GTK_BOX(vbox), FALSE);
00405                 g_ptr_array_add(vboxes, (gpointer) vbox);
00406                 gtk_paned_add1(GTK_PANED(hpaned), vbox);
00407                 vbox_label = g_ptr_array_index(col_labels, i);
00408                 gtk_box_pack_start(GTK_BOX(vbox), vbox_label, FALSE, FALSE, 3);
00409                 i++;
00410         }
00411 
00412         vbox = gtk_vbox_new(FALSE, 2);
00413         g_ptr_array_add(vboxes, (gpointer) vbox);
00414         gtk_paned_add2(GTK_PANED(hpaned), vbox);
00415         gtk_box_set_homogeneous(GTK_BOX(vbox), FALSE);
00416         vbox_label = g_ptr_array_index(col_labels, i);
00417         gtk_box_pack_start(GTK_BOX(vbox), vbox_label, FALSE, FALSE, 3);
00418 
00419         tab->index = index;
00420         tab->nb_cols = nb_cols;
00421         tab->nb_rows = 0;
00422         tab->label = gtk_label_new(label);   /* tab's label */
00423         gtk_misc_set_padding(GTK_MISC(tab->label), 2, 2);
00424         gtk_misc_set_alignment(GTK_MISC(tab->label), 0.5, 0.5);
00425         tab->col_labels = col_labels;
00426         tab->vboxes = vboxes;
00427         tab->rows = NULL;
00428 
00429         gtk_widget_show_all(child);
00430         gtk_notebook_append_page(notebook, child, tab->label);
00431 
00432         return tab;
00433 }
00434 
00435 /**
00436  * Adds a row to a particular tab
00437  * @param tab : the tab to which we want to add the row
00438  * @param row : the row we want to add (make sure it has been initialized)
00439  */
00440 void add_new_row_to_tab(tab_t *tab, decode_generic_t *row)
00441 {
00442         GtkWidget *vbox = NULL;  /**< the vbox to which we want to pack           */
00443         decode_t *couple = NULL; /**< couple from which we want to pack the entry */
00444         guint i = 0;
00445         guint j = 0;
00446 
00447         if (tab != NULL && row != NULL)
00448         {
00449 
00450                 if (tab->rows == NULL)
00451                 {
00452                         tab->rows = g_ptr_array_new();
00453                 }
00454 
00455                 g_ptr_array_add(tab->rows, (gpointer) row);
00456                 tab->nb_rows++;
00457 
00458                 /* label packing */
00459                 vbox = g_ptr_array_index(tab->vboxes, 0);
00460                 gtk_box_pack_start(GTK_BOX(vbox), row->label, FALSE, FALSE, 3);
00461 
00462                 j = 0;
00463                 i = 1;
00464 
00465                 while (i <  tab->nb_cols)
00466                 {
00467                         vbox = g_ptr_array_index(tab->vboxes, i);
00468                         couple = g_ptr_array_index(row->decode_array, j);
00469                         gtk_box_pack_start(GTK_BOX(vbox), couple->entry, FALSE, FALSE, 1);
00470                         gtk_widget_show(couple->entry);
00471                         j++;
00472                         i++;
00473                 }
00474         }
00475 }
00476 
00477 /**
00478  * Inits data interpretor with default tabs
00479  * Must be called only once at bootime
00480  * @param main_window : main_structure
00481  * */
00482 static void add_default_tabs(heraia_window_t *main_window)
00483 {
00484         GtkWidget *notebook = NULL;
00485         tab_t *tab = NULL;
00486         decode_generic_t *row = NULL;
00487         data_window_t *dw = NULL;
00488 
00489         dw = main_window->current_DW;
00490         notebook = heraia_get_widget(main_window->xmls->main, "diw_notebook");
00491 
00492         dw->tabs = g_ptr_array_new();
00493 
00494         /** Adding a tab for numbers */
00495         tab = add_new_tab_in_data_interpretor(GTK_NOTEBOOK(notebook), 0, "Numbers", 3, "Length", "Value unsigned", "Value signed");
00496 
00497         if (tab != NULL)
00498         {
00499                 g_ptr_array_add(dw->tabs, (gpointer) tab);
00500                 dw->nb_tabs++;
00501                 row = new_decode_generic_t("8 bits", 1, TRUE, "Can not interpret %d byte as a 8 bits number", 2,  decode_8bits_unsigned, decode_8bits_signed);
00502                 add_new_row_to_tab(tab, row);
00503                 row = new_decode_generic_t("16 bits", 2, TRUE, "Can not interpret %d bytes as a 16 bits number", 2, decode_16bits_unsigned, decode_16bits_signed);
00504                 add_new_row_to_tab(tab, row);
00505                 row = new_decode_generic_t("32 bits", 4, TRUE, "Can not interpret %d bytes as a 32 bits number", 2, decode_32bits_unsigned, decode_32bits_signed);
00506                 add_new_row_to_tab(tab, row);
00507                 row = new_decode_generic_t("64 bits", 8, TRUE, "Can not interpret %d bytes as a 64 bits number", 2, decode_64bits_unsigned, decode_64bits_signed);
00508                 add_new_row_to_tab(tab, row);
00509         }
00510 
00511         /** Adding a tab for floting numbers */
00512         tab = add_new_tab_in_data_interpretor(GTK_NOTEBOOK(notebook), 0, "Floats", 3, "Length", "Normal Notation", "Exponential notation");
00513 
00514         if (tab != NULL)
00515         {
00516                 g_ptr_array_add(dw->tabs, (gpointer) tab);
00517                 dw->nb_tabs++;
00518                 row = new_decode_generic_t("Float (32 bits)", 4, TRUE, "Can not interpret %d bytes as a float number", 2, decode_float_normal, decode_float_scientific);
00519                 add_new_row_to_tab(tab, row);
00520                 row = new_decode_generic_t("Double (64 bits)", 8, TRUE, "Can not interpret %d bytes as a double number", 2, decode_double_normal, decode_double_scientific);
00521                 add_new_row_to_tab(tab, row);
00522         }
00523 
00524         /** Adding a tab for date and time */
00525         tab = add_new_tab_in_data_interpretor(GTK_NOTEBOOK(notebook), 2, "Dates and Times", 2, "Type", "Value");
00526 
00527         if (tab != NULL)
00528         {
00529                 g_ptr_array_add(dw->tabs, (gpointer) tab);
00530                 dw->nb_tabs++;
00531                 row = new_decode_generic_t("MS-DOS", 4, TRUE, "Can not interpret %d bytes as a DOS date", 1, decode_dos_date);
00532                 add_new_row_to_tab(tab, row);
00533                 row = new_decode_generic_t("Filetime", 8, TRUE,  "Can not interpret %d bytes as a filetime date", 1, decode_filetime_date);
00534                 add_new_row_to_tab(tab, row);
00535                 row = new_decode_generic_t("C", 4, TRUE, "Can not interpret %d bytes as a C date", 1, decode_C_date);
00536                 add_new_row_to_tab(tab, row);
00537                 row = new_decode_generic_t("HFS", 4, TRUE, "Can not interpret %d bytes as a HFS date",  1, decode_HFS_date);
00538                 add_new_row_to_tab(tab, row);
00539         }
00540 
00541         /** Adding a tab for binary based conversions */
00542         tab = add_new_tab_in_data_interpretor(GTK_NOTEBOOK(notebook), 3, "Binary based", 2, "Type", "Value");
00543 
00544         if (tab != NULL)
00545         {
00546                 g_ptr_array_add(dw->tabs, (gpointer) tab);
00547                 dw->nb_tabs++;
00548                 row = new_decode_generic_t("Bits", 1, FALSE, "Can not decode %d byte(s) to bits", 1, decode_to_bits);
00549                 add_new_row_to_tab(tab, row);
00550                 row = new_decode_generic_t("Packed BCD", 1, FALSE, "Can not interpret %d byte(s) as packed BCD string",  1, decode_packed_BCD);
00551                 add_new_row_to_tab(tab, row);
00552         }
00553 }
00554 
00555 
00556 
00557 
00558 
00559 
00560 
00561 
00562 
00563 
00564 
00565 
00566 
00567 
00568 
00569 
00570 
00571 

Generated on Tue Jun 30 23:18:16 2009 for Heraia by  doxygen 1.5.8