diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2024-07-03 10:19:30 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2024-07-03 10:19:30 +0200 |
commit | a14a7a0ccc9de76aeab0b2e4bbf58f1a79deedc2 (patch) | |
tree | e469179df67a0e0db49161a43cbf8076a189f6f4 /app/wlib/gtklib/splash.c | |
parent | 5d2c2b27a6323e2666378b986129b2a7c2c39e5c (diff) |
New upstream version 5.3.0GAupstream/5.3.0GAupstream
Diffstat (limited to 'app/wlib/gtklib/splash.c')
-rw-r--r-- | app/wlib/gtklib/splash.c | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/app/wlib/gtklib/splash.c b/app/wlib/gtklib/splash.c index 7b7613c..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,13 +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); - return TRUE; - } + if (!window) { return FALSE; } + if (msg && message) { + gtk_label_set_text(GTK_LABEL(message), msg); + return TRUE; + } - return FALSE; + return FALSE; } /** @@ -137,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; } |