[maemo-commits] [maemo-commits] r12740 - in projects/haf/trunk/hildon-desktop: . libhildondesktop

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Sun Jul 15 19:51:08 EEST 2007
Author: jobi
Date: 2007-07-15 19:51:00 +0300 (Sun, 15 Jul 2007)
New Revision: 12740

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-composite.c
Log:

2007-07-15  Johan Bilien  <johan.bilien at nokia.com>

	* libhildondesktop/hildon-desktop-panel-window-composite.c:
	- if the panel background size does not match the panel size,
	stretch it



Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-07-13 16:36:41 UTC (rev 12739)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-07-15 16:51:00 UTC (rev 12740)
@@ -1,3 +1,9 @@
+2007-07-15  Johan Bilien  <johan.bilien at nokia.com>
+
+	* libhildondesktop/hildon-desktop-panel-window-composite.c:
+	- if the panel background size does not match the panel size,
+	stretch it
+
 2007-07-11  Johan Bilien  <johan.bilien at nokia.com>
 
 	* libhildondesktop/hildon-desktop-panel-window-composite.[ch],

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-composite.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-composite.c	2007-07-13 16:36:41 UTC (rev 12739)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-composite.c	2007-07-15 16:51:00 UTC (rev 12740)
@@ -62,9 +62,13 @@
 
   Picture       background_picture;
   Picture       background_mask;
+  gint          background_width, background_height;
 
   gint          x, y, width, height;
 
+  XTransform    transform;
+  gboolean      scale;
+
 };
 #endif
 
@@ -280,6 +284,19 @@
   priv->width = event->width;
   priv->height = event->height;
 
+  if (priv->background_width != priv->width ||
+      priv->background_height != priv->height)
+  {
+    XTransform scale = {{{ XDoubleToFixed ((gdouble)priv->background_width /priv->width), 0, 0},
+                   {0, XDoubleToFixed ((gdouble)priv->background_height / priv->height), 0},
+                   {0, 0, XDoubleToFixed (1.0)}}};
+
+    priv->transform = scale;
+    priv->scale = TRUE;
+  }
+  else
+    priv->scale = FALSE;
+
   return FALSE;
 
 }
@@ -308,6 +325,16 @@
                        "picture", GINT_TO_POINTER (picture));
 
     if (priv->home_picture != None)
+
+    {
+      g_debug ("paint home on %i, %i, %i, %i, %i, %i, %i, %i",
+                        priv->x + event->area.x, priv->y + event->area.y,
+                        priv->x + event->area.x, priv->y + event->area.y,
+                        event->area.x - x_offset,
+                        event->area.y - y_offset,
+                        event->area.width,
+                        event->area.height);
+
       XRenderComposite (GDK_DISPLAY (),
                         PictOpSrc,
                         priv->home_picture,
@@ -319,8 +346,21 @@
                         event->area.y - y_offset,
                         event->area.width,
                         event->area.height);
+    }
 
     if (priv->background_picture != None)
+    {
+      if (priv->scale)
+      {
+        XRenderSetPictureTransform (GDK_DISPLAY (),
+                                    priv->background_picture,
+                                    &priv->transform);
+
+        XRenderSetPictureTransform (GDK_DISPLAY (),
+                                    priv->background_mask,
+                                    &priv->transform);
+      }
+
       XRenderComposite (GDK_DISPLAY (),
                         PictOpOver,
                         priv->background_picture,
@@ -333,6 +373,8 @@
                         event->area.width,
                         event->area.height);
 
+    }
+
     result = GTK_WIDGET_CLASS (hildon_desktop_panel_window_composite_parent_class)->
         expose_event (widget, event);
 
@@ -391,16 +433,22 @@
   hildon_desktop_picture_and_mask_from_file (filename,
                                              &priv->background_picture,
                                              &priv->background_mask,
-                                             NULL, NULL);
-}
+                                             &priv->background_width,
+                                             &priv->background_height);
 
-#endif
+  if (priv->background_width != priv->width ||
+      priv->background_height != priv->height)
+  {
+    XTransform scale = {{{ XDoubleToFixed ((gdouble)priv->background_width /priv->width), 0, 0},
+                   {0, XDoubleToFixed ((gdouble)priv->background_height / priv->height), 0},
+                   {0, 0, XDoubleToFixed (1.0)}}};
 
+    priv->transform = scale;
+    priv->scale = TRUE;
+  }
+  else
+    priv->scale = FALSE;
 
+}
 
-
-
-
-
-
-
+#endif


More information about the maemo-commits mailing list