r7374 - in dumbhippo/trunk/client: common/stacker linux linux/src windows/HippoUI



Author: otaylor
Date: 2008-03-24 14:09:45 -0500 (Mon, 24 Mar 2008)
New Revision: 7374

Added:
   dumbhippo/trunk/client/common/stacker/stacker.css
Modified:
   dumbhippo/trunk/client/common/stacker/hippo-block.c
   dumbhippo/trunk/client/common/stacker/hippo-canvas-block-amazon-activity.c
   dumbhippo/trunk/client/common/stacker/hippo-canvas-block-generic.c
   dumbhippo/trunk/client/common/stacker/hippo-canvas-block-group-member.c
   dumbhippo/trunk/client/common/stacker/hippo-canvas-block-netflix-movie.c
   dumbhippo/trunk/client/common/stacker/hippo-canvas-block-post.c
   dumbhippo/trunk/client/common/stacker/hippo-canvas-block.c
   dumbhippo/trunk/client/common/stacker/hippo-canvas-chat-preview.c
   dumbhippo/trunk/client/common/stacker/hippo-canvas-filter-area.c
   dumbhippo/trunk/client/common/stacker/hippo-canvas-timestamp.c
   dumbhippo/trunk/client/common/stacker/hippo-canvas-url-image.c
   dumbhippo/trunk/client/common/stacker/hippo-canvas-url-link.c
   dumbhippo/trunk/client/common/stacker/hippo-canvas-url-link.h
   dumbhippo/trunk/client/common/stacker/hippo-quip-window.c
   dumbhippo/trunk/client/common/stacker/hippo-window.c
   dumbhippo/trunk/client/common/stacker/hippo-window.h
   dumbhippo/trunk/client/linux/Makefile-libstacker.am
   dumbhippo/trunk/client/linux/Makefile-mugshot.am
   dumbhippo/trunk/client/linux/Makefile.am
   dumbhippo/trunk/client/linux/src/hippo-stacker-platform-impl.c
   dumbhippo/trunk/client/linux/src/hippo-window-wrapper.c
   dumbhippo/trunk/client/linux/src/hippo-window-wrapper.h
   dumbhippo/trunk/client/linux/src/main.c
   dumbhippo/trunk/client/linux/src/main.h
   dumbhippo/trunk/client/windows/HippoUI/HippoCanvas.cpp
Log:
* Add a stylesheet for the stacker
* Use CSS-styling additions to HippoCanvas to 
  set block properties that are more conveniently 
  set that way or need to be set that way (in particular
  inherited foreground colors can only be set through
  CSS styles)
* Add a HIPPO_UNINSTALLED=1 env-var setting to allow
  looking for uninstalled resources like icons and
  stylesheets


Modified: dumbhippo/trunk/client/common/stacker/hippo-block.c
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-block.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-block.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -1020,7 +1020,7 @@
         return NULL;
     }
 
-    guid = g_strndup(slash + 1, type - 1 - slash);
+    guid = g_strndup(slash + 1, type - 1 - (slash + 1));
     
     block_type = HIPPO_BLOCK_TYPE_UNKNOWN;
     

Modified: dumbhippo/trunk/client/common/stacker/hippo-canvas-block-amazon-activity.c
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-canvas-block-amazon-activity.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-canvas-block-amazon-activity.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -330,12 +330,12 @@
 
     block_amazon_activity->list_link = g_object_new(HIPPO_TYPE_CANVAS_URL_LINK, 
                                                     "actions", hippo_canvas_block_get_actions(block),
+                                                    "classes", "amazon-list-link",
                                                     "size-mode", HIPPO_CANVAS_SIZE_WRAP_WORD, 
                                                     "xalign", HIPPO_ALIGNMENT_START,
                                                     "yalign", HIPPO_ALIGNMENT_CENTER,
                                                     "font", "Bold 12px",
                                                     "tooltip", "Check out this list",
-                                                    "underline", FALSE,  
                                                     NULL);
     hippo_canvas_box_append(list_item_details_box, block_amazon_activity->list_link, 0);
     hippo_canvas_item_set_visible(block_amazon_activity->list_link,

Modified: dumbhippo/trunk/client/common/stacker/hippo-canvas-block-generic.c
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-canvas-block-generic.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-canvas-block-generic.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -40,8 +40,6 @@
 
 static void hippo_canvas_block_generic_expand   (HippoCanvasBlock *canvas_block);
 static void hippo_canvas_block_generic_unexpand (HippoCanvasBlock *canvas_block);
-static void hippo_canvas_block_generic_hush     (HippoCanvasBlock *canvas_block);
-static void hippo_canvas_block_generic_unhush   (HippoCanvasBlock *canvas_block);
 
 
 
@@ -118,8 +116,6 @@
     canvas_block_class->stack_reason_changed = hippo_canvas_block_generic_stack_reason_changed;
     canvas_block_class->expand = hippo_canvas_block_generic_expand;
     canvas_block_class->unexpand = hippo_canvas_block_generic_unexpand;
-    canvas_block_class->hush = hippo_canvas_block_generic_hush;
-    canvas_block_class->unhush = hippo_canvas_block_generic_unhush;
 }
 
 static void
@@ -569,26 +565,3 @@
         on_block_chat_id_changed(canvas_block->block, NULL, canvas_block);
     }
 }
-
-static void
-hippo_canvas_block_generic_hush(HippoCanvasBlock *canvas_block)
-{
-    HippoCanvasBlockGeneric *block_generic = HIPPO_CANVAS_BLOCK_GENERIC(canvas_block);
-    
-    HIPPO_CANVAS_BLOCK_CLASS(hippo_canvas_block_generic_parent_class)->hush(canvas_block);
-
-    hippo_canvas_chat_preview_set_hushed(HIPPO_CANVAS_CHAT_PREVIEW(block_generic->chat_preview),
-                                         TRUE);
-}
-
-static void
-hippo_canvas_block_generic_unhush(HippoCanvasBlock *canvas_block)
-{
-    HippoCanvasBlockGeneric *block_generic = HIPPO_CANVAS_BLOCK_GENERIC(canvas_block);
-    
-    HIPPO_CANVAS_BLOCK_CLASS(hippo_canvas_block_generic_parent_class)->unhush(canvas_block);
-
-    hippo_canvas_chat_preview_set_hushed(HIPPO_CANVAS_CHAT_PREVIEW(block_generic->chat_preview),
-                                         FALSE);
-}
-

Modified: dumbhippo/trunk/client/common/stacker/hippo-canvas-block-group-member.c
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-canvas-block-group-member.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-canvas-block-group-member.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -34,8 +34,6 @@
 
 static void hippo_canvas_block_group_member_expand   (HippoCanvasBlock *canvas_block);
 static void hippo_canvas_block_group_member_unexpand (HippoCanvasBlock *canvas_block);
-static void hippo_canvas_block_group_member_hush     (HippoCanvasBlock *canvas_block);
-static void hippo_canvas_block_group_member_unhush   (HippoCanvasBlock *canvas_block);
 
 
 struct _HippoCanvasBlockGroupMember {
@@ -99,8 +97,6 @@
     canvas_block_class->title_activated = hippo_canvas_block_group_member_title_activated;
     canvas_block_class->expand = hippo_canvas_block_group_member_expand;
     canvas_block_class->unexpand = hippo_canvas_block_group_member_unexpand;
-    canvas_block_class->hush = hippo_canvas_block_group_member_hush;
-    canvas_block_class->unhush = hippo_canvas_block_group_member_unhush;
 }
 
 static void
@@ -203,7 +199,6 @@
     
     canvas_group_member->invite_link = g_object_new(HIPPO_TYPE_CANVAS_LINK,
                                                     "text", "Invite to group",
-                                                    "color-cascade", HIPPO_CASCADE_MODE_NONE,
                                                     NULL);
     hippo_canvas_box_append(invite_parent, canvas_group_member->invite_link, 0);
 
@@ -394,27 +389,3 @@
 
     HIPPO_CANVAS_BLOCK_CLASS(hippo_canvas_block_group_member_parent_class)->unexpand(canvas_block);
 }
-
-static void
-hippo_canvas_block_group_member_hush(HippoCanvasBlock *canvas_block)
-{
-    HippoCanvasBlockGroupMember *block_group = HIPPO_CANVAS_BLOCK_GROUP_MEMBER(canvas_block);
-    
-    HIPPO_CANVAS_BLOCK_CLASS(hippo_canvas_block_group_member_parent_class)->hush(canvas_block);
-
-    g_object_set(G_OBJECT(block_group->invite_link),
-                 "color-cascade", HIPPO_CASCADE_MODE_INHERIT,
-                 NULL);
-}
-
-static void
-hippo_canvas_block_group_member_unhush(HippoCanvasBlock *canvas_block)
-{
-    HippoCanvasBlockGroupMember *block_group = HIPPO_CANVAS_BLOCK_GROUP_MEMBER(canvas_block);
-    
-    HIPPO_CANVAS_BLOCK_CLASS(hippo_canvas_block_group_member_parent_class)->unhush(canvas_block);
-
-    g_object_set(G_OBJECT(block_group->invite_link),
-                 "color-cascade", HIPPO_CASCADE_MODE_NONE,
-                 NULL);
-}

Modified: dumbhippo/trunk/client/common/stacker/hippo-canvas-block-netflix-movie.c
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-canvas-block-netflix-movie.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-canvas-block-netflix-movie.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -441,11 +441,11 @@
         
         title = g_object_new(HIPPO_TYPE_CANVAS_URL_LINK, 
                              "actions", hippo_canvas_block_get_actions(canvas_block),
+                             "classes", "netflix-movie-link",
                              "xalign", HIPPO_ALIGNMENT_START,
                              "size-mode", HIPPO_CANVAS_SIZE_ELLIPSIZE_END,
                              "text", movie_title,
                              "url", movie_link,
-                             "underline", FALSE,
                              "padding-left", 4,
                              NULL);
         

Modified: dumbhippo/trunk/client/common/stacker/hippo-canvas-block-post.c
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-canvas-block-post.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-canvas-block-post.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -45,8 +45,6 @@
 
 static void hippo_canvas_block_post_expand   (HippoCanvasBlock *canvas_block);
 static void hippo_canvas_block_post_unexpand (HippoCanvasBlock *canvas_block);
-static void hippo_canvas_block_post_hush     (HippoCanvasBlock *canvas_block);
-static void hippo_canvas_block_post_unhush   (HippoCanvasBlock *canvas_block);
 
 /* Our own methods */
 static void hippo_canvas_block_post_set_post (HippoCanvasBlockPost *canvas_block_post,
@@ -131,8 +129,6 @@
     canvas_block_class->stack_reason_changed = hippo_canvas_block_post_stack_reason_changed;
     canvas_block_class->expand = hippo_canvas_block_post_expand;
     canvas_block_class->unexpand = hippo_canvas_block_post_unexpand;
-    canvas_block_class->hush = hippo_canvas_block_post_hush;
-    canvas_block_class->unhush = hippo_canvas_block_post_unhush;
 }
 
 static void
@@ -555,43 +551,8 @@
     hippo_canvas_block_post_update_visibility(block_post);
 }
 
-
-static void
-hippo_canvas_block_post_hush(HippoCanvasBlock *canvas_block)
-{
-    HippoCanvasBlockPost *block_post = HIPPO_CANVAS_BLOCK_POST(canvas_block);
-    
-    HIPPO_CANVAS_BLOCK_CLASS(hippo_canvas_block_post_parent_class)->hush(canvas_block);
-
 #if 0
-    g_object_set(G_OBJECT(block_post->faves_link),
-                 "color-cascade", HIPPO_CASCADE_MODE_INHERIT,
-                 NULL);
-#endif
-    
-    hippo_canvas_chat_preview_set_hushed(HIPPO_CANVAS_CHAT_PREVIEW(block_post->chat_preview),
-                                         TRUE);
-}
-
 static void
-hippo_canvas_block_post_unhush(HippoCanvasBlock *canvas_block)
-{
-    HippoCanvasBlockPost *block_post = HIPPO_CANVAS_BLOCK_POST(canvas_block);
-    
-    HIPPO_CANVAS_BLOCK_CLASS(hippo_canvas_block_post_parent_class)->unhush(canvas_block);
-
-#if 0
-    g_object_set(G_OBJECT(block_post->faves_link),
-                 "color-cascade", HIPPO_CASCADE_MODE_NONE,
-                 NULL);
-#endif
-    
-    hippo_canvas_chat_preview_set_hushed(HIPPO_CANVAS_CHAT_PREVIEW(block_post->chat_preview),
-                                         FALSE);
-}
-
-#if 0
-static void
 on_faves_activated(HippoCanvasItem      *button_or_link,
                    HippoCanvasBlockPost *canvas_block_post)
 {

Modified: dumbhippo/trunk/client/common/stacker/hippo-canvas-block.c
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-canvas-block.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-canvas-block.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -192,10 +192,10 @@
         canvas_block->age_set = set_timestamp_item(canvas_block, canvas_block->age_parent, canvas_block->age_item, 
                                                    (GTime) (hippo_block_get_timestamp(canvas_block->block) / 1000));
         
-        hippo_canvas_item_set_visible(canvas_block->age_separator_item,
+        hippo_canvas_item_set_visible(canvas_block->age_item,
                                       canvas_block->age_set);
         hippo_canvas_item_set_visible(canvas_block->age_separator_item,
-                                      canvas_block->expanded && canvas_block->age_set);
+                                      canvas_block->age_set);
     }
 }
 
@@ -411,7 +411,6 @@
     g_object_set(block->main_box,
                  "orientation", HIPPO_ORIENTATION_VERTICAL,
                  "padding", 4,
-                 "font", "11px",
                  NULL);
      
     hippo_canvas_box_append(HIPPO_CANVAS_BOX(block),
@@ -500,7 +499,6 @@
         
         item = g_object_new(HIPPO_TYPE_CANVAS_LINK,
                             "text", "Hush",
-                            "color-cascade", HIPPO_CASCADE_MODE_NONE,
                             "tooltip", "Stop showing me this item",
                             NULL);
         block->toggle_hush_link = item;
@@ -557,8 +555,8 @@
     
     if (!block->skip_heading) {
         box = g_object_new(HIPPO_TYPE_CANVAS_BOX,
+                           "classes", "block-heading",
                            "orientation", HIPPO_ORIENTATION_HORIZONTAL,
-                           "font", "Bold 12px",
                            NULL);
         block->heading_box = box;
         hippo_canvas_box_append(block->main_box, HIPPO_CANVAS_ITEM(box), 0);
@@ -951,7 +949,7 @@
 hippo_canvas_block_hush_impl(HippoCanvasBlock *canvas_block)
 {
     g_object_set(G_OBJECT(canvas_block),
-                 "color", HIPPO_CANVAS_BLOCK_GRAY_TEXT_COLOR,
+                 "classes", "block-hushed",
                  NULL);
     g_object_set(G_OBJECT(canvas_block->toggle_hush_link),
                  "text", "Unhush",
@@ -963,7 +961,7 @@
 hippo_canvas_block_unhush_impl(HippoCanvasBlock *canvas_block)
 {
     g_object_set(G_OBJECT(canvas_block),
-                 "color-set", FALSE,
+                 "classes", "",
                  NULL);
     g_object_set(G_OBJECT(canvas_block->toggle_hush_link),
                  "text", "Hush",

Modified: dumbhippo/trunk/client/common/stacker/hippo-canvas-chat-preview.c
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-canvas-chat-preview.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-canvas-chat-preview.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -252,7 +252,6 @@
     hippo_canvas_box_append(HIPPO_CANVAS_BOX(chat_preview), HIPPO_CANVAS_ITEM(box), 0);
     
     item = g_object_new(HIPPO_TYPE_CANVAS_LINK,
-                        "color-cascade", HIPPO_CASCADE_MODE_NONE,
                         "tooltip", "View all quips and comments",
                         NULL);
     chat_preview->chat_link = item;
@@ -475,28 +474,6 @@
     g_object_notify(G_OBJECT(chat_preview), "block");
 }
 
-void
-hippo_canvas_chat_preview_set_hushed(HippoCanvasChatPreview *chat_preview,
-                                     gboolean                value)
-{
-    value = value != FALSE;
-    
-    if (chat_preview->hushed == value)
-        return;
-
-    chat_preview->hushed = value;
-
-    if (value) {
-        g_object_set(G_OBJECT(chat_preview->chat_link),
-                     "color-cascade", HIPPO_CASCADE_MODE_INHERIT,
-                     NULL);
-    } else {
-        g_object_set(G_OBJECT(chat_preview->chat_link),
-                     "color-cascade", HIPPO_CASCADE_MODE_NONE,
-                     NULL);
-    }
-}
-
 static void
 hippo_canvas_chat_preview_update_visibility(HippoCanvasChatPreview *chat_preview)
 {

Modified: dumbhippo/trunk/client/common/stacker/hippo-canvas-filter-area.c
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-canvas-filter-area.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-canvas-filter-area.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -191,15 +191,13 @@
     HippoCanvasFilterArea *area = HIPPO_CANVAS_FILTER_AREA(object);
     HippoCanvasItem *item;    
     HippoCanvasBox *box;
-    
+
     box = g_object_new(HIPPO_TYPE_CANVAS_IMAGE,
                        "orientation", HIPPO_ORIENTATION_HORIZONTAL,
                        NULL);
     hippo_canvas_box_append(HIPPO_CANVAS_BOX(area),
                             HIPPO_CANVAS_ITEM(box), 0);    
 
-    box->background_color_rgba = 0xE4D0EDFF;
-    
     item = g_object_new(HIPPO_TYPE_CANVAS_TEXT,
                         "text", "Hide feeds: ",
 #ifdef WITH_MAEMO

Modified: dumbhippo/trunk/client/common/stacker/hippo-canvas-timestamp.c
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-canvas-timestamp.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-canvas-timestamp.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -55,10 +55,7 @@
 hippo_canvas_timestamp_class_init(HippoCanvasTimestampClass *klass)
 {
     GObjectClass *object_class = G_OBJECT_CLASS(klass);
-    HippoCanvasBoxClass *box_class = HIPPO_CANVAS_BOX_CLASS(klass);
 
-    box_class->default_color = 0x0033ffff;
-    
     object_class->set_property = hippo_canvas_timestamp_set_property;
     object_class->get_property = hippo_canvas_timestamp_get_property;
 

Modified: dumbhippo/trunk/client/common/stacker/hippo-canvas-url-image.c
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-canvas-url-image.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-canvas-url-image.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -64,10 +64,7 @@
 hippo_canvas_url_image_class_init(HippoCanvasUrlImageClass *klass)
 {
     GObjectClass *object_class = G_OBJECT_CLASS(klass);
-    HippoCanvasBoxClass *box_class = HIPPO_CANVAS_BOX_CLASS(klass);
 
-    box_class->default_color = 0x0033ffff;
-    
     object_class->set_property = hippo_canvas_url_image_set_property;
     object_class->get_property = hippo_canvas_url_image_get_property;
 

Modified: dumbhippo/trunk/client/common/stacker/hippo-canvas-url-link.c
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-canvas-url-link.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-canvas-url-link.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -38,17 +38,15 @@
 enum {
     PROP_0,
     PROP_ACTIONS,
-    PROP_URL,
-    PROP_UNDERLINE
+    PROP_URL
 };
 
-G_DEFINE_TYPE_WITH_CODE(HippoCanvasUrlLink, hippo_canvas_url_link, HIPPO_TYPE_CANVAS_TEXT,
+G_DEFINE_TYPE_WITH_CODE(HippoCanvasUrlLink, hippo_canvas_url_link, HIPPO_TYPE_CANVAS_LINK,
                         G_IMPLEMENT_INTERFACE(HIPPO_TYPE_CANVAS_ITEM, hippo_canvas_url_link_iface_init));
 
 static void
 hippo_canvas_url_link_init(HippoCanvasUrlLink *link)
 {
-    link->underline = TRUE;
 }
 
 static HippoCanvasItemIface *item_parent_class;
@@ -66,10 +64,7 @@
 hippo_canvas_url_link_class_init(HippoCanvasUrlLinkClass *klass)
 {
     GObjectClass *object_class = G_OBJECT_CLASS(klass);
-    HippoCanvasBoxClass *box_class = HIPPO_CANVAS_BOX_CLASS(klass);
 
-    box_class->default_color = 0x0033ffff;
-    
     object_class->set_property = hippo_canvas_url_link_set_property;
     object_class->get_property = hippo_canvas_url_link_get_property;
 
@@ -90,15 +85,6 @@
                                                         _("UI actions object"),
                                                         HIPPO_TYPE_ACTIONS,
                                                         G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); 
-
-    g_object_class_install_property(object_class,
-                                    PROP_UNDERLINE,
-                                    g_param_spec_boolean("underline",
-                                                         _("Underline"),
-                                                         _("Whether the link should be underlined"),
-                                                         TRUE,
-                                                         G_PARAM_READABLE | G_PARAM_WRITABLE));
-
 }
 
 static void
@@ -120,32 +106,6 @@
     return HIPPO_CANVAS_ITEM(link);
 }
 
-static void 
-update_url_link(HippoCanvasUrlLink *link)
-{
-    if (link->url) {
-        PangoAttrList *attrs;
-        PangoAttribute *a;
-        
-        HIPPO_CANVAS_BOX(link)->clickable = TRUE;
-        
-        attrs = pango_attr_list_new();
-        
-        if (link->underline) {
-            a = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
-            a->start_index = 0;
-            a->end_index = G_MAXUINT;
-            pango_attr_list_insert(attrs, a);
-        }
- 
-        g_object_set(link, "attributes", attrs, NULL);
-        pango_attr_list_unref(attrs);
-    } else {
-        g_object_set(link, "attributes", NULL, NULL);
-        HIPPO_CANVAS_BOX(link)->clickable = FALSE;
-    }
-}
-
 static void
 hippo_canvas_url_link_set_url(HippoCanvasUrlLink *link,
                               const char         *url)
@@ -157,8 +117,6 @@
         g_free(link->url);
     
     link->url = g_strdup(url);
-
-    update_url_link(link);
 }
 
 static void
@@ -182,20 +140,6 @@
 }
 
 static void
-hippo_canvas_url_link_set_underline(HippoCanvasUrlLink *link,
-                                    gboolean           value)
-{
-    value = value != FALSE;
-    
-    if (link->underline == value)
-        return;
-
-    link->underline = value;
-    
-    update_url_link(link);
-}
-
-static void
 hippo_canvas_url_link_set_property(GObject         *object,
                                    guint            prop_id,
                                    const GValue    *value,
@@ -215,9 +159,6 @@
             hippo_canvas_url_link_set_actions(link, new_actions);
         }
         break;
-    case PROP_UNDERLINE:
-        hippo_canvas_url_link_set_underline(link, g_value_get_boolean(value));
-        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
         break;
@@ -241,9 +182,6 @@
     case PROP_ACTIONS:
         g_value_set_object(value, (GObject*) link->actions);
         break;
-    case PROP_UNDERLINE:
-        g_value_set_boolean(value, link->underline);
-        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
         break;

Modified: dumbhippo/trunk/client/common/stacker/hippo-canvas-url-link.h
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-canvas-url-link.h	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-canvas-url-link.h	2008-03-24 19:09:45 UTC (rev 7374)
@@ -4,7 +4,7 @@
 
 /* An href-link canvas item. */
 
-#include <hippo/hippo-canvas-text.h>
+#include <hippo/hippo-canvas-link.h>
 #include "hippo-actions.h"
 #include <cairo.h>
 
@@ -21,10 +21,9 @@
 #define HIPPO_CANVAS_URL_LINK_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), HIPPO_TYPE_CANVAS_URL_LINK, HippoCanvasUrlLinkClass))
 
 struct _HippoCanvasUrlLink {
-    HippoCanvasText text;
+    HippoCanvasLink link;
     HippoActions *actions;
     char *url;
-    unsigned int underline : 1;
 };
 
 struct _HippoCanvasUrlLinkClass {

Modified: dumbhippo/trunk/client/common/stacker/hippo-quip-window.c
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-quip-window.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-quip-window.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -21,6 +21,7 @@
     GObject parent;
     DDMDataModel *model;
     HippoStackerPlatform *platform;
+    HippoCanvasTheme *theme;
 
     HippoChatKind chat_kind;
     char *chat_id;
@@ -385,38 +386,23 @@
 static void
 hippo_quip_window_update_sentiment(HippoQuipWindow *quip_window)
 {
-    if (quip_window->sentiment == HIPPO_SENTIMENT_INDIFFERENT)
-        g_object_set(quip_window->indifferent_box,
-                     "color",            0xffffffff,
-                     "background-color", 0xac6ac6ff,
-                     NULL);
-    else
-        g_object_set(quip_window->indifferent_box,
-                     "color",            0x000000ff,
-                     "background-color", 0x00000000,
-                     NULL);
-
-    if (quip_window->sentiment == HIPPO_SENTIMENT_LOVE)
-        g_object_set(quip_window->love_box,
-                     "color",            0xffffffff,
-                     "background-color", 0xac6ac6ff,
-                     NULL);
-    else
-        g_object_set(quip_window->love_box,
-                     "color",            0x000000ff,
-                     "background-color", 0x00000000,
-                     NULL);
-
-    if (quip_window->sentiment == HIPPO_SENTIMENT_HATE)
-        g_object_set(quip_window->hate_box,
-                     "color",            0xffffffff,
-                     "background-color", 0xac6ac6ff,
-                     NULL);
-    else
-        g_object_set(quip_window->hate_box,
-                     "color",            0x000000ff,
-                     "background-color", 0x00000000,
-                     NULL);
+    g_object_set(quip_window->indifferent_box,
+                 "classes",
+                 (quip_window->sentiment == HIPPO_SENTIMENT_INDIFFERENT)
+                 ? "quip-sentiment-active" : "quip-sentiment-inactive",
+                 NULL);
+    
+    g_object_set(quip_window->love_box,
+                 "classes",
+                 (quip_window->sentiment == HIPPO_SENTIMENT_LOVE)
+                 ? "quip-sentiment-active" : "quip-sentiment-inactive",
+                 NULL);
+    
+    g_object_set(quip_window->hate_box,
+                 "classes",
+                 (quip_window->sentiment == HIPPO_SENTIMENT_HATE)
+                 ? "quip-sentiment-active" : "quip-sentiment-inactive",
+                 NULL);
 }
 
 void

Modified: dumbhippo/trunk/client/common/stacker/hippo-window.c
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-window.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-window.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -1,4 +1,6 @@
 /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
+#include <hippo/hippo-canvas-theme.h>
+
 #include "hippo-stacker-internal.h"
 #include "hippo-window.h"
 #include "hippo-stacker-marshal.h"
@@ -88,6 +90,17 @@
 }
 
 void
+hippo_window_set_theme(HippoWindow      *window,
+                       HippoCanvasTheme *theme)
+
+{
+    g_return_if_fail(HIPPO_IS_WINDOW(window));
+    g_return_if_fail(theme == NULL || HIPPO_IS_CANVAS_THEME(theme));
+
+    HIPPO_WINDOW_GET_CLASS(window)->set_theme(window, theme);
+}
+
+void
 hippo_window_set_visible(HippoWindow     *window,
                          gboolean         visible)
 {

Modified: dumbhippo/trunk/client/common/stacker/hippo-window.h
===================================================================
--- dumbhippo/trunk/client/common/stacker/hippo-window.h	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/hippo-window.h	2008-03-24 19:09:45 UTC (rev 7374)
@@ -29,9 +29,11 @@
 
 struct _HippoWindowClass {
     GTypeInterface base_iface;
-    
+
     void (* set_contents)      (HippoWindow     *window,
                                 HippoCanvasItem *item);
+    void (* set_theme)         (HippoWindow      *window,
+                                HippoCanvasTheme *theme);
     void (* set_visible)       (HippoWindow     *window,
                                 gboolean         visible);
     void (* hide_to_icon)      (HippoWindow     *window,
@@ -64,6 +66,8 @@
 
 void hippo_window_set_contents      (HippoWindow      *window,
                                      HippoCanvasItem  *item);
+void hippo_window_set_theme         (HippoWindow      *window,
+                                     HippoCanvasTheme *theme);
 void hippo_window_set_visible       (HippoWindow      *window,
                                      gboolean          visible);
 void hippo_window_hide_to_icon      (HippoWindow      *window,

Added: dumbhippo/trunk/client/common/stacker/stacker.css
===================================================================
--- dumbhippo/trunk/client/common/stacker/stacker.css	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/common/stacker/stacker.css	2008-03-24 19:09:45 UTC (rev 7374)
@@ -0,0 +1,54 @@
+:link {
+  color: #0033ff;
+}
+
+:visited {
+  color: #666666;
+}
+
+.block-hushed {
+  color: #666666;
+}
+
+.block-hushed :link {
+  color: #666666;
+}
+
+.block-heading {
+  font-size: 12px;
+  font-weight: bold;
+}
+
+.block-heading :link, .block-heading :visted {
+  text-decoration: underline;
+}
+
+HippoCanvasUrlLink {
+  text-decoration: underline;
+}
+
+HippoCanvasUrlLink.netflix-movie-link, HippoCanvasUrlLink.amazon-activity-link {
+  text-decoration: none;
+}
+
+HippoCanvasBlock {
+  font-size: 11px;
+  color: black;    /* We set a background gradient from the code */
+}
+
+.quip-sentiment-inactive :link {
+  color: black;
+}
+
+.quip-sentiment-active {
+  background-color: #ac6ac6;
+}
+
+.quip-sentiment-active :link {
+  color: white;
+}
+
+HippoCanvasFilterArea {
+  color: black;
+  background-color: #e4d0ed;
+}

Modified: dumbhippo/trunk/client/linux/Makefile-libstacker.am
===================================================================
--- dumbhippo/trunk/client/linux/Makefile-libstacker.am	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/linux/Makefile-libstacker.am	2008-03-24 19:09:45 UTC (rev 7374)
@@ -126,6 +126,13 @@
 MAINTAINERCLEANFILES +=	$(LIBSTACKER_BUILT_SOURCEFILES)
 BUILT_SOURCES += $(LIBSTACKER_BUILT_SOURCEFILES)
 
+# CSS files
+CSS_STYLESHEETS = \
+	$(COMMONSRCDIR)/stacker/stacker.css
+
+pkgdata_DATA += $(CSS_STYLESHEETS)
+EXTRA_DIST += $(CSS_STYLESHEETS)
+
 ## we need to nodist these because otherwise automake would copy 
 ## ../common to distdir/../common which puts common outside of distdir.
 ## so we handle the disting manually so the destination is always distdir/common-dist

Modified: dumbhippo/trunk/client/linux/Makefile-mugshot.am
===================================================================
--- dumbhippo/trunk/client/linux/Makefile-mugshot.am	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/linux/Makefile-mugshot.am	2008-03-24 19:09:45 UTC (rev 7374)
@@ -1,9 +1,10 @@
 bin_PROGRAMS += mugshot
 
-mugshot_CPPFLAGS = 			\
-	$(AM_CPPFLAGS)			\
-	-I $(top_srcdir)		\
-	$(MUGSHOT_CFLAGS)		\
+mugshot_CPPFLAGS = 			   \
+	$(AM_CPPFLAGS)			   \
+	-I $(top_srcdir)		   \
+	$(MUGSHOT_CFLAGS)		   \
+	-DHIPPO_DATA_DIR=\"$(pkgdatadir)\" \
 	-DDDM_I_KNOW_THIS_IS_UNSTABLE=1
 
 mugshot_LDFLAGS=
@@ -141,6 +142,5 @@
 mugshot-autostart.desktop: mugshot-autostart.desktop.in
 	cat $(srcdir)/mugshot-autostart.desktop.in | sed -e 's/^_//g' > mugshot-autostart.desktop
 
-
 EXTRA_DIST += $(autostart_in_files) $(desktopfiles_in_files) #$(service_in_files)
 MAINTAINERCLEANFILES +=	$(autostart_files) $(desktopfiles_files) #$(service_DATA)

Modified: dumbhippo/trunk/client/linux/Makefile.am
===================================================================
--- dumbhippo/trunk/client/linux/Makefile.am	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/linux/Makefile.am	2008-03-24 19:09:45 UTC (rev 7374)
@@ -48,6 +48,7 @@
 BUILT_SOURCES =
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA =
+pkgdata_DATA =
 TESTS =
 
 include Makefile-libhippoipc.am

Modified: dumbhippo/trunk/client/linux/src/hippo-stacker-platform-impl.c
===================================================================
--- dumbhippo/trunk/client/linux/src/hippo-stacker-platform-impl.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/linux/src/hippo-stacker-platform-impl.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -4,6 +4,7 @@
 #include "hippo-window-wrapper.h"
 #include "hippo-status-icon.h"
 #include "hippo-http.h"
+#include <hippo/hippo-canvas-theme.h>
 #include "main.h"
 #include <string.h>
 #include <errno.h>
@@ -53,6 +54,7 @@
 struct _HippoStackerPlatformImpl {
     GObject parent;
     HippoInstanceType instance;
+    HippoCanvasTheme *theme;
 };
 
 struct _HippoStackerPlatformImplClass {
@@ -79,7 +81,14 @@
 static void
 hippo_stacker_platform_impl_init(HippoStackerPlatformImpl       *impl)
 {
+    const char *theme_stylesheet;
 
+    if (hippo_stacker_app_is_uninstalled())
+        theme_stylesheet = ABSOLUTE_TOP_SRCDIR "/../common/stacker/stacker.css";
+    else
+        theme_stylesheet = HIPPO_DATA_DIR "/stacker.css";
+    
+    impl->theme = hippo_canvas_theme_new(NULL, NULL, theme_stylesheet, NULL);
 }
 
 static void
@@ -123,7 +132,11 @@
 static HippoWindow*
 hippo_stacker_platform_impl_create_window(HippoStackerPlatform *platform)
 {
-    return HIPPO_WINDOW(hippo_window_wrapper_new());
+    HippoStackerPlatformImpl *impl = HIPPO_STACKER_PLATFORM_IMPL(platform);
+    HippoWindow *window = hippo_window_wrapper_new();
+    hippo_window_set_theme(window, impl->theme);
+
+    return window;
 }
 
 static void

Modified: dumbhippo/trunk/client/linux/src/hippo-window-wrapper.c
===================================================================
--- dumbhippo/trunk/client/linux/src/hippo-window-wrapper.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/linux/src/hippo-window-wrapper.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -43,6 +43,8 @@
 /* Window methods */
 static void hippo_window_wrapper_set_contents      (HippoWindow      *window,
                                                     HippoCanvasItem  *item);
+static void hippo_window_wrapper_set_theme         (HippoWindow      *window,
+                                                    HippoCanvasTheme *theme);
 static void hippo_window_wrapper_set_visible       (HippoWindow      *window,
                                                     gboolean          visible);
 static void hippo_window_wrapper_hide_to_icon      (HippoWindow      *window,
@@ -109,6 +111,7 @@
 hippo_window_wrapper_iface_init(HippoWindowClass *window_class)
 {
     window_class->set_contents = hippo_window_wrapper_set_contents;
+    window_class->set_theme = hippo_window_wrapper_set_theme;
     window_class->set_visible = hippo_window_wrapper_set_visible;
     window_class->hide_to_icon = hippo_window_wrapper_hide_to_icon;
     window_class->set_position = hippo_window_wrapper_set_position;
@@ -327,6 +330,15 @@
 }
 
 static void
+hippo_window_wrapper_set_theme(HippoWindow      *window,
+                               HippoCanvasTheme *theme)
+{
+    HippoWindowWrapper *wrapper = HIPPO_WINDOW_WRAPPER(window);
+
+    hippo_canvas_window_set_theme(HIPPO_CANVAS_WINDOW(wrapper->window), theme);
+}
+
+static void
 hippo_window_wrapper_set_visible(HippoWindow     *window,
                                  gboolean         visible)
 {

Modified: dumbhippo/trunk/client/linux/src/hippo-window-wrapper.h
===================================================================
--- dumbhippo/trunk/client/linux/src/hippo-window-wrapper.h	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/linux/src/hippo-window-wrapper.h	2008-03-24 19:09:45 UTC (rev 7374)
@@ -22,7 +22,6 @@
 
 HippoWindow* hippo_window_wrapper_new    (void);
 
-
 G_END_DECLS
 
 #endif /* __HIPPO_WINDOW_WRAPPER_H__ */

Modified: dumbhippo/trunk/client/linux/src/main.c
===================================================================
--- dumbhippo/trunk/client/linux/src/main.c	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/linux/src/main.c	2008-03-24 19:09:45 UTC (rev 7374)
@@ -344,6 +344,16 @@
     g_free(app);
 }
 
+gboolean
+hippo_stacker_app_is_uninstalled()
+{
+    const char *envvar = g_getenv("HIPPO_UNINSTALLED");
+    if (envvar != NULL && strcmp(envvar, "") != 0)
+        return TRUE;
+    else
+        return FALSE;
+}
+
 /* 
  * Singleton HippoStackerApp and main()
  */
@@ -445,7 +455,7 @@
     if (options.debug_updates)
         gdk_window_set_debug_updates(TRUE);
     
-    if (options.instance_type == HIPPO_INSTANCE_DEBUG) {
+    if (hippo_stacker_app_is_uninstalled()) {
         gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(),
                                           ABSOLUTE_TOP_SRCDIR "/icons");
     }

Modified: dumbhippo/trunk/client/linux/src/main.h
===================================================================
--- dumbhippo/trunk/client/linux/src/main.h	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/linux/src/main.h	2008-03-24 19:09:45 UTC (rev 7374)
@@ -32,6 +32,12 @@
 
 void       hippo_stacker_app_quit           (HippoStackerApp   *app);
 
+/* checks HIPPO_UNINSTALLED environment variable; doesn't take
+ * HppoStackerApp *app parameter since we use it in creating the app
+ * and it doesn't need one
+ */
+gboolean hippo_stacker_app_is_uninstalled(void);
+
 DDMDataModel   *      hippo_stacker_app_get_data_model       (HippoStackerApp *app);
 HippoStackerPlatform *hippo_stacker_app_get_stacker_platform (HippoStackerApp *app);
 HippoStackManager*    hippo_stacker_app_get_stack            (HippoStackerApp *app);

Modified: dumbhippo/trunk/client/windows/HippoUI/HippoCanvas.cpp
===================================================================
--- dumbhippo/trunk/client/windows/HippoUI/HippoCanvas.cpp	2008-03-21 14:38:40 UTC (rev 7373)
+++ dumbhippo/trunk/client/windows/HippoUI/HippoCanvas.cpp	2008-03-24 19:09:45 UTC (rev 7374)
@@ -1217,6 +1217,9 @@
     case HIPPO_STOCK_COLOR_BG_PRELIGHT:
         // FIXME use real system color
         return 0x999999ff;
+    case HIPPO_STOCK_COLOR_FG:
+        // FIXME use real system color
+        return 0x000000ff;
     }
 
     g_warning("unknown stock color %d", color);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]