[maemo-commits] [maemo-commits] r17312 - in projects/haf/trunk/libmatchbox2: . matchbox/comp-mgr matchbox/core matchbox/theme-engines

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Jan 28 19:01:40 EET 2009
Author: gw
Date: 2009-01-28 19:01:34 +0200 (Wed, 28 Jan 2009)
New Revision: 17312

Modified:
   projects/haf/trunk/libmatchbox2/ChangeLog
   projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-decor.h
   projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme-png.c
   projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme-xml.c
   projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme.c
   projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme.h
Log:
	* matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c:
	Removed un-needed transition code + remnants of shadow code
	Made the clutter group containing the texture be created along with
	the class to allow decor to be added to it.
	* matchbox/theme-engines/mb-wm-theme.h
	* matchbox/theme-engines/mb-wm-theme.c:
	Added a field for the image filename (for clutter title bars)
	* matchbox/core/mb-wm-decor.h:
	Allowed a class to extend MBWMDecor
	* matchbox/theme-engines/mb-wm-theme-xml.c:
	Fixed some badly initialised vars (-1 for offsets that may not exist
	in XML)
	* matchbox/theme-engines/mb-wm-theme-png.c:
	Trying to fix issue where offsets in the XML theme were wrongly 
	offsetting buttons



Modified: projects/haf/trunk/libmatchbox2/ChangeLog
===================================================================
--- projects/haf/trunk/libmatchbox2/ChangeLog	2009-01-28 16:01:00 UTC (rev 17311)
+++ projects/haf/trunk/libmatchbox2/ChangeLog	2009-01-28 17:01:34 UTC (rev 17312)
@@ -1,3 +1,21 @@
+2009-01-28  Gordon Williams  <gordon.williams at collabora.co.uk>
+
+	* matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c:
+	Removed un-needed transition code + remnants of shadow code
+	Made the clutter group containing the texture be created along with
+	the class to allow decor to be added to it.
+	* matchbox/theme-engines/mb-wm-theme.h
+	* matchbox/theme-engines/mb-wm-theme.c:
+	Added a field for the image filename (for clutter title bars)
+	* matchbox/core/mb-wm-decor.h:
+	Allowed a class to extend MBWMDecor
+	* matchbox/theme-engines/mb-wm-theme-xml.c:
+	Fixed some badly initialised vars (-1 for offsets that may not exist
+	in XML)
+	* matchbox/theme-engines/mb-wm-theme-png.c:
+	Trying to fix issue where offsets in the XML theme were wrongly 
+	offsetting buttons
+
 2009-01-27  Thomas Thurman  <thomas.thurman at collabora.co.uk>
 
 	* matchbox/theme-engines/mb-wm-theme-png.c: remove byte order

Modified: projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c	2009-01-28 16:01:00 UTC (rev 17311)
+++ projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c	2009-01-28 17:01:34 UTC (rev 17312)
@@ -53,6 +53,7 @@
 #define WIDTH  (3*MAX_TILE_SZ)
 #define HEIGHT (3*MAX_TILE_SZ)
 
+#if SGX_CORRUPTION_WORKAROUND
 /* FIXME: This is copied from hd-wm, and should be removed
  * when we take out the nasty X11 hack */
 typedef enum _HdWmClientType
@@ -63,6 +64,7 @@
   HdWmClientTypeStatusMenu  = MBWMClientTypeLast << 4,
   HdWmClientTypeAnimationActor = MBWMClientTypeLast << 5,
 } HdWmClientType;
+#endif
 
 static void
 mb_wm_comp_mgr_clutter_add_actor (MBWMCompMgrClutter *,
@@ -198,7 +200,7 @@
 #ifdef HAVE_XEXT
   /*
    * If the client is shaped, we have to tell our texture about which bits of
-   * it are visible. If it's not we want to just chear all shapes, and it'll
+   * it are visible. If it's not we want to just clear all shapes, and it'll
    * know it needs to draw the whole thing
    */
   clutter_x11_texture_pixmap_clear_shapes(
@@ -239,6 +241,8 @@
   cclient->priv =
     mb_wm_util_malloc0 (sizeof (MBWMCompMgrClutterClientPrivate));
 
+  cclient->priv->actor = clutter_group_new();
+
   return 1;
 }
 
@@ -360,99 +364,13 @@
   return (MBWMCompMgrClutterClientFlags) cclient->priv->flags;
 }
 
-
-/*
- * MBWMCompMgrClutterClientEventEffect
- */
-typedef struct MBWMCompMgrClutterClientEventEffect
-{
-  ClutterTimeline        *timeline;
-  ClutterBehaviour       *behaviour; /* can be either behaviour or effect */
-} MBWMCompMgrClutterClientEventEffect;
-
-static void
-mb_wm_comp_mgr_clutter_client_event_free (MBWMCompMgrClutterClientEventEffect * effect)
-{
-  g_object_unref (effect->timeline);
-  g_object_unref (effect->behaviour);
-
-  free (effect);
-}
-
-/**
- * Data passed to the callback for ClutterTimeline::completed,
- * comp_mgr_clutter_client_event_completed_cb().
- */
-struct completed_cb_data
-{
-  gulong                                my_id;
-  MBWMCompMgrClutterClient            * cclient;
-  MBWMCompMgrClientEvent                event;
-  MBWMCompMgrClutterClientEventEffect * effect;
-};
-
 ClutterActor *
 mb_wm_comp_mgr_clutter_client_get_actor (MBWMCompMgrClutterClient *cclient)
 { /* Don't try to g_object_ref(NULL), which is when we're unmapped. */
   return cclient->priv->actor ? g_object_ref (cclient->priv->actor) : NULL;
 }
 
-static MBWMCompMgrClutterClientEventEffect *
-mb_wm_comp_mgr_clutter_client_event_new (MBWMCompMgrClient     *client,
-					 MBWMCompMgrClientEvent event,
-					 unsigned long          duration)
-{
-  MBWMCompMgrClutterClientEventEffect * eff;
-  ClutterTimeline          * timeline;
-  ClutterBehaviour         * behaviour = NULL;
-  ClutterAlpha             * alpha;
-  MBWMCompMgrClutterClient * cclient = MB_WM_COMP_MGR_CLUTTER_CLIENT (client);
-  MBWindowManager          * wm = client->wm;
-  ClutterKnot                knots[2];
-  MBGeometry                 geom;
 
-  if (!cclient->priv->actor)
-    return NULL;
-
-  timeline = clutter_timeline_new_for_duration (duration);
-
-  if (!timeline)
-    return NULL;
-
-  alpha = clutter_alpha_new_full (timeline,
-				  CLUTTER_ALPHA_RAMP_INC, NULL, NULL);
-
-  mb_wm_client_get_coverage (client->wm_client, &geom);
-
-  switch (event)
-    {
-    case MBWMCompMgrClientEventMinimize:
-      behaviour =
-	clutter_behaviour_scale_newx (alpha, CFX_ONE, CFX_ONE, 0, 0);
-      break;
-    case MBWMCompMgrClientEventUnmap:
-      behaviour = clutter_behaviour_opacity_new (alpha, 0xff, 0);
-      break;
-    case MBWMCompMgrClientEventMap:
-      knots[0].x = -wm->xdpy_width;
-      knots[0].y = geom.y;
-      knots[1].x = geom.x;
-      knots[1].y = geom.y;
-      behaviour = clutter_behaviour_path_new (alpha, &knots[0], 2);
-      break;
-    default:
-      g_warning ("%s: unhandled switch case!", __FUNCTION__);
-    }
-
-  eff = mb_wm_util_malloc0 (sizeof (MBWMCompMgrClutterClientEventEffect));
-  eff->timeline = timeline;
-  eff->behaviour = behaviour;
-
-  clutter_behaviour_apply (behaviour, cclient->priv->actor);
-
-  return eff;
-}
-
 /**
  * Implementation of MBWMCompMgrClutter
  */
@@ -460,7 +378,6 @@
 {
   ClutterActor * arena;
   MBWMList     * desktops;
-  ClutterActor * shadow;
 
   Window         overlay_window;
 };
@@ -470,9 +387,6 @@
 {
   MBWMCompMgrClutterPrivate * priv = mgr->priv;
 
-  if (priv->shadow)
-    clutter_actor_destroy (priv->shadow);
-
   free (priv);
 }
 
@@ -508,11 +422,6 @@
                                                Bool reverse);
 
 static void
-mb_wm_comp_mgr_clutter_client_event_real (MBWMCompMgr            * mgr,
-                                          MBWindowManagerClient  * client,
-                                          MBWMCompMgrClientEvent   event);
-
-static void
 mb_wm_comp_mgr_clutter_restack_real (MBWMCompMgr *mgr);
 
 static Bool
@@ -546,8 +455,6 @@
   cm_klass->turn_off          = mb_wm_comp_mgr_clutter_turn_off_real;
   cm_klass->map_notify        = mb_wm_comp_mgr_clutter_map_notify_real;
   cm_klass->my_window         = mb_wm_comp_mgr_is_my_window_real;
-  cm_klass->client_transition = mb_wm_comp_mgr_clutter_client_transition_real;
-  cm_klass->client_event      = mb_wm_comp_mgr_clutter_client_event_real;
   cm_klass->restack           = mb_wm_comp_mgr_clutter_restack_real;
   cm_klass->select_desktop    = mb_wm_comp_mgr_clutter_select_desktop;
   cm_klass->handle_damage     = mb_wm_comp_mgr_clutter_handle_damage;
@@ -1009,7 +916,6 @@
   MBWMCompMgrClient         * client  = c->cm_client;
   MBWMCompMgrClutterClient  * cclient = MB_WM_COMP_MGR_CLUTTER_CLIENT(client);
   MBWindowManager           * wm      = client->wm;
-  ClutterActor              * actor;
   ClutterActor              * texture;
   MBGeometry                  geom;
   MBWMClientType              ctype = MB_WM_CLIENT_CLIENT_TYPE (c);
@@ -1066,15 +972,10 @@
 
   mb_wm_client_get_coverage (c, &geom);
 
-  actor = g_object_ref (clutter_group_new ());
+  g_snprintf(actor_name, 64, "window_0x%lx",
+             c->xwin_frame ? c->xwin_frame : c->window->xwindow);
+  clutter_actor_set_name(cclient->priv->actor, actor_name);
 
-  if (c->name)
-    g_snprintf(actor_name, 64, "window_%s", c->name);
-  else
-    g_snprintf(actor_name, 64, "window_0x%lx",
-            c->xwin_frame ? c->xwin_frame : c->window->xwindow);
-  clutter_actor_set_name(actor, actor_name);
-
 #if HAVE_CLUTTER_GLX
   texture = clutter_glx_texture_pixmap_new ();
 #elif HAVE_CLUTTER_EGLX
@@ -1112,268 +1013,30 @@
 
   clutter_actor_show (texture);
 
-  clutter_container_add (CLUTTER_CONTAINER (actor), texture, NULL);
+  clutter_container_add_actor (CLUTTER_CONTAINER (cclient->priv->actor), texture);
+  /* We want to lower this below any decor */
+  clutter_actor_lower_bottom(texture);
 
-  cclient->priv->actor = actor;
+  if (cclient->priv->texture)
+    clutter_actor_destroy(cclient->priv->texture);
   cclient->priv->texture = texture;
 
-  g_object_set_data (G_OBJECT (actor), "MBWMCompMgrClutterClient", cclient);
+  g_object_set_data (G_OBJECT (cclient->priv->actor),
+      "MBWMCompMgrClutterClient", cclient);
 
-  clutter_actor_set_position (actor, geom.x, geom.y);
+  clutter_actor_set_position (cclient->priv->actor, geom.x, geom.y);
   clutter_actor_set_size (texture, geom.width, geom.height);
 
   /* If the client has a "do not show" flag set explicitly,
      prevent it from being shown when it is added to the desktop */
 
   if (cclient->priv->flags & MBWMCompMgrClutterClientDontShow)
-    g_object_set (actor, "show-on-set-parent", FALSE, NULL);
+    g_object_set (cclient->priv->actor, "show-on-set-parent", FALSE, NULL);
 
   mb_wm_comp_mgr_clutter_add_actor (cmgr, cclient);
 }
 
-/**
- * Structure that gets passed to mb_wm_comp_mgr_clutter_transtion_fade_cb().
- */
-struct _fade_cb_data
-{
-  MBWMCompMgrClutterClient *cclient1;
-  MBWMCompMgrClutterClient *cclient2;
-  ClutterTimeline  * timeline;
-  ClutterBehaviour * beh;
-};
-
-static void
-mb_wm_comp_mgr_clutter_transtion_fade_cb (ClutterTimeline * t, void * data)
-{
-  struct _fade_cb_data * d  = data;
-  ClutterActor   * a1 = d->cclient1->priv->actor;
-
-  clutter_actor_set_opacity (a1, 0xff);
-
-  d->cclient1->priv->flags &= ~MBWMCompMgrClutterClientEffectRunning;
-  d->cclient2->priv->flags &= ~MBWMCompMgrClutterClientEffectRunning;
-
-  mb_wm_object_unref (MB_WM_OBJECT (d->cclient1));
-  mb_wm_object_unref (MB_WM_OBJECT (d->cclient2));
-
-  g_object_unref (d->timeline);
-  g_object_unref (d->beh);
-}
-
-static void
-_fade_apply_behaviour_to_client (MBWindowManagerClient * wc,
-				 ClutterBehaviour      * b)
-{
-  MBWMList * l;
-  ClutterActor * a = MB_WM_COMP_MGR_CLUTTER_CLIENT (wc->cm_client)->priv->actor;
-
-  clutter_actor_set_opacity (a, 0);
-  clutter_behaviour_apply (b, a);
-
-  l = mb_wm_client_get_transients (wc);
-  while (l)
-    {
-      MBWindowManagerClient * c = l->data;
-
-      _fade_apply_behaviour_to_client (c, b);
-      l = l->next;
-    }
-}
-
-static void
-mb_wm_comp_mgr_clutter_client_transition_fade (MBWMCompMgrClutterClient *cclient1,
-                                               MBWMCompMgrClutterClient *cclient2,
-                                               unsigned long duration)
-{
-  ClutterTimeline             * timeline;
-  ClutterAlpha                * alpha;
-  static struct _fade_cb_data   cb_data;
-  ClutterBehaviour            * b;
-
-  /*
-   * Fade is simple -- we only need to animate the second actor and its
-   * children, as the stacking order automatically takes care of the
-   * actor appearing to fade out from the first one
-   */
-  timeline = clutter_timeline_new_for_duration (duration);
-
-  alpha = clutter_alpha_new_full (timeline,
-				  CLUTTER_ALPHA_RAMP_DEC, NULL, NULL);
-
-  b = clutter_behaviour_opacity_new (alpha, 0xff, 0);
-
-  cb_data.cclient1 = mb_wm_object_ref (MB_WM_OBJECT (cclient1));
-  cb_data.cclient2 = mb_wm_object_ref (MB_WM_OBJECT (cclient2));
-  cb_data.timeline = timeline;
-  cb_data.beh = b;
-
-  _fade_apply_behaviour_to_client (MB_WM_COMP_MGR_CLIENT (cclient2)->wm_client, b);
-
-  /*
-   * Must restore the opacity on the 'from' actor
-   */
-  g_signal_connect (timeline, "completed",
-		    G_CALLBACK (mb_wm_comp_mgr_clutter_transtion_fade_cb),
-		    &cb_data);
-
-  cclient1->priv->flags |= MBWMCompMgrClutterClientEffectRunning;
-  cclient2->priv->flags |= MBWMCompMgrClutterClientEffectRunning;
-
-  clutter_timeline_start (timeline);
-}
-
-static void
-mb_wm_comp_mgr_clutter_client_transition_real (MBWMCompMgr * mgr,
-                                               MBWindowManagerClient *c1,
-                                               MBWindowManagerClient *c2,
-                                               Bool reverse)
-{
-  MBWMCompMgrClutterClient * cclient1 =
-    MB_WM_COMP_MGR_CLUTTER_CLIENT (c1->cm_client);
-  MBWMCompMgrClutterClient * cclient2 =
-    MB_WM_COMP_MGR_CLUTTER_CLIENT (c2->cm_client);
-
-  mb_wm_comp_mgr_clutter_client_transition_fade (cclient1,
-					         cclient2,
-                                                 100);
-}
-
 /*
- * Callback for ClutterTimeline::completed signal.
- *
- * One-off; get connected when the timeline is started, and disconnected
- * again when it finishes.
- */
-static void
-mb_wm_comp_mgr_clutter_client_event_completed_cb (ClutterTimeline * t, void * data)
-{
-  struct completed_cb_data * d = data;
-
-  d->cclient->priv->flags &= ~MBWMCompMgrClutterClientEffectRunning;
-
-  g_signal_handler_disconnect (t, d->my_id);
-
-  switch (d->event)
-    {
-    case MBWMCompMgrClientEventUnmap:
-    case MBWMCompMgrClientEventMinimize:
-      clutter_actor_hide (d->cclient->priv->actor);
-      break;
-
-    default:
-      break;
-    }
-
-  /*
-   * Release the extra reference on the CM client that was added for the sake
-   * of the effect
-   */
-  mb_wm_object_unref (MB_WM_OBJECT (d->cclient));
-
-  mb_wm_comp_mgr_clutter_client_event_free (d->effect);
-
-  free (d);
-}
-
-static void
-mb_wm_comp_mgr_clutter_client_event_real (MBWMCompMgr            * mgr,
-					  MBWindowManagerClient  * client,
-					  MBWMCompMgrClientEvent   event)
-{
-  MBWMCompMgrClutterClientEventEffect * eff;
-  MBWMCompMgrClutterClient            * cclient =
-    MB_WM_COMP_MGR_CLUTTER_CLIENT (client->cm_client);
-
-  if (MB_WM_CLIENT_CLIENT_TYPE (client) != MBWMClientTypeApp)
-    return;
-
-  eff = mb_wm_comp_mgr_clutter_client_event_new (client->cm_client,
-						 event, 600);
-
-  if (eff)
-    {
-      ClutterActor *a;
-      Bool dont_run = False;
-
-      a = cclient->priv->actor;
-
-      if (CLUTTER_IS_BEHAVIOUR_PATH (eff->behaviour))
-	{
-	  /*
-	   * At this stage, if the actor is not yet visible, move it to
-	   * the starting point of the path (this is mostly because of
-	   * 'map' effects,  where the clutter_actor_show () is delayed
-	   * until this point, so that the actor can be positioned in the
-	   * correct location without visible artefacts).
-	   *
-	   * FIXME -- this is very clumsy; we need clutter API to query
-	   * the first knot of the path to avoid messing about with copies
-	   * of the list.
-	   */
-
-	  GSList * knots =
-	    clutter_behaviour_path_get_knots (
-				     CLUTTER_BEHAVIOUR_PATH (eff->behaviour));
-
-	  if (knots)
-	    {
-	      ClutterKnot * k = knots->data;
-
-	      clutter_actor_set_position (a, k->x, k->y);
-
-	      g_slist_free (knots);
-	    }
-	}
-
-      if (event == MBWMCompMgrClientEventUnmap)
-	{
-	  cclient->priv->flags |= MBWMCompMgrClutterClientDontUpdate;
-
-	  if (cclient->priv->flags & MBWMCompMgrClutterClientDone)
-	    dont_run = True;
-	  else
-	    cclient->priv->flags |= MBWMCompMgrClutterClientDone;
-	}
-      else if (event == MBWMCompMgrClientEventMinimize)
-	{
-	  /*
-	   * This is tied specifically to the unmap scale effect (the
-	   * themable version of effects allowed to handle this is a nice
-	   * generic fashion. :-(
-	   */
-	  clutter_actor_move_anchor_point_from_gravity (a,
-						CLUTTER_GRAVITY_SOUTH_EAST);
-	}
-
-      /*
-       * Make sure the actor is showing (for example with 'map' effects,
-       * the show() is delayed until the effect had chance to
-       * set up the actor postion).
-       */
-      if (!dont_run)
-	{
-	  struct completed_cb_data * d;
-
-	  d = mb_wm_util_malloc0 (sizeof (struct completed_cb_data));
-
-	  d->cclient = mb_wm_object_ref (MB_WM_OBJECT (cclient));
-	  d->event   = event;
-	  d->effect  = eff;
-
-	  d->my_id = g_signal_connect (eff->timeline, "completed",
-		  G_CALLBACK (mb_wm_comp_mgr_clutter_client_event_completed_cb),
-		  d);
-
-	  cclient->priv->flags |= MBWMCompMgrClutterClientEffectRunning;
-	  clutter_actor_show (a);
-	  clutter_timeline_start (eff->timeline);
-	}
-      else
-	mb_wm_comp_mgr_clutter_client_event_free (eff);
-    }
-}
-
-/*
  * Our windows which we need the WM to ingore are the overlay and the stage
  * window.
  */
@@ -1425,15 +1088,6 @@
   return MB_WM_COMP_MGR (mgr);
 }
 
-/* ------------------------------- */
-/* Shadow Generation */
-
-typedef struct MBGaussianMap
-{
-  int	   size;
-  double * data;
-} MBGaussianMap;
-
 /*
  * TidyTextureFrame copied from tidy
  */

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-decor.h
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-decor.h	2009-01-28 16:01:00 UTC (rev 17311)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-decor.h	2009-01-28 17:01:34 UTC (rev 17312)
@@ -212,6 +212,9 @@
   */
 };
 
+int
+mb_wm_decor_button_class_type (void);
+
 void
 mb_wm_decor_button_show (MBWMDecorButton *button);
 

Modified: projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme-png.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme-png.c	2009-01-28 16:01:00 UTC (rev 17311)
+++ projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme-png.c	2009-01-28 17:01:34 UTC (rev 17312)
@@ -1070,15 +1070,15 @@
 	       * then we assume padding happens in the center.
 	       * Note: we look at pad_length because pad_offset could be 0
 	       */
-	      button_x = b->x - d->x;
+	      button_x = b->x;
 	      if (button_x > (d->pad_length ? d->pad_offset : d->width/2) )
-		button_x = decor->geom.width - (d->x + d->width - b->x);
+		button_x = decor->geom.width + b->x - d->width;
 
 	      *x = button_x;
 	    }
 
 	  if (y)
-	    *y = b->y - d->y;
+	    *y = b->y;
 
 	  return;
 	}

Modified: projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme-xml.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme-xml.c	2009-01-28 16:01:00 UTC (rev 17311)
+++ projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme-xml.c	2009-01-28 17:01:34 UTC (rev 17312)
@@ -29,12 +29,12 @@
 {
   MBWMXmlButton * b = mb_wm_util_malloc0 (sizeof (MBWMXmlButton));
 
-  b->x = -1;
-  b->y = -1;
-  b->active_x = -1;
-  b->active_y = -1;
-  b->inactive_x = -1;
-  b->inactive_y = -1;
+  b->x = 0;
+  b->y = 0;
+  b->active_x = 0;
+  b->active_y = 0;
+  b->inactive_x = 0;
+  b->inactive_y = 0;
 
   return b;
 }

Modified: projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme.c	2009-01-28 16:01:00 UTC (rev 17311)
+++ projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme.c	2009-01-28 17:01:34 UTC (rev 17312)
@@ -97,6 +97,9 @@
   if (theme->path)
     free (theme->path);
 
+  if (theme->image_filename)
+    free (theme->image_filename);
+
   MBWMList *l = theme->xml_clients;
 
   while (l)
@@ -118,6 +121,7 @@
   MBWMObjectProp    prop;
   MBWMList         *xml_clients = NULL;
   char             *path = NULL;
+  char             *image_filename = NULL;
   MBWMColor        *clr_lowlight = NULL;
   MBWMColor        *clr_shadow = NULL;
 
@@ -132,6 +136,9 @@
 	case MBWMObjectPropThemePath:
 	  path = va_arg(vap, char *);
 	  break;
+	case MBWMObjectPropThemeImg:
+	  image_filename = va_arg(vap, char *);
+          break;
 	case MBWMObjectPropThemeXmlClients:
 	  xml_clients = va_arg(vap, MBWMList *);
 	  break;
@@ -164,6 +171,11 @@
   if (path)
     theme->path = strdup (path);
 
+  if (image_filename)
+    theme->image_filename = strdup(image_filename);
+  else
+    theme->image_filename = 0;
+
   if (clr_shadow && clr_shadow->set)
     {
       theme->color_shadow.r = clr_shadow->r;
@@ -594,6 +606,7 @@
 			MB_WM_TYPE_THEME,
 	                MBWMObjectPropWm,                  wm,
 			MBWMObjectPropThemeXmlClients,     xml_clients,
+			MBWMObjectPropThemeImg,            img,
 			MBWMObjectPropThemeColorLowlight, &clr_lowlight,
 			MBWMObjectPropThemeColorShadow,   &clr_shadow,
 			MBWMObjectPropThemeShadowType,     shadow_type,
@@ -1706,17 +1719,17 @@
    * Returning all 0 if in the full screen mode.
    */
   if (mb_wm_client_window_is_state_set (
-	client->window, 
-	MBWMClientWindowEWMHStateFullscreen)) 
-  { 
-    if (north) 
-      *north = 0; 
-    if (south) 
-      *south = 0; 
-    if (west) 
-      *west = 0; 
-    if (east) 
-      *east = 0; 
+	client->window,
+	MBWMClientWindowEWMHStateFullscreen))
+  {
+    if (north)
+      *north = 0;
+    if (south)
+      *south = 0;
+    if (west)
+      *west = 0;
+    if (east)
+      *east = 0;
     return;
   }
 
@@ -1957,7 +1970,7 @@
 			  &extents);
 	  centering_padding = (rec.width - extents.width) / 2;
       }
-      
+
       XftDrawSetClipRectangles (dd->xftdraw, 0, 0, &rec, 1);
 
       XftDrawStringUtf8(dd->xftdraw,

Modified: projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme.h
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme.h	2009-01-28 16:01:00 UTC (rev 17311)
+++ projects/haf/trunk/libmatchbox2/matchbox/theme-engines/mb-wm-theme.h	2009-01-28 17:01:34 UTC (rev 17312)
@@ -92,7 +92,7 @@
 
   void  (*set_left_padding)     (MBWMTheme             *theme,
 			         MBWMDecor             *decor,
-                     int                    new_padding);
+                                 int                    new_padding);
 };
 
 /**
@@ -112,6 +112,7 @@
   MBWMColor              color_lowlight;
   MBWMColor              color_shadow;
   MBWMCompMgrShadowType  shadow_type;
+  char                  *image_filename;
 };
 
 int


More information about the maemo-commits mailing list