00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "heraia_types.h"
00026
00027 static gboolean load_heraia_glade_xml(heraia_window_t *main_window);
00028 static void heraia_ui_connect_signals(heraia_window_t *main_window);
00029 static void record_and_hide_about_box(heraia_window_t *main_window);
00030
00034 void on_quitter1_activate( GtkWidget *widget, gpointer data )
00035 {
00036 gtk_main_quit();
00037 }
00038
00042 void on_nouveau1_activate(GtkWidget *widget, gpointer data)
00043 {
00044 heraia_window_t *main_window = (heraia_window_t *) data;
00045
00046 log_message(main_window, G_LOG_LEVEL_WARNING, "Not implemented Yet (Please contribute !)");
00047 }
00048
00052 void a_propos_activate(GtkWidget *widget, gpointer data)
00053 {
00054 heraia_window_t *main_window = (heraia_window_t *) data;
00055 GtkWidget *about_dialog = NULL;
00056
00057 about_dialog = heraia_get_widget(main_window->xmls->main, "about_dialog");
00058
00059 if (about_dialog != NULL)
00060 {
00061 if (GTK_MINOR_VERSION >= 12)
00062 {
00063 gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(about_dialog), PACKAGE_NAME);
00064 }
00065 if (GTK_MINOR_VERSION >= 6)
00066 {
00067 gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about_dialog), PACKAGE_VERSION);
00068 }
00069 main_window->win_prop->about_box = move_and_show_dialog_box(about_dialog, main_window->win_prop->about_box);
00070 }
00071 }
00072
00076 window_prop_t *move_and_show_dialog_box(GtkWidget *dialog_box, window_prop_t *dialog_prop)
00077 {
00078 if (dialog_prop->displayed == FALSE)
00079 {
00080 gtk_window_move(GTK_WINDOW(dialog_box), dialog_prop->x, dialog_prop->y);
00081
00082 gtk_widget_show_all(dialog_box);
00083 dialog_prop->displayed = TRUE;
00084 }
00085
00086 return dialog_prop;
00087 }
00088
00089
00093 window_prop_t *record_and_hide_dialog_box(GtkWidget *dialog_box, window_prop_t *dialog_prop)
00094 {
00095 gint x = 0;
00096 gint y = 0;
00097
00098 if (dialog_prop->displayed == TRUE)
00099 {
00100
00101 gtk_window_get_position(GTK_WINDOW(dialog_box), &x, &y);
00102
00103 dialog_prop->x = x;
00104 dialog_prop->y = y;
00105
00106 gtk_widget_hide(dialog_box);
00107 dialog_prop->displayed = FALSE;
00108 }
00109
00110 return dialog_prop;
00111 }
00112
00113
00117 static void record_and_hide_about_box(heraia_window_t *main_window)
00118 {
00119 GtkWidget *about_dialog = NULL;
00120
00121 about_dialog = heraia_get_widget(main_window->xmls->main, "about_dialog");
00122
00123 if (about_dialog != NULL)
00124 {
00125 main_window->win_prop->about_box = record_and_hide_dialog_box(about_dialog, main_window->win_prop->about_box);
00126 }
00127 }
00128
00129
00133 static void a_propos_response(GtkWidget *widget, gint response, gpointer data)
00134 {
00135 heraia_window_t *main_window = (heraia_window_t *) data;
00136 record_and_hide_about_box(main_window);
00137 }
00138
00139 static void a_propos_close(GtkWidget *widget, gpointer data)
00140 {
00141 heraia_window_t *main_window = (heraia_window_t *) data;
00142 record_and_hide_about_box(main_window);
00143 }
00144
00145 static gboolean a_propos_delete(GtkWidget *widget, GdkEvent *event, gpointer data)
00146 {
00147 heraia_window_t *main_window = (heraia_window_t *) data;
00148 record_and_hide_about_box(main_window);
00149
00150 return TRUE;
00151 }
00152
00153
00157 void on_supprimer1_activate( GtkWidget *widget, gpointer data )
00158 {
00159 heraia_window_t *main_window = (heraia_window_t *) data;
00160
00161 log_message(main_window, G_LOG_LEVEL_WARNING, "Not implemented Yet (Please contribute !)");
00162 }
00163
00167 void on_couper1_activate( GtkWidget *widget, gpointer data )
00168 {
00169 heraia_window_t *main_window = (heraia_window_t *) data;
00170
00171 log_message(main_window, G_LOG_LEVEL_WARNING, "Not implemented Yet (Please contribute !)");
00172 }
00173
00177 void on_copier1_activate( GtkWidget *widget, gpointer data )
00178 {
00179 heraia_window_t *main_window = (heraia_window_t *) data;
00180
00181 log_message(main_window, G_LOG_LEVEL_WARNING, "Not implemented Yet (Please contribute !)");
00182 }
00183
00184
00188 void on_coller1_activate( GtkWidget *widget, gpointer data )
00189 {
00190 heraia_window_t *main_window = (heraia_window_t *) data;
00191
00192 log_message(main_window, G_LOG_LEVEL_WARNING, "Not implemented Yet (Please contribute !)");
00193 }
00194
00195
00200 void refresh_event_handler(GtkWidget *widget, gpointer data)
00201 {
00202 heraia_window_t *main_window = (heraia_window_t *) data;
00203
00204 if (main_window != NULL)
00205 {
00206
00207 if (main_window->event == HERAIA_REFRESH_NOTHING)
00208 main_window->event = HERAIA_REFRESH_CURSOR_MOVE;
00209
00210 refresh_data_interpretor_window(widget, main_window);
00211 refresh_all_plugins(main_window);
00212
00213 main_window->event = HERAIA_REFRESH_NOTHING;
00214 }
00215 }
00216
00217
00221 void on_ouvrir1_activate(GtkWidget *widget, gpointer data )
00222 {
00223 heraia_window_t *main_window = (heraia_window_t *) data;
00224
00225 if (select_file_to_load(main_window) == TRUE)
00226 {
00227 load_file_to_analyse(main_window, main_window->filename);
00228 }
00229
00230 main_window->event = HERAIA_REFRESH_NEW_FILE;
00231 refresh_event_handler(main_window->current_DW->current_hexwidget, main_window);
00232 }
00233
00234
00239 void on_save_activate( GtkWidget *widget, gpointer data )
00240 {
00241 heraia_window_t *main_window = (heraia_window_t *) data;
00242 HERAIA_ERROR erreur = HERAIA_NOERR;
00243 gchar *filename = NULL;
00244
00245 if (main_window != NULL)
00246 {
00247 erreur = heraia_hex_document_save(main_window);
00248 }
00249
00250 if (erreur != HERAIA_NOERR)
00251 {
00252 filename = heraia_hex_document_get_filename(main_window->current_doc);
00253 log_message(main_window, G_LOG_LEVEL_ERROR, "Error while saving file %s !", filename);
00254 }
00255 }
00256
00260 void on_save_as_activate( GtkWidget *widget, gpointer data )
00261 {
00262 heraia_window_t *main_window = (heraia_window_t *) data;
00263 HERAIA_ERROR erreur = HERAIA_NOERR;
00264 gchar *filename = NULL;
00265
00266 if (main_window != NULL)
00267 {
00268 filename = select_a_file_to_save(main_window);
00269
00270 if (filename != NULL)
00271 {
00272 erreur = heraia_hex_document_save_as(main_window, filename);
00273 }
00274 else
00275 {
00276 erreur = HERAIA_CANCELLED;
00277 }
00278
00279 if (erreur != HERAIA_NOERR)
00280 {
00281 if (erreur == HERAIA_CANCELLED)
00282 {
00283 log_message(main_window, G_LOG_LEVEL_DEBUG, "Saving file as... : operation cancelled.");
00284 }
00285 else
00286 {
00287 log_message(main_window, G_LOG_LEVEL_ERROR, "Error while saving file as %s", main_window->current_doc->file_name);
00288 }
00289 }
00290 else
00291 {
00292
00293 update_main_window_name(main_window);
00294 log_message(main_window, G_LOG_LEVEL_DEBUG, "File %s saved and now edited.", main_window->current_doc->file_name);
00295 }
00296 }
00297 }
00298
00303 void on_DIMenu_activate(GtkWidget *widget, gpointer data)
00304 {
00305
00306 heraia_window_t *main_window = (heraia_window_t *) data;
00307 data_window_t *dw = NULL;
00308 GtkNotebook *notebook = NULL;
00309
00310 if (main_window != NULL)
00311 {
00312 dw = main_window->current_DW;
00313
00314 if (dw != NULL)
00315 {
00316 if (dw->diw == NULL)
00317 {
00318 dw->diw = heraia_get_widget(main_window->xmls->main, "data_interpretor_window");
00319 }
00320
00321 if (dw->diw != NULL)
00322 {
00323
00324 notebook = GTK_NOTEBOOK(heraia_get_widget(main_window->xmls->main, "diw_notebook"));
00325
00326 if (main_window->win_prop->data_interpretor->displayed == FALSE)
00327 {
00328
00329 gtk_notebook_set_current_page(notebook, dw->tab_displayed);
00330
00331
00332 main_window->win_prop->data_interpretor = move_and_show_dialog_box(dw->diw, main_window->win_prop->data_interpretor);
00333
00334
00335 refresh_data_interpretor_window(widget, data);
00336 }
00337 else
00338 {
00339
00340 dw->tab_displayed = gtk_notebook_get_current_page(notebook);
00341 main_window->win_prop->data_interpretor = record_and_hide_dialog_box(dw->diw, main_window->win_prop->data_interpretor);
00342
00343 }
00344 }
00345 }
00346 }
00347 }
00348
00352 gboolean delete_main_window_event(GtkWidget *widget, GdkEvent *event, gpointer data)
00353 {
00354 gtk_widget_destroy(widget);
00355 return TRUE;
00356 }
00357
00358
00362 gboolean delete_dt_window_event(GtkWidget *widget, GdkEvent *event, gpointer data)
00363 {
00364 heraia_window_t *main_window = (heraia_window_t *) data;
00365
00366 g_signal_emit_by_name(heraia_get_widget(main_window->xmls->main, "DIMenu"), "activate");
00367
00368 return TRUE;
00369 }
00370
00371 void destroy_dt_window(GtkWidget *widget, GdkEvent *event, gpointer data)
00372 {
00373 heraia_window_t *main_window = (heraia_window_t *) data;
00374
00375 g_signal_emit_by_name(heraia_get_widget(main_window->xmls->main, "DIMenu"), "activate");
00376 }
00377
00378
00379
00385 static gchar *make_absolute_path(gchar *filename)
00386 {
00387 gchar *current_dir = NULL;
00388 gchar *new_dir = NULL;
00389
00390 if (g_path_is_absolute(filename) == TRUE)
00391 {
00392
00393 return g_path_get_dirname(filename);
00394 }
00395 else
00396 {
00397 current_dir = g_get_current_dir();
00398 new_dir = g_path_get_dirname(filename);
00399
00400 if (g_chdir(new_dir) == 0)
00401 {
00402 g_free(new_dir);
00403 new_dir = g_get_current_dir();
00404 g_chdir(current_dir);
00405 g_free(current_dir);
00406
00407 return new_dir;
00408 }
00409 else
00410 {
00411 g_free(current_dir);
00412
00413 return NULL;
00414 }
00415 }
00416 }
00417
00418
00424 static void set_the_working_directory(GtkFileChooser *file_chooser, gchar *filename)
00425 {
00426 gchar *dirname = NULL;
00427
00428 dirname = make_absolute_path(filename);
00429
00430 if (dirname != NULL)
00431 {
00432 gtk_file_chooser_set_current_folder(file_chooser, dirname);
00433 g_free(dirname);
00434 }
00435 }
00436
00437
00443 gboolean select_file_to_load(heraia_window_t *main_window)
00444 {
00445 GtkWidget *parent = NULL;
00446 GtkFileChooser *file_chooser = NULL;
00447 gboolean success = FALSE;
00448 gchar *filename = NULL;
00449
00450 parent = heraia_get_widget(main_window->xmls->main, "main_window");
00451
00452 file_chooser = GTK_FILE_CHOOSER(gtk_file_chooser_dialog_new("Select a file to analyse",
00453 GTK_WINDOW(parent),
00454 GTK_FILE_CHOOSER_ACTION_OPEN,
00455 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
00456 GTK_STOCK_OPEN, GTK_RESPONSE_OK,
00457 NULL));
00458
00463 gtk_window_set_modal(GTK_WINDOW(file_chooser), TRUE);
00464 gtk_file_chooser_set_select_multiple(file_chooser, FALSE);
00465
00470 if (main_window->filename != NULL)
00471 {
00472 set_the_working_directory(file_chooser, main_window->filename);
00473 }
00474
00475 switch (gtk_dialog_run(GTK_DIALOG(file_chooser)))
00476 {
00477 case GTK_RESPONSE_OK:
00478 filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(file_chooser));
00479 log_message(main_window, G_LOG_LEVEL_DEBUG, "filename selected : %s", filename);
00480
00481
00482 if (main_window->filename != NULL)
00483 {
00484 g_free(main_window->filename);
00485 }
00486
00487 main_window->filename = g_strdup_printf("%s", filename);
00488 success = TRUE;
00489 break;
00490 case GTK_RESPONSE_CANCEL:
00491 default:
00492 success = FALSE;
00493 break;
00494 }
00495
00496 g_free(filename);
00497 gtk_widget_destroy(GTK_WIDGET(file_chooser));
00498
00499 return success;
00500 }
00501
00506 gchar *select_a_file_to_save(heraia_window_t *main_window)
00507 {
00508 GtkWidget *parent = NULL;
00509 GtkFileChooser *fcd = NULL;
00510 gchar *filename = NULL;
00511
00512 parent = heraia_get_widget(main_window->xmls->main, "main_window");
00513
00514
00515 fcd = GTK_FILE_CHOOSER(gtk_file_chooser_dialog_new("Save As...",
00516 GTK_WINDOW(parent),
00517 GTK_FILE_CHOOSER_ACTION_SAVE,
00518 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
00519 GTK_STOCK_SAVE, GTK_RESPONSE_OK,
00520 NULL));
00521
00522
00523 gtk_window_set_modal(GTK_WINDOW(fcd), TRUE);
00524 gtk_file_chooser_set_select_multiple(fcd, FALSE);
00525 gtk_file_chooser_set_do_overwrite_confirmation(fcd, TRUE);
00526
00527
00528 if (main_window->filename != NULL)
00529 {
00530 set_the_working_directory(fcd, main_window->filename);
00531 }
00532
00533 switch(gtk_dialog_run(GTK_DIALOG(fcd)))
00534 {
00535 case GTK_RESPONSE_OK:
00536
00537 filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(fcd));
00538 break;
00539 default:
00540 filename = NULL;
00541 break;
00542 }
00543
00544 gtk_widget_destroy(GTK_WIDGET(fcd));
00545
00546 return filename;
00547 }
00548
00549
00553 void update_main_window_name(heraia_window_t *main_window)
00554 {
00555 GtkWidget *widget = NULL;
00556 gchar *filename;
00557
00558 if (main_window != NULL && main_window->current_doc != NULL)
00559 {
00560 widget = heraia_get_widget(main_window->xmls->main, "main_window");
00561 filename = g_filename_display_basename(main_window->current_doc->file_name);
00562
00563 gtk_window_set_title(GTK_WINDOW(widget), filename);
00564 }
00565 }
00566
00573 void init_heraia_interface(heraia_window_t *main_window)
00574 {
00575 data_window_t *dw = NULL;
00576 GtkWidget *diw = NULL;
00577 GtkWidget *menu = NULL;
00578 GtkWidget *window = NULL;
00579 all_window_prop_t *win_prop;
00580
00586 if (main_window != NULL)
00587 {
00588 dw = main_window->current_DW;
00589
00590 menu = heraia_get_widget(main_window->xmls->main, "DIMenu");
00591 window = heraia_get_widget(main_window->xmls->main, "main_window");
00592 win_prop = main_window->win_prop;
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621 }
00622 }
00623
00624
00632 static gboolean load_heraia_glade_xml(heraia_window_t *main_window)
00633 {
00634 gchar *filename = NULL;
00635
00636 if (main_window != NULL && main_window->xmls != NULL)
00637 {
00638
00639 filename = g_strdup_printf("heraia.glade");
00640 main_window->xmls->main = load_glade_xml_file(main_window->location_list, filename);
00641 g_free(filename);
00642
00649 if (main_window->xmls->main == NULL)
00650 return FALSE;
00651 else
00652 return TRUE;
00653 }
00654 else
00655 return FALSE;
00656 }
00657
00662 void connect_cursor_moved_signal(heraia_window_t *main_window)
00663 {
00664 g_signal_connect(G_OBJECT(main_window->current_DW->current_hexwidget), "cursor_moved",
00665 G_CALLBACK(refresh_event_handler), main_window);
00666 }
00667
00668
00672 static void heraia_ui_connect_signals(heraia_window_t *main_window)
00673 {
00674
00675
00676 g_signal_connect (G_OBJECT (heraia_get_widget(main_window->xmls->main, "DIMenu")), "activate",
00677 G_CALLBACK (on_DIMenu_activate), main_window);
00678
00679
00680 g_signal_connect (G_OBJECT (heraia_get_widget(main_window->xmls->main, "quitter1")), "activate",
00681 G_CALLBACK (on_quitter1_activate), main_window);
00682
00683
00684 g_signal_connect (G_OBJECT (heraia_get_widget(main_window->xmls->main, "nouveau1")), "activate",
00685 G_CALLBACK (on_nouveau1_activate), main_window);
00686
00687
00688 g_signal_connect (G_OBJECT (heraia_get_widget(main_window->xmls->main, "ouvrir1")), "activate",
00689 G_CALLBACK (on_ouvrir1_activate), main_window);
00690
00691
00692 g_signal_connect (G_OBJECT (heraia_get_widget(main_window->xmls->main, "save")), "activate",
00693 G_CALLBACK (on_save_activate), main_window);
00694
00695
00696 g_signal_connect (G_OBJECT (heraia_get_widget(main_window->xmls->main, "save_as")), "activate",
00697 G_CALLBACK (on_save_as_activate), main_window);
00698
00699
00700 g_signal_connect (G_OBJECT (heraia_get_widget(main_window->xmls->main, "couper1")), "activate",
00701 G_CALLBACK (on_couper1_activate), main_window);
00702
00703
00704 g_signal_connect (G_OBJECT (heraia_get_widget(main_window->xmls->main, "copier1")), "activate",
00705 G_CALLBACK (on_copier1_activate), main_window);
00706
00707
00708 g_signal_connect (G_OBJECT (heraia_get_widget(main_window->xmls->main, "coller1")), "activate",
00709 G_CALLBACK (on_coller1_activate), main_window);
00710
00711
00712
00713 g_signal_connect (G_OBJECT(heraia_get_widget(main_window->xmls->main, "a_propos1")), "activate",
00714 G_CALLBACK(a_propos_activate), main_window);
00715
00716 g_signal_connect(G_OBJECT(heraia_get_widget(main_window->xmls->main, "about_dialog")), "close",
00717 G_CALLBACK(a_propos_close), main_window);
00718
00719 g_signal_connect(G_OBJECT(heraia_get_widget(main_window->xmls->main, "about_dialog")), "response",
00720 G_CALLBACK(a_propos_response), main_window);
00721
00722 g_signal_connect(G_OBJECT(heraia_get_widget(main_window->xmls->main, "about_dialog")), "delete-event",
00723 G_CALLBACK(a_propos_delete), main_window);
00724
00725
00726
00727 g_signal_connect (G_OBJECT (heraia_get_widget(main_window->xmls->main, "main_window")), "delete_event",
00728 G_CALLBACK (delete_main_window_event), NULL);
00729
00730 g_signal_connect (G_OBJECT (heraia_get_widget(main_window->xmls->main, "main_window")), "destroy",
00731 G_CALLBACK (on_quitter1_activate), NULL);
00732
00733 }
00734
00742 int load_heraia_ui(heraia_window_t *main_window)
00743 {
00744 gboolean success = FALSE;
00745
00746
00747 success = load_heraia_glade_xml(main_window);
00748
00749 if (success == TRUE)
00750 {
00751
00752 if (main_window->debug == TRUE)
00753 {
00754 fprintf(stdout, "connecting heraia_ui signals ");
00755 }
00756
00757 heraia_ui_connect_signals(main_window);
00758
00759 if (main_window->debug == TRUE)
00760 {
00761 fprintf(stdout, " [Done]\n");
00762 }
00763
00764
00765
00766 if (main_window->debug == TRUE)
00767 {
00768 fprintf(stdout, "log window init interface ");
00769 }
00770
00771 log_window_init_interface(main_window);
00772
00773 if (main_window->debug == TRUE)
00774 {
00775 fprintf(stdout, " [Done]\n");
00776 }
00777
00778
00779
00780 if (main_window->debug == TRUE)
00781 {
00782 fprintf(stdout, "data interpretor init interface");
00783 }
00784
00785 data_interpretor_init_interface(main_window);
00786
00787 if (main_window->debug == TRUE)
00788 {
00789 fprintf(stdout, " [Done]\n");
00790 }
00791
00792
00793
00794 if (main_window->debug == TRUE)
00795 {
00796 fprintf(stdout, "list data types init interface ");
00797 }
00798
00799 list_data_types_init_interface(main_window);
00800
00801 if (main_window->debug == TRUE)
00802 {
00803 fprintf(stdout, " [Done]\n");
00804 }
00805
00806
00807
00808 if (main_window->debug == TRUE)
00809 {
00810 fprintf(stdout, "data type init interface ");
00811 }
00812
00813 data_type_init_interface(main_window);
00814
00815 if (main_window->debug == TRUE)
00816 {
00817 fprintf(stdout, " [Done]\n");
00818 }
00819 }
00820
00821 return success;
00822 }
00823
00824
00828 void add_text_to_textview(GtkTextView *textview, const char *format, ...)
00829 {
00830 va_list args;
00831 GtkTextBuffer *tb = NULL;
00832 GtkTextIter iEnd;
00833 gchar *display = NULL;
00834 GError *err = NULL;
00835
00836 va_start(args, format);
00837 display = g_locale_to_utf8(g_strdup_vprintf(format, args), -1, NULL, NULL, &err);
00838 va_end(args);
00839
00840 tb = GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)));
00841 gtk_text_buffer_get_end_iter(tb, &iEnd);
00842 gtk_text_buffer_insert(tb, &iEnd, display, -1);
00843 g_free(display);
00844 }
00845
00846
00850 void kill_text_from_textview(GtkTextView *textview)
00851 {
00852 GtkTextBuffer *tb = NULL;
00853 GtkTextIter iStart;
00854 GtkTextIter iEnd;
00855
00856 tb = GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)));
00857 gtk_text_buffer_get_start_iter(tb, &iStart);
00858 gtk_text_buffer_get_end_iter(tb, &iEnd);
00859 gtk_text_buffer_delete (tb, &iStart, &iEnd);
00860 }
00861
00862
00868 GtkWidget *gtk_radio_button_get_active(GSList *group)
00869 {
00870 GSList *tmp_slist = group;
00871
00872 while (tmp_slist)
00873 {
00874 if (GTK_TOGGLE_BUTTON (tmp_slist->data)->active)
00875 {
00876 return GTK_WIDGET (tmp_slist->data);
00877 }
00878 tmp_slist = tmp_slist->next;
00879 }
00880
00881 return NULL;
00882 }
00883
00884
00892 GtkWidget *gtk_radio_button_get_active_from_widget(GtkRadioButton *radio_group_member)
00893 {
00894 if (radio_group_member)
00895 {
00896 return gtk_radio_button_get_active(radio_group_member->group);
00897 }
00898 else
00899 {
00900 return NULL;
00901 }
00902 }
00903
00904
00908 gboolean is_cmi_checked(GtkWidget *check_menu_item)
00909 {
00910 return gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(check_menu_item));
00911 }
00912
00913
00920 GtkWidget *heraia_get_widget(GladeXML *xml, gchar *widget_name)
00921 {
00922 if (xml != NULL && widget_name != NULL)
00923 {
00924 return glade_xml_get_widget(xml, widget_name);
00925 }
00926 else
00927 {
00928 return NULL;
00929 }
00930 }
00931
00932
00936 void destroy_a_single_widget(GtkWidget *widget)
00937 {
00938 if (widget != NULL)
00939 {
00940 gtk_widget_destroy(widget);
00941 }
00942 }