patches/gnome-session-05-solaris-branding.diff
author yippi
Mon, 27 Sep 2010 21:07:51 +0000
changeset 20108 51df67ca9307
parent 15074 dfd8a3744c19
permissions -rw-r--r--
I had these modules listed as being owned by me, but they are really owned by wangke, correcting.

diff -urN gnome-session-2.25.90/splash/Makefile.am ../SUNWgnome-session-2.25.2.no-patch5.hacked/gnome-session-2.25.90/splash/Makefile.am
--- gnome-session-2.25.90/splash/Makefile.am	2009-02-03 13:32:47.000000000 +0000
+++ ../SUNWgnome-session-2.25.2.no-patch5.hacked/gnome-session-2.25.90/splash/Makefile.am	2009-02-12 15:03:22.729019000 +0000
@@ -3,6 +3,7 @@
 INCLUDES =					\
 	-I$(top_srcdir)/egg			\
 	-DLOCALE_DIR=\""$(datadir)/locale"\"	\
+ 	-DGNOME_ICONDIR=\""$(datadir)/pixmaps\"" \
 	$(WARN_CFLAGS)				\
 	$(DISABLE_DEPRECATED_CFLAGS)		\
 	$(SPLASH_CFLAGS)
diff -urN gnome-session-2.25.90/splash/gnome-session-splash.c ../SUNWgnome-session-2.25.2.no-patch5.hacked/gnome-session-2.25.90/splash/gnome-session-splash.c
--- gnome-session-2.25.90/splash/gnome-session-splash.c	2009-02-12 14:46:22.337047000 +0000
+++ ../SUNWgnome-session-2.25.2.no-patch5.hacked/gnome-session-2.25.90/splash/gnome-session-splash.c	2009-02-12 14:58:00.826377000 +0000
@@ -258,6 +258,128 @@
 
         return pixbuf;
 }
+static GdkPixbuf *
+composite_bkg_image (GdkPixbuf *splash, 
+		     GdkPixbuf *sun_logo, 
+		     GdkPixbuf *java_logo, 
+		     GdkPixbuf *adobe_logo,
+		     GdkPixbuf *flash_logo)
+{
+  GdkScreen *scr;
+  GdkWindow *root_win;
+  GdkPixbuf *root_pb;
+  GdkPixbuf *splash_scaled = NULL;
+  int w, h, scr_w, scr_h, x_offset, y_offset;
+  GdkRectangle monitor;
+
+  scr = gdk_screen_get_default ();
+  root_win = gdk_screen_get_root_window (scr);  
+
+  scr_w = gdk_screen_get_width (scr);
+  scr_h = gdk_screen_get_height (scr);
+  gdk_screen_get_monitor_geometry (scr, 0, &monitor);
+
+  root_pb = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
+			    TRUE,
+			    gdk_pixbuf_get_bits_per_sample (splash),
+			    scr_w, scr_h);
+
+  gdk_pixbuf_fill (root_pb, 0x35556bff); 
+  /* gdk_pixbuf_fill (root_pb, 0xffffffff); */
+
+  w = gdk_pixbuf_get_width (splash);
+  h = gdk_pixbuf_get_height (splash);
+
+  if (w > scr_w)
+    {
+      splash_scaled = gdk_pixbuf_scale_simple (splash, 
+					       scr_w,
+					       scr_h,
+					       GDK_INTERP_BILINEAR);
+      splash = splash_scaled;
+      x_offset = 0;
+      y_offset = 0;
+      w = scr_w;
+      h = scr_h;
+    }
+  else
+    {
+      x_offset = (monitor.width - w) / 2;
+      y_offset = (monitor.height - h) / 2;
+    }
+  
+  gdk_pixbuf_copy_area (splash, 0, 0,
+			w, h,
+			root_pb,
+			x_offset,
+			y_offset);
+
+  w = gdk_pixbuf_get_width (sun_logo);
+  h = gdk_pixbuf_get_height (sun_logo);
+
+#define SUN_LOGO_X_OFFSET 20
+#define SUN_LOGO_Y_OFFSET 20
+  
+  gdk_pixbuf_copy_area (sun_logo, 0, 0,
+			w, h,
+			root_pb,
+			SUN_LOGO_X_OFFSET,
+			SUN_LOGO_Y_OFFSET);
+
+#define BOTTOM_LOGO_INITIAL_X_GAP 25
+#define BOTTOM_LOGO_X_GAP 10
+#define BOTTOM_LOGO_Y_GAP 20
+  
+  w = gdk_pixbuf_get_width (java_logo);
+  h = gdk_pixbuf_get_height (java_logo);
+
+  y_offset = scr_h - (h + BOTTOM_LOGO_Y_GAP);
+  
+  gdk_pixbuf_copy_area (java_logo, 0, 0,
+			w, h,
+			root_pb,
+			BOTTOM_LOGO_INITIAL_X_GAP,
+			y_offset);
+
+  x_offset = BOTTOM_LOGO_INITIAL_X_GAP + w + BOTTOM_LOGO_X_GAP;
+
+  w = gdk_pixbuf_get_width (flash_logo);
+  h = gdk_pixbuf_get_height (flash_logo);
+
+  y_offset = scr_h - (h + BOTTOM_LOGO_Y_GAP);
+  
+  gdk_pixbuf_copy_area (flash_logo, 0, 0,
+			w, h,
+			root_pb,
+			x_offset,
+			y_offset);
+
+  x_offset += w + BOTTOM_LOGO_X_GAP;
+
+  /* display the adobe postscript if running on a Xsun xserver */
+  if (adobe_logo) {
+    Display *dpy = gdk_x11_display_get_xdisplay (gdk_screen_get_display (scr));
+    int opcode, event, error;
+      
+    if ((strcmp(ServerVendor(dpy), "Sun Microsystems, Inc.") == 0) && 
+	(XQueryExtension(dpy, "Adobe-DPS-Extension", &opcode, &event, &error) == True))
+      {
+	w = gdk_pixbuf_get_width (adobe_logo);
+	h = gdk_pixbuf_get_height (adobe_logo);
+	
+	y_offset = scr_h - (h + BOTTOM_LOGO_Y_GAP);
+
+	gdk_pixbuf_copy_area (adobe_logo, 0, 0,
+			      w, h,
+			      root_pb,
+			      x_offset, y_offset);
+      }
+  }
+
+  if (splash_scaled) gdk_pixbuf_unref (splash_scaled);
+  
+  return root_pb;
+}
 
 static void
 setup_splash_window (void)
@@ -268,10 +390,44 @@
         SnDisplay       *sn_display;
         GtkWidget       *splash_widget;
         GsmSplashWindow *splash;
-        GdkPixbuf       *background;
+        GdkPixbuf       *background, *pb, *sun_logo, *adobe_logo, *java_logo, *flash_logo;
+        char *filename;;
 
         /* Create the splash window */
-        background = load_splash_pixbuf ();
+ 
+        pb = load_splash_pixbuf ();
+     
+        if (g_file_test (GNOME_ICONDIR "/splash/sun-logo.png", G_FILE_TEST_EXISTS))
+	 {    
+	   filename = g_strdup (GNOME_ICONDIR "/splash/sun-logo.png");
+     
+	   sun_logo = gdk_pixbuf_new_from_file (filename, NULL);
+	   g_free (filename);
+     
+	   filename = g_strdup (GNOME_ICONDIR "/splash/java-logo.png");
+	   java_logo = gdk_pixbuf_new_from_file (filename, NULL);
+	   g_free (filename);
+     
+	   filename = g_strdup (GNOME_ICONDIR "/splash/adobe-sun.png");
+	   adobe_logo = gdk_pixbuf_new_from_file (filename, NULL);
+	   g_free (filename);
+     
+	   filename = g_strdup (GNOME_ICONDIR "/splash/flash.png");
+	   flash_logo = gdk_pixbuf_new_from_file (filename, NULL);
+	   g_free (filename);
+     
+	   background = composite_bkg_image (pb, sun_logo, java_logo, adobe_logo, flash_logo);
+     
+	   g_object_unref (pb);
+	   g_object_unref (sun_logo);
+	   if (adobe_logo)
+	    g_object_unref (adobe_logo); 
+	   if (flash_logo) 
+	    g_object_unref (flash_logo);
+	 }
+        else
+	 background = pb;
+ 
         splash_widget = gsm_splash_window_new (background);
         splash = (GsmSplashWindow *)splash_widget;
         if (background)
diff -urN gnome-session-2.25.90/splash/splash-window.c ../SUNWgnome-session-2.25.2.no-patch5.hacked/gnome-session-2.25.90/splash/splash-window.c
--- gnome-session-2.25.90/splash/splash-window.c	2009-02-03 13:32:47.000000000 +0000
+++ ../SUNWgnome-session-2.25.2.no-patch5.hacked/gnome-session-2.25.90/splash/splash-window.c	2009-02-12 15:02:33.590467000 +0000
@@ -21,6 +21,8 @@
 #include <stdio.h>
 #include <string.h>
 #include <gtk/gtk.h>
+#include <gdk/gdkx.h>
+#include <X11/Xlib.h>
 
 #include "splash-window.h"
 
@@ -34,13 +36,13 @@
 #define SPLASH_BASE_HEIGHT 220
 
 /* offset from bottom of label & font */
-#define SPLASH_LABEL_V_OFFSET 18
-#define SPLASH_LABEL_FONT_SIZE 8
+#define SPLASH_LABEL_V_OFFSET 310
+#define SPLASH_LABEL_FONT_SIZE 10
 
 /* icon border, spacing, offset from bottom and initial size */
-#define SPLASH_ICON_BORDER  26
+#define SPLASH_ICON_BORDER  195
 #define SPLASH_ICON_SPACING 4
-#define SPLASH_ICON_V_OFFSET 28
+#define SPLASH_ICON_V_OFFSET 235
 #define SPLASH_BASE_ICON_SIZE 22
 #define SPLASH_BASE_ICON_ROWS 1
 
@@ -113,13 +115,19 @@
 {
         GtkAllocation *allocation = &GTK_WIDGET (splash)->allocation;
         PangoRectangle pixel_rect;
+        GdkScreen *scr = gdk_screen_get_default ();
+        int scr_h = gdk_screen_get_height (scr);
 
         pango_layout_get_pixel_extents (splash->layout, NULL, &pixel_rect);
 
         splash->text_box.x = (allocation->x + allocation->width / 2 -
                               pixel_rect.width / 2);
-        splash->text_box.y = (allocation->y + allocation->height -
-                              pixel_rect.height - SPLASH_LABEL_V_OFFSET);
+	if (scr_h < 768)
+	  splash->text_box.y = (gdk_screen_get_height (scr) * 5714) / 10000;
+	else
+	  splash->text_box.y = (allocation->y + allocation->height -
+				pixel_rect.height - SPLASH_LABEL_V_OFFSET);
+
         splash->text_box.width = pixel_rect.width + 1;
         splash->text_box.height = pixel_rect.height + 1;
 }