00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00027 #include <stdio.h>
00028 #include <gnome.h>
00029 #include <libxml/parser.h>
00030 #include <libxml/catalog.h>
00031 #include "config.h"
00032
00033 #include "utils.h"
00034 #include "mlview-app.h"
00035
00036
00041 int main (int argc, char** argv) {
00042
00043 GnomeApp *mlview_application = NULL ;
00044
00045 gchar ** args = NULL ;
00046 poptContext popt_context = {0} ;
00047 gboolean show_version = FALSE, show_info = FALSE ;
00048
00049 struct poptOption cmd_options_table [] = {
00050 {
00051 "version",
00052 'v',
00053 POPT_ARG_NONE,
00054 &show_version,
00055 0,
00056 N_("Prints The version of gnome-mlview you are using"),
00057 NULL
00058 },
00059 {
00060 "about",
00061 'a',
00062 POPT_ARG_NONE,
00063 &show_info,
00064 0,
00065 N_("Prints some information about gnome-mlview"),
00066 NULL
00067 },
00068 {0}
00069 } ;
00070
00071
00072 gnome_init_with_popt_table (PACKAGE, VERSION, argc, argv,
00073 cmd_options_table, 0 , &popt_context) ;
00074
00075
00076
00077 init_i18n () ;
00078
00079
00080 args = (gchar**) poptGetArgs (popt_context) ;
00081
00082 if (show_version == TRUE) {
00083 g_print ("%s\n", VERSION) ;
00084 poptFreeContext (popt_context) ;
00085 return 0 ;
00086 }
00087
00088 if (show_info == TRUE) {
00089 g_print ("%s\n", _("No usefull info yest")) ;
00090 poptFreeContext (popt_context) ;
00091 return 0 ;
00092 }
00093
00094
00095 mlview_application = mlview_app_new (PACKAGE) ;
00096
00097 gtk_widget_set_usize (GTK_WIDGET (mlview_application),
00098 800, 600) ;
00099
00100 gtk_window_set_wmclass (GTK_WINDOW (mlview_application),
00101 "main-application-window", "MlView") ;
00102
00103 gtk_widget_realize (GTK_WIDGET (mlview_application)) ;
00104
00105 mlview_app_set_icon (mlview_application) ;
00106
00107 gtk_widget_show_all (GTK_WIDGET (mlview_application)) ;
00108
00109
00110 if ( args ) {
00111 MlViewEditor * mlview_editor = mlview_app_get_editor (mlview_application) ;
00112 if ( mlview_editor ) {
00113 int i ;
00114 for (i=0 ; args[i] != NULL ; i++) {
00115 mlview_editor_load_xml_file (mlview_editor, (gchar *)args[i]) ;
00116 }
00117 }
00118 }
00119
00120 poptFreeContext (popt_context) ;
00121
00122 gtk_main();
00123 return 0 ;
00124 }