diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2024-11-14 19:35:45 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2024-11-14 19:35:45 +0100 |
commit | df5520aa2dae5b3ce7abf8733dcdd152898af163 (patch) | |
tree | 00d3047bfb14f682bfb5a21010c731ed649bfed7 /app/wlib/gtklib/splash.c | |
parent | df247efec654e512242e4f4f1b0212034f9e01fe (diff) | |
parent | ec3c0f6f6e7153fa797dc57a0e95779cbc63a23b (diff) |
Merge branch 'release/debian/1_5.3.0GA-1'debian/1_5.3.0GA-1
Diffstat (limited to 'app/wlib/gtklib/splash.c')
-rw-r--r-- | app/wlib/gtklib/splash.c | 115 |
1 files changed, 57 insertions, 58 deletions
diff --git a/app/wlib/gtklib/splash.c b/app/wlib/gtklib/splash.c index 5d56e9f..d42b7c0 100644 --- a/app/wlib/gtklib/splash.c +++ b/app/wlib/gtklib/splash.c @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <string.h> @@ -50,65 +50,65 @@ static GtkWidget *message; /**< window handle for progress message */ int wCreateSplash(char *appName, char *appVer) { - GtkWidget *vbox; - GtkWidget *image; - GtkWidget *label; - char *temp; - char logoPath[BUFSIZ]; - - /* create the basic window */ - window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_decorated(GTK_WINDOW(window), FALSE); - gtk_window_set_title(GTK_WINDOW(window), appName); - gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); - gtk_window_set_resizable(GTK_WINDOW(window), FALSE); - gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_SPLASHSCREEN); + GtkWidget *vbox; + GtkWidget *image; + GtkWidget *label; + char *temp; + char logoPath[BUFSIZ]; + + /* create the basic window */ + window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_decorated(GTK_WINDOW(window), FALSE); + gtk_window_set_title(GTK_WINDOW(window), appName); + gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); + gtk_window_set_resizable(GTK_WINDOW(window), FALSE); + gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_SPLASHSCREEN); #if GTK_MAJOR_VERSION > 1 || GTK_MINOR_VERSION > 5 - gtk_window_set_focus_on_map(GTK_WINDOW(window), FALSE); + gtk_window_set_focus_on_map(GTK_WINDOW(window), FALSE); #endif - vbox = gtk_vbox_new(FALSE, 0); - gtk_widget_show(vbox); - gtk_container_add(GTK_CONTAINER(window), vbox); + vbox = gtk_vbox_new(FALSE, 0); + gtk_widget_show(vbox); + gtk_container_add(GTK_CONTAINER(window), vbox); - /* add the logo image to the top of the splash window */ - sprintf(logoPath, "%s/" LOGOFILENAME, wGetAppLibDir()); - image = gtk_image_new_from_file(logoPath); - gtk_widget_show(image); - gtk_box_pack_start(GTK_BOX(vbox), image, TRUE, TRUE, 0); - gtk_misc_set_alignment(GTK_MISC(image), 0, 0); + /* add the logo image to the top of the splash window */ + sprintf(logoPath, "%s/" LOGOFILENAME, wGetAppLibDir()); + image = gtk_image_new_from_file(logoPath); + gtk_widget_show(image); + gtk_box_pack_start(GTK_BOX(vbox), image, TRUE, TRUE, 0); + gtk_misc_set_alignment(GTK_MISC(image), 0, 0); - /* put the product name into the window */ + /* put the product name into the window */ - temp = malloc(strlen(appName) + strlen(appVer) + 2); + temp = malloc(strlen(appName) + strlen(appVer) + 2); - if (!temp) { - return (FALSE); - } + if (!temp) { + return (FALSE); + } - sprintf(temp, "%s %s", appName, appVer); + sprintf(temp, "%s %s", appName, appVer); - label = gtk_label_new(temp); - gtk_widget_show(label); - gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); - gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_FILL); - gtk_label_set_selectable(GTK_LABEL(label), FALSE); - gtk_misc_set_padding(GTK_MISC(label), 6, 2); + label = gtk_label_new(temp); + gtk_widget_show(label); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); + gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_FILL); + gtk_label_set_selectable(GTK_LABEL(label), FALSE); + gtk_misc_set_padding(GTK_MISC(label), 6, 2); - free(temp); + free(temp); - label = gtk_label_new("Application is starting..."); - gtk_widget_show(label); - gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); - gtk_label_set_line_wrap(GTK_LABEL(label), FALSE); - gtk_misc_set_padding(GTK_MISC(label), 6, 2); + label = gtk_label_new("Application is starting..."); + gtk_widget_show(label); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); + gtk_label_set_line_wrap(GTK_LABEL(label), FALSE); + gtk_misc_set_padding(GTK_MISC(label), 6, 2); #if GTK_MINOR_VERSION > 5 - gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_START); + gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_START); #endif - message = label; + message = label; - gtk_widget_show(window); - return (TRUE); + gtk_widget_show(window); + return (TRUE); } /** @@ -120,14 +120,13 @@ wCreateSplash(char *appName, char *appVer) int wSetSplashInfo(char *msg) { - if (!window) return FALSE; - if (msg && message) { - gtk_label_set_text(GTK_LABEL(message), msg); - wFlush(); - return TRUE; - } - - return FALSE; + if (!window) { return FALSE; } + if (msg && message) { + gtk_label_set_text(GTK_LABEL(message), msg); + return TRUE; + } + + return FALSE; } /** @@ -138,9 +137,9 @@ wSetSplashInfo(char *msg) void wDestroySplash(void) { - /* kill window */ - if (window) gtk_widget_destroy(window); - window = NULL; + /* kill window */ + if (window) { gtk_widget_destroy(window); } + window = NULL; - return; + return; } |