gitkrinit.c

Go to the documentation of this file.
00001 
00018 #define GITK_RENDERER_C
00019 #define GITKR_INIT_C
00020 
00021 #include "gitkrincludes.h"
00022 
00029 gboolean gitkr_init(guint *argc, gchar ***argv) {
00030   (void)g_log_set_handler(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG|G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_WARNING|G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_ERROR, gitk_log_handler, NULL);
00031   (void)g_log_set_handler("Gdk",G_LOG_LEVEL_DEBUG|G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_WARNING|G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_ERROR, gitk_log_handler, NULL);
00032   (void)g_log_set_handler("Gtk",G_LOG_LEVEL_DEBUG|G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_WARNING|G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_ERROR, gitk_log_handler, NULL);
00033   gitk_log("gtk+ render plugin init beg");
00034 
00035   if(!gitkr_init_process_commandline(argc,argv)) {
00036     gitkr_themes_init();
00037     //-- init the gtk+ library
00038     gtk_disable_setlocale();
00039     //-- temporay patch, works since gtk+-1.3.15
00040     //gtk_disable_atexit();
00041     return(gtk_init_check(argc,argv));
00042   }
00043   return(TRUE);
00044 }
00045 
00050 gboolean gitkr_init_process_commandline(guint *argc, gchar ***argv) {
00051   guint i;
00052   gboolean info_only=FALSE; 
00053   gboolean info_help=FALSE, info_version=FALSE;
00054 
00055   gitk_log("gitkr_init_process_commandline() beg");
00056 
00057   //-- check if there have been passed some parameters for libgitk
00058   for (i=1;i<*argc;) {
00059     if (!strcmp("--help", (*argv)[i]) || !strcmp("-h", (*argv)[i])) {
00060       info_only=info_help=TRUE;
00061     }
00062     else if((*argv)[i] && (!strcmp("--version", (*argv)[i]))) {
00063       info_only=info_version=TRUE;
00064     } 
00065     i++;
00066   }
00067   if(info_help) {
00068     gitk_puts(_("GITK-Renderer-Gtk options"));
00069     //gitk_puts(_("      --gitkr-gtk-theme\twhich gtk theme to use {default}"));
00070     putchar('\n');
00071   }
00072   if(info_version) puts(PACKAGE_NAME": version "PACKAGE_VERSION" by "PACKAGE_BUGREPORT);
00073 
00074   //-- remove found parameters
00075   cleanup_commandline_args(argc,argv);
00076   gitk_log1("gitk_init_process_commandline()=%1d end",info_only);
00077   return(info_only);
00078 }

Generated on Thu Oct 28 10:59:11 2004 for gitk by doxygen 1.3.6