gxsm_app.C

Go to the documentation of this file.
00001 /* Gxsm - Gnome X Scanning Microscopy
00002  * universal STM/AFM/SARLS/SPALEED/... controlling and
00003  * data analysis software
00004  * 
00005  * Copyright (C) 1999,2000,2001,2002,2003 Percy Zahl
00006  *
00007  * Authors: Percy Zahl <zahl@users.sf.net>
00008  * additional features: Andreas Klust <klust@users.sf.net>
00009  * WWW Home: http://gxsm.sf.net
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00024  */
00025 
00026 /* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 8 c-style: "K&R" -*- */
00027 
00028 #include <locale.h>
00029 #include <libintl.h>
00030 
00031 
00032 #include "../pixmaps/gxsmlogo.xpm"
00033 
00034 #include "gxsm_app.h"
00035 #include "gxsm_menudef.h"
00036 
00037 #include "version.h"
00038 #include "glbvars.h"
00039 
00040 #include "unit.h"
00041 #include "pcs.h"
00042 
00043 #include "xsmtypes.h"
00044 #include "surface.h"
00045 #include "tips_dialog.h"
00046 #include "plugin_ctrl.h"
00047 
00048 // ========================================
00049 // Application Startup Point
00050 // ========================================
00051 
00052 App::App(int restarted)
00053 {
00054         XSM_DEBUG(DBG_L2, "App::App" );
00055         // until Application is created
00056         app = NULL;
00057 
00058         // still not created
00059         channelselector = NULL;
00060         monitorcontrol = NULL;
00061         spm_control = NULL;
00062         xsm = NULL;
00063 
00064         // Remote Control Lists
00065         RemoteEntryList  = NULL;  
00066         RemoteActionList = NULL;  
00067         remotecontrol    = NULL;
00068 
00069         // Plungin Interface, Plugin Events
00070         GxsmPlugins = NULL;
00071         PluginNotifyOnSPMRange = NULL;
00072         PluginNotifyOnStartScan = NULL;
00073         PluginNotifyOnStopScan = NULL;
00074         PluginNotifyOnCDFLoad = NULL;
00075         PluginNotifyOnCDFSave = NULL;
00076         PluginNotifyOnLoadFile = NULL;
00077         PluginNotifyOnSaveFile = NULL;
00078 
00079         PluginCallGetNCInfo = NULL;
00080         PluginCallPrinter = NULL;
00081         PluginCallMkicons = NULL;
00082   
00083         // Application Gxsm
00084         nodestroy = TRUE;
00085 }
00086 
00087 App::~App(){
00088         SetStatus(N_("App::~App: Closing Application object now."));
00089         XSM_DEBUG(DBG_L2, "App::~App: Closing Application object now..." );
00090 
00091         // remove plugins: killflag = TRUE
00092         reload_gxsm_plugins( TRUE );
00093 
00094         delete channelselector;
00095         delete monitorcontrol;
00096 
00097         delete spm_control;
00098         delete xsm;
00099         check_events();
00100         XSM_DEBUG(DBG_L2, "App::~App: done." );
00101 }
00102 
00103 void App::build_gxsm(){
00104         XSM_DEBUG(DBG_L2, "App::build_gxsm" );
00105         /* Make the main window and binds the delete event so you can close
00106            the program from your WM */
00107         app = gnome_app_new (PACKAGE, _("Gxsm - STM/AFM/SPA-LEED..."));
00108 
00109         gtk_widget_realize (app);
00110         gtk_signal_connect (GTK_OBJECT (app), "delete_event",
00111                             GTK_SIGNAL_FUNC (file_exit_callback),
00112                             NULL);
00113 
00114         gnome_window_icon_set_from_file (GTK_WINDOW (app),
00115                                          GNOME_ICONDIR"/GxsmBWlogoTransparentColor.png");
00116       
00117         GnomeAppServiceSetApp(app); // connect Service with app
00118         /* Launch Splash -- it destroys itself after timeout ! */
00119         GxsmSplash();
00120 
00121         /* Now that we've the main window we'll make the menues */
00122         gnome_app_create_menus (GNOME_APP (app), main_menu);
00123         gxsmmenu = (GNOME_APP (app))->menubar;
00124 
00125         /* Make Default Toolbar */
00126         gnome_app_create_toolbar (GNOME_APP (app), main_toolbar);
00127 
00128         /* Make Statusbar */
00129         appbar = gnome_appbar_new(TRUE, TRUE, GNOME_PREFERENCES_NEVER);
00130         gnome_app_set_statusbar(GNOME_APP (app), GTK_WIDGET (appbar));
00131         
00132         /* Now show Window */
00133         gtk_widget_show (GTK_WIDGET (appbar));
00134         gtk_widget_show (GTK_WIDGET (app));
00135         
00136         XSM_DEBUG(DBG_L2, "App::build_gxsm - starting up" );
00137         SetStatus(N_("Starting GXSM..."));
00138         
00139         /* Now read User Confiugartion */
00140         XSM_DEBUG(DBG_L2, "App::build_gxsm - reading config" );
00141         SetStatus(N_("Reading User Config"));
00142 
00143         GnomeResPreferences *pref = gnome_res_preferences_new (xsm_res_def);
00144         gnome_res_read_user_config (pref);
00145         gnome_res_destroy (pref);
00146         
00147         ClearStatus();
00148 
00149         /* install menu hints ? */
00150         XSM_DEBUG(DBG_L2, "App::build_gxsm - tooltips install" );
00151         if(xsmres.menutooltips)
00152                 gnome_app_install_menu_hints(GNOME_APP (app), main_menu);
00153 
00154         /* Erzeuge und Initialise Xsm system */
00155         XSM_DEBUG(DBG_L2, "App::build_gxsm - xsm = new Surface" );
00156         SetStatus(N_("Generating Surface Object..."));
00157         xsm = new Surface (); // This is the master backend (app is only passed to HwI's)
00158 
00159         /* Load Gxsm Plugins: additional control windows, math/filters/etc. */
00160         XSM_DEBUG(DBG_L2, "App::build_gxsm - Scanning for PlugIns...");
00161         SetStatus(N_("Scanning for GXSM Plugins..."));
00162         if( !xsmres.disableplugins )
00163                 reload_gxsm_plugins();
00164 
00165         /* Now create and attach Main Control Box (emtpy vbox only) */
00166         XSM_DEBUG(DBG_L2, "App::build_gxsm - main control window" );
00167         main_control = create_control ();
00168         
00169 
00170         /* Enable DND to accept file Drops */
00171         XSM_DEBUG(DBG_L2, "App::build_gxsm - DnD setup" );
00172         configure_drop_on_widget(main_control);
00173 
00174         /* Attach more Elements... to main window */
00175 
00176         /* fill in main control elements SPM + AS + UI */
00177         XSM_DEBUG(DBG_L2, "App::build_gxsm - attach control" );
00178         spm_control = NULL;
00179         xsm->SetModeFlg(MODE_SETSTEPS);
00180         if(IS_SPALEED_CTRL)
00181                 // SPALEED Controls
00182                 spm_control  = create_spa_control ();
00183         else
00184                 // SPM Controls
00185                 spm_control  = create_spm_control ();
00186 
00187         // Auto Save Control
00188         XSM_DEBUG(DBG_L2, "App::build_gxsm - AS control" );
00189         as_control   = create_as_control ();
00190 
00191         // User Info Control
00192         XSM_DEBUG(DBG_L2, "App::build_gxsm - UI control" );
00193         ui_control   = create_ui_control ();
00194         
00195         /* ... and Attach to App mainwindow */
00196         gnome_app_set_contents ( GNOME_APP (app), main_control);
00197         gtk_widget_show (spm_control);
00198 
00199         XSM_DEBUG(DBG_L2, "App::build_gxsm - Monitor");
00200         /* create windows */
00201         monitorcontrol  = new MonitorControl();
00202 
00203         XSM_DEBUG(DBG_L2, "App::build_gxsm - Channelselector");
00204         channelselector = new ChannelSelector();
00205         
00206         /* We now show the widgets, the order doesn't matter, but i suggests 
00207            showing the main window last so the whole window will popup at
00208            once rather than seeing the window pop up, and then the button form
00209            inside of it. Although with such simple example, you'd never notice. */
00210         
00211         /* Show all Windows if desired  -- default is used if no Res is available */
00212         
00213         monitorcontrol->SetResName    ("WindowMonitorControl", "false", xsmres.geomsave);
00214         channelselector->SetResName   ("WindowChannelSelector", "true", xsmres.geomsave);
00215 
00216         /* Update all fields */
00217         XSM_DEBUG(DBG_L2, "App::build_gxsm - update all entries");
00218         spm_update_all(-xsm->data.display.ViewFlg);
00219         monitorcontrol->LogEvent("GXSM", "startup");
00220 
00221         /* Setup initial Menu Toggleitem states */
00222         XSM_DEBUG(DBG_L2, "App::build_gxsm - menu toggels setup");
00223         SetupToggleMenuItem(gxsmmenu, N_("View/Autozoom"), TRUE);
00224 
00225         XSM_DEBUG(DBG_L2, "App::build_gxsm - done.");
00226 }
00227 
00228 // Plugin handling
00229 // ========================================
00230 
00231 gint App::Gxsm_Plugin_Check (const gchar *category){
00232         if( category ){
00233                 // HARD_ELEM = noHARD, spmHARD, spaHARD, ccdHARD, [bbHARD, dspHARD]
00234                 // (+HARD) = (+HARD +HARD_ELEM)
00235                 // (-HARD) = (-HARD -HARD_ELEM)
00236                 // INST_ELEM = STM, AFM, SARLS, SPALEED, ELSLEED, CCD, ALL
00237                 // (+INST) = (+INST +INST_ELEM)
00238                 // (-INST) = (-INST -INST_ELEM)
00239                 // Decision is:
00240                 // LoadPlugin if ( (+HARD && -HARD) && (+INST && -INST) )
00241                 // (+HARD) = (+HARD || (+HARD_ELEM is HardwareType))
00242                 // (-HARD) = (-HARD && (-HARD_ELEM is not HardwareType))
00243                 // (+INST) = (+INST || (+INST_ELEM is InstrumentType))
00244                 // (-INST) = (-INST && (-INST_ELEM is not InstrumentType))
00245                 
00246                 // z.B. load if
00247                 // category = "+noHARD -SPALEED" :  no Hardware and not SPALEED
00248                 // category = "+SPALEED"  :  only SPALEED
00249                 // category = "+spm -AFM" :  spm Hardware and not AFM
00250                 
00251                 gint  phard, mhard, pinst, minst;
00252                 gchar *pht=g_strconcat("+", xsmres.HardwareType, "HARD", NULL);
00253                 gchar *mht=g_strconcat("-", xsmres.HardwareType, "HARD", NULL);
00254                 gchar *pit=g_strconcat("+", xsmres.InstrumentType, NULL);
00255                 gchar *mit=g_strconcat("-", xsmres.InstrumentType, NULL);
00256                 
00257                 if(  strstr( category, pht ) || !strstr( category, "HARD") )
00258                         phard = TRUE; else phard = FALSE;
00259                 if( !strstr( category, mht ) || !strstr( category, "HARD") )
00260                         mhard = TRUE; else mhard = FALSE;
00261                 
00262                 if(  strstr( category, pit ) || strstr( category, "+ALL") )
00263                         pinst = TRUE; else pinst = FALSE;
00264                 if( !strstr( category, mit ) || strstr( category, "+ALL") )
00265                         minst = TRUE; else minst = FALSE;
00266                 
00267                 g_free(pit);
00268                 g_free(mit);
00269                 g_free(pht);
00270                 g_free(mht);
00271                 
00272                 if((phard && mhard) && (pinst && minst))
00273                         return TRUE;
00274                 return FALSE;
00275         }
00276         return TRUE;
00277 }
00278 
00279 
00280 void App::ConnectPluginToSPMRangeEvent( void (*cbfkt)(gpointer) ){
00281         PluginNotifyOnSPMRange = g_list_prepend(PluginNotifyOnSPMRange, (gpointer) cbfkt);
00282 }
00283 void App::ConnectPluginToStartScanEvent( void (*cbfkt)(gpointer) ){
00284         PluginNotifyOnStartScan = g_list_prepend(PluginNotifyOnStartScan, (gpointer) cbfkt);
00285 }
00286 void App::ConnectPluginToStopScanEvent( void (*cbfkt)(gpointer) ){
00287         PluginNotifyOnStopScan = g_list_prepend(PluginNotifyOnStopScan, (gpointer) cbfkt);
00288 }
00289 void App::ConnectPluginToCDFLoadEvent( void (*cbfkt)(gpointer) ){
00290         PluginNotifyOnCDFLoad = g_list_prepend(PluginNotifyOnCDFLoad, (gpointer) cbfkt);
00291 }
00292 void App::ConnectPluginToCDFSaveEvent( void (*cbfkt)(gpointer) ){
00293         PluginNotifyOnCDFSave = g_list_prepend(PluginNotifyOnCDFSave, (gpointer) cbfkt);
00294 }
00295 void App::ConnectPluginToLoadFileEvent( void (*cbfkt)(gpointer) ){
00296         PluginNotifyOnLoadFile = g_list_prepend(PluginNotifyOnLoadFile, (gpointer) cbfkt);
00297 }
00298 void App::ConnectPluginToSaveFileEvent( void (*cbfkt)(gpointer) ){
00299         PluginNotifyOnSaveFile = g_list_prepend(PluginNotifyOnSaveFile, (gpointer) cbfkt);
00300 }
00301 
00302 void App::ConnectPluginToGetNCInfoEvent( void (*cbfkt)(gchar *filename ) ){
00303         PluginCallGetNCInfo = cbfkt;
00304 }
00305 
00306 void App::ConnectPluginToPrinterEvent( void (*cbfkt)(GtkWidget*, void*) ){
00307         PluginCallPrinter = cbfkt;
00308 }
00309 
00310 void App::ConnectPluginToMkiconsEvent( void (*cbfkt)(GtkWidget*, void*) ){
00311         PluginCallMkicons = cbfkt;
00312 }
00313 
00314 
00315 void App::reload_gxsm_plugins( gint killflag ){
00316         gint (*gxsm_plugin_check)(const gchar *) = Gxsm_Plugin_Check;
00317         GList *PluginDirs = NULL;
00318         XSM_DEBUG(DBG_L2, "Remove/Reload Gxsm plugins" );
00319 
00320         
00321         if( PluginNotifyOnSPMRange ){
00322                 g_list_free( PluginNotifyOnSPMRange);
00323                 PluginNotifyOnSPMRange = NULL;
00324         }
00325         if( PluginNotifyOnStartScan ){
00326                 g_list_free( PluginNotifyOnStartScan );
00327                 PluginNotifyOnStartScan = NULL;
00328         }
00329         if( PluginNotifyOnStopScan ){
00330                 g_list_free( PluginNotifyOnStopScan );
00331                 PluginNotifyOnStopScan = NULL;
00332         }
00333         if( PluginNotifyOnCDFLoad ){
00334                 g_list_free( PluginNotifyOnCDFLoad );
00335                 PluginNotifyOnCDFLoad = NULL;
00336         }
00337         if( PluginNotifyOnCDFSave ){
00338                 g_list_free( PluginNotifyOnCDFSave );
00339                 PluginNotifyOnCDFSave = NULL;
00340         }
00341         if( PluginNotifyOnLoadFile ){
00342                 g_list_free( PluginNotifyOnLoadFile );
00343                 PluginNotifyOnLoadFile = NULL;
00344         }
00345         if( PluginNotifyOnSaveFile ){
00346                 g_list_free( PluginNotifyOnSaveFile );
00347                 PluginNotifyOnSaveFile = NULL;
00348         }
00349 
00350         PluginCallGetNCInfo = NULL;
00351         PluginCallPrinter = NULL;
00352         PluginCallMkicons = NULL;
00353         
00354         // (re)load HwI
00355         xsm->reload_hardware_interface (killflag ? NULL:this);
00356 
00357         if( !GxsmPlugins && killflag ){
00358                 XSM_DEBUG(DBG_L2, "no GXSM plugins found, done." );
00359                 return;
00360         }
00361         
00362         if( GxsmPlugins ){
00363                 SetStatus(N_("Removing Plugins..."));
00364                 delete GxsmPlugins;
00365                 GxsmPlugins = NULL;
00366                 if( killflag ) // cleanup only ?
00367                         return;
00368                 
00369                 XSM_DEBUG(DBG_L2, "Plugins removed" );
00370                 SetStatus(N_("Plugins removed"));
00371 
00372                 GtkWidget *dialog = gtk_message_dialog_new 
00373                         (NULL,
00374                          GTK_DIALOG_DESTROY_WITH_PARENT,
00375                          GTK_MESSAGE_QUESTION, 
00376                          GTK_BUTTONS_NONE,
00377                          N_("GXSM PlugIns unloaded. Reload plug-ins now?\n\n"
00378                             "Yes: automatic plug-in selection\n"
00379                             "All: force loading of all plug-ins\n"
00380                             "No: do not load any plug-in,\n"
00381                             "  call 'GXSM->Reload Plugins' again\n"
00382                             "  to auto load plug-ins again!"));
00383                 gtk_dialog_add_buttons (GTK_DIALOG (dialog), 
00384                                         GTK_STOCK_YES, GTK_RESPONSE_YES,
00385                                         N_("All"), 99,
00386                                         GTK_STOCK_NO, GTK_RESPONSE_NO,
00387                                         NULL);
00388 
00389                 int ret = gtk_dialog_run (GTK_DIALOG(dialog));
00390                 gtk_widget_destroy (dialog);
00391 
00392                 switch(ret){
00393                 case GTK_RESPONSE_YES : break;
00394                 case 99 : gxsm_plugin_check = NULL; break;
00395                 default: return;
00396                 }
00397         }
00398 
00399         GxsmSplash(0.01, " ", "Looking for GXSM PlugIns");
00400         
00401         // Make plugin search dir list
00402         PluginDirs = g_list_prepend
00403                 (PluginDirs, g_strconcat(PACKAGE_PLUGIN_DIR, "/common", NULL));
00404         PluginDirs = g_list_prepend
00405                 (PluginDirs, g_strconcat(PACKAGE_PLUGIN_DIR, "/math", NULL));
00406         PluginDirs = g_list_prepend
00407                 (PluginDirs, g_strconcat(PACKAGE_PLUGIN_DIR, "/probe", NULL));
00408         PluginDirs = g_list_prepend
00409                 (PluginDirs, g_strconcat(PACKAGE_PLUGIN_DIR, "/control", NULL));
00410         PluginDirs = g_list_prepend
00411                 (PluginDirs, g_strconcat(PACKAGE_PLUGIN_DIR, "/scan", NULL));
00412         PluginDirs = g_list_prepend
00413                 (PluginDirs, g_strconcat(g_get_home_dir(), "/.gxsm/plugins", NULL));
00414         PluginDirs = g_list_prepend
00415                 (PluginDirs, g_strdup(xsmres.UserPluginPath));
00416         
00417         GxsmPlugins = new gxsm_plugins(this, PluginDirs, gxsm_plugin_check);
00418         
00419         // and remove list
00420         GList *node = PluginDirs;
00421         while(node){
00422                 g_free(node->data);
00423                 node = node->next;
00424         }
00425         g_list_free(PluginDirs);
00426         
00427         gchar *txt = g_strdup_printf
00428                 (N_("%d Plugins loaded!"), GxsmPlugins->how_many());
00429         SetStatus(txt);
00430         //  message((const char*)txt);
00431         g_free(txt);
00432 
00433         GxsmSplash(-1.);
00434 }
00435 
00436 void App::CallPlugin( void (*cbfkt)( gpointer ), gpointer data){
00437         (*cbfkt) ( data ); 
00438 }
00439 
00440 void App::SignalEventToPlugins( GList *PluginNotifyList, gpointer data ){
00441         g_list_foreach( PluginNotifyList, (GFunc) CallPlugin, data);    
00442 }
00443 
00444 
00445 // Gxsm Splash
00446 // ========================================
00447 
00448 gint App::RemoveGxsmSplash(GtkWidget *widget){
00449 //        GdkPixbuf  *img = (GdkPixbuf*) gtk_object_get_data ( GTK_OBJECT (widget), "splash_pixbuf");
00450 
00451         
00452         gtk_widget_destroy (widget);
00453 //        gdk_imlib_kill_image(img); ??!?? this is now a gobject, how to kill it? fixme!
00454         
00455         /* Show tip of the day */
00456         XsmRescourceManager xrm("GUI-global","Tips");
00457         if (xrm.GetBool("ShowTips", TRUE))
00458                 tips_dialog_create ();
00459         
00460         return FALSE;
00461 }
00462 
00463 void App::GxsmSplash(gdouble progress, const gchar *text, const gchar* info){
00464         static GtkWidget *progress_bar = NULL;
00465         static GnomeCanvasItem *info_label = NULL;
00466         static GtkWidget *splash = NULL;
00467         GtkWidget *canvas;
00468         GdkPixbuf *img;
00469         gchar     *sload;
00470         gchar     *font, *font2;
00471         gchar     *fontcolor, *fontcolor2;
00472         gchar     *txt;
00473 
00474         if (progress_bar && splash && progress > -0.2){
00475                 if (progress >= 0. && progress <= 1.0)
00476                         gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), progress);
00477                 else
00478                         gtk_progress_bar_pulse (GTK_PROGRESS_BAR (progress_bar));
00479                 if (text){
00480                         gtk_progress_bar_set_text (GTK_PROGRESS_BAR (progress_bar), text);
00481                 }
00482                 if (info)
00483                         gnome_canvas_item_set(info_label, "text", info, NULL);
00484                 while(gtk_events_pending()) gtk_main_iteration();
00485                 return;
00486         }
00487         else if (splash && progress < -0.5){
00488                 XsmRescourceManager xrm("GUI-global","Splash");
00489                 int ms;
00490                 xrm.Get("timeout", &ms, "3000");
00491                 if (ms < 100) ms = 5000;
00492                 gtk_timeout_add (ms, (GtkFunction) App::RemoveGxsmSplash, splash);
00493                 progress_bar = NULL;
00494                 splash = NULL;
00495                 return;
00496         }
00497         
00498         const int ImgW = atoi(xxsmlogo_xpm[0]);
00499         const int ImgH = atoi(xxsmlogo_xpm[0]+4);
00500         
00501         XsmRescourceManager xrm("GUI-global","Splash");
00502         sload = xrm.GetStr("load", "Yes");
00503         XSM_DEBUG(DBG_L5, "App::GxsmSplash: load = " << sload << "<");
00504 
00505         if (!strcasecmp (sload, "yes")){
00506                 font = xrm.GetStr ("font", "helvetica Bold 18");
00507                 fontcolor = xrm.GetStr ("fontcolor", "blue");
00508                 font2 = xrm.GetStr ("font2", "helvetica 12");
00509                 fontcolor2 = xrm.GetStr ("fontcolor2", "black");
00510                 txt = xrm.GetStr ("message", "STM/AFM/SPALEED...");
00511                 
00512                 splash = gtk_window_new (GTK_WINDOW_POPUP);
00513                 gtk_window_set_default_size(GTK_WINDOW(splash), ImgW, ImgH+20);
00514                 gtk_window_set_title(GTK_WINDOW(splash), "GXSM Startup");
00515                 gtk_widget_set_uposition (splash, (gdk_screen_width()-ImgW)/2, (gdk_screen_height()-ImgH)/2);
00516 
00517                 GtkWidget* vb = gtk_vbox_new (FALSE, 0);
00518                 gtk_widget_show (vb);
00519                 gtk_container_add (GTK_CONTAINER (splash), vb);
00520 
00521                 canvas = gnome_canvas_new();
00522                 gnome_canvas_set_pixels_per_unit( GNOME_CANVAS(canvas), 1.);
00523                 gnome_canvas_set_scroll_region( GNOME_CANVAS(canvas), -(double)ImgW/2, -(double)ImgH/2, (double)ImgW/2, (double)ImgH/2);
00524 
00525                 gtk_box_pack_start_defaults (GTK_BOX (vb), canvas);
00526 
00527                 progress_bar = gtk_progress_bar_new ();
00528 #ifdef PANGO_ELLIPSIZE_START
00529                 gtk_progress_bar_set_ellipsize (GTK_PROGRESS_BAR (progress_bar), PANGO_ELLIPSIZE_START);
00530 #endif
00531                 gtk_widget_show (progress_bar);
00532                 gtk_box_pack_start (GTK_BOX (vb), progress_bar, FALSE, FALSE, 0);
00533 
00534                 img = gdk_pixbuf_new_from_xpm_data(xxsmlogo_xpm);
00535                 gtk_object_set_data( GTK_OBJECT (splash), "splash_pixbuf", img);
00536                 gnome_canvas_item_new(gnome_canvas_root( GNOME_CANVAS(canvas)),
00537                                       gnome_canvas_pixbuf_get_type(),
00538                                       "pixbuf", img,
00539                                       "x", 0.0,
00540                                       "y", 0.0,
00541                                       "anchor", GTK_ANCHOR_CENTER,
00542                                       NULL);
00543                 info_label = gnome_canvas_item_new(gnome_canvas_root( GNOME_CANVAS(canvas)),
00544                                       gnome_canvas_text_get_type(),
00545                                       "text", txt,
00546                                       "x", 0.0,
00547                                       "y", 60.0,
00548                                       "fill_color", "black",
00549                                       "font", font2,
00550                                       "anchor", GTK_ANCHOR_CENTER,
00551                                       NULL);
00552                 gnome_canvas_item_new(gnome_canvas_root( GNOME_CANVAS(canvas)),
00553                                       gnome_canvas_text_get_type(),
00554                                       "text", PACKAGE "-" VERSION,
00555                                       "x", 0.0,
00556                                       "y", -60.0,
00557                                       "fill_color", "blue",
00558                                       "font", font,
00559                                       "anchor", GTK_ANCHOR_CENTER,
00560                                       NULL);
00561 
00562                 gnome_canvas_item_new(gnome_canvas_root( GNOME_CANVAS(canvas)),
00563                                       gnome_canvas_rect_get_type(),
00564                                       "x1",-(double)ImgW/2+1,
00565                                       "y1",-(double)ImgH/2+1,
00566                                       "x2",(double)ImgW/2-1,
00567                                       "y2",(double)ImgH/2-1,
00568                                       "outline_color","grey80",
00569                                       "width_units",4.0,
00570                                       NULL);
00571                 g_free(font);
00572                 g_free(fontcolor);
00573                 g_free(txt);
00574                 
00575                 gtk_widget_show(canvas);
00576                 
00577                 gtk_widget_show(splash);
00578                 
00579                 while(gtk_events_pending()) gtk_main_iteration();
00580         }
00581 }
00582 

Generated on Sat Apr 1 09:03:57 2006 for GXSM by  doxygen 1.4.6