From: <kr_...@us...> - 2004-05-08 09:21:21
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19849/src/cbits/GTK Modified Files: Frame.c Internals.h Util.c Log Message: Change the way in which the AppName is evaluated from AppTitle Index: Frame.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Frame.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Frame.c 8 May 2004 07:38:37 -0000 1.13 --- Frame.c 8 May 2004 09:21:09 -0000 1.14 *************** *** 6,9 **** --- 6,10 ---- #include <gdk/gdkkeysyms.h> + char *gAppTitle = NULL; char *gAppName = NULL; char *gAppVersion = NULL; *************** *** 217,221 **** /* Create the window. */ ! gFrameWidget = gnome_app_new(gAppName, gAppName); gtk_signal_connect (GTK_OBJECT(gFrameWidget), "delete-event", GTK_SIGNAL_FUNC(frame_delete_handler), --- 218,222 ---- /* Create the window. */ ! gFrameWidget = gnome_app_new(gAppName, gAppTitle); gtk_signal_connect (GTK_OBJECT(gFrameWidget), "delete-event", GTK_SIGNAL_FUNC(frame_delete_handler), *************** *** 319,323 **** /* Create the window. */ ! gFrameWidget = gnome_app_new(gAppName, gAppName); gtk_signal_connect (GTK_OBJECT(gFrameWidget), "delete-event", GTK_SIGNAL_FUNC(frame_delete_handler), --- 320,324 ---- /* Create the window. */ ! gFrameWidget = gnome_app_new(gAppName, gAppTitle); gtk_signal_connect (GTK_OBJECT(gFrameWidget), "delete-event", GTK_SIGNAL_FUNC(frame_delete_handler), Index: Internals.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Internals.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Internals.h 2 Oct 2003 22:31:39 -0000 1.6 --- Internals.h 8 May 2004 09:21:09 -0000 1.7 *************** *** 13,17 **** extern int gDocumentInterface; ! extern char *gAppName, *gAppVersion, *gWindowName; extern GtkWidget *gFrameWidget; extern GtkWidget *gClientWidget; --- 13,17 ---- extern int gDocumentInterface; ! extern char *gAppTitle, *gAppName, *gAppVersion, *gWindowName; extern GtkWidget *gFrameWidget; extern GtkWidget *gClientWidget; Index: Util.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Util.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Util.c 8 May 2004 07:38:37 -0000 1.19 --- Util.c 8 May 2004 09:21:09 -0000 1.20 *************** *** 27,31 **** } ! void osInit(char *appName, char *appVersion, int DocumentInterface) { if (!gProgram) --- 27,69 ---- } ! void parseAppNameVersion(char *appTitle,char *appVersion) ! { ! int appNameLen; ! char *s; ! ! s = appVersion; ! while (*s != ' ' && *s != 0) s++; ! ! if (*s == ' ') ! { ! appNameLen = s-appVersion; ! gAppName = malloc(appNameLen+1); ! memcpy(gAppName, appVersion, appNameLen); ! gAppName[appNameLen] = 0; ! ! while (*s == ' ') s++; ! gAppVersion = strdup(s); ! } ! else ! { ! gAppName = strdup(appTitle); ! gAppVersion = strdup(appVersion); ! } ! ! s = gAppName; ! appNameLen = 0; ! while (*s) ! { ! if (isalnum(*s)) ! gAppName[appNameLen++] = *s++; ! else ! s++; ! } ! gAppName[appNameLen] = 0; ! ! gAppTitle = strdup(appTitle); ! } ! ! void osInit(char *appTitle, char *appVersion, int DocumentInterface) { if (!gProgram) *************** *** 34,44 **** char **margv; gtk_set_locale(); getProgArgv(&margc, &margv); ! gProgram = gnome_program_init(appName, appVersion, LIBGNOMEUI_MODULE, margc, margv, GNOME_PARAM_POPT_TABLE, GNOME_PARAM_NONE); - gAppName = strdup(appName); - gAppVersion = strdup(appVersion); gDocumentInterface = DocumentInterface; gFrameWidget = NULL; --- 72,82 ---- char **margv; + parseAppNameVersion(appTitle,appVersion); + gtk_set_locale(); getProgArgv(&margc, &margv); ! gProgram = gnome_program_init(gAppName, appVersion, LIBGNOMEUI_MODULE, margc, margv, GNOME_PARAM_POPT_TABLE, GNOME_PARAM_NONE); gDocumentInterface = DocumentInterface; gFrameWidget = NULL; *************** *** 62,67 **** gtk_main(); handleProcessDestroy(); ! free(gAppName); ! free(gAppVersion); } --- 100,106 ---- gtk_main(); handleProcessDestroy(); ! free(gAppTitle); gAppTitle = NULL; ! free(gAppName); gAppName = NULL; ! free(gAppVersion); gAppVersion = NULL; } |