From f365484a5c97df96ce92d23c672bd0ed1622be58 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 28 Oct 2010 14:03:45 -0400 Subject: [PATCH 01/85] popupMenu: fix spacing between columns This patch didn't get updated for the st_theme_node_get_spacing() change. --- js/ui/popupMenu.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 23969a6a5..56c7013c4 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -81,9 +81,7 @@ PopupBaseMenuItem.prototype = { }, _onStyleChanged: function (actor) { - let themeNode = actor.get_theme_node(); - let [found, spacing] = themeNode.get_length('spacing', false); - this._spacing = found ? spacing : 0; + this._spacing = actor.get_theme_node().get_length('spacing'); }, _hoverChanged: function (actor) { From d66e7dd49edc589577477a98c2806b7930335e24 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 27 Oct 2010 17:41:20 +0100 Subject: [PATCH 02/85] st-theme-node-drawing: Don't create lots of one-shot materials A few places in st-theme-node-drawing create one-shot material, paint with it and then free it. This is suboptimal with current Cogl because it will end up compiling an ARBfp program just for that single paint and then it will throw it away when the material is destroyed. There is a new function in st-private.c called _st_create_texture_material. This creates a simple material for a texture based on a common parent material that points to a dummy texture. Any materials created with this function are likely to be able to share the same program unless the material is further modified to contain a different number of layers. It would be possible to use cogl_set_source_texture for this instead except that it's not possible to modify the material's color in that case so we couldn't render the texture with opacity. The corner textures are now stored as a handle to a material that references the texture rather than storing the texure directly. There is also a separate border_material member which always points to border_texture as the only layer. https://bugzilla.gnome.org/show_bug.cgi?id=633340 --- src/st/st-private.c | 43 +++++++++++++++++ src/st/st-private.h | 2 + src/st/st-theme-node-drawing.c | 85 +++++++++++++++------------------- src/st/st-theme-node-private.h | 3 +- 4 files changed, 84 insertions(+), 49 deletions(-) diff --git a/src/st/st-private.c b/src/st/st-private.c index 264ed727e..f1f3aab86 100644 --- a/src/st/st-private.c +++ b/src/st/st-private.c @@ -324,6 +324,49 @@ _st_set_text_from_style (ClutterText *text, } } +/** + * _st_create_texture_material: + * @src_texture: The CoglTexture for the material + * + * Creates a simple material which contains the given texture as a + * single layer. + */ +CoglHandle +_st_create_texture_material (CoglHandle src_texture) +{ + static CoglHandle texture_material_template = COGL_INVALID_HANDLE; + CoglHandle material; + + g_return_val_if_fail (src_texture != COGL_INVALID_HANDLE, + COGL_INVALID_HANDLE); + + /* We use a material that has a dummy texture as a base for all + texture materials. The idea is that only the Cogl texture object + would be different in the children so it is likely that Cogl will + be able to share GL programs between all the textures. */ + if (G_UNLIKELY (texture_material_template == COGL_INVALID_HANDLE)) + { + static const guint8 white_pixel[] = { 0xff, 0xff, 0xff, 0xff }; + CoglHandle dummy_texture; + + dummy_texture = + cogl_texture_new_from_data (1, 1, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_RGBA_8888_PRE, + COGL_PIXEL_FORMAT_ANY, + 4, white_pixel); + + texture_material_template = cogl_material_new (); + cogl_material_set_layer (texture_material_template, 0, dummy_texture); + cogl_handle_unref (dummy_texture); + } + + material = cogl_material_copy (texture_material_template); + + cogl_material_set_layer (material, 0, src_texture); + + return material; +} /***** * Shadows diff --git a/src/st/st-private.h b/src/st/st-private.h index 33d58d422..0d0e6422a 100644 --- a/src/st/st-private.h +++ b/src/st/st-private.h @@ -73,6 +73,8 @@ void _st_allocate_fill (StWidget *parent, void _st_set_text_from_style (ClutterText *text, StThemeNode *theme_node); +CoglHandle _st_create_texture_material (CoglHandle src_texture); + /* Helper for widgets which need to draw additional shadows */ CoglHandle _st_create_shadow_material (StShadow *shadow_spec, CoglHandle src_texture); diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c index 718a156a1..d28f03e49 100644 --- a/src/st/st-theme-node-drawing.c +++ b/src/st/st-theme-node-drawing.c @@ -52,7 +52,7 @@ typedef struct { } StCornerSpec; static CoglHandle -create_corner_texture (StCornerSpec *corner) +create_corner_material (StCornerSpec *corner) { CoglHandle texture; cairo_t *cr; @@ -167,7 +167,7 @@ load_corner (StTextureCache *cache, { LoadCornerData *data = datap; - return create_corner_texture (data->corner); + return create_corner_material (data->corner); } /* To match the CSS specification, we want the border to look like it was @@ -222,7 +222,7 @@ static CoglHandle st_theme_node_lookup_corner (StThemeNode *node, StCorner corner_id) { - CoglHandle texture; + CoglHandle texture, material; char *key; StTextureCache *cache; StCornerSpec corner; @@ -269,10 +269,12 @@ st_theme_node_lookup_corner (StThemeNode *node, data.node = node; data.corner = &corner; texture = st_texture_cache_load (cache, key, ST_TEXTURE_CACHE_POLICY_NONE, load_corner, &data, NULL); + material = _st_create_texture_material (texture); + cogl_handle_unref (texture); g_free (key); - return texture; + return material; } static void @@ -511,12 +513,14 @@ _st_theme_node_free_drawing_state (StThemeNode *node) cogl_handle_unref (node->background_shadow_material); if (node->border_texture != COGL_INVALID_HANDLE) cogl_handle_unref (node->border_texture); + if (node->border_material != COGL_INVALID_HANDLE) + cogl_handle_unref (node->border_material); if (node->border_shadow_material != COGL_INVALID_HANDLE) cogl_handle_unref (node->border_shadow_material); for (corner_id = 0; corner_id < 4; corner_id++) - if (node->corner_texture[corner_id] != COGL_INVALID_HANDLE) - cogl_handle_unref (node->corner_texture[corner_id]); + if (node->corner_material[corner_id] != COGL_INVALID_HANDLE) + cogl_handle_unref (node->corner_material[corner_id]); _st_theme_node_init_drawing_state (node); } @@ -530,9 +534,10 @@ _st_theme_node_init_drawing_state (StThemeNode *node) node->background_shadow_material = COGL_INVALID_HANDLE; node->border_shadow_material = COGL_INVALID_HANDLE; node->border_texture = COGL_INVALID_HANDLE; + node->border_material = COGL_INVALID_HANDLE; for (corner_id = 0; corner_id < 4; corner_id++) - node->corner_texture[corner_id] = COGL_INVALID_HANDLE; + node->corner_material[corner_id] = COGL_INVALID_HANDLE; } static void st_theme_node_paint_borders (StThemeNode *node, @@ -581,6 +586,11 @@ st_theme_node_render_resources (StThemeNode *node, node->border_texture = st_theme_node_render_gradient (node); } + if (node->border_texture) + node->border_material = _st_create_texture_material (node->border_texture); + else + node->border_material = COGL_INVALID_HANDLE; + if (shadow_spec) { if (node->border_texture != COGL_INVALID_HANDLE) @@ -630,40 +640,26 @@ st_theme_node_render_resources (StThemeNode *node, } } - node->corner_texture[ST_CORNER_TOPLEFT] = + node->corner_material[ST_CORNER_TOPLEFT] = st_theme_node_lookup_corner (node, ST_CORNER_TOPLEFT); - node->corner_texture[ST_CORNER_TOPRIGHT] = + node->corner_material[ST_CORNER_TOPRIGHT] = st_theme_node_lookup_corner (node, ST_CORNER_TOPRIGHT); - node->corner_texture[ST_CORNER_BOTTOMRIGHT] = + node->corner_material[ST_CORNER_BOTTOMRIGHT] = st_theme_node_lookup_corner (node, ST_CORNER_BOTTOMRIGHT); - node->corner_texture[ST_CORNER_BOTTOMLEFT] = + node->corner_material[ST_CORNER_BOTTOMLEFT] = st_theme_node_lookup_corner (node, ST_CORNER_BOTTOMLEFT); } static void -paint_texture_with_opacity (CoglHandle texture, - ClutterActorBox *box, - guint8 paint_opacity) +paint_material_with_opacity (CoglHandle material, + ClutterActorBox *box, + guint8 paint_opacity) { - if (paint_opacity == 255) - { - /* Minor: optimization use the default material if we can */ - cogl_set_source_texture (texture); - cogl_rectangle (box->x1, box->y1, box->x2, box->y2); - return; - } - - CoglHandle material; - - material = cogl_material_new (); - cogl_material_set_layer (material, 0, texture); cogl_material_set_color4ub (material, paint_opacity, paint_opacity, paint_opacity, paint_opacity); cogl_set_source (material); cogl_rectangle (box->x1, box->y1, box->x2, box->y2); - - cogl_handle_unref (material); } static void @@ -678,7 +674,6 @@ st_theme_node_paint_borders (StThemeNode *node, int max_width_radius[4]; int corner_id; ClutterColor border_color; - CoglHandle material; width = box->x2 - box->x1; height = box->y2 - box->y1; @@ -753,19 +748,15 @@ st_theme_node_paint_borders (StThemeNode *node, /* corners */ if (max_border_radius > 0) { - material = cogl_material_new (); - cogl_material_set_color4ub (material, - paint_opacity, paint_opacity, - paint_opacity, paint_opacity); - cogl_set_source (material); - for (corner_id = 0; corner_id < 4; corner_id++) { - if (node->corner_texture[corner_id] == COGL_INVALID_HANDLE) + if (node->corner_material[corner_id] == COGL_INVALID_HANDLE) continue; - cogl_material_set_layer (material, - 0, node->corner_texture[corner_id]); + cogl_material_set_color4ub (node->corner_material[corner_id], + paint_opacity, paint_opacity, + paint_opacity, paint_opacity); + cogl_set_source (node->corner_material[corner_id]); switch (corner_id) { @@ -791,7 +782,6 @@ st_theme_node_paint_borders (StThemeNode *node, break; } } - cogl_handle_unref (material); } /* background color */ @@ -930,8 +920,7 @@ st_theme_node_paint_sliced_border_image (StThemeNode *node, if (ey < 0) ey = border_bottom; /* FIXME ? */ - material = cogl_material_new (); - cogl_material_set_layer (material, 0, node->border_texture); + material = node->border_material; cogl_material_set_color4ub (material, paint_opacity, paint_opacity, paint_opacity, paint_opacity); @@ -988,8 +977,6 @@ st_theme_node_paint_sliced_border_image (StThemeNode *node, cogl_rectangles_with_texture_coords (rectangles, 9); } - - cogl_handle_unref (material); } static void @@ -1096,11 +1083,11 @@ st_theme_node_paint (StThemeNode *node, &allocation, paint_opacity); - if (node->border_texture != COGL_INVALID_HANDLE) + if (node->border_material != COGL_INVALID_HANDLE) { /* Gradients and border images are mutually exclusive at this time */ if (node->background_gradient_type != ST_GRADIENT_NONE) - paint_texture_with_opacity (node->border_texture, &allocation, paint_opacity); + paint_material_with_opacity (node->border_material, &allocation, paint_opacity); else st_theme_node_paint_sliced_border_image (node, &allocation, paint_opacity); } @@ -1133,7 +1120,7 @@ st_theme_node_paint (StThemeNode *node, &background_box, paint_opacity); - paint_texture_with_opacity (node->background_texture, &background_box, paint_opacity); + paint_material_with_opacity (node->border_material, &background_box, paint_opacity); } } @@ -1172,7 +1159,9 @@ st_theme_node_copy_cached_paint_state (StThemeNode *node, node->background_texture = cogl_handle_ref (other->background_texture); if (other->border_texture) node->border_texture = cogl_handle_ref (other->border_texture); + if (other->border_material) + node->border_material = cogl_handle_ref (other->border_material); for (corner_id = 0; corner_id < 4; corner_id++) - if (other->corner_texture[corner_id]) - node->corner_texture[corner_id] = cogl_handle_ref (other->corner_texture[corner_id]); + if (other->corner_material[corner_id]) + node->corner_material[corner_id] = cogl_handle_ref (other->corner_material[corner_id]); } diff --git a/src/st/st-theme-node-private.h b/src/st/st-theme-node-private.h index 9267a6efa..c6078fca8 100644 --- a/src/st/st-theme-node-private.h +++ b/src/st/st-theme-node-private.h @@ -78,7 +78,8 @@ struct _StThemeNode { CoglHandle border_shadow_material; CoglHandle background_texture; CoglHandle border_texture; - CoglHandle corner_texture[4]; + CoglHandle border_material; + CoglHandle corner_material[4]; }; struct _StThemeNodeClass { From 88729136656794dcb6c079d609afdfd37abd462c Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Thu, 28 Oct 2010 21:51:13 +0100 Subject: [PATCH 03/85] StThemeNode: Fix the confusion between border and background In d66e7dd49 I got confused between border_texture and background_texture. The background_texture was being created as normal but in the one place that it gets drawn I accidentally made it use the border_material instead. This patch makes it create a background_material similar to the border_material and uses it to paint. --- src/st/st-theme-node-drawing.c | 8 +++++++- src/st/st-theme-node-private.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c index d28f03e49..8bc191555 100644 --- a/src/st/st-theme-node-drawing.c +++ b/src/st/st-theme-node-drawing.c @@ -509,6 +509,8 @@ _st_theme_node_free_drawing_state (StThemeNode *node) if (node->background_texture != COGL_INVALID_HANDLE) cogl_handle_unref (node->background_texture); + if (node->background_material != COGL_INVALID_HANDLE) + cogl_handle_unref (node->background_material); if (node->background_shadow_material != COGL_INVALID_HANDLE) cogl_handle_unref (node->background_shadow_material); if (node->border_texture != COGL_INVALID_HANDLE) @@ -531,6 +533,7 @@ _st_theme_node_init_drawing_state (StThemeNode *node) int corner_id; node->background_texture = COGL_INVALID_HANDLE; + node->background_material = COGL_INVALID_HANDLE; node->background_shadow_material = COGL_INVALID_HANDLE; node->border_shadow_material = COGL_INVALID_HANDLE; node->border_texture = COGL_INVALID_HANDLE; @@ -632,6 +635,7 @@ st_theme_node_render_resources (StThemeNode *node, { node->background_texture = st_texture_cache_load_file_to_cogl_texture (texture_cache, background_image); + node->background_material = _st_create_texture_material (node->background_texture); if (shadow_spec) { @@ -1120,7 +1124,7 @@ st_theme_node_paint (StThemeNode *node, &background_box, paint_opacity); - paint_material_with_opacity (node->border_material, &background_box, paint_opacity); + paint_material_with_opacity (node->background_material, &background_box, paint_opacity); } } @@ -1157,6 +1161,8 @@ st_theme_node_copy_cached_paint_state (StThemeNode *node, node->border_shadow_material = cogl_handle_ref (other->border_shadow_material); if (other->background_texture) node->background_texture = cogl_handle_ref (other->background_texture); + if (other->background_material) + node->background_material = cogl_handle_ref (other->background_material); if (other->border_texture) node->border_texture = cogl_handle_ref (other->border_texture); if (other->border_material) diff --git a/src/st/st-theme-node-private.h b/src/st/st-theme-node-private.h index c6078fca8..a13df17c6 100644 --- a/src/st/st-theme-node-private.h +++ b/src/st/st-theme-node-private.h @@ -77,6 +77,7 @@ struct _StThemeNode { CoglHandle background_shadow_material; CoglHandle border_shadow_material; CoglHandle background_texture; + CoglHandle background_material; CoglHandle border_texture; CoglHandle border_material; CoglHandle corner_material[4]; From 58001563d95d84e0a2f6b14f861ab1d4f424e18e Mon Sep 17 00:00:00 2001 From: A S Alam Date: Fri, 29 Oct 2010 08:13:46 +0530 Subject: [PATCH 04/85] update translation and completed --- po/pa.po | 296 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 251 insertions(+), 45 deletions(-) diff --git a/po/pa.po b/po/pa.po index a0479c7c7..bec9a27f5 100644 --- a/po/pa.po +++ b/po/pa.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: gnome-shell master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug." "cgi?product=gnome-shell&component=general\n" -"POT-Creation-Date: 2010-10-02 20:44+0000\n" -"PO-Revision-Date: 2010-10-04 07:19+0530\n" +"POT-Creation-Date: 2010-10-27 23:15+0000\n" +"PO-Revision-Date: 2010-10-29 08:13+0530\n" "Last-Translator: A S Alam \n" "Language-Team: Punjabi/Panjabi \n" "MIME-Version: 1.0\n" @@ -166,9 +166,9 @@ msgid "" "() to obtain a specific format. See the strftime() manual for more " "information." msgstr "" -"ਇਹ ਕੁੰਜੀ ਪੈਨਲ ਘੜੀ ਲਈ ਵਰਤਣ ਵਾਸਤੇ ਫਾਰਮੈਟ ਦਿੰਦੀ ਹੈ, ਜਦੋਂ ਕਿ ਫਾਰਮੈਟ ਕੁੰਜੀ \"ਕਸਟਮ\" ਸੈੱਟ " -"ਕੀਤੀ ਹੋਵੇ। ਤੁਸੀਂ ਖਾਸ ਫਾਰਮੈਟ ਦੇਣ ਲਈ ਹਦਾਇਤਾਂ ਵਾਸਤੇ strftime () ਨੂੰ ਵਰਤ ਸਕਦੇ ਹੋ। " -"ਹੋਰ ਜਾਣਕਾਰੀ ਲਈ strftime () ਦਸਤਾਵੇਜ਼ ਵੇਖੋ।" +"ਇਹ ਕੁੰਜੀ ਪੈਨਲ ਘੜੀ ਲਈ ਵਰਤਣ ਵਾਸਤੇ ਫਾਰਮੈਟ ਦਿੰਦੀ ਹੈ, ਜਦੋਂ ਕਿ ਫਾਰਮੈਟ ਕੁੰਜੀ \"ਕਸਟਮ\" ਸੈੱਟ ਕੀਤੀ " +"ਹੋਵੇ। ਤੁਸੀਂ ਖਾਸ ਫਾਰਮੈਟ ਦੇਣ ਲਈ ਹਦਾਇਤਾਂ ਵਾਸਤੇ strftime () ਨੂੰ ਵਰਤ ਸਕਦੇ ਹੋ। ਹੋਰ ਜਾਣਕਾਰੀ ਲਈ " +"strftime () ਦਸਤਾਵੇਜ਼ ਵੇਖੋ।" #: ../data/org.gnome.shell.gschema.xml.in.h:25 msgid "" @@ -179,12 +179,12 @@ msgid "" "in the custom_format key. Note that if set to either \"unix\" or \"custom\", " "the show_date and show_seconds keys are ignored." msgstr "" -"ਇਹ ਕੁੰਜੀ ਤਹਿ ਕਰਦੀ ਹੈ ਕਿ ਕਿਹੜਾ ਪੈਨਲ ਘੜੀ ਵਿੱਚ ਘੰਟਾ ਫਾਰਮੈਟ ਵਰਤਿਆ ਜਾਵੇ। ਸੰਭਵ ਮੁੱਲ ਹਨ " -"\"12-hour\"(੧੨-ਘੰਟੇ), \"24-hour\" (੨੪-ਘੰਟੇ), \"unix\" (ਯੂਨੈਕਸ) ਅਤੇ \"custom\" " -"(ਪਸੰਦੀਦਾ)। ਜੇ \"ਯੂਨੈਕਸ\" ਸੈੱਟ ਕੀਤਾ ਗਿਆ ਤਾਂ ਘੜੀ ਨੂੰ ਈਪੋਚ (੦੧-ਜਨਵਰੀ-੧੯੭੦) ਤੋਂ ਵੇਖਾਇਆ\n" -"ਜਾਵੇਗਾ। ਜੇ \"ਪਸੰਦੀਦਾ\" ਲਈ ਸੈੱਟ ਕੀਤਾ ਗਿਆ ਤਾਂ, ਘੜੀ ਨੂੰ custom_format ਕੁੰਜੀ ਵਿੱਚ ਦਿੱਤੇ " -"ਫਾਰਮੈਟ ਮੁਤਾਬਕ ਵੇਖਾਇਆ ਜਾਵੇਗਾ। ਯਾਦ ਰੱਖੋ ਕਿ ਜੇ \"ਯੂਨੈਕਸ\" ਜਾਂ \"ਪਸੰਦੀਦਾ\" ਸੈੱਟ ਕੀਤਾ ਤਾਂ ਅੱਪਗਰੇਡ " -"ਮਿਤੀ ਵੇਖਾਓ ਤੇ ਸਕਿੰਟ ਵੇਖਾਓ ਨੂੰ ਅਣਡਿੱਠਾ ਕੀਤਾ ਜਾਵੇਗਾ।" +"ਇਹ ਕੁੰਜੀ ਤਹਿ ਕਰਦੀ ਹੈ ਕਿ ਕਿਹੜਾ ਪੈਨਲ ਘੜੀ ਵਿੱਚ ਘੰਟਾ ਫਾਰਮੈਟ ਵਰਤਿਆ ਜਾਵੇ। ਸੰਭਵ ਮੁੱਲ ਹਨ \"12-" +"hour\"(੧੨-ਘੰਟੇ), \"24-hour\" (੨੪-ਘੰਟੇ), \"unix\" (ਯੂਨੈਕਸ) ਅਤੇ \"custom\" (ਪਸੰਦੀਦਾ)। " +"ਜੇ \"ਯੂਨੈਕਸ\" ਸੈੱਟ ਕੀਤਾ ਗਿਆ ਤਾਂ ਘੜੀ ਨੂੰ ਈਪੋਚ (੦੧-ਜਨਵਰੀ-੧੯੭੦) ਤੋਂ ਵੇਖਾਇਆ\n" +"ਜਾਵੇਗਾ। ਜੇ \"ਪਸੰਦੀਦਾ\" ਲਈ ਸੈੱਟ ਕੀਤਾ ਗਿਆ ਤਾਂ, ਘੜੀ ਨੂੰ custom_format ਕੁੰਜੀ ਵਿੱਚ ਦਿੱਤੇ ਫਾਰਮੈਟ " +"ਮੁਤਾਬਕ ਵੇਖਾਇਆ ਜਾਵੇਗਾ। ਯਾਦ ਰੱਖੋ ਕਿ ਜੇ \"ਯੂਨੈਕਸ\" ਜਾਂ \"ਪਸੰਦੀਦਾ\" ਸੈੱਟ ਕੀਤਾ ਤਾਂ ਅੱਪਗਰੇਡ ਮਿਤੀ " +"ਵੇਖਾਓ ਤੇ ਸਕਿੰਟ ਵੇਖਾਓ ਨੂੰ ਅਣਡਿੱਠਾ ਕੀਤਾ ਜਾਵੇਗਾ।" #: ../data/org.gnome.shell.gschema.xml.in.h:26 msgid "Uuids of extensions to disable" @@ -194,6 +194,132 @@ msgstr "ਇਕਟੈਨਸ਼ਨ ਦੀ Uuids ਬੰਦ ਹੈ" msgid "Whether to collect stats about applications usage" msgstr "ਐਪਲੀਕੇਸ਼ਨ ਵਰਤੋਂ ਬਾਰੇ ਅੰਕੜੇ ਇੱਕਠੇ ਕਰਨੇ ਹਨ" +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:1 +msgid "Clip the crosshairs at the center" +msgstr "ਸੈਂਟਰ ਉੱਤੇ ਕਰਾਂਸਹੇਅਰ ਕਲਿੱਪ ਕਰੋ" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:2 +msgid "Color of the crosshairs" +msgstr "ਕਰਾਂਸਹੇਅਰ ਦਾ ਰੰਗ" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:3 +msgid "" +"Determines the length of the vertical and horizontal lines that make up the " +"crosshairs." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:4 +msgid "" +"Determines the position of the magnified mouse image within the magnified " +"view and how it reacts to system mouse movement. The values are - none: no " +"mouse tracking; - centered: the mouse image is displayed at the center of " +"the zoom region (which also represents the point under the system mouse) and " +"the magnified contents are scrolled as the system mouse moves; - " +"proportional: the position of the magnified mouse in the zoom region is " +"proportionally the same as the position of the system mouse on screen; - " +"push: when the magnified mouse intersects a boundary of the zoom region, the " +"contents are scrolled into view." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:5 +msgid "" +"Determines the transparency of the crosshairs, from fully opaque to fully " +"transparent." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:6 +msgid "" +"Determines whether the crosshairs intersect the magnified mouse sprite, or " +"are clipped such that the ends of the horizontal and vertical lines surround " +"the mouse image." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:7 +#| msgid "Enabled" +msgid "Enable lens mode" +msgstr "ਲੈਨਜ਼ ਮੋਡ ਚਾਲੂ" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:8 +msgid "" +"Enables/disables display of crosshairs centered on the magnified mouse " +"sprite." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:9 +msgid "" +"For centered mouse tracking, when the system pointer is at or near the edge " +"of the screen, the magnified contents continue to scroll such that the " +"screen edge moves into the magnified view." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:10 +msgid "Length of the crosshairs" +msgstr "ਕਰਾਂਸਹੇਅਰ ਦੀ ਲੰਬਾਈ" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:11 +msgid "Magnification factor" +msgstr "ਵੱਡਦਰਸ਼ੀ ਗੁਣਾਂਕ" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:12 +msgid "Mouse Tracking Mode" +msgstr "ਮਾਊਸ ਟਰੈਕਿੰਗ ਮੋਡ" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:13 +msgid "Opacity of the crosshairs" +msgstr "ਕਰਾਂਸਹੇਅਰ ਦਾ ਧੁੰਦਲਾਪਨ" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:14 +msgid "Screen position" +msgstr "ਸਕਰੀਨ ਸਥਿਤੀ" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:15 +msgid "Scroll magnified contents beyond the edges of the desktop" +msgstr "ਡੈਸਕਟਾਪ ਦੇ ਕੋਨਿਆਂ ਤੋਂ ਪਾਰ ਵੱਡਦਰਸ਼ੀ ਸਮੱਗਰੀ ਸਕਰੋਲ ਕਰੋ" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:16 +msgid "Show or hide crosshairs" +msgstr "ਕਰਾਂਸਹੇਅਰ ਵੇਖੋ ਜਾਂ ਓਹਲੇ ਕਰੋ" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:17 +msgid "Show or hide the magnifier" +msgstr "ਵੱਡਦਰਸ਼ੀ ਵੇਖੋ ਜਾਂ ਓਹਲੇ ਕਰੋ" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:18 +msgid "Show or hide the magnifier and all of its zoom regions." +msgstr "ਵੱਡਦਰਸ਼ੀ ਵੇਖੋ ਜਾਂ ਓਹਲੇ ਕਰੋ ਤੇ ਇਸ ਦੇ ਸਭ ਖੇਤਰਾਂ ਨੂੰ ਜ਼ੂਮ ਕਰੋ।" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:19 +msgid "" +"The color of the the vertical and horizontal lines that make up the " +"crosshairs." +msgstr "ਵਰਟੀਕਲ ਤੇ ਹਰੀਜੱਟਲ ਲਾਈਨਾਂ ਦਾ ਰੰਗ, ਜੋ ਕਿ ਕਰਾਂਸਹੇਅਰ ਬਣਾਉਂਦੀਆਂ ਹਨ" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:20 +msgid "" +"The magnified view either fills the entire screen, or occupies the top-half, " +"bottom-half, left-half, or right-half of the screen." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:21 +msgid "" +"The power of the magnification. A value of 1.0 means no magnification. A " +"value of 2.0 doubles the size." +msgstr "ਵੱਡਦਰਸ਼ੀ ਦੀ ਤਾਕਤ ਹੈ। ੧.੦ ਦਾ ਮਤਲਬ ਹੈ ਕਿ ਕੋਈ ਵੀ ਨਹੀਂ। ੨.੦ ਦਾ ਮਤਲਬ ਹੈ ਆਕਾਰ ਦਾ ਦੋ ਗੁਣਾ।" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:22 +msgid "Thickness of the crosshairs" +msgstr "ਕਰਾਂਸਹੇਅਰ ਦੀ ਮੋਟਾਈ" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:23 +msgid "" +"Whether the magnified view should be centered over the location of the " +"system mouse and move with it." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:24 +msgid "Width of the vertical and horizontal lines that make up the crosshairs." +msgstr "ਵਰਟੀਕਲ ਤੇ ਹਰੀਜੱਟਲ ਲਾਈਨਾਂ ਦੀ ਚੌੜਾਈ, ਜੋ ਕਿ ਕਰਾਂਸਹੇਅਰ ਬਣਾਉਂਦੀਆਂ ਹਨ" + #: ../data/clock-preferences.ui.h:1 msgid "Clock Format" msgstr "ਘੜੀ ਫਾਰਮੈਟ" @@ -289,7 +415,9 @@ msgstr "ਕੋਈ ਇਕਸਟੈਨਸ਼ਨ ਇੰਸਟਾਲ ਨਹੀਂ msgid "Enabled" msgstr "ਚਾਲੂ ਹੈ" -#: ../js/ui/lookingGlass.js:591 +#. translators: +#. * The device has been disabled +#: ../js/ui/lookingGlass.js:591 ../src/gvc/gvc-mixer-control.c:1087 msgid "Disabled" msgstr "ਬੰਦ ਹੈ" @@ -314,58 +442,58 @@ msgid "Undo" msgstr "ਵਾਪਸ" #. TODO - _quit() doesn't really work on apps in state STARTING yet -#: ../js/ui/panel.js:461 +#: ../js/ui/panel.js:469 #, c-format msgid "Quit %s" msgstr "%s ਬੰਦ ਕਰੋ" -#: ../js/ui/panel.js:486 +#: ../js/ui/panel.js:494 msgid "Preferences" msgstr "ਮੇਰੀ ਪਸੰਦ" #. Translators: This is the time format with date used #. in 24-hour mode. -#: ../js/ui/panel.js:572 +#: ../js/ui/panel.js:580 msgid "%a %b %e, %R:%S" msgstr "%a, %e %b %R:%S" -#: ../js/ui/panel.js:573 +#: ../js/ui/panel.js:581 msgid "%a %b %e, %R" msgstr "%a %e %b, %R" #. Translators: This is the time format without date used #. in 24-hour mode. -#: ../js/ui/panel.js:577 +#: ../js/ui/panel.js:585 msgid "%a %R:%S" msgstr "%a %R:%S" -#: ../js/ui/panel.js:578 +#: ../js/ui/panel.js:586 msgid "%a %R" msgstr "%a %R" #. Translators: This is a time format with date used #. for AM/PM. -#: ../js/ui/panel.js:585 +#: ../js/ui/panel.js:593 msgid "%a %b %e, %l:%M:%S %p" msgstr "%a %e %b, %l:%M:%S %p" -#: ../js/ui/panel.js:586 +#: ../js/ui/panel.js:594 msgid "%a %b %e, %l:%M %p" msgstr "%a %e %b, %l:%M %p" #. Translators: This is a time format without date used #. for AM/PM. -#: ../js/ui/panel.js:590 +#: ../js/ui/panel.js:598 msgid "%a %l:%M:%S %p" msgstr "%a %l:%M:%S %p" -#: ../js/ui/panel.js:591 +#: ../js/ui/panel.js:599 msgid "%a %l:%M %p" msgstr "%a %l:%M %p" #. Button on the left side of the panel. #. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview". -#: ../js/ui/panel.js:736 +#: ../js/ui/panel.js:744 msgid "Activities" msgstr "ਸਰਗਰਮੀਆਂ" @@ -389,7 +517,7 @@ msgstr "...ਨਾਲ ਕੁਨੈਕਟ ਕਰੋ" #. simply result in invisible toggle switches. #: ../js/ui/popupMenu.js:33 msgid "toggle-switch-us" -msgstr "" +msgstr "toggle-switch-us" #: ../js/ui/runDialog.js:233 msgid "Please enter a command:" @@ -400,43 +528,95 @@ msgstr "ਕਮਾਂਡ ਦਿਓ ਜੀ:" msgid "Execution of '%s' failed:" msgstr "'%s' ਚਲਾਉਣ ਲਈ ਫੇਲ੍ਹ:" -#: ../js/ui/statusMenu.js:91 +#: ../js/ui/statusMenu.js:101 msgid "Available" msgstr "ਉਪਲੱਬਧ" -#: ../js/ui/statusMenu.js:95 +#: ../js/ui/statusMenu.js:106 msgid "Busy" msgstr "ਰੁਝਿਆ" -#: ../js/ui/statusMenu.js:99 +#: ../js/ui/statusMenu.js:111 msgid "Invisible" msgstr "ਅਦਿੱਖ" -#: ../js/ui/statusMenu.js:106 -msgid "Account Information..." -msgstr "ਅਕਾਊਂਟ ਜਾਣਕਾਰੀ..." +#: ../js/ui/statusMenu.js:119 +msgid "My Account..." +msgstr "...ਮੇਰਾ ਅਕਾਊਂਟ" -#: ../js/ui/statusMenu.js:110 -#| msgid "System Preferences..." -msgid "System Settings..." -msgstr "ਸਿਸਟਮ ਸੈਟਿੰਗ..." +#: ../js/ui/statusMenu.js:123 +#| msgid "Preferences" +msgid "System Preferences..." +msgstr "ਸਿਸਟਮ ਪਸੰਦ..." -#: ../js/ui/statusMenu.js:117 +#: ../js/ui/statusMenu.js:130 msgid "Lock Screen" msgstr "ਸਕਰੀਨ ਲਾਕ ਕਰੋ" -#: ../js/ui/statusMenu.js:121 +#: ../js/ui/statusMenu.js:134 msgid "Switch User" msgstr "ਯੂਜ਼ਰ ਬਦਲੋ" -#: ../js/ui/statusMenu.js:126 +#: ../js/ui/statusMenu.js:139 msgid "Log Out..." msgstr "ਲਾਗਆਉਟ..." -#: ../js/ui/statusMenu.js:130 +#: ../js/ui/statusMenu.js:146 +msgid "Suspend" +msgstr "ਸਸਪੈਂਡ" + +#: ../js/ui/statusMenu.js:150 +msgid "Restart..." +msgstr "...ਮੁੜ-ਚਾਲੂ" + +#: ../js/ui/statusMenu.js:154 msgid "Shut Down..." msgstr "ਬੰਦ ਕਰੋ..." +#: ../js/ui/status/accessibility.js:88 +msgid "Screen Reader" +msgstr "ਸਕਰੀਨ ਰੀਡਰ" + +#: ../js/ui/status/accessibility.js:91 +msgid "Screen Keyboard" +msgstr "ਸਕਰੀਨ ਕੀਬੋਰਡ" + +#: ../js/ui/status/accessibility.js:94 +msgid "Visual Alerts" +msgstr "ਦਿੱਖ ਚੇਤਾਵਨੀ" + +#: ../js/ui/status/accessibility.js:97 +msgid "Sticky Keys" +msgstr "ਸਟਿੱਕੀ ਸਵਿੱਚਾਂ" + +#: ../js/ui/status/accessibility.js:100 +msgid "Slow Keys" +msgstr "ਹੌਲੀ ਸਵਿੱਚਾਂ" + +#: ../js/ui/status/accessibility.js:103 +msgid "Bounce Keys" +msgstr "ਬਾਊਂਸ ਸਵਿੱਚਾਂ" + +#: ../js/ui/status/accessibility.js:106 +msgid "Mouse Keys" +msgstr "ਮਾਊਸ ਸਵਿੱਚਾਂ" + +#: ../js/ui/status/accessibility.js:110 +msgid "Universal Access Settings" +msgstr "ਯੂਨੀਵਰਸਲ ਅਸੈੱਸ ਸੈਟਿੰਗ" + +#: ../js/ui/status/accessibility.js:163 +msgid "High Contrast" +msgstr "ਵੱਧ ਕਨਟਰਾਸਟ" + +#: ../js/ui/status/accessibility.js:202 +msgid "Large Text" +msgstr "ਵੱਡੇ ਅੱਖਰ" + +#: ../js/ui/status/accessibility.js:223 +msgid "Zoom" +msgstr "ਜ਼ੂਮ" + #: ../js/ui/windowAttentionHandler.js:43 #, c-format msgid "%s has finished starting" @@ -447,40 +627,63 @@ msgstr "%s ਸ਼ੁਰੂ ਹੋਣਾ ਖਤਮ ਹੋਇਆ" msgid "'%s' is ready" msgstr "'%s' ਤਿਆਰ ਹੈ" -#: ../js/ui/workspacesView.js:230 +#: ../js/ui/workspacesView.js:229 msgid "Can't add a new workspace because maximum workspaces limit has been reached." msgstr "ਨਵਾਂ ਵਰਕਸਪੇਸ ਜੋੜਿਆ ਨਹੀਂ ਜਾ ਸਕਦਾ, ਕਿਉਂਕਿ ਵਰਕਸਪੇਸਾਂ ਦੀ ਵੱਧੋ-ਵੱਧ ਗਿਣਤੀ ਪੂਰੀ ਹੋ ਚੁੱਕੀ ਹੈ।" -#: ../js/ui/workspacesView.js:247 +#: ../js/ui/workspacesView.js:246 msgid "Can't remove the first workspace." msgstr "ਪਹਿਲਾਂ ਵਰਕਸਪੇਸ ਨਹੀਂ ਹਟਾਇਆ ਜਾ ਸਕਦਾ।" -#: ../src/shell-global.c:1196 +#. translators: +#. * The number of sound outputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1094 +#, c-format +msgid "%u Output" +msgid_plural "%u Outputs" +msgstr[0] "%u ਆਉਟਪੁੱਟ" +msgstr[1] "%u ਆਉਟਪੁੱਟ" + +#. translators: +#. * The number of sound inputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1104 +#, c-format +msgid "%u Input" +msgid_plural "%u Inputs" +msgstr[0] "%u ਇੰਪੁੱਟ" +msgstr[1] "%u ਇੰਪੁੱਟ" + +#: ../src/gvc/gvc-mixer-control.c:1402 +#| msgid "System Settings..." +msgid "System Sounds" +msgstr "ਸਿਸਟਮ ਸਾਊਂਡ" + +#: ../src/shell-global.c:1204 msgid "Less than a minute ago" msgstr "ਇੱਕ ਮਿੰਟ ਤੋਂ ਘੱਟ ਚਿਰ ਪਹਿਲਾਂ" -#: ../src/shell-global.c:1200 +#: ../src/shell-global.c:1208 #, c-format msgid "%d minute ago" msgid_plural "%d minutes ago" msgstr[0] "%d ਮਿੰਟ ਪਹਿਲਾਂ" msgstr[1] "%d ਮਿੰਟ ਪਹਿਲਾਂ" -#: ../src/shell-global.c:1205 +#: ../src/shell-global.c:1213 #, c-format msgid "%d hour ago" msgid_plural "%d hours ago" msgstr[0] "%d ਘੰਟਾ ਪਹਿਲਾਂ" msgstr[1] "%d ਘੰਟੇ ਪਹਿਲਾਂ" -#: ../src/shell-global.c:1210 +#: ../src/shell-global.c:1218 #, c-format msgid "%d day ago" msgid_plural "%d days ago" msgstr[0] "%d ਦਿਨ ਪਹਿਲਾਂ" msgstr[1] "%d ਦਿਨ ਪਹਿਲਾਂ" -#: ../src/shell-global.c:1215 +#: ../src/shell-global.c:1223 #, c-format msgid "%d week ago" msgid_plural "%d weeks ago" @@ -511,6 +714,9 @@ msgstr "ਖੋਜ" msgid "%1$s: %2$s" msgstr "%1$s: %2$s" +#~ msgid "Account Information..." +#~ msgstr "ਅਕਾਊਂਟ ਜਾਣਕਾਰੀ..." + #~ msgid "Sidebar" #~ msgstr "ਬਾਹੀ" From d2b968a7df5c7c565e125774f2cd2886fa4fbc9e Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 15 Jun 2010 12:11:39 -0400 Subject: [PATCH 05/85] St: add keyboard focus navigation support Add StWidget:can-focus, st_widget_navigate_focus(), and st_container_get_focus_chain(), and implement as needed to allow keyboard navigation of widgets. https://bugzilla.gnome.org/show_bug.cgi?id=621671 --- src/shell-generic-container.c | 22 +++ src/st/st-bin.c | 25 +++ src/st/st-container.c | 325 ++++++++++++++++++++++++++++++++++ src/st/st-container.h | 6 +- src/st/st-entry.c | 24 +++ src/st/st-overflow-box.c | 65 +++++-- src/st/st-widget.c | 155 +++++++++++++++- src/st/st-widget.h | 13 +- 8 files changed, 622 insertions(+), 13 deletions(-) diff --git a/src/shell-generic-container.c b/src/shell-generic-container.c index 5b439636c..e378d7211 100644 --- a/src/shell-generic-container.c +++ b/src/shell-generic-container.c @@ -162,6 +162,25 @@ shell_generic_container_pick (ClutterActor *actor, } } +static GList * +shell_generic_container_get_focus_chain (StContainer *container) +{ + ShellGenericContainer *self = SHELL_GENERIC_CONTAINER (container); + GList *children, *focus_chain; + + focus_chain = NULL; + for (children = st_container_get_children_list (container); children; children = children->next) + { + ClutterActor *child = children->data; + + if (CLUTTER_ACTOR_IS_VISIBLE (child) && + !shell_generic_container_get_skip_paint (self, child)) + focus_chain = g_list_prepend (focus_chain, child); + } + + return g_list_reverse (focus_chain); +} + /** * shell_generic_container_get_n_skip_paint: * @self: A #ShellGenericContainer @@ -231,6 +250,7 @@ shell_generic_container_class_init (ShellGenericContainerClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + StContainerClass *container_class = ST_CONTAINER_CLASS (klass); gobject_class->finalize = shell_generic_container_finalize; @@ -240,6 +260,8 @@ shell_generic_container_class_init (ShellGenericContainerClass *klass) actor_class->paint = shell_generic_container_paint; actor_class->pick = shell_generic_container_pick; + container_class->get_focus_chain = shell_generic_container_get_focus_chain; + shell_generic_container_signals[GET_PREFERRED_WIDTH] = g_signal_new ("get-preferred-width", G_TYPE_FROM_CLASS (klass), diff --git a/src/st/st-bin.c b/src/st/st-bin.c index 30392972c..d6223956c 100644 --- a/src/st/st-bin.c +++ b/src/st/st-bin.c @@ -226,6 +226,28 @@ st_bin_dispose (GObject *gobject) G_OBJECT_CLASS (st_bin_parent_class)->dispose (gobject); } +static gboolean +st_bin_navigate_focus (StWidget *widget, + ClutterActor *from, + GtkDirectionType direction) +{ + StBinPrivate *priv = ST_BIN (widget)->priv; + ClutterActor *bin_actor = CLUTTER_ACTOR (widget); + + if (st_widget_get_can_focus (widget)) + { + if (from && clutter_actor_contains (bin_actor, from)) + return FALSE; + + clutter_actor_grab_key_focus (bin_actor); + return TRUE; + } + else if (priv->child && ST_IS_WIDGET (priv->child)) + return st_widget_navigate_focus (ST_WIDGET (priv->child), from, direction, FALSE); + else + return FALSE; +} + static void st_bin_set_property (GObject *gobject, guint prop_id, @@ -309,6 +331,7 @@ st_bin_class_init (StBinClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + StWidgetClass *widget_class = ST_WIDGET_CLASS (klass); GParamSpec *pspec; g_type_class_add_private (klass, sizeof (StBinPrivate)); @@ -323,6 +346,8 @@ st_bin_class_init (StBinClass *klass) actor_class->paint = st_bin_paint; actor_class->pick = st_bin_pick; + widget_class->navigate_focus = st_bin_navigate_focus; + /** * StBin:child: * diff --git a/src/st/st-container.c b/src/st/st-container.c index 7a8dee2f0..2c828496f 100644 --- a/src/st/st-container.c +++ b/src/st/st-container.c @@ -28,6 +28,8 @@ #include "config.h" #endif +#include + #include "st-container.h" #define ST_CONTAINER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj),ST_TYPE_CONTAINER, StContainerPrivate)) @@ -178,6 +180,40 @@ st_container_get_children_list (StContainer *container) return container->priv->children; } +static GList * +st_container_real_get_focus_chain (StContainer *container) +{ + GList *chain, *children; + + chain = NULL; + for (children = container->priv->children; children; children = children->next) + { + ClutterActor *child = children->data; + + if (CLUTTER_ACTOR_IS_VISIBLE (child)) + chain = g_list_prepend (chain, child); + } + + return g_list_reverse (chain); +} + +/** + * st_container_get_focus_chain: + * @container: An #StContainer + * + * Gets a list of the focusable children of @container, in "Tab" + * order. By default, this returns all visible + * (as in CLUTTER_ACTOR_IS_VISIBLE()) children of @container. + * + * Returns: (element-type Clutter.Actor) (transfer container): + * @container's focusable children + */ +GList * +st_container_get_focus_chain (StContainer *container) +{ + return ST_CONTAINER_GET_CLASS (container)->get_focus_chain (container); +} + static gint sort_z_order (gconstpointer a, gconstpointer b) @@ -389,6 +425,289 @@ st_container_dispose (GObject *object) G_OBJECT_CLASS (st_container_parent_class)->dispose (object); } +/* filter @children to contain only only actors that overlap @rbox + * when moving in @direction. (Assuming no transformations.) + */ +static GList * +filter_by_position (GList *children, + ClutterActorBox *rbox, + GtkDirectionType direction) +{ + ClutterActorBox cbox; + GList *l, *ret; + ClutterActor *child; + + for (l = children, ret = NULL; l; l = l->next) + { + child = l->data; + clutter_actor_get_allocation_box (child, &cbox); + + /* Filter out children if they are in the wrong direction from + * @rbox, or if they don't overlap it. + */ + switch (direction) + { + case GTK_DIR_UP: + if (cbox.y2 > rbox->y1) + continue; + if (cbox.x1 >= rbox->x2 || cbox.x2 <= rbox->x1) + continue; + break; + + case GTK_DIR_DOWN: + if (cbox.y1 < rbox->y2) + continue; + if (cbox.x1 >= rbox->x2 || cbox.x2 <= rbox->x1) + continue; + break; + + case GTK_DIR_LEFT: + if (cbox.x2 > rbox->x1) + continue; + if (cbox.y1 >= rbox->y2 || cbox.y2 <= rbox->y1) + continue; + break; + + case GTK_DIR_RIGHT: + if (cbox.x1 < rbox->x2) + continue; + if (cbox.y1 >= rbox->y2 || cbox.y2 <= rbox->y1) + continue; + break; + + default: + g_return_val_if_reached (NULL); + } + + ret = g_list_prepend (ret, child); + } + + g_list_free (children); + return ret; +} + +typedef struct { + GtkDirectionType direction; + ClutterActorBox box; +} StContainerChildSortData; + +static int +sort_by_position (gconstpointer a, + gconstpointer b, + gpointer user_data) +{ + ClutterActor *actor_a = (ClutterActor *)a; + ClutterActor *actor_b = (ClutterActor *)b; + StContainerChildSortData *sort_data = user_data; + GtkDirectionType direction = sort_data->direction; + ClutterActorBox abox, bbox; + int ax, ay, bx, by; + int cmp, fmid; + + /* Determine the relationship, relative to motion in @direction, of + * the center points of the two actors. Eg, for %GTK_DIR_UP, we + * return a negative number if @actor_a's center is below @actor_b's + * center, and postive if vice versa, which will result in an + * overall list sorted bottom-to-top. + */ + + clutter_actor_get_allocation_box (actor_a, &abox); + ax = (int)(abox.x1 + abox.x2) / 2; + ay = (int)(abox.y1 + abox.y2) / 2; + clutter_actor_get_allocation_box (actor_b, &bbox); + bx = (int)(bbox.x1 + bbox.x2) / 2; + by = (int)(bbox.y1 + bbox.y2) / 2; + + switch (direction) + { + case GTK_DIR_UP: + cmp = by - ay; + break; + case GTK_DIR_DOWN: + cmp = ay - by; + break; + case GTK_DIR_LEFT: + cmp = bx - ax; + break; + case GTK_DIR_RIGHT: + cmp = ax - bx; + break; + default: + g_return_val_if_reached (0); + } + + if (cmp) + return cmp; + + /* If two actors have the same center on the axis being sorted, + * prefer the one that is closer to the center of the current focus + * actor on the other axis. Eg, for %GTK_DIR_UP, prefer whichever + * of @actor_a and @actor_b has a horizontal center closest to the + * current focus actor's horizontal center. + * + * (This matches GTK's behavior.) + */ + switch (direction) + { + case GTK_DIR_UP: + case GTK_DIR_DOWN: + fmid = (int)(sort_data->box.x1 + sort_data->box.x2) / 2; + return abs (ax - fmid) - abs (bx - fmid); + case GTK_DIR_LEFT: + case GTK_DIR_RIGHT: + fmid = (int)(sort_data->box.y1 + sort_data->box.y2) / 2; + return abs (ay - fmid) - abs (by - fmid); + default: + g_return_val_if_reached (0); + } +} + +static gboolean +st_container_navigate_focus (StWidget *widget, + ClutterActor *from, + GtkDirectionType direction) +{ + StContainer *container = ST_CONTAINER (widget); + ClutterActor *container_actor, *focus_child; + GList *children, *l; + + container_actor = CLUTTER_ACTOR (widget); + if (from == container_actor) + return FALSE; + + /* Figure out if @from is a descendant of @container, and if so, + * set @focus_child to the immediate child of @container that + * contains (or *is*) @from. + */ + focus_child = from; + while (focus_child && clutter_actor_get_parent (focus_child) != container_actor) + focus_child = clutter_actor_get_parent (focus_child); + + if (st_widget_get_can_focus (widget)) + { + if (!focus_child) + { + /* Accept focus from outside */ + clutter_actor_grab_key_focus (container_actor); + return TRUE; + } + else + { + /* Yield focus from within: since @container itself is + * focusable we don't allow the focus to be navigated + * within @container. + */ + return FALSE; + } + } + + /* See if we can navigate within @focus_child */ + if (focus_child && ST_IS_WIDGET (focus_child)) + { + if (st_widget_navigate_focus (ST_WIDGET (focus_child), from, direction, FALSE)) + return TRUE; + } + + /* At this point we know that we want to navigate focus to one of + * @container's immediate children; the next one after @focus_child, + * or the first one if @focus_child is %NULL. (With "next" and + * "first" being determined by @direction.) + */ + + children = st_container_get_focus_chain (container); + if (direction == GTK_DIR_TAB_FORWARD || + direction == GTK_DIR_TAB_BACKWARD) + { + if (direction == GTK_DIR_TAB_BACKWARD) + children = g_list_reverse (children); + + if (focus_child) + { + /* Remove focus_child and any earlier children */ + while (children && children->data != focus_child) + children = g_list_delete_link (children, children); + if (children) + children = g_list_delete_link (children, children); + } + } + else /* direction is an arrow key, not tab */ + { + StContainerChildSortData sort_data; + + /* Compute the allocation box of the previous focused actor, in + * @container's coordinate space. If there was no previous focus, + * use the coordinates of the appropriate edge of @container. + * + * Note that all of this code assumes the actors are not + * transformed (or at most, they are all scaled by the same + * amount). If @container or any of its children is rotated, or + * any child is inconsistently scaled, then the focus chain will + * probably be unpredictable. + */ + if (from) + { + if (from == focus_child) + clutter_actor_get_allocation_box (focus_child, &sort_data.box); + else + { + float cx, cy, fx, fy, fw, fh; + + clutter_actor_get_transformed_position (CLUTTER_ACTOR (container), &cx, &cy); + clutter_actor_get_transformed_position (from, &fx, &fy); + clutter_actor_get_transformed_size (from, &fw, &fh); + + sort_data.box.x1 = fx - cx; + sort_data.box.x2 = fx - cx + fw; + sort_data.box.y1 = fy - cy; + sort_data.box.y2 = fy - cy + fh; + } + } + else + { + clutter_actor_get_allocation_box (CLUTTER_ACTOR (container), &sort_data.box); + switch (direction) + { + case GTK_DIR_UP: + sort_data.box.y1 = sort_data.box.y2; + break; + case GTK_DIR_DOWN: + sort_data.box.y2 = sort_data.box.y1; + break; + case GTK_DIR_LEFT: + sort_data.box.x1 = sort_data.box.x2; + break; + case GTK_DIR_RIGHT: + sort_data.box.x2 = sort_data.box.x1; + break; + default: + g_warn_if_reached (); + } + } + sort_data.direction = direction; + + if (focus_child) + children = filter_by_position (children, &sort_data.box, direction); + if (children) + children = g_list_sort_with_data (children, sort_by_position, &sort_data); + } + + /* Now try each child in turn */ + for (l = children; l; l = l->next) + { + if (ST_IS_WIDGET (l->data)) + { + if (st_widget_navigate_focus (l->data, from, direction, FALSE)) + { + g_list_free (children); + return TRUE; + } + } + } + + g_list_free (children); + return FALSE; +} + static void clutter_container_iface_init (ClutterContainerIface *iface) { @@ -410,8 +729,14 @@ static void st_container_class_init (StContainerClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); + StWidgetClass *widget_class = ST_WIDGET_CLASS (klass); + StContainerClass *container_class = ST_CONTAINER_CLASS (klass); g_type_class_add_private (klass, sizeof (StContainerPrivate)); object_class->dispose = st_container_dispose; + + widget_class->navigate_focus = st_container_navigate_focus; + + container_class->get_focus_chain = st_container_real_get_focus_chain; } diff --git a/src/st/st-container.h b/src/st/st-container.h index ac9ef2c06..a19a742b7 100644 --- a/src/st/st-container.h +++ b/src/st/st-container.h @@ -50,6 +50,8 @@ struct _StContainer { struct _StContainerClass { StWidgetClass parent_class; + + GList * (*get_focus_chain) (StContainer *container); }; GType st_container_get_type (void) G_GNUC_CONST; @@ -57,11 +59,13 @@ GType st_container_get_type (void) G_GNUC_CONST; void st_container_remove_all (StContainer *container); void st_container_destroy_children (StContainer *container); +GList * st_container_get_focus_chain (StContainer *container); + /* Only to be used by subclasses of StContainer */ void st_container_move_child (StContainer *container, ClutterActor *actor, int pos); -GList *st_container_get_children_list (StContainer *container); +GList * st_container_get_children_list (StContainer *container); G_END_DECLS diff --git a/src/st/st-entry.c b/src/st/st-entry.c index ecb8ba783..b82da8afe 100644 --- a/src/st/st-entry.c +++ b/src/st/st-entry.c @@ -219,6 +219,29 @@ st_entry_style_changed (StWidget *self) ST_WIDGET_CLASS (st_entry_parent_class)->style_changed (self); } +static gboolean +st_entry_navigate_focus (StWidget *widget, + ClutterActor *from, + GtkDirectionType direction) +{ + StEntryPrivate *priv = ST_ENTRY_PRIV (widget); + + /* This is basically the same as st_widget_real_navigate_focus(), + * except that widget is behaving as a proxy for priv->entry (which + * isn't an StWidget and so has no can-focus flag of its own). + */ + + if (from == priv->entry) + return FALSE; + else if (st_widget_get_can_focus (widget)) + { + clutter_actor_grab_key_focus (priv->entry); + return TRUE; + } + else + return FALSE; +} + static void st_entry_get_preferred_width (ClutterActor *actor, gfloat for_height, @@ -632,6 +655,7 @@ st_entry_class_init (StEntryClass *klass) actor_class->leave_event = st_entry_leave_event; widget_class->style_changed = st_entry_style_changed; + widget_class->navigate_focus = st_entry_navigate_focus; pspec = g_param_spec_object ("clutter-text", "Clutter Text", diff --git a/src/st/st-overflow-box.c b/src/st/st-overflow-box.c index 6d40049c3..23e11534a 100644 --- a/src/st/st-overflow-box.c +++ b/src/st/st-overflow-box.c @@ -314,27 +314,36 @@ st_overflow_box_allocate (ClutterActor *actor, } static void -st_overflow_box_internal_paint (StOverflowBox *box) +visible_children_iter_init (StOverflowBox *box, + GList **iter, + int *n) +{ + *iter = st_container_get_children_list (ST_CONTAINER (box)); + *n = 0; +} + +static ClutterActor * +visible_children_iter (StOverflowBox *box, + GList **iter, + int *n) { StOverflowBoxPrivate *priv = box->priv; - GList *l, *children; - int i; + GList *l; - i = 0; - children = st_container_get_children_list (ST_CONTAINER (box)); - for (l = children; i < priv->n_visible && l; l = l->next) + for (l = *iter; *n < priv->n_visible && l; l = l->next) { ClutterActor *child = (ClutterActor*) l->data; if (!CLUTTER_ACTOR_IS_VISIBLE (child)) continue; if (!clutter_actor_get_fixed_position_set (child)) - i++; + (*n)++; - clutter_actor_paint (child); + *iter = l->next; + return child; } - for (;l; l = l->next) + for (; l; l = l->next) { ClutterActor *child = (ClutterActor*) l->data; @@ -342,8 +351,25 @@ st_overflow_box_internal_paint (StOverflowBox *box) continue; if (clutter_actor_get_fixed_position_set (child)) - clutter_actor_paint (child); + { + *iter = l->next; + return child; + } } + + return NULL; +} + +static void +st_overflow_box_internal_paint (StOverflowBox *box) +{ + ClutterActor *child; + GList *children; + int n; + + visible_children_iter_init (box, &children, &n); + while ((child = visible_children_iter (box, &children, &n))) + clutter_actor_paint (child); } static void @@ -379,12 +405,29 @@ st_overflow_box_style_changed (StWidget *self) ST_WIDGET_CLASS (st_overflow_box_parent_class)->style_changed (self); } +static GList * +st_overflow_box_get_focus_chain (StContainer *container) +{ + StOverflowBox *box = ST_OVERFLOW_BOX (container); + ClutterActor *child; + GList *children, *focus_chain; + int n; + + focus_chain = NULL; + visible_children_iter_init (box, &children, &n); + while ((child = visible_children_iter (box, &children, &n))) + focus_chain = g_list_prepend (focus_chain, child); + + return g_list_reverse (focus_chain); +} + static void st_overflow_box_class_init (StOverflowBoxClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); StWidgetClass *widget_class = ST_WIDGET_CLASS (klass); + StContainerClass *container_class = ST_CONTAINER_CLASS (klass); GParamSpec *pspec; g_type_class_add_private (klass, sizeof (StOverflowBoxPrivate)); @@ -400,6 +443,8 @@ st_overflow_box_class_init (StOverflowBoxClass *klass) widget_class->style_changed = st_overflow_box_style_changed; + container_class->get_focus_chain = st_overflow_box_get_focus_chain; + pspec = g_param_spec_uint ("min-children", "Min Children", "The actor will request a minimum size large enough to include this many children", diff --git a/src/st/st-widget.c b/src/st/st-widget.c index 48c7a3dde..32a5d2388 100644 --- a/src/st/st-widget.c +++ b/src/st/st-widget.c @@ -64,6 +64,7 @@ struct _StWidgetPrivate gboolean draw_border_internal : 1; gboolean track_hover : 1; gboolean hover : 1; + gboolean can_focus : 1; StTooltip *tooltip; @@ -93,7 +94,8 @@ enum PROP_HAS_TOOLTIP, PROP_TOOLTIP_TEXT, PROP_TRACK_HOVER, - PROP_HOVER + PROP_HOVER, + PROP_CAN_FOCUS }; enum @@ -113,6 +115,9 @@ G_DEFINE_ABSTRACT_TYPE (StWidget, st_widget, CLUTTER_TYPE_ACTOR); static void st_widget_recompute_style (StWidget *widget, StThemeNode *old_theme_node); +static gboolean st_widget_real_navigate_focus (StWidget *widget, + ClutterActor *from, + GtkDirectionType direction); static void st_widget_set_property (GObject *gobject, @@ -164,6 +169,10 @@ st_widget_set_property (GObject *gobject, st_widget_set_hover (actor, g_value_get_boolean (value)); break; + case PROP_CAN_FOCUS: + st_widget_set_can_focus (actor, g_value_get_boolean (value)); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); break; @@ -217,6 +226,10 @@ st_widget_get_property (GObject *gobject, g_value_set_boolean (value, priv->hover); break; + case PROP_CAN_FOCUS: + g_value_set_boolean (value, priv->can_focus); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); break; @@ -604,6 +617,22 @@ st_widget_leave (ClutterActor *actor, return FALSE; } +static void +st_widget_key_focus_in (ClutterActor *actor) +{ + StWidget *widget = ST_WIDGET (actor); + + st_widget_add_style_pseudo_class (widget, "focus"); +} + +static void +st_widget_key_focus_out (ClutterActor *actor) +{ + StWidget *widget = ST_WIDGET (actor); + + st_widget_remove_style_pseudo_class (widget, "focus"); +} + static void st_widget_hide (ClutterActor *actor) { @@ -642,9 +671,12 @@ st_widget_class_init (StWidgetClass *klass) actor_class->enter_event = st_widget_enter; actor_class->leave_event = st_widget_leave; + actor_class->key_focus_in = st_widget_key_focus_in; + actor_class->key_focus_out = st_widget_key_focus_out; actor_class->hide = st_widget_hide; klass->style_changed = st_widget_real_style_changed; + klass->navigate_focus = st_widget_real_navigate_focus; /** * StWidget:pseudo-class: @@ -777,6 +809,20 @@ st_widget_class_init (StWidgetClass *klass) PROP_HOVER, pspec); + /** + * StWidget:can-focus: + * + * Whether or not the widget can be focused via keyboard navigation. + */ + pspec = g_param_spec_boolean ("can-focus", + "Can focus", + "Whether the widget can be focused via keyboard navigation", + FALSE, + ST_PARAM_READWRITE); + g_object_class_install_property (gobject_class, + PROP_CAN_FOCUS, + pspec); + /** * StWidget::style-changed: * @@ -1624,6 +1670,113 @@ st_widget_get_hover (StWidget *widget) return widget->priv->hover; } +/** + * st_widget_set_can_focus: + * @widget: A #StWidget + * @can_focus: %TRUE if the widget can receive keyboard focus + * via keyboard navigation + * + * Marks @widget as being able to receive keyboard focus via + * keyboard navigation. + */ +void +st_widget_set_can_focus (StWidget *widget, + gboolean can_focus) +{ + StWidgetPrivate *priv; + + g_return_if_fail (ST_IS_WIDGET (widget)); + + priv = widget->priv; + + if (priv->can_focus != can_focus) + { + priv->can_focus = can_focus; + g_object_notify (G_OBJECT (widget), "can-focus"); + } +} + +/** + * st_widget_get_can_focus: + * @widget: A #StWidget + * + * Returns the current value of the can-focus property. See + * st_widget_set_can_focus() for more information. + * + * Returns: current value of can-focus on @widget + */ +gboolean +st_widget_get_can_focus (StWidget *widget) +{ + g_return_val_if_fail (ST_IS_WIDGET (widget), FALSE); + + return widget->priv->can_focus; +} + +static gboolean +st_widget_real_navigate_focus (StWidget *widget, + ClutterActor *from, + GtkDirectionType direction) +{ + if (widget->priv->can_focus && + CLUTTER_ACTOR (widget) != from) + { + clutter_actor_grab_key_focus (CLUTTER_ACTOR (widget)); + return TRUE; + } + return FALSE; +} + +/** + * st_widget_navigate_focus: + * @widget: the "top level" container + * @from: (allow-none): the actor that the focus is coming from + * @direction: the direction focus is moving in + * @wrap_around: whether focus should wrap around + * + * Tries to update the keyboard focus within @widget in response to a + * keyboard event. + * + * If @from is a descendant of @widget, this attempts to move the + * keyboard focus to the next descendant of @widget (in the order + * implied by @direction) that has the #StWidget:can-focus property + * set. If @from is %NULL, or outside of @widget, this attempts to + * focus either @widget itself, or its first descendant in the order + * implied by @direction. + * + * If a container type is marked #StWidget:can-focus, the expected + * behavior is that it will only take up a single slot on the focus + * chain as a whole, rather than allowing navigation between its child + * actors (or having a distinction between itself being focused and + * one of its children being focused). + * + * Some widget classes might have slightly different behavior from the + * above, where that would make more sense. + * + * If @wrap_around is %TRUE and @from is a child of @widget, but the + * widget has no further children that can accept the focus in the + * given direction, then st_widget_navigate_focus() will try a second + * time, using a %NULL @from, which should cause it to reset the focus + * to the first available widget in the given direction. + * + * Return value: %TRUE if clutter_actor_grab_key_focus() has been + * called on an actor. %FALSE if not. + */ +gboolean +st_widget_navigate_focus (StWidget *widget, + ClutterActor *from, + GtkDirectionType direction, + gboolean wrap_around) +{ + g_return_val_if_fail (ST_IS_WIDGET (widget), FALSE); + + if (ST_WIDGET_GET_CLASS (widget)->navigate_focus (widget, from, direction)) + return TRUE; + if (wrap_around && from && clutter_actor_contains (CLUTTER_ACTOR (widget), from)) + return ST_WIDGET_GET_CLASS (widget)->navigate_focus (widget, NULL, direction); + return FALSE; +} + static gboolean append_actor_text (GString *desc, ClutterActor *actor) diff --git a/src/st/st-widget.h b/src/st/st-widget.h index 2a65f8fff..3f0e87902 100644 --- a/src/st/st-widget.h +++ b/src/st/st-widget.h @@ -78,7 +78,10 @@ struct _StWidgetClass ClutterActorClass parent_class; /* vfuncs */ - void (* style_changed) (StWidget *self); + void (* style_changed) (StWidget *self); + gboolean (* navigate_focus) (StWidget *self, + ClutterActor *from, + GtkDirectionType direction); }; GType st_widget_get_type (void) G_GNUC_CONST; @@ -137,6 +140,14 @@ StTextDirection st_widget_get_direction (StWidget *self void st_widget_set_direction (StWidget *self, StTextDirection dir); +void st_widget_set_can_focus (StWidget *widget, + gboolean can_focus); +gboolean st_widget_get_can_focus (StWidget *widget); +gboolean st_widget_navigate_focus (StWidget *widget, + ClutterActor *from, + GtkDirectionType direction, + gboolean wrap_around); + /* Only to be used by sub-classes of StWidget */ void st_widget_style_changed (StWidget *widget); StThemeNode * st_widget_get_theme_node (StWidget *widget); From 5a83ef83252aa54e5b3230bcb7569a607a86c8bf Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 5 Oct 2010 10:09:40 -0400 Subject: [PATCH 06/85] St: add StFocusManager, to handle keyboard navigation StFocusManager allows setting up "focus groups" in which it will automatically handle navigation between can_focus widgets. https://bugzilla.gnome.org/show_bug.cgi?id=621671 --- src/Makefile-st.am | 2 + src/shell-global.c | 15 +++ src/st/st-focus-manager.c | 202 ++++++++++++++++++++++++++++++++++++++ src/st/st-focus-manager.h | 80 +++++++++++++++ 4 files changed, 299 insertions(+) create mode 100644 src/st/st-focus-manager.c create mode 100644 src/st/st-focus-manager.h diff --git a/src/Makefile-st.am b/src/Makefile-st.am index 74b023b75..0423da40a 100644 --- a/src/Makefile-st.am +++ b/src/Makefile-st.am @@ -77,6 +77,7 @@ st_source_h = \ st/st-container.h \ st/st-drawing-area.h \ st/st-entry.h \ + st/st-focus-manager.h \ st/st-group.h \ st/st-im-text.h \ st/st-label.h \ @@ -126,6 +127,7 @@ st_source_c = \ st/st-container.c \ st/st-drawing-area.c \ st/st-entry.c \ + st/st-focus-manager.c \ st/st-group.c \ st/st-im-text.c \ st/st-label.c \ diff --git a/src/shell-global.c b/src/shell-global.c index a1518b44a..40fa49008 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -7,6 +7,7 @@ #include "shell-perf-log.h" #include "shell-window-tracker.h" #include "shell-wm.h" +#include "st.h" #include "display.h" #include "util.h" @@ -58,6 +59,7 @@ struct _ShellGlobal { const char *datadir; const char *imagedir; const char *userdatadir; + StFocusManager *focus_manager; /* Displays the root window; see shell_global_create_root_pixmap_actor() */ ClutterActor *root_pixmap; @@ -89,6 +91,7 @@ enum { PROP_DATADIR, PROP_IMAGEDIR, PROP_USERDATADIR, + PROP_FOCUS_MANAGER, }; G_DEFINE_TYPE(ShellGlobal, shell_global, G_TYPE_OBJECT); @@ -172,6 +175,9 @@ shell_global_get_property(GObject *object, case PROP_USERDATADIR: g_value_set_string (value, global->userdatadir); break; + case PROP_FOCUS_MANAGER: + g_value_set_object (value, global->focus_manager); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -327,6 +333,13 @@ shell_global_class_init (ShellGlobalClass *klass) "Directory containing gnome-shell user data", NULL, G_PARAM_READABLE)); + g_object_class_install_property (gobject_class, + PROP_FOCUS_MANAGER, + g_param_spec_object ("focus-manager", + "Focus manager", + "The shell's StFocusManager", + ST_TYPE_FOCUS_MANAGER, + G_PARAM_READABLE)); } /** @@ -722,6 +735,8 @@ _shell_global_set_plugin (ShellGlobal *global, display = meta_screen_get_display (screen); g_signal_connect (display, "notify::focus-window", G_CALLBACK (focus_window_changed), global); + + global->focus_manager = st_focus_manager_get_for_stage (CLUTTER_STAGE (stage)); } void diff --git a/src/st/st-focus-manager.c b/src/st/st-focus-manager.c new file mode 100644 index 000000000..50cb0bdaa --- /dev/null +++ b/src/st/st-focus-manager.c @@ -0,0 +1,202 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-focus-manager.c: Keyboard focus manager + * + * Copyright (c) 2010 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU Lesser General Public License, + * version 2.1, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * SECTION:st-focus-manager + * @short_description: Keyboard focus management + * + * #StFocusManager handles keyboard focus for all actors on the stage. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include "st-focus-manager.h" + +#define ST_FOCUS_MANAGER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ST_TYPE_FOCUS_MANAGER, StFocusManagerPrivate)) + +struct _StFocusManagerPrivate +{ + GHashTable *groups; +}; + +G_DEFINE_TYPE (StFocusManager, st_focus_manager, G_TYPE_OBJECT) + +static void +st_focus_manager_dispose (GObject *object) +{ + StFocusManager *manager = ST_FOCUS_MANAGER (object); + + if (manager->priv->groups) + { + g_hash_table_destroy (manager->priv->groups); + manager->priv->groups = NULL; + } + + G_OBJECT_CLASS (st_focus_manager_parent_class)->dispose (object); +} + +static void +st_focus_manager_class_init (StFocusManagerClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (StFocusManagerPrivate)); + + object_class->dispose = st_focus_manager_dispose; +} + +static void +st_focus_manager_init (StFocusManager *manager) +{ + manager->priv = ST_FOCUS_MANAGER_GET_PRIVATE (manager); + manager->priv->groups = g_hash_table_new_full (NULL, NULL, + g_object_unref, NULL); +} + +static gboolean +st_focus_manager_stage_event (ClutterActor *stage, + ClutterEvent *event, + gpointer user_data) +{ + StFocusManager *manager = user_data; + GtkDirectionType direction; + gboolean wrap_around = FALSE; + ClutterActor *focused, *group; + + if (event->type != CLUTTER_KEY_PRESS) + return FALSE; + + switch (event->key.keyval) + { + case CLUTTER_KEY_Up: + direction = GTK_DIR_UP; + break; + case CLUTTER_KEY_Down: + direction = GTK_DIR_DOWN; + break; + case CLUTTER_KEY_Left: + direction = GTK_DIR_LEFT; + break; + case CLUTTER_KEY_Right: + direction = GTK_DIR_RIGHT; + break; + case CLUTTER_KEY_Tab: + if (event->key.modifier_state & CLUTTER_SHIFT_MASK) + direction = GTK_DIR_TAB_BACKWARD; + else + direction = GTK_DIR_TAB_FORWARD; + wrap_around = TRUE; + break; + case CLUTTER_KEY_ISO_Left_Tab: + direction = GTK_DIR_TAB_BACKWARD; + wrap_around = TRUE; + break; + + default: + return FALSE; + } + + focused = clutter_stage_get_key_focus (CLUTTER_STAGE (stage)); + if (!focused) + return FALSE; + + for (group = focused; group != stage; group = clutter_actor_get_parent (group)) + { + if (g_hash_table_lookup (manager->priv->groups, group)) + { + return st_widget_navigate_focus (ST_WIDGET (group), focused, + direction, wrap_around); + } + } + return FALSE; +} + +/** + * st_focus_manager_get_for_stage: + * @stage: a #ClutterStage + * + * Gets the #StFocusManager for @stage, creating it if necessary. + * + * Return value: (transfer none): the focus manager for @stage + */ +StFocusManager * +st_focus_manager_get_for_stage (ClutterStage *stage) +{ + StFocusManager *manager; + + manager = g_object_get_data (G_OBJECT (stage), "st-focus-manager"); + if (!manager) + { + manager = g_object_new (ST_TYPE_FOCUS_MANAGER, NULL); + g_object_set_data_full (G_OBJECT (stage), "st-focus-manager", + manager, g_object_unref); + + g_signal_connect (stage, "event", + G_CALLBACK (st_focus_manager_stage_event), manager); + } + + return manager; +} + +static void +remove_destroyed_group (ClutterActor *actor, + gpointer user_data) +{ + StFocusManager *manager = user_data; + + st_focus_manager_remove_group (manager, ST_WIDGET (actor)); +} + +/** + * st_focus_manager_add_group: + * @manager: the #StFocusManager + * @root: the root container of the group + * + * Adds a new focus group to @manager. When the focus is in an actor + * that is a descendant of @root, @manager will handle moving focus + * from one actor to another within @root based on keyboard events. + */ +void +st_focus_manager_add_group (StFocusManager *manager, + StWidget *root) +{ + g_signal_connect (root, "destroy", + G_CALLBACK (remove_destroyed_group), + manager); + g_hash_table_insert (manager->priv->groups, root, GINT_TO_POINTER (1)); +} + +/** + * st_focus_manager_remove_group: + * @manager: the #StFocusManager + * @root: the root container of the group + * + * Removes the group rooted at @root from @manager + */ +void +st_focus_manager_remove_group (StFocusManager *manager, + StWidget *root) +{ + g_hash_table_remove (manager->priv->groups, root); +} diff --git a/src/st/st-focus-manager.h b/src/st/st-focus-manager.h new file mode 100644 index 000000000..365cf970f --- /dev/null +++ b/src/st/st-focus-manager.h @@ -0,0 +1,80 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-focus-manager.h: Keyboard focus manager + * + * Copyright 2010 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU Lesser General Public License, + * version 2.1, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + * Boston, MA 02111-1307, USA. + */ + +#if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) +#error "Only can be included directly.h" +#endif + +#ifndef __ST_FOCUS_MANAGER_H__ +#define __ST_FOCUS_MANAGER_H__ + +#include +#include + +G_BEGIN_DECLS + +#define ST_TYPE_FOCUS_MANAGER (st_focus_manager_get_type ()) +#define ST_FOCUS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_FOCUS_MANAGER, StFocusManager)) +#define ST_IS_FOCUS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_FOCUS_MANAGER)) +#define ST_FOCUS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_FOCUS_MANAGER, StFocusManagerClass)) +#define ST_IS_FOCUS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_FOCUS_MANAGER)) +#define ST_FOCUS_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_FOCUS_MANAGER, StFocusManagerClass)) + +typedef struct _StFocusManager StFocusManager; +typedef struct _StFocusManagerPrivate StFocusManagerPrivate; +typedef struct _StFocusManagerClass StFocusManagerClass; + +/** + * StFocusManager: + * + * The #StFocusManager struct contains only private data + */ +struct _StFocusManager +{ + /*< private >*/ + GObject parent_instance; + + StFocusManagerPrivate *priv; +}; + +/** + * StFocusManagerClass: + * + * The #StFocusManagerClass struct contains only private data + */ +struct _StFocusManagerClass +{ + /*< private >*/ + GObjectClass parent_class; +}; + +GType st_focus_manager_get_type (void) G_GNUC_CONST; + +StFocusManager *st_focus_manager_get_for_stage (ClutterStage *stage); + +void st_focus_manager_add_group (StFocusManager *manager, + StWidget *root); +void st_focus_manager_remove_group (StFocusManager *manager, + StWidget *root); + +G_END_DECLS + +#endif /* __ST_FOCUS_MANAGER_H__ */ From 548a23a969714f146751a352f60718516d75ec79 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 7 Oct 2010 14:15:51 -0400 Subject: [PATCH 07/85] PopupMenu: redo keynav using St.FocusManager Each menu is a focus manager group, but there is also some explicit focus handling between non-hierarchically-related widgets. Eg, to move between menus, or from a menubutton into its menu. https://bugzilla.gnome.org/show_bug.cgi?id=621671 --- js/ui/appDisplay.js | 3 +- js/ui/panel.js | 5 +- js/ui/panelMenu.js | 24 +++++- js/ui/popupMenu.js | 194 +++++++++++++++++++++++--------------------- 4 files changed, 128 insertions(+), 98 deletions(-) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 55d07685e..8c3330e19 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -501,11 +501,10 @@ AppWellIcon.prototype = { } })); - this._menuManager.addMenu(this._menu, true); + this._menuManager.addMenu(this._menu); } this._menu.popup(); - this._menuManager.grab(); return false; }, diff --git a/js/ui/panel.js b/js/ui/panel.js index d683a1813..da1079c79 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -743,8 +743,9 @@ Panel.prototype = { /* Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview". */ let label = new St.Label({ text: _("Activities") }); this.button = new St.Clickable({ name: 'panelActivities', - style_class: 'panel-button', - reactive: true }); + style_class: 'panel-button', + reactive: true, + can_focus: true }); this.button.set_child(label); this._leftBox.add(this.button); diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js index 029e08e38..95c203baf 100644 --- a/js/ui/panelMenu.js +++ b/js/ui/panelMenu.js @@ -1,5 +1,6 @@ /* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */ +const Clutter = imports.gi.Clutter; const St = imports.gi.St; const Lang = imports.lang; const PopupMenu = imports.ui.popupMenu; @@ -13,11 +14,13 @@ Button.prototype = { _init: function(menuAlignment) { this.actor = new St.Bin({ style_class: 'panel-button', reactive: true, + can_focus: true, x_fill: true, y_fill: false, track_hover: true }); this.actor._delegate = this; this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress)); + this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPress)); this.menu = new PopupMenu.PopupMenu(this.actor, menuAlignment, St.Side.TOP, /* FIXME */ 0); this.menu.connect('open-state-changed', Lang.bind(this, this._onOpenStateChanged)); Main.chrome.addActor(this.menu.actor, { visibleInOverview: true, @@ -29,10 +32,27 @@ Button.prototype = { this.menu.toggle(); }, + _onKeyPress: function(actor, event) { + let symbol = event.get_key_symbol(); + if (symbol == Clutter.KEY_space || symbol == Clutter.KEY_Return) { + this.menu.toggle(); + return true; + } else if (symbol == Clutter.KEY_Down) { + if (!this.menu.isOpen) + this.menu.toggle(); + this.menu.activateFirst(); + return true; + } else + return false; + }, + _onOpenStateChanged: function(menu, open) { - if (open) + if (open) { this.actor.add_style_pseudo_class('pressed'); - else + let focus = global.stage.get_key_focus(); + if (!focus || (focus != this.actor && !menu.contains(focus))) + this.actor.grab_key_focus(); + } else this.actor.remove_style_pseudo_class('pressed'); } }; diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 56c7013c4..f572e1354 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -58,7 +58,8 @@ PopupBaseMenuItem.prototype = { hover: true }); this.actor = new Shell.GenericContainer({ style_class: 'popup-menu-item', reactive: params.reactive, - track_hover: params.reactive }); + track_hover: params.reactive, + can_focus: params.reactive }); this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth)); this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight)); this.actor.connect('allocate', Lang.bind(this, this._allocate)); @@ -72,19 +73,39 @@ PopupBaseMenuItem.prototype = { this.active = false; if (params.reactive && params.activate) { - this.actor.connect('button-release-event', Lang.bind(this, function (actor, event) { - this.emit('activate', event); - })); + this.actor.connect('button-release-event', Lang.bind(this, this._onButtonReleaseEvent)); + this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent)); } if (params.reactive && params.hover) - this.actor.connect('notify::hover', Lang.bind(this, this._hoverChanged)); + this.actor.connect('notify::hover', Lang.bind(this, this._onHoverChanged)); + if (params.reactive) + this.actor.connect('key-focus-in', Lang.bind(this, this._onKeyFocusIn)); }, _onStyleChanged: function (actor) { this._spacing = actor.get_theme_node().get_length('spacing'); }, - _hoverChanged: function (actor) { + _onButtonReleaseEvent: function (actor, event) { + this.emit('activate', event); + return true; + }, + + _onKeyPressEvent: function (actor, event) { + let symbol = event.get_key_symbol(); + + if (symbol == Clutter.KEY_space || symbol == Clutter.KEY_Return) { + this.emit('activate', event); + return true; + } + return false; + }, + + _onKeyFocusIn: function (actor) { + this.setActive(true); + }, + + _onHoverChanged: function (actor) { this.setActive(actor.hover); }, @@ -97,9 +118,10 @@ PopupBaseMenuItem.prototype = { if (activeChanged) { this.active = active; - if (active) + if (active) { this.actor.add_style_pseudo_class('active'); - else + this.actor.grab_key_focus(); + } else this.actor.remove_style_pseudo_class('active'); this.emit('active-changed', active); } @@ -110,10 +132,6 @@ PopupBaseMenuItem.prototype = { this.emit('destroy'); }, - handleKeyPress: function(event) { - return false; - }, - // true if non descendant content includes @actor contains: function(actor) { return false; @@ -337,6 +355,8 @@ PopupSliderMenuItem.prototype = { _init: function(value) { PopupBaseMenuItem.prototype._init.call(this, { activate: false }); + this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent)); + if (isNaN(value)) // Avoid spreading NaNs around throw TypeError('The slider value must be a number'); @@ -482,10 +502,10 @@ PopupSliderMenuItem.prototype = { return this._value; }, - handleKeyPress: function(event) { + _onKeyPressEvent: function (actor, event) { let key = event.get_key_symbol(); - if (key == Clutter.Right || key == Clutter.Left) { - let delta = key == Clutter.Right ? 0.1 : -0.1; + if (key == Clutter.KEY_Right || key == Clutter.KEY_Left) { + let delta = key == Clutter.KEY_Right ? 0.1 : -0.1; this._value = Math.max(0, Math.min(this._value + delta, 1)); this._slider.queue_repaint(); this.emit('value-changed', this._value); @@ -611,6 +631,14 @@ PopupMenu.prototype = { this._boxWrapper.add_actor(this._box); this.actor.add_style_class_name('popup-menu'); + global.focus_manager.add_group(this.actor); + + if (sourceActor._delegate instanceof PopupSubMenuMenuItem) { + this._isSubMenu = true; + this.actor.reactive = true; + this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent)); + } + this.isOpen = false; this._activeMenuItem = null; }, @@ -709,12 +737,10 @@ PopupMenu.prototype = { } }, - open: function(submenu) { + open: function() { if (this.isOpen) return; - this.emit('opening'); - let primary = global.get_primary_monitor(); // We need to show it now to force an allocation, @@ -730,7 +756,7 @@ PopupMenu.prototype = { let menuWidth = natWidth, menuHeight = natHeight; // Position the non-pointing axis - if (submenu) { + if (this._isSubmenu) { if (this._arrowSide == St.Side.TOP || this._arrowSide == St.Side.BOTTOM) { // vertical submenu if (sourceY + sourceHeigth + menuHeight + this._gap < primary.y + primary.height) @@ -763,8 +789,6 @@ PopupMenu.prototype = { if (!this.isOpen) return; - this.emit('closing'); - if (this._activeMenuItem) this._activeMenuItem.setActive(false); this.actor.reactive = false; @@ -773,7 +797,6 @@ PopupMenu.prototype = { this.emit('open-state-changed', false); }, - toggle: function() { if (this.isOpen) this.close(); @@ -781,35 +804,15 @@ PopupMenu.prototype = { this.open(); }, - handleKeyPress: function(event, submenu) { - if (!this.isOpen || (submenu && !this._activeMenuItem)) - return false; - if (this._activeMenuItem && this._activeMenuItem.handleKeyPress(event)) + _onKeyPressEvent: function(actor, event) { + // Move focus back to parent menu if the user types Left. + // (This handler is only connected if the PopupMenu is a + // submenu.) + if (this.isOpen && + this._activeMenuItem && + event.get_key_symbol() == Clutter.KEY_Left) { + this._activeMenuItem.setActive(false); return true; - switch (event.get_key_symbol()) { - case Clutter.space: - case Clutter.Return: - if (this._activeMenuItem) - this._activeMenuItem.activate(event); - return true; - case Clutter.Down: - case Clutter.Up: - let items = this._box.get_children().filter(function (child) { return child.visible && child.reactive; }); - let current = this._activeMenuItem ? this._activeMenuItem.actor : null; - let direction = event.get_key_symbol() == Clutter.Down ? 1 : -1; - - let next = findNextInCycle(items, current, direction); - if (next) { - next._delegate.setActive(true); - return true; - } - break; - case Clutter.Left: - if (submenu) { - this._activeMenuItem.setActive(false); - return true; - } - break; } return false; @@ -844,6 +847,7 @@ PopupSubMenuMenuItem.prototype = { _init: function(text) { PopupBaseMenuItem.prototype._init.call(this, { activate: false, hover: false }); this.actor.connect('enter-event', Lang.bind(this, this._mouseEnter)); + this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent)); this.label = new St.Label({ text: text }); this.addActor(this.label); @@ -888,7 +892,7 @@ PopupSubMenuMenuItem.prototype = { setActive: function(active) { if (this.menu) { if (active) - this.menu.open(true); + this.menu.open(); else this.menu.close(); } @@ -896,14 +900,14 @@ PopupSubMenuMenuItem.prototype = { PopupBaseMenuItem.prototype.setActive.call(this, active); }, - handleKeyPress: function(event) { + _onKeyPressEvent: function(actor, event) { if (!this.menu) return false; - if (event.get_key_symbol() == Clutter.Right) { + if (event.get_key_symbol() == Clutter.KEY_Right) { this.menu.activateFirst(); return true; } - return this.menu.handleKeyPress(event, true); + return false; }, contains: function(actor) { @@ -929,6 +933,7 @@ PopupMenuManager.prototype = { this.grabbed = false; this._eventCaptureId = 0; + this._keyPressEventId = 0; this._enterEventId = 0; this._leaveEventId = 0; this._activeMenu = null; @@ -936,21 +941,20 @@ PopupMenuManager.prototype = { this._delayedMenus = []; }, - addMenu: function(menu, noGrab, position) { + addMenu: function(menu, position) { let menudata = { menu: menu, openStateChangeId: menu.connect('open-state-changed', Lang.bind(this, this._onMenuOpenState)), activateId: menu.connect('activate', Lang.bind(this, this._onMenuActivated)), destroyId: menu.connect('destroy', Lang.bind(this, this._onMenuDestroy)), enterId: 0, - buttonPressId: 0 + focusId: 0 }; let source = menu.sourceActor; if (source) { - menudata.enterId = source.connect('enter-event', Lang.bind(this, this._onMenuSourceEnter, menu)); - if (!noGrab) - menudata.buttonPressId = source.connect('button-press-event', Lang.bind(this, this._onMenuSourcePress, menu)); + menudata.enterId = source.connect('enter-event', Lang.bind(this, function() { this._onMenuSourceEnter(menu); })); + menudata.focusId = source.connect('key-focus-in', Lang.bind(this, function() { this._onMenuSourceEnter(menu); })); } if (position == undefined) @@ -974,8 +978,8 @@ PopupMenuManager.prototype = { if (menudata.enterId) menu.sourceActor.disconnect(menudata.enterId); - if (menudata.buttonPressId) - menu.sourceActor.disconnect(menudata.buttonPressId); + if (menudata.focusId) + menu.sourceActor.disconnect(menudata.focusId); this._menus.splice(position, 1); }, @@ -984,6 +988,7 @@ PopupMenuManager.prototype = { Main.pushModal(this._owner.actor); this._eventCaptureId = global.stage.connect('captured-event', Lang.bind(this, this._onEventCapture)); + this._keyPressEventId = global.stage.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent)); // captured-event doesn't see enter/leave events this._enterEventId = global.stage.connect('enter-event', Lang.bind(this, this._onEventCapture)); this._leaveEventId = global.stage.connect('leave-event', Lang.bind(this, this._onEventCapture)); @@ -994,24 +999,30 @@ PopupMenuManager.prototype = { ungrab: function() { global.stage.disconnect(this._eventCaptureId); this._eventCaptureId = 0; + global.stage.disconnect(this._keyPressEventId); + this._keyPressEventId = 0; global.stage.disconnect(this._enterEventId); this._enterEventId = 0; global.stage.disconnect(this._leaveEventId); this._leaveEventId = 0; - Main.popModal(this._owner.actor); - this.grabbed = false; + Main.popModal(this._owner.actor); }, _onMenuOpenState: function(menu, open) { - if (!open && menu == this._activeMenu) - this._activeMenu = null; - else if (open) + if (open) { this._activeMenu = menu; + if (!this.grabbed) + this.grab(); + } else if (menu == this._activeMenu) { + this._activeMenu = null; + if (this.grabbed) + this.ungrab(); + } }, - _onMenuSourceEnter: function(actor, event, menu) { + _onMenuSourceEnter: function(menu) { if (!this.grabbed || menu == this._activeMenu) return false; @@ -1021,13 +1032,6 @@ PopupMenuManager.prototype = { return false; }, - _onMenuSourcePress: function(actor, event, menu) { - if (this.grabbed) - return false; - this.grab(); - return false; - }, - _onMenuActivated: function(menu, item) { if (this.grabbed) this.ungrab(); @@ -1084,23 +1088,6 @@ PopupMenuManager.prototype = { || (eventType == Clutter.EventType.KEY_PRESS && event.get_key_symbol() == Clutter.Escape)) { this._closeMenu(); return true; - } else if (eventType == Clutter.EventType.KEY_PRESS - && this._activeMenu != null - && this._activeMenu.handleKeyPress(event, false)) { - return true; - } else if (eventType == Clutter.EventType.KEY_PRESS - && this._activeMenu != null - && (event.get_key_symbol() == Clutter.Left - || event.get_key_symbol() == Clutter.Right)) { - let direction = event.get_key_symbol() == Clutter.Right ? 1 : -1; - let pos = this._findMenu(this._activeMenu); - let next = this._menus[mod(pos + direction, this._menus.length)].menu; - if (next != this._activeMenu) { - this._activeMenu.close(); - next.open(false); - next.activateFirst(); - } - return true; } else if (activeMenuContains || this._eventIsOnAnyMenuSource(event)) { return false; } @@ -1108,9 +1095,32 @@ PopupMenuManager.prototype = { return true; }, + _onKeyPressEvent: function(actor, event) { + if (!this.grabbed || !this._activeMenu) + return false; + if (!this._eventIsOnActiveMenu(event)) + return false; + + let symbol = event.get_key_symbol(); + if (symbol == Clutter.Left || symbol == Clutter.Right) { + let direction = symbol == Clutter.Right ? 1 : -1; + let pos = this._findMenu(this._activeMenu); + let next = this._menus[mod(pos + direction, this._menus.length)].menu; + if (next != this._activeMenu) { + let oldMenu = this._activeMenu; + this._activeMenu = next; + oldMenu.close(); + next.open(); + next.activateFirst(); + } + return true; + } + + return false; + }, + _closeMenu: function() { if (this._activeMenu != null) this._activeMenu.close(); - this.ungrab(); } }; From 08f7ecad359c80839ac060f0e67ccb12a75816c3 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Thu, 28 Oct 2010 22:25:33 +0200 Subject: [PATCH 08/85] Don't remove the tray icons we don't add Tray icons replaced by a shell version are automatically filtered and never make to the tray container, but when removed by the client we were still trying to remove them from the tray, causing a warning. https://bugzilla.gnome.org/show_bug.cgi?id=633028 --- js/ui/panel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui/panel.js b/js/ui/panel.js index da1079c79..eb1e4a378 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -903,7 +903,8 @@ Panel.prototype = { }, _onTrayIconRemoved: function(o, icon) { - this._trayBox.remove_actor(icon); + if (icon.get_parent() != null) + this._trayBox.remove_actor(icon); }, _addRipple : function(delay, time, startScale, startOpacity, finalScale, finalOpacity) { From a19e8d58f5d30f82f97a79ffe007143a627ac3e5 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Thu, 28 Oct 2010 22:28:17 +0200 Subject: [PATCH 09/85] Do not remove destroyed actors from their container The container already connects to destroy and will do that for us, preventing a warning. https://bugzilla.gnome.org/show_bug.cgi?id=633028 --- js/ui/popupMenu.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index f572e1354..51b2989d8 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -155,20 +155,24 @@ PopupBaseMenuItem.prototype = { this._children.push({ actor: child, column: column, span: span }); - this.actor.connect('destroy', Lang.bind(this, function () { this.removeActor(child); })); + this.actor.connect('destroy', Lang.bind(this, function () { this._removeChild(child); })); this.actor.add_actor(child); }, - removeActor: function(child) { + _removeChild: function(child) { for (let i = 0; i < this._children.length; i++) { if (this._children[i].actor == child) { this._children.splice(i, 1); - this.actor.remove_actor(child); return; } } }, + removeActor: function(child) { + this.actor.remove_actor(child); + this._removeChild(child); + }, + setShowDot: function(show) { if (show) { if (this._dot) From f21403fd9f7f6a70484d8b938545f0741707544a Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 29 Oct 2010 14:54:53 -0400 Subject: [PATCH 10/85] pushModal: clear focus after pushing a new level This way the new modal level is independent of whatever may have been happening before. Fixes a problem with status menus becoming active again from inside the app switcher, etc. --- js/ui/main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/ui/main.js b/js/ui/main.js index 8e46209e6..5177df6ec 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -390,6 +390,7 @@ function pushModal(actor) { } modalActorFocusStack.push([actor, curFocus]); + global.stage.set_key_focus(null); return true; } From 8f307c858cc2eee22c4bd4e4dc5ad34f6e2d2a04 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sat, 30 Oct 2010 13:33:43 +0200 Subject: [PATCH 11/85] Updated Arabic translation --- po/ar.po | 530 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 466 insertions(+), 64 deletions(-) diff --git a/po/ar.po b/po/ar.po index 0069243d0..f981ba16f 100644 --- a/po/ar.po +++ b/po/ar.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: HEAD\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-15 23:40+0300\n" -"PO-Revision-Date: 2010-05-15 23:40+0300\n" +"POT-Creation-Date: 2010-10-30 13:30+0200\n" +"PO-Revision-Date: 2010-10-30 13:30+0300\n" "Last-Translator: Khaled Hosny \n" "Language-Team: Arabic \n" "MIME-Version: 1.0\n" @@ -16,7 +16,7 @@ msgstr "" "Language: ar\n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " "&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" -"X-Generator: Virtaal 0.6.0\n" +"X-Generator: Virtaal 0.6.1\n" #: ../data/gnome-shell.desktop.in.in.h:1 msgid "GNOME Shell" @@ -34,32 +34,332 @@ msgstr "الساعة" msgid "Customize the panel clock" msgstr "طوّع ساعة اللوحة" +#: ../data/org.gnome.shell.gschema.xml.in.h:1 +msgid "" +"Allows access to internal debugging and monitoring tools using the Alt-F2 " +"dialog." +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:2 +msgid "Custom format of the clock" +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:3 +msgid "Enable internal tools useful for developers and testers from Alt-F2" +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:4 +msgid "File extension used for storing the screencast" +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:5 +msgid "Framerate used for recording screencasts." +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:6 +msgid "" +"GNOME Shell extensions have a uuid property; this key lists extensions which " +"should not be loaded." +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:7 +msgid "History for command (Alt-F2) dialog" +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:8 +msgid "Hour format" +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:9 +msgid "" +"If true and format is either \"12-hour\" or \"24-hour\", display date in the " +"clock, in addition to time." +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:10 +msgid "" +"If true and format is either \"12-hour\" or \"24-hour\", display seconds in " +"time." +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:11 +msgid "If true, display the ISO week date in the calendar." +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:12 +msgid "List of desktop file IDs for favorite applications" +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:13 +msgid "Overview workspace view mode" +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:14 +msgid "" +"Sets the GStreamer pipeline used to encode recordings. It follows the syntax " +"used for gst-launch. The pipeline should have an unconnected sink pad where " +"the recorded video is recorded. It will normally have a unconnected source " +"pad; output from that pad will be written into the output file. However the " +"pipeline can also take care of its own output - this might be used to send " +"the output to an icecast server via shout2send or similar. When unset or set " +"to an empty value, the default pipeline will be used. This is currently " +"'videorate ! theoraenc ! oggmux' and records to Ogg Theora." +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:15 +msgid "Show date in clock" +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:16 +msgid "Show the week date in the calendar" +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:17 +msgid "Show time with seconds" +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:18 +msgid "" +"The applications corresponding to these identifiers will be displayed in the " +"favorites area." +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:19 +msgid "" +"The filename for recorded screencasts will be a unique filename based on the " +"current date, and use this extension. It should be changed when recording to " +"a different container format." +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:20 +msgid "" +"The framerate of the resulting screencast recordered by GNOME Shell's " +"screencast recorder in frames-per-second." +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:21 +msgid "The gstreamer pipeline used to encode the screencast" +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:22 +msgid "" +"The selected workspace view mode in the overview. Supported values are " +"\"single\" and \"grid\"." +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:23 +msgid "" +"The shell normally monitors active applications in order to present the most " +"used ones (e.g. in launchers). While this data will be kept private, you may " +"want to disable this for privacy reasons. Please note that doing so won't " +"remove already saved data." +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:24 +msgid "" +"This key specifies the format used by the panel clock when the format key is " +"set to \"custom\". You can use conversion specifiers understood by strftime" +"() to obtain a specific format. See the strftime() manual for more " +"information." +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:25 +msgid "" +"This key specifies the hour format used by the panel clock. Possible values " +"are \"12-hour\", \"24-hour\", \"unix\" and \"custom\". If set to \"unix\", " +"the clock will display time in seconds since Epoch, i.e. 1970-01-01. If set " +"to \"custom\", the clock will display time according to the format specified " +"in the custom_format key. Note that if set to either \"unix\" or \"custom\", " +"the show_date and show_seconds keys are ignored." +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:26 +msgid "Uuids of extensions to disable" +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:27 +msgid "Whether to collect stats about applications usage" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:1 +msgid "Clip the crosshairs at the center" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:2 +msgid "Color of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:3 +msgid "" +"Determines the length of the vertical and horizontal lines that make up the " +"crosshairs." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:4 +msgid "" +"Determines the position of the magnified mouse image within the magnified " +"view and how it reacts to system mouse movement. The values are - none: no " +"mouse tracking; - centered: the mouse image is displayed at the center of " +"the zoom region (which also represents the point under the system mouse) and " +"the magnified contents are scrolled as the system mouse moves; - " +"proportional: the position of the magnified mouse in the zoom region is " +"proportionally the same as the position of the system mouse on screen; - " +"push: when the magnified mouse intersects a boundary of the zoom region, the " +"contents are scrolled into view." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:5 +msgid "" +"Determines the transparency of the crosshairs, from fully opaque to fully " +"transparent." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:6 +msgid "" +"Determines whether the crosshairs intersect the magnified mouse sprite, or " +"are clipped such that the ends of the horizontal and vertical lines surround " +"the mouse image." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:7 +msgid "Enable lens mode" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:8 +msgid "" +"Enables/disables display of crosshairs centered on the magnified mouse " +"sprite." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:9 +msgid "" +"For centered mouse tracking, when the system pointer is at or near the edge " +"of the screen, the magnified contents continue to scroll such that the " +"screen edge moves into the magnified view." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:10 +msgid "Length of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:11 +msgid "Magnification factor" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:12 +msgid "Mouse Tracking Mode" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:13 +msgid "Opacity of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:14 +msgid "Screen position" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:15 +msgid "Scroll magnified contents beyond the edges of the desktop" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:16 +msgid "Show or hide crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:17 +msgid "Show or hide the magnifier" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:18 +msgid "Show or hide the magnifier and all of its zoom regions." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:19 +msgid "" +"The color of the the vertical and horizontal lines that make up the " +"crosshairs." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:20 +msgid "" +"The magnified view either fills the entire screen, or occupies the top-half, " +"bottom-half, left-half, or right-half of the screen." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:21 +msgid "" +"The power of the magnification. A value of 1.0 means no magnification. A " +"value of 2.0 doubles the size." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:22 +msgid "Thickness of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:23 +msgid "" +"Whether the magnified view should be centered over the location of the " +"system mouse and move with it." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:24 +msgid "Width of the vertical and horizontal lines that make up the crosshairs." +msgstr "" + +#: ../data/clock-preferences.ui.h:1 +msgid "Clock Format" +msgstr "تنسيق الساعة" + +#: ../data/clock-preferences.ui.h:2 +msgid "Clock Preferences" +msgstr "تفضيلات الساعة" + +#: ../data/clock-preferences.ui.h:3 +msgid "Panel Display" +msgstr "عرض اللوحة" + +#: ../data/clock-preferences.ui.h:4 +msgid "Show seco_nds" +msgstr "أظهر ال_ثواني" + +#: ../data/clock-preferences.ui.h:5 +msgid "Show the _date" +msgstr "أظهر ال_تاريخ" + +#: ../data/clock-preferences.ui.h:6 +msgid "_12 hour format" +msgstr "نسق _12 ساعة" + +#: ../data/clock-preferences.ui.h:7 +msgid "_24 hour format" +msgstr "نسق _24 ساعة" + #. **** Applications **** -#: ../js/ui/appDisplay.js:306 ../js/ui/dash.js:850 +#: ../js/ui/appDisplay.js:316 ../js/ui/dash.js:778 msgid "APPLICATIONS" msgstr "التطبيقات" -#: ../js/ui/appDisplay.js:338 +#: ../js/ui/appDisplay.js:348 msgid "PREFERENCES" msgstr "التفضيلات" -#: ../js/ui/appDisplay.js:705 +#: ../js/ui/appDisplay.js:647 msgid "New Window" msgstr "نافذة جديدة" -#: ../js/ui/appDisplay.js:709 +#: ../js/ui/appDisplay.js:651 msgid "Remove from Favorites" msgstr "أزِل من المفضّلة" -#: ../js/ui/appDisplay.js:710 +#: ../js/ui/appDisplay.js:652 msgid "Add to Favorites" msgstr "أضِف إلى المفضّلة" -#: ../js/ui/appDisplay.js:1037 +#: ../js/ui/appDisplay.js:829 msgid "Drag here to add favorites" msgstr "اسحب إلى هنا ليضاف إلى المفضّلة" -#: ../js/ui/appFavorites.js:89 +#: ../js/ui/appFavorites.js:88 #, c-format msgid "%s has been added to your favorites." msgstr "أضيف %s إلى مفضلتك." @@ -69,194 +369,293 @@ msgstr "أضيف %s إلى مفضلتك." msgid "%s has been removed from your favorites." msgstr "أزيل %s من مفضّلتك." -#: ../js/ui/dash.js:189 +#: ../js/ui/dash.js:142 msgid "Find" msgstr "ابحث" -#: ../js/ui/dash.js:505 +#: ../js/ui/dash.js:473 msgid "Searching..." msgstr "يبحث..." -#: ../js/ui/dash.js:519 +#: ../js/ui/dash.js:487 msgid "No matching results." msgstr "لا نتائج مطابقة." #. **** Places **** #. Translators: This is in the sense of locations for documents, #. network locations, etc. -#: ../js/ui/dash.js:869 ../js/ui/placeDisplay.js:543 +#: ../js/ui/dash.js:797 ../js/ui/placeDisplay.js:554 msgid "PLACES & DEVICES" msgstr "الأماكن والأجهزة" #. **** Documents **** -#: ../js/ui/dash.js:876 ../js/ui/docDisplay.js:489 +#: ../js/ui/dash.js:804 ../js/ui/docDisplay.js:494 msgid "RECENT ITEMS" msgstr "العناصر الحديثة" -#: ../js/ui/lookingGlass.js:354 +#: ../js/ui/lookingGlass.js:552 msgid "No extensions installed" msgstr "لم تثبّت أية امتدادات" -#: ../js/ui/lookingGlass.js:391 +#: ../js/ui/lookingGlass.js:589 msgid "Enabled" msgstr "مفعّل" -#: ../js/ui/lookingGlass.js:393 +#. translators: +#. * The device has been disabled +#: ../js/ui/lookingGlass.js:591 ../src/gvc/gvc-mixer-control.c:1087 msgid "Disabled" msgstr "معطّل" -#: ../js/ui/lookingGlass.js:395 +#: ../js/ui/lookingGlass.js:593 msgid "Error" msgstr "خطأ" -#: ../js/ui/lookingGlass.js:397 +#: ../js/ui/lookingGlass.js:595 msgid "Out of date" msgstr "غير محدث" -#: ../js/ui/lookingGlass.js:422 +#: ../js/ui/lookingGlass.js:620 msgid "View Source" msgstr "اعرض المصدر" -#: ../js/ui/lookingGlass.js:428 +#: ../js/ui/lookingGlass.js:626 msgid "Web Page" msgstr "صفحة الوب" -#: ../js/ui/overview.js:161 +#: ../js/ui/overview.js:160 msgid "Undo" msgstr "تراجع" -#: ../js/ui/panel.js:535 -msgid "Quit" -msgstr "أنهِ" +#. TODO - _quit() doesn't really work on apps in state STARTING yet +#: ../js/ui/panel.js:469 +#, c-format +msgid "Quit %s" +msgstr "أغلق %s" -#. Button on the left side of the panel. -#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview". -#: ../js/ui/panel.js:740 -msgid "Activities" -msgstr "الأنشطة" +#: ../js/ui/panel.js:494 +msgid "Preferences" +msgstr "التفضيلات" #. Translators: This is the time format with date used #. in 24-hour mode. -#: ../js/ui/panel.js:955 +#: ../js/ui/panel.js:580 msgid "%a %b %e, %R:%S" msgstr "%A %e %B، %R:%S" -#: ../js/ui/panel.js:956 +#: ../js/ui/panel.js:581 msgid "%a %b %e, %R" msgstr "%A %e %B، %R" #. Translators: This is the time format without date used #. in 24-hour mode. -#: ../js/ui/panel.js:960 +#: ../js/ui/panel.js:585 msgid "%a %R:%S" msgstr "%A %R:%S" -#: ../js/ui/panel.js:961 +#: ../js/ui/panel.js:586 msgid "%a %R" msgstr "%A %R" #. Translators: This is a time format with date used #. for AM/PM. -#: ../js/ui/panel.js:968 +#: ../js/ui/panel.js:593 msgid "%a %b %e, %l:%M:%S %p" msgstr "%A %e %B، %l:%M:%S %p" -#: ../js/ui/panel.js:969 +#: ../js/ui/panel.js:594 msgid "%a %b %e, %l:%M %p" msgstr "%A %e %B، %l:%M %p" #. Translators: This is a time format without date used #. for AM/PM. -#: ../js/ui/panel.js:973 +#: ../js/ui/panel.js:598 msgid "%a %l:%M:%S %p" msgstr "%A %l:%M:%S %p" -#: ../js/ui/panel.js:974 +#: ../js/ui/panel.js:599 msgid "%a %l:%M %p" msgstr "%A %Ol:%OM %p" -#: ../js/ui/placeDisplay.js:108 +#. Button on the left side of the panel. +#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview". +#: ../js/ui/panel.js:744 +msgid "Activities" +msgstr "الأنشطة" + +#: ../js/ui/placeDisplay.js:111 #, c-format msgid "Failed to unmount '%s'" msgstr "فشل فصْل '%s'" -#: ../js/ui/placeDisplay.js:111 +#: ../js/ui/placeDisplay.js:114 msgid "Retry" msgstr "أعد المحاولة" -#: ../js/ui/placeDisplay.js:156 +#: ../js/ui/placeDisplay.js:159 msgid "Connect to..." msgstr "اتّصل ب‍..." -#: ../js/ui/runDialog.js:231 +#. Translators: this MUST be either "toggle-switch-us" +#. (for toggle switches containing the English words +#. "ON" and "OFF") or "toggle-switch-intl" (for toggle +#. switches containing "◯" and "|"). Other values will +#. simply result in invisible toggle switches. +#: ../js/ui/popupMenu.js:33 +msgid "toggle-switch-us" +msgstr "" + +#: ../js/ui/runDialog.js:233 msgid "Please enter a command:" msgstr "من فضلك اكتب أمرا:" -#: ../js/ui/runDialog.js:375 +#: ../js/ui/runDialog.js:378 #, c-format msgid "Execution of '%s' failed:" msgstr "فشل تنفيذ '%s':‏" -#: ../js/ui/statusMenu.js:90 +#: ../js/ui/statusMenu.js:101 msgid "Available" msgstr "متاح" -#: ../js/ui/statusMenu.js:94 +#: ../js/ui/statusMenu.js:106 msgid "Busy" msgstr "مشغول" -#: ../js/ui/statusMenu.js:98 +#: ../js/ui/statusMenu.js:111 msgid "Invisible" msgstr "خفي" -#: ../js/ui/statusMenu.js:105 -msgid "Account Information..." -msgstr "معلومات الحساب..." +#: ../js/ui/statusMenu.js:119 +msgid "My Account..." +msgstr "حسابي..." -#: ../js/ui/statusMenu.js:109 +#: ../js/ui/statusMenu.js:123 msgid "System Preferences..." msgstr "تفضيلات النظام..." -#: ../js/ui/statusMenu.js:116 +#: ../js/ui/statusMenu.js:130 msgid "Lock Screen" msgstr "أوصد الشاشة" -#: ../js/ui/statusMenu.js:120 +#: ../js/ui/statusMenu.js:134 msgid "Switch User" msgstr "بدّل المستخدم" -#: ../js/ui/statusMenu.js:125 +#: ../js/ui/statusMenu.js:139 msgid "Log Out..." msgstr "اخرج..." -#: ../js/ui/statusMenu.js:129 +#: ../js/ui/statusMenu.js:146 +msgid "Suspend" +msgstr "علّق" + +#: ../js/ui/statusMenu.js:150 +msgid "Restart..." +msgstr "أعد التشغيل..." + +#: ../js/ui/statusMenu.js:154 msgid "Shut Down..." msgstr "أطفئ..." -#: ../js/ui/windowAttentionHandler.js:47 +#: ../js/ui/status/accessibility.js:88 +msgid "Screen Reader" +msgstr "قارئ الشاشة" + +#: ../js/ui/status/accessibility.js:91 +msgid "Screen Keyboard" +msgstr "لوحة مفاتيح على الشاشة" + +#: ../js/ui/status/accessibility.js:94 +msgid "Visual Alerts" +msgstr "تنبيهات بصرية" + +#: ../js/ui/status/accessibility.js:97 +msgid "Sticky Keys" +msgstr "مفاتيح لاصقة" + +#: ../js/ui/status/accessibility.js:100 +msgid "Slow Keys" +msgstr "مفاتيح بطيئة" + +#: ../js/ui/status/accessibility.js:103 +msgid "Bounce Keys" +msgstr "مفاتيح لها صوت" + +#: ../js/ui/status/accessibility.js:106 +msgid "Mouse Keys" +msgstr "مفاتيح الفأرة" + +#: ../js/ui/status/accessibility.js:110 +msgid "Universal Access Settings" +msgstr "إعدادات الإتاحة" + +#: ../js/ui/status/accessibility.js:163 +msgid "High Contrast" +msgstr "تباين عال" + +#: ../js/ui/status/accessibility.js:202 +msgid "Large Text" +msgstr "نص كبير" + +#: ../js/ui/status/accessibility.js:223 +msgid "Zoom" +msgstr "تقريب" + +#: ../js/ui/windowAttentionHandler.js:43 #, c-format msgid "%s has finished starting" msgstr "انتهى %s من البدء" -#: ../js/ui/windowAttentionHandler.js:49 +#: ../js/ui/windowAttentionHandler.js:45 #, c-format msgid "'%s' is ready" msgstr "‏'%s' جاهز" -#: ../js/ui/workspacesView.js:239 +#: ../js/ui/workspacesView.js:229 msgid "" "Can't add a new workspace because maximum workspaces limit has been reached." msgstr "تعذّر إضافة مساحة عمل جديدة، لتجاوز أقصى عدد من مساحات العمل." -#: ../js/ui/workspacesView.js:256 +#: ../js/ui/workspacesView.js:246 msgid "Can't remove the first workspace." msgstr "لا يمكن حذف مساحة العمل الأولى." -#: ../src/shell-global.c:979 +#. translators: +#. * The number of sound outputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1094 +#, c-format +msgid "%u Output" +msgid_plural "%u Outputs" +msgstr[0] "لا مخرَج" +msgstr[1] "مخرَج واحد" +msgstr[2] "مخرَجين" +msgstr[3] "%u مخارج" +msgstr[4] "%u مخرجا" +msgstr[5] "%u مخرج" + +#. translators: +#. * The number of sound inputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1104 +#, c-format +msgid "%u Input" +msgid_plural "%u Inputs" +msgstr[0] "لا مدخل" +msgstr[1] "مدخل واحد" +msgstr[2] "مدخلين" +msgstr[3] "%u مداخل" +msgstr[4] "%u مدخلا" +msgstr[5] "%u مدخل" + +#: ../src/gvc/gvc-mixer-control.c:1402 +msgid "System Sounds" +msgstr "أصوات النظام" + +#: ../src/shell-global.c:1219 msgid "Less than a minute ago" msgstr "منذ أقل من دقيقة" -#: ../src/shell-global.c:983 +#: ../src/shell-global.c:1223 #, c-format msgid "%d minute ago" msgid_plural "%d minutes ago" @@ -267,7 +666,7 @@ msgstr[3] "منذ %d دقائق" msgstr[4] "منذ %d دقيقة" msgstr[5] "منذ %d دقيقة" -#: ../src/shell-global.c:988 +#: ../src/shell-global.c:1228 #, c-format msgid "%d hour ago" msgid_plural "%d hours ago" @@ -278,7 +677,7 @@ msgstr[3] "منذ %d ساعات" msgstr[4] "منذ %d ساعة" msgstr[5] "منذ %d ساعة" -#: ../src/shell-global.c:993 +#: ../src/shell-global.c:1233 #, c-format msgid "%d day ago" msgid_plural "%d days ago" @@ -289,7 +688,7 @@ msgstr[3] "منذ %d أيام" msgstr[4] "منذ %d يوما" msgstr[5] "منذ %d يوم" -#: ../src/shell-global.c:998 +#: ../src/shell-global.c:1238 #, c-format msgid "%d week ago" msgid_plural "%d weeks ago" @@ -324,6 +723,9 @@ msgstr "ابحث" msgid "%1$s: %2$s" msgstr "‏%1$s:‏ %2$s" +#~ msgid "Account Information..." +#~ msgstr "معلومات الحساب..." + #~ msgid "%H:%M" #~ msgstr "%OH:%OM" From d5f1cd667b29c8d4d4bcf9841909c945634fc9e8 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Sat, 30 Oct 2010 13:43:23 -0400 Subject: [PATCH 12/85] Use System Settings instead of Preferences in the user menu (again) This matches the terminology used in the result of the action. also see commit 4a316fbc66467304ec45641d6a8a4d109216f3b6 --- js/ui/statusMenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ui/statusMenu.js b/js/ui/statusMenu.js index 5d12567e4..3f2029cf8 100644 --- a/js/ui/statusMenu.js +++ b/js/ui/statusMenu.js @@ -120,7 +120,7 @@ StatusMenuButton.prototype = { item.connect('activate', Lang.bind(this, this._onMyAccountActivate)); this.menu.addMenuItem(item); - item = new PopupMenu.PopupMenuItem(_("System Preferences...")); + item = new PopupMenu.PopupMenuItem(_("System Settings...")); item.connect('activate', Lang.bind(this, this._onPreferencesActivate)); this.menu.addMenuItem(item); From 3640a4dd1ebb786831b77789a0650436506d061c Mon Sep 17 00:00:00 2001 From: Hellyna Ng Date: Sun, 31 Oct 2010 03:54:43 +0800 Subject: [PATCH 13/85] Increase the timeout for hiding the tray if the mouse didn't move far from it We shouldn't hide the tray as quickly if the user might have left it unintentionally, such as when moving the mouse over to a different tray item or using the scroll bar in the chat notification. https://bugzilla.gnome.org/show_bug.cgi?id=630767 --- js/ui/messageTray.js | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index e0561cb4c..7ab1b76d2 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -26,6 +26,10 @@ const BUTTON_ICON_SIZE = 36; const MAX_SOURCE_TITLE_WIDTH = 180; +// We delay hiding of the tray if the mouse is within MOUSE_LEFT_ACTOR_THRESHOLD +// range from the point where it left the tray. +const MOUSE_LEFT_ACTOR_THRESHOLD = 20; + const State = { HIDDEN: 0, SHOWING: 1, @@ -1146,6 +1150,8 @@ MessageTray.prototype = { if (this._trayLeftTimeoutId) { Mainloop.source_remove(this._trayLeftTimeoutId); this._trayLeftTimeoutId = 0; + this._trayLeftMouseX = -1; + this._trayLeftMouseY = -1; return; } @@ -1167,6 +1173,14 @@ MessageTray.prototype = { this._pointerInTray = true; this._updateState(); } else { + // We record the position of the mouse the moment it leaves the tray. These coordinates are used in + // this._onTrayLeftTimeout() to determine if the mouse has moved far enough during the initial timeout for us + // to consider that the user intended to leave the tray and therefore hide the tray. If the mouse is still + // close to its previous position, we extend the timeout once. + let [x, y, mods] = global.get_pointer(); + this._trayLeftMouseX = x; + this._trayLeftMouseY = y; + // We wait just a little before hiding the message tray in case the user quickly moves the mouse back into it. // We wait for a longer period if the notification popped up where the mouse pointer was already positioned. // That gives the user more time to mouse away from the notification and mouse back in in order to expand it. @@ -1176,12 +1190,25 @@ MessageTray.prototype = { }, _onTrayLeftTimeout: function() { - this._useLongerTrayLeftTimeout = false; - this._trayLeftTimeoutId = 0; - this._pointerInTray = false; - this._pointerInSummary = false; - this._updateNotificationTimeout(0); - this._updateState(); + let [x, y, mods] = global.get_pointer(); + // We extend the timeout once if the mouse moved no further than MOUSE_LEFT_ACTOR_THRESHOLD to either side or up. + // We don't check how far down the mouse moved because any point above the tray, but below the exit coordinate, + // is close to the tray. + if (this._trayLeftMouseX > -1 && + y > this._trayLeftMouseY - MOUSE_LEFT_ACTOR_THRESHOLD && + x < this._trayLeftMouseX + MOUSE_LEFT_ACTOR_THRESHOLD && + x > this._trayLeftMouseX - MOUSE_LEFT_ACTOR_THRESHOLD) { + this._trayLeftMouseX = -1; + this._trayLeftTimeoutId = Mainloop.timeout_add(LONGER_HIDE_TIMEOUT * 1000, + Lang.bind(this, this._onTrayLeftTimeout)); + } else { + this._trayLeftTimeoutId = 0; + this._useLongerTrayLeftTimeout = false; + this._pointerInTray = false; + this._pointerInSummary = false; + this._updateNotificationTimeout(0); + this._updateState(); + } return false; }, From 65a7b042eda21efe91097e4b8cfe4426122dc68e Mon Sep 17 00:00:00 2001 From: Petr Kovar Date: Sun, 31 Oct 2010 12:10:40 +0100 Subject: [PATCH 14/85] Update Czech translation --- po/cs.po | 343 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 283 insertions(+), 60 deletions(-) diff --git a/po/cs.po b/po/cs.po index cc1c66411..7af12ff3d 100644 --- a/po/cs.po +++ b/po/cs.po @@ -7,15 +7,16 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-07-11 21:54+0200\n" -"PO-Revision-Date: 2010-07-11 21:51+0200\n" +"POT-Creation-Date: 2010-10-31 12:09+0100\n" +"PO-Revision-Date: 2010-10-31 12:09+0100\n" "Last-Translator: Petr Kovar \n" "Language-Team: Czech \n" +"Language: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -"X-Generator: Lokalize 1.0\n" +"X-Generator: Lokalize 1.1\n" #: ../data/gnome-shell.desktop.in.in.h:1 msgid "GNOME Shell" @@ -219,6 +220,132 @@ msgstr "Uuid rozšíření určených k vypnutí" msgid "Whether to collect stats about applications usage" msgstr "Zda sbírat statistická data o používání aplikací" +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:1 +msgid "Clip the crosshairs at the center" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:2 +msgid "Color of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:3 +msgid "" +"Determines the length of the vertical and horizontal lines that make up the " +"crosshairs." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:4 +msgid "" +"Determines the position of the magnified mouse image within the magnified " +"view and how it reacts to system mouse movement. The values are - none: no " +"mouse tracking; - centered: the mouse image is displayed at the center of " +"the zoom region (which also represents the point under the system mouse) and " +"the magnified contents are scrolled as the system mouse moves; - " +"proportional: the position of the magnified mouse in the zoom region is " +"proportionally the same as the position of the system mouse on screen; - " +"push: when the magnified mouse intersects a boundary of the zoom region, the " +"contents are scrolled into view." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:5 +msgid "" +"Determines the transparency of the crosshairs, from fully opaque to fully " +"transparent." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:6 +msgid "" +"Determines whether the crosshairs intersect the magnified mouse sprite, or " +"are clipped such that the ends of the horizontal and vertical lines surround " +"the mouse image." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:7 +#, fuzzy +msgid "Enable lens mode" +msgstr "Povoleno" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:8 +msgid "" +"Enables/disables display of crosshairs centered on the magnified mouse " +"sprite." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:9 +msgid "" +"For centered mouse tracking, when the system pointer is at or near the edge " +"of the screen, the magnified contents continue to scroll such that the " +"screen edge moves into the magnified view." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:10 +msgid "Length of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:11 +msgid "Magnification factor" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:12 +msgid "Mouse Tracking Mode" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:13 +msgid "Opacity of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:14 +msgid "Screen position" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:15 +msgid "Scroll magnified contents beyond the edges of the desktop" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:16 +msgid "Show or hide crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:17 +msgid "Show or hide the magnifier" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:18 +msgid "Show or hide the magnifier and all of its zoom regions." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:19 +msgid "" +"The color of the the vertical and horizontal lines that make up the " +"crosshairs." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:20 +msgid "" +"The magnified view either fills the entire screen, or occupies the top-half, " +"bottom-half, left-half, or right-half of the screen." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:21 +msgid "" +"The power of the magnification. A value of 1.0 means no magnification. A " +"value of 2.0 doubles the size." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:22 +msgid "Thickness of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:23 +msgid "" +"Whether the magnified view should be centered over the location of the " +"system mouse and move with it." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:24 +msgid "Width of the vertical and horizontal lines that make up the crosshairs." +msgstr "" + #: ../data/clock-preferences.ui.h:1 msgid "Clock Format" msgstr "Formát hodin" @@ -248,27 +375,27 @@ msgid "_24 hour format" msgstr "_24hodinový formát" #. **** Applications **** -#: ../js/ui/appDisplay.js:388 ../js/ui/dash.js:777 +#: ../js/ui/appDisplay.js:316 ../js/ui/dash.js:778 msgid "APPLICATIONS" msgstr "APLIKACE" -#: ../js/ui/appDisplay.js:420 +#: ../js/ui/appDisplay.js:348 msgid "PREFERENCES" msgstr "PŘEDVOLBY" -#: ../js/ui/appDisplay.js:725 +#: ../js/ui/appDisplay.js:647 msgid "New Window" msgstr "Nové okno" -#: ../js/ui/appDisplay.js:729 +#: ../js/ui/appDisplay.js:651 msgid "Remove from Favorites" msgstr "Odstranit z oblíbených" -#: ../js/ui/appDisplay.js:730 +#: ../js/ui/appDisplay.js:652 msgid "Add to Favorites" msgstr "Přidat mezi oblíbené" -#: ../js/ui/appDisplay.js:1037 +#: ../js/ui/appDisplay.js:829 msgid "Drag here to add favorites" msgstr "Oblíbené přidáte přetažením sem" @@ -277,209 +404,302 @@ msgstr "Oblíbené přidáte přetažením sem" msgid "%s has been added to your favorites." msgstr "%s byl přidán mezi oblíbené." -#: ../js/ui/appFavorites.js:106 +#: ../js/ui/appFavorites.js:107 #, c-format msgid "%s has been removed from your favorites." msgstr "%s byl odstraněn z oblíbených." -#: ../js/ui/dash.js:146 +#: ../js/ui/dash.js:142 msgid "Find" msgstr "Najít" -#: ../js/ui/dash.js:475 +#: ../js/ui/dash.js:473 msgid "Searching..." msgstr "Hledá se..." -#: ../js/ui/dash.js:489 +#: ../js/ui/dash.js:487 msgid "No matching results." msgstr "Neodpovídá ani jeden z výsledků." #. **** Places **** #. Translators: This is in the sense of locations for documents, #. network locations, etc. -#: ../js/ui/dash.js:796 ../js/ui/placeDisplay.js:552 +#: ../js/ui/dash.js:797 ../js/ui/placeDisplay.js:554 msgid "PLACES & DEVICES" msgstr "MÍSTA A ZAŘÍZENÍ" #. **** Documents **** -#: ../js/ui/dash.js:803 ../js/ui/docDisplay.js:497 +#: ../js/ui/dash.js:804 ../js/ui/docDisplay.js:494 msgid "RECENT ITEMS" msgstr "NEDÁVNÉ POLOŽKY" -#: ../js/ui/lookingGlass.js:471 +#: ../js/ui/lookingGlass.js:552 msgid "No extensions installed" msgstr "Nejsou nainstalována žádná rozšíření" -#: ../js/ui/lookingGlass.js:508 +#: ../js/ui/lookingGlass.js:589 msgid "Enabled" msgstr "Povoleno" -#: ../js/ui/lookingGlass.js:510 +#. translators: +#. * The device has been disabled +#: ../js/ui/lookingGlass.js:591 ../src/gvc/gvc-mixer-control.c:1087 msgid "Disabled" msgstr "Zakázáno" -#: ../js/ui/lookingGlass.js:512 +#: ../js/ui/lookingGlass.js:593 msgid "Error" msgstr "Chyba" -#: ../js/ui/lookingGlass.js:514 +#: ../js/ui/lookingGlass.js:595 msgid "Out of date" msgstr "Neaktuální" -#: ../js/ui/lookingGlass.js:539 +#: ../js/ui/lookingGlass.js:620 msgid "View Source" msgstr "Zobrazit zdroj" -#: ../js/ui/lookingGlass.js:545 +#: ../js/ui/lookingGlass.js:626 msgid "Web Page" msgstr "Webová stránka" -#: ../js/ui/overview.js:165 +#: ../js/ui/overview.js:160 msgid "Undo" msgstr "Zpět" -#: ../js/ui/panel.js:517 +#. TODO - _quit() doesn't really work on apps in state STARTING yet +#: ../js/ui/panel.js:469 +#, c-format +msgid "Quit %s" +msgstr "Ukončit %s" + +#: ../js/ui/panel.js:494 msgid "Preferences" msgstr "Předvolby" # Not sure whether we've enough space for it, but anyway, looks more aesthetically with "%A". #. Translators: This is the time format with date used #. in 24-hour mode. -#: ../js/ui/panel.js:603 +#: ../js/ui/panel.js:580 msgid "%a %b %e, %R:%S" msgstr "%A, %e. %B, %R:%S" # Not sure whether we've enough space for it, but anyway, looks more aesthetically with "%A". -#: ../js/ui/panel.js:604 +#: ../js/ui/panel.js:581 msgid "%a %b %e, %R" msgstr "%A, %e. %B, %R" # Not sure whether we've enough space for it, but anyway, looks more aesthetically with "%A". #. Translators: This is the time format without date used #. in 24-hour mode. -#: ../js/ui/panel.js:608 +#: ../js/ui/panel.js:585 msgid "%a %R:%S" msgstr "%A, %R:%S" # Not sure whether we've enough space for it, but anyway, looks more aesthetically with "%A". -#: ../js/ui/panel.js:609 +#: ../js/ui/panel.js:586 msgid "%a %R" msgstr "%A, %R" # Not sure whether we've enough space for it, but anyway, looks more aesthetically with "%A". #. Translators: This is a time format with date used #. for AM/PM. -#: ../js/ui/panel.js:616 +#: ../js/ui/panel.js:593 msgid "%a %b %e, %l:%M:%S %p" msgstr "%A, %e. %B, %l:%M:%S %p" # Not sure whether we've enough space for it, but anyway, looks more aesthetically with "%A". -#: ../js/ui/panel.js:617 +#: ../js/ui/panel.js:594 msgid "%a %b %e, %l:%M %p" msgstr "%A, %e. %B, %l:%M %p" # Not sure whether we've enough space for it, but anyway, looks more aesthetically with "%A". #. Translators: This is a time format without date used #. for AM/PM. -#: ../js/ui/panel.js:621 +#: ../js/ui/panel.js:598 msgid "%a %l:%M:%S %p" msgstr "%A, %l:%M:%S %p" # Not sure whether we've enough space for it, but anyway, looks more aesthetically with "%A". -#: ../js/ui/panel.js:622 +#: ../js/ui/panel.js:599 msgid "%a %l:%M %p" msgstr "%A, %l:%M %p" #. Button on the left side of the panel. #. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview". -#: ../js/ui/panel.js:760 +#: ../js/ui/panel.js:744 msgid "Activities" msgstr "Činnosti" -#: ../js/ui/placeDisplay.js:109 +#: ../js/ui/placeDisplay.js:111 #, c-format msgid "Failed to unmount '%s'" msgstr "Nelze odpojit \"%s\"" -#: ../js/ui/placeDisplay.js:112 +#: ../js/ui/placeDisplay.js:114 msgid "Retry" msgstr "Opakovat" -#: ../js/ui/placeDisplay.js:157 +#: ../js/ui/placeDisplay.js:159 msgid "Connect to..." msgstr "Připojit se k..." -#: ../js/ui/runDialog.js:234 +#. Translators: this MUST be either "toggle-switch-us" +#. (for toggle switches containing the English words +#. "ON" and "OFF") or "toggle-switch-intl" (for toggle +#. switches containing "◯" and "|"). Other values will +#. simply result in invisible toggle switches. +#: ../js/ui/popupMenu.js:33 +msgid "toggle-switch-us" +msgstr "toggle-switch-intl" + +#: ../js/ui/runDialog.js:233 msgid "Please enter a command:" msgstr "Zadejte prosím příkaz:" -#: ../js/ui/runDialog.js:379 +#: ../js/ui/runDialog.js:378 #, c-format msgid "Execution of '%s' failed:" msgstr "Vykonání \"%s\" selhalo:" -#: ../js/ui/statusMenu.js:91 +#: ../js/ui/statusMenu.js:101 msgid "Available" msgstr "Přítomen" -#: ../js/ui/statusMenu.js:95 +#: ../js/ui/statusMenu.js:106 msgid "Busy" msgstr "Zaneprázdněn" -#: ../js/ui/statusMenu.js:99 +#: ../js/ui/statusMenu.js:111 msgid "Invisible" msgstr "Neviditelný" -#: ../js/ui/statusMenu.js:106 -msgid "Account Information..." -msgstr "Informace o účtu..." +#: ../js/ui/statusMenu.js:119 +msgid "My Account..." +msgstr "Můj účet..." -#: ../js/ui/statusMenu.js:110 -msgid "System Preferences..." -msgstr "Předvolby systému..." +#: ../js/ui/statusMenu.js:123 +msgid "System Settings..." +msgstr "Nastavení systému..." -#: ../js/ui/statusMenu.js:117 +#: ../js/ui/statusMenu.js:130 msgid "Lock Screen" msgstr "Uzamknout obrazovku" -#: ../js/ui/statusMenu.js:121 +#: ../js/ui/statusMenu.js:134 msgid "Switch User" msgstr "Přepnout uživatele" -#: ../js/ui/statusMenu.js:126 +#: ../js/ui/statusMenu.js:139 msgid "Log Out..." msgstr "Odhlásit..." -#: ../js/ui/statusMenu.js:130 +#: ../js/ui/statusMenu.js:146 +msgid "Suspend" +msgstr "Uspat do paměti" + +#: ../js/ui/statusMenu.js:150 +msgid "Restart..." +msgstr "Restartovat..." + +#: ../js/ui/statusMenu.js:154 msgid "Shut Down..." msgstr "Vypnout..." -#: ../js/ui/windowAttentionHandler.js:47 +#: ../js/ui/status/accessibility.js:88 +msgid "Screen Reader" +msgstr "Čtení obrazovky" + +#: ../js/ui/status/accessibility.js:91 +msgid "Screen Keyboard" +msgstr "Klávesnice na obrazovce" + +#: ../js/ui/status/accessibility.js:94 +msgid "Visual Alerts" +msgstr "Vizuální upozornění" + +#: ../js/ui/status/accessibility.js:97 +msgid "Sticky Keys" +msgstr "Lepící klávesy" + +#: ../js/ui/status/accessibility.js:100 +msgid "Slow Keys" +msgstr "Pomalé klávesy" + +#: ../js/ui/status/accessibility.js:103 +msgid "Bounce Keys" +msgstr "Vícenásobné stisky kláves" + +#: ../js/ui/status/accessibility.js:106 +msgid "Mouse Keys" +msgstr "Myš klávesnicí" + +#: ../js/ui/status/accessibility.js:110 +msgid "Universal Access Settings" +msgstr "Nastavení zpřístupnění" + +#: ../js/ui/status/accessibility.js:163 +msgid "High Contrast" +msgstr "Vysoký kontrast" + +#: ../js/ui/status/accessibility.js:202 +msgid "Large Text" +msgstr "Styl velkého textu" + +#: ../js/ui/status/accessibility.js:223 +msgid "Zoom" +msgstr "Zvětšení" + +#: ../js/ui/windowAttentionHandler.js:43 #, c-format msgid "%s has finished starting" msgstr "Spouštění %s dokončeno" -#: ../js/ui/windowAttentionHandler.js:49 +#: ../js/ui/windowAttentionHandler.js:45 #, c-format msgid "'%s' is ready" msgstr "Připraveno \"%s\"" -#: ../js/ui/workspacesView.js:237 +#: ../js/ui/workspacesView.js:229 msgid "" "Can't add a new workspace because maximum workspaces limit has been reached." msgstr "" "Novou pracovní plochu nelze přidat, jelikož byl dosažen maximální počet " "pracovních ploch." -#: ../js/ui/workspacesView.js:254 +#: ../js/ui/workspacesView.js:246 msgid "Can't remove the first workspace." msgstr "Nelze odstranit první pracovní plochu." -#: ../src/shell-global.c:1039 +#. translators: +#. * The number of sound outputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1094 +#, c-format +msgid "%u Output" +msgid_plural "%u Outputs" +msgstr[0] "%u výstup" +msgstr[1] "%u výstupy" +msgstr[2] "%u výstupů" + +#. translators: +#. * The number of sound inputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1104 +#, c-format +msgid "%u Input" +msgid_plural "%u Inputs" +msgstr[0] "%u vstup" +msgstr[1] "%u vstupy" +msgstr[2] "%u vstupů" + +#: ../src/gvc/gvc-mixer-control.c:1402 +msgid "System Sounds" +msgstr "Systémové zvuky" + +#: ../src/shell-global.c:1219 msgid "Less than a minute ago" msgstr "Před méně než minutou" -#: ../src/shell-global.c:1043 +#: ../src/shell-global.c:1223 #, c-format msgid "%d minute ago" msgid_plural "%d minutes ago" @@ -487,7 +707,7 @@ msgstr[0] "Před %d minutou" msgstr[1] "Před %d minutami" msgstr[2] "Před %d minutami" -#: ../src/shell-global.c:1048 +#: ../src/shell-global.c:1228 #, c-format msgid "%d hour ago" msgid_plural "%d hours ago" @@ -495,7 +715,7 @@ msgstr[0] "Před %d hodinou" msgstr[1] "Před %d hodinami" msgstr[2] "Před %d hodinami" -#: ../src/shell-global.c:1053 +#: ../src/shell-global.c:1233 #, c-format msgid "%d day ago" msgid_plural "%d days ago" @@ -503,7 +723,7 @@ msgstr[0] "Před %d dnem" msgstr[1] "Před %d dny" msgstr[2] "Před %d dny" -#: ../src/shell-global.c:1058 +#: ../src/shell-global.c:1238 #, c-format msgid "%d week ago" msgid_plural "%d weeks ago" @@ -534,3 +754,6 @@ msgstr "Hledat" #, c-format msgid "%1$s: %2$s" msgstr "%1$s: %2$s" + +#~ msgid "Account Information..." +#~ msgstr "Informace o účtu..." From 8bbfa913cbdfdba78e6de047ccd64d9420a35050 Mon Sep 17 00:00:00 2001 From: Adel Gadllah Date: Sun, 31 Oct 2010 17:14:17 +0100 Subject: [PATCH 15/85] Adjust appSwitcher and workspaceSwitcher popup to match mockups --- data/theme/gnome-shell.css | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index 30e74fe93..ee5b14edb 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -1003,8 +1003,8 @@ StTooltip { .switcher-list { background: rgba(0,0,0,0.8); border: 1px solid rgba(128,128,128,0.40); - border-radius: 8px; - padding: 18px; + border-radius: 24px; + padding: 20px; font: 12px sans-serif; color: white; @@ -1018,7 +1018,9 @@ StTooltip { background-gradient-direction: horizontal; background-gradient-start: rgba(51, 51, 51, 1.0); background-gradient-end: rgba(51, 51, 51, 0); - border-radius: 8px; + border-radius: 24px; + border-radius-topright: 0px; + border-radius-bottomright: 0px; width: 60px; } @@ -1026,13 +1028,15 @@ StTooltip { background-gradient-direction: horizontal; background-gradient-start: rgba(51, 51, 51, 0); background-gradient-end: rgba(51, 51, 51, 1.0); - border-radius: 8px; + border-radius: 24px; + border-radius-topleft: 0px; + border-radius-bottomleft: 0px; width: 60px; } .switcher-list .item-box { padding: 8px; - border-radius: 4px; + border-radius: 8px; } .switcher-list .thumbnail-box { @@ -1047,12 +1051,12 @@ StTooltip { .switcher-list .outlined-item-box { padding: 6px; border: 2px solid rgba(85,85,85,1.0); - border-radius: 4px; + border-radius: 8px; } .switcher-list .selected-item-box { padding: 8px; - border-radius: 4px; + border-radius: 8px; background: rgba(255,255,255,0.33); } @@ -1085,16 +1089,16 @@ StTooltip { .workspace-switcher-container { background: rgba(0,0,0,0.8); border: 1px solid rgba(128,128,128,0.40); - border-radius: 8px; - padding: 12px; + border-radius: 24px; + padding: 20px; } .workspace-switcher { background: transparent; border: 0px; border-radius: 0px; - padding: 4px; - spacing: 4.5px; + padding: 0px; + spacing: 8px; } .ws-switcher-active-left { @@ -1102,7 +1106,7 @@ StTooltip { border: 0px; background: rgba(255,255,255,0.5); background-image: url("ws-switch-arrow-left.svg"); - border-radius: 4px; + border-radius: 8px; } .ws-switcher-active-right { @@ -1110,14 +1114,14 @@ StTooltip { border: 0px; background: rgba(255,255,255,0.5); background-image: url("ws-switch-arrow-right.svg"); - border-radius: 4px; + border-radius: 8px; } .ws-switcher-box { height: 96px; border: 2px solid rgba(85,85,85,0.5); background: transparent; - border-radius: 4px; + border-radius: 8px; } /* Run Dialog */ From 6d115dd23bfcd08f82b24fe2f4a3208fa82d8b1e Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Sun, 31 Oct 2010 11:26:32 -0400 Subject: [PATCH 16/85] Add new standard GNOME 3 themes Replaces gtk-engines-3. --- tools/build/gnome-shell.modules | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/build/gnome-shell.modules b/tools/build/gnome-shell.modules index 35e83342f..ef44d45a9 100644 --- a/tools/build/gnome-shell.modules +++ b/tools/build/gnome-shell.modules @@ -86,13 +86,20 @@ - - + + + + + + + + + @@ -194,7 +201,7 @@ - + @@ -202,7 +209,7 @@ - + From cbed9f956a78061f2d0a8e0ff511574a0b1dbad1 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Sun, 31 Oct 2010 11:40:47 -0400 Subject: [PATCH 17/85] Explicitly set the repos for the new modules just added We don't set a default repo for the moduleset. --- tools/build/gnome-shell.modules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/build/gnome-shell.modules b/tools/build/gnome-shell.modules index ef44d45a9..e6a51ca32 100644 --- a/tools/build/gnome-shell.modules +++ b/tools/build/gnome-shell.modules @@ -87,14 +87,14 @@ - + - + From 2fe7507689ec05aeac63c0d433fff16d8c5b3bb0 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Sun, 31 Oct 2010 11:51:36 -0400 Subject: [PATCH 18/85] Use the GNOME 3 WM theme by default Set up an override to specify the metacity window decoration theme. Use the GNOME 3 standard theme as the default. --- data/gnome-shell.schemas | 18 ++++++++++++++++++ src/gnome-shell-plugin.c | 2 ++ 2 files changed, 20 insertions(+) diff --git a/data/gnome-shell.schemas b/data/gnome-shell.schemas index 5798a3edb..1a887118a 100644 --- a/data/gnome-shell.schemas +++ b/data/gnome-shell.schemas @@ -62,5 +62,23 @@ + + /schemas/desktop/gnome/shell/windows/theme + /desktop/gnome/shell/windows/theme + gnome-shell + string + Adwaita + + Current theme + + The theme determines the appearance of window borders, + titlebar, and so forth. + + This key overrides /apps/metacity/general/theme when + running GNOME Shell. + + + + diff --git a/src/gnome-shell-plugin.c b/src/gnome-shell-plugin.c index f67277840..0a3959df4 100644 --- a/src/gnome-shell-plugin.c +++ b/src/gnome-shell-plugin.c @@ -161,6 +161,8 @@ gnome_shell_plugin_init (GnomeShellPlugin *shell_plugin) "/desktop/gnome/shell/windows/button_layout"); meta_prefs_override_preference_location ("/apps/metacity/general/side_by_side_tiling", "/desktop/gnome/shell/windows/side_by_side_tiling"); + meta_prefs_override_preference_location ("/apps/metacity/general/theme", + "/desktop/gnome/shell/windows/theme"); } static void From 75e608f03993fe836459439a6ecc5129c8d8e758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gonz=C3=A1lez?= Date: Sun, 31 Oct 2010 21:50:18 +0100 Subject: [PATCH 19/85] Updated Spanish translation --- po/es.po | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/po/es.po b/po/es.po index 443343293..2dba065c7 100644 --- a/po/es.po +++ b/po/es.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: gnome-shell.master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" "shell&component=general\n" -"POT-Creation-Date: 2010-10-27 23:15+0000\n" -"PO-Revision-Date: 2010-10-28 01:42+0200\n" +"POT-Creation-Date: 2010-10-30 17:51+0000\n" +"PO-Revision-Date: 2010-10-31 21:36+0100\n" "Last-Translator: Jorge González \n" "Language-Team: Español \n" "MIME-Version: 1.0\n" @@ -420,19 +420,19 @@ msgstr "APLICACIONES" msgid "PREFERENCES" msgstr "PREFERENCIAS" -#: ../js/ui/appDisplay.js:648 +#: ../js/ui/appDisplay.js:647 msgid "New Window" msgstr "Ventana nueva" -#: ../js/ui/appDisplay.js:652 +#: ../js/ui/appDisplay.js:651 msgid "Remove from Favorites" msgstr "Quitar de los favoritos" -#: ../js/ui/appDisplay.js:653 +#: ../js/ui/appDisplay.js:652 msgid "Add to Favorites" msgstr "Añadir a los favoritos" -#: ../js/ui/appDisplay.js:830 +#: ../js/ui/appDisplay.js:829 msgid "Drag here to add favorites" msgstr "Arrastrar aquí para añadir a los favoritos" @@ -608,8 +608,9 @@ msgid "My Account..." msgstr "Mi cuenta…" #: ../js/ui/statusMenu.js:123 -msgid "System Preferences..." -msgstr "Preferencias del sistema…" +#| msgid "System Preferences..." +msgid "System Settings..." +msgstr "Ajustes del sistema…" #: ../js/ui/statusMenu.js:130 msgid "Lock Screen" @@ -719,36 +720,35 @@ msgstr[0] "%u entrada" msgstr[1] "%u entradas" #: ../src/gvc/gvc-mixer-control.c:1402 -#| msgid "System Settings..." msgid "System Sounds" msgstr "Sonidos del sistema" -#: ../src/shell-global.c:1204 +#: ../src/shell-global.c:1219 msgid "Less than a minute ago" msgstr "Hace menos de un minuto" -#: ../src/shell-global.c:1208 +#: ../src/shell-global.c:1223 #, c-format msgid "%d minute ago" msgid_plural "%d minutes ago" msgstr[0] "Hace %d minuto" msgstr[1] "Hace %d minutos" -#: ../src/shell-global.c:1213 +#: ../src/shell-global.c:1228 #, c-format msgid "%d hour ago" msgid_plural "%d hours ago" msgstr[0] "Hace %d hora" msgstr[1] "Hace %d horas" -#: ../src/shell-global.c:1218 +#: ../src/shell-global.c:1233 #, c-format msgid "%d day ago" msgid_plural "%d days ago" msgstr[0] "Hace %d día" msgstr[1] "Hace %d días" -#: ../src/shell-global.c:1223 +#: ../src/shell-global.c:1238 #, c-format msgid "%d week ago" msgid_plural "%d weeks ago" From ab206ff82acdbf180640a0502d78d49f486cf012 Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Mon, 1 Nov 2010 07:48:16 +0200 Subject: [PATCH 20/85] Updated Hebrew translation. --- po/he.po | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/po/he.po b/po/he.po index be704419f..0899a1fa1 100644 --- a/po/he.po +++ b/po/he.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell master\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-10-28 08:56+0200\n" -"PO-Revision-Date: 2010-10-28 08:58+0200\n" +"POT-Creation-Date: 2010-11-01 07:47+0200\n" +"PO-Revision-Date: 2010-11-01 07:48+0200\n" "Last-Translator: Yaron Shahrabani \n" "Language-Team: Hebrew \n" "MIME-Version: 1.0\n" @@ -411,19 +411,19 @@ msgstr "יישומים" msgid "PREFERENCES" msgstr "העדפות" -#: ../js/ui/appDisplay.js:648 +#: ../js/ui/appDisplay.js:647 msgid "New Window" msgstr "חלון חדש" -#: ../js/ui/appDisplay.js:652 +#: ../js/ui/appDisplay.js:651 msgid "Remove from Favorites" msgstr "הסרה מהמועדפים" -#: ../js/ui/appDisplay.js:653 +#: ../js/ui/appDisplay.js:652 msgid "Add to Favorites" msgstr "הוספה למועדפים" -#: ../js/ui/appDisplay.js:830 +#: ../js/ui/appDisplay.js:829 msgid "Drag here to add favorites" msgstr "יש לגרור פריטים לכאן כדי להוסיף מועדפים" @@ -599,8 +599,8 @@ msgid "My Account..." msgstr "החשבון שלי..." #: ../js/ui/statusMenu.js:123 -msgid "System Preferences..." -msgstr "העדפות המערכת..." +msgid "System Settings..." +msgstr "הגדרות המערכת..." #: ../js/ui/statusMenu.js:130 msgid "Lock Screen" @@ -713,11 +713,11 @@ msgstr[2] "2 קלטים" msgid "System Sounds" msgstr "צלילי מערכת" -#: ../src/shell-global.c:1204 +#: ../src/shell-global.c:1219 msgid "Less than a minute ago" msgstr "לפני פחות מדקה" -#: ../src/shell-global.c:1208 +#: ../src/shell-global.c:1223 #, c-format msgid "%d minute ago" msgid_plural "%d minutes ago" @@ -725,7 +725,7 @@ msgstr[0] "לפני דקה" msgstr[1] "לפני %d דקות" msgstr[2] "לפני 2 דקות" -#: ../src/shell-global.c:1213 +#: ../src/shell-global.c:1228 #, c-format msgid "%d hour ago" msgid_plural "%d hours ago" @@ -733,7 +733,7 @@ msgstr[0] "לפני שעה" msgstr[1] "לפני %d שעות" msgstr[2] "לפני שעתיים" -#: ../src/shell-global.c:1218 +#: ../src/shell-global.c:1233 #, c-format msgid "%d day ago" msgid_plural "%d days ago" @@ -741,7 +741,7 @@ msgstr[0] "לפני יום" msgstr[1] "לפני %d ימים" msgstr[2] "לפני יומיים" -#: ../src/shell-global.c:1223 +#: ../src/shell-global.c:1238 #, c-format msgid "%d week ago" msgid_plural "%d weeks ago" From bff553e978218a7a7cd6a06487b47c5002537d9c Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Mon, 1 Nov 2010 13:26:49 +0100 Subject: [PATCH 21/85] PopupSliderMenuItem: connect to scroll-event on the whole actor Connect to scroll-event on .actor, not ._slider, so you can scroll on the whole menu item. https://bugzilla.gnome.org/show_bug.cgi?id=633668 --- js/ui/popupMenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 51b2989d8..b6b2b8c2c 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -370,7 +370,7 @@ PopupSliderMenuItem.prototype = { this.addActor(this._slider, 0, -1); this._slider.connect('repaint', Lang.bind(this, this._sliderRepaint)); this._slider.connect('button-press-event', Lang.bind(this, this._startDragging)); - this._slider.connect('scroll-event', Lang.bind(this, this._onScrollEvent)); + this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent)); this._releaseId = this._motionId = 0; this._dragging = false; From 0c2aa1437d42e73825d16b4ccf6ab6284ff68fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 17 Sep 2010 01:45:13 +0200 Subject: [PATCH 22/85] magnifier: Sync MouseTrackingMode values with the gsettings enum The tracking modes "push" and "proportional" are swapped. https://bugzilla.gnome.org/show_bug.cgi?id=629884 --- js/ui/magnifier.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js index e572961a0..ac53a299d 100644 --- a/js/ui/magnifier.js +++ b/js/ui/magnifier.js @@ -15,8 +15,8 @@ const MagnifierDBus = imports.ui.magnifierDBus; const MouseTrackingMode = { NONE: 0, CENTERED: 1, - PUSH: 2, - PROPORTIONAL: 3 + PROPORTIONAL: 2, + PUSH: 3 }; const ScreenPosition = { @@ -681,7 +681,7 @@ ZoomRegion.prototype = { * @mode: One of the enum MouseTrackingMode values. */ setMouseTrackingMode: function(mode) { - if (mode >= MouseTrackingMode.NONE && mode <= MouseTrackingMode.PROPORTIONAL) + if (mode >= MouseTrackingMode.NONE && mode <= MouseTrackingMode.PUSH) this._mouseTrackingMode = mode; }, From 576376a21bd921892923307dfccb68f2c9d4ca8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 17 Sep 2010 01:29:18 +0200 Subject: [PATCH 23/85] magnifier: Change default values mccann: we should default to full screen with mouse position as "proportional" https://bugzilla.gnome.org/show_bug.cgi?id=629884 --- data/org.gnome.accessibility.magnifier.gschema.xml.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/org.gnome.accessibility.magnifier.gschema.xml.in b/data/org.gnome.accessibility.magnifier.gschema.xml.in index aa2d4fbcf..7958fcac9 100644 --- a/data/org.gnome.accessibility.magnifier.gschema.xml.in +++ b/data/org.gnome.accessibility.magnifier.gschema.xml.in @@ -27,7 +27,7 @@ - 'centered' + 'proportional' <_summary>Mouse Tracking Mode <_description> Determines the position of the magnified mouse image within the @@ -45,7 +45,7 @@ - 'bottom-half' + 'full-screen' <_summary>Screen position <_description> The magnified view either fills the entire screen, or occupies the From 909ec7a7090efb5b371ffdf5211ca67aab9fc5b3 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sat, 30 Oct 2010 17:28:36 -0400 Subject: [PATCH 24/85] Fix cursor image tracking on 64-bit systems Like all X API, XFixesGetCursorImage returns arrays of 32-bit quantities as arrays of long; on 64-bit systems we need to convert to an array of 32-bit words before creating a texture from the result. https://bugzilla.gnome.org/show_bug.cgi?id=633591 --- src/shell-xfixes-cursor.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/shell-xfixes-cursor.c b/src/shell-xfixes-cursor.c index baf677c5c..14d2b59c4 100644 --- a/src/shell-xfixes-cursor.c +++ b/src/shell-xfixes-cursor.c @@ -195,11 +195,40 @@ xfixes_cursor_reset_image (ShellXFixesCursor *xfixes_cursor) { XFixesCursorImage *cursor_image; CoglHandle sprite = COGL_INVALID_HANDLE; + guint8 *cursor_data; + gboolean free_cursor_data; if (!xfixes_cursor->have_xfixes) return; cursor_image = XFixesGetCursorImage (clutter_x11_get_default_display ()); + + /* Like all X APIs, XFixesGetCursorImage() returns arrays of 32-bit + * quantities as arrays of long; we need to convert on 64 bit */ + if (sizeof(long) == 4) + { + cursor_data = (guint8 *)cursor_image->pixels; + free_cursor_data = FALSE; + } + else + { + int i, j; + guint32 *cursor_words; + gulong *p; + guint32 *q; + + cursor_words = g_new (guint32, cursor_image->width * cursor_image->height); + cursor_data = (guint8 *)cursor_words; + + p = cursor_image->pixels; + q = cursor_words; + for (j = 0; j < cursor_image->height; j++) + for (i = 0; i < cursor_image->width; i++) + *(q++) = *(p++); + + free_cursor_data = TRUE; + } + sprite = cogl_texture_new_from_data (cursor_image->width, cursor_image->height, COGL_TEXTURE_NONE, @@ -210,7 +239,11 @@ xfixes_cursor_reset_image (ShellXFixesCursor *xfixes_cursor) #endif COGL_PIXEL_FORMAT_ANY, cursor_image->width * 4, /* stride */ - (const guint8 *) cursor_image->pixels); + cursor_data); + + if (free_cursor_data) + g_free (cursor_data); + if (sprite != COGL_INVALID_HANDLE) { if (xfixes_cursor->cursor_sprite != NULL) From 79a33fa7fb3a8b32d809486b5ffad1efa20b0ec1 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 1 Nov 2010 10:51:11 -0400 Subject: [PATCH 25/85] gnome-shell.modules: add libcanberra The volume status icon requires libcanberra; we could get by with packages so far, but we will need a very very recent libcanberra soon anyway, so just require that. https://bugzilla.gnome.org/show_bug.cgi?id=633418 --- tools/build/gnome-shell.modules | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/build/gnome-shell.modules b/tools/build/gnome-shell.modules index e6a51ca32..dd02aa08a 100644 --- a/tools/build/gnome-shell.modules +++ b/tools/build/gnome-shell.modules @@ -11,6 +11,8 @@ href="git://git.moblin.org"/> + @@ -179,6 +181,15 @@ + + + + + + + @@ -192,6 +203,7 @@ + From c6f6ac926ecef2598cb84e1ea63b343adc41ecce Mon Sep 17 00:00:00 2001 From: Mathieu Bridon Date: Mon, 1 Nov 2010 18:18:11 +0100 Subject: [PATCH 26/85] build: Add missing libcanberra build deps on Fedora --- tools/build/gnome-shell-build-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/build/gnome-shell-build-setup.sh b/tools/build/gnome-shell-build-setup.sh index ca0bbf9cf..702ce450c 100755 --- a/tools/build/gnome-shell-build-setup.sh +++ b/tools/build/gnome-shell-build-setup.sh @@ -61,7 +61,7 @@ fi # libjasper, libjpeg, libpng, libpulse, libtiff, libwnck, # libxml2, ORBit2, python, readline, # spidermonkey ({mozilla,firefox,xulrunner}-js), startup-notification -# xdamage, icon-naming-utils +# xdamage, icon-naming-utils, libtool-ltdl, libvorbis # # Non-devel packages needed by gnome-shell and its deps: # glxinfo, gstreamer-plugins-base, gstreamer-plugins-good, @@ -109,7 +109,7 @@ if test "x$system" = xFedora ; then python-devel pygobject2 readline-devel xulrunner-devel libXdamage-devel libcroco-devel libxml2-devel gstreamer-devel gstreamer-plugins-base gstreamer-plugins-good glx-utils startup-notification-devel xorg-x11-server-Xephyr gnome-terminal zenity - icon-naming-utils + icon-naming-utils libtool-ltdl-devel libvorbis-devel " if expr $version \>= 14 > /dev/null ; then From 11794e3da90f4c83d191b9393a4bd8caedd6d954 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 1 Nov 2010 13:29:33 -0400 Subject: [PATCH 27/85] build: Add missing libcanberra build deps on Debian --- tools/build/gnome-shell-build-setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build/gnome-shell-build-setup.sh b/tools/build/gnome-shell-build-setup.sh index 702ce450c..36c4f6fff 100755 --- a/tools/build/gnome-shell-build-setup.sh +++ b/tools/build/gnome-shell-build-setup.sh @@ -87,6 +87,7 @@ if test "x$system" = xUbuntu -o "x$system" = xDebian -o "x$system" = xLinuxMint mesa-common-dev mesa-utils python-dev python-gconf python-gobject \ xulrunner-dev xserver-xephyr gnome-terminal libcroco3-dev \ libgstreamer0.10-dev gstreamer0.10-plugins-base gstreamer0.10-plugins-good \ + libltdl-dev libvorbis-dev ; do if ! dpkg-checkbuilddeps -d $pkg /dev/null 2> /dev/null; then reqd="$pkg $reqd" From 31df386fedea087780fb62dce8370216accf5c8c Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 1 Nov 2010 14:28:56 -0400 Subject: [PATCH 28/85] build: fix syntax error in setup script --- tools/build/gnome-shell-build-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build/gnome-shell-build-setup.sh b/tools/build/gnome-shell-build-setup.sh index 36c4f6fff..e4dc26c9c 100755 --- a/tools/build/gnome-shell-build-setup.sh +++ b/tools/build/gnome-shell-build-setup.sh @@ -87,7 +87,7 @@ if test "x$system" = xUbuntu -o "x$system" = xDebian -o "x$system" = xLinuxMint mesa-common-dev mesa-utils python-dev python-gconf python-gobject \ xulrunner-dev xserver-xephyr gnome-terminal libcroco3-dev \ libgstreamer0.10-dev gstreamer0.10-plugins-base gstreamer0.10-plugins-good \ - libltdl-dev libvorbis-dev + libltdl-dev libvorbis-dev \ ; do if ! dpkg-checkbuilddeps -d $pkg /dev/null 2> /dev/null; then reqd="$pkg $reqd" From 9585c823d51af30a536c7b304cbc12b24259635b Mon Sep 17 00:00:00 2001 From: Jonathan Matthew Date: Sat, 30 Oct 2010 16:29:21 +1000 Subject: [PATCH 29/85] MessageTray: only create icon buttons if specifically requested Action names sometimes unintentionally overlap with icon names, so we should only create icon buttons if the message tray source requests it. For the notification daemon, this is done by setting the 'action-icons' hint on the notification. The previous notification server capability used to advertise this feature, "x-gnome-icon-buttons", has been removed in favour of the new capability described in the notification spec, "action-icons". https://bugzilla.gnome.org/show_bug.cgi?id=624584 --- js/ui/messageTray.js | 7 ++++++- js/ui/notificationDaemon.js | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 7ab1b76d2..d11051943 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -102,6 +102,7 @@ Notification.prototype = { this.source = source; this.urgent = false; this.expanded = false; + this._useActionIcons = false; this._customContent = false; this._bannerBodyText = null; this._titleFitsInBannerMode = true; @@ -346,7 +347,7 @@ Notification.prototype = { let button = new St.Button(); - if (Gtk.IconTheme.get_default().has_icon(id)) { + if (this._useActionIcons && Gtk.IconTheme.get_default().has_icon(id)) { button.add_style_class_name('notification-icon-button'); button.child = St.TextureCache.get_default().load_icon_name(id, St.IconType.SYMBOLIC, BUTTON_ICON_SIZE); } else { @@ -363,6 +364,10 @@ Notification.prototype = { this.urgent = urgent; }, + setUseActionIcons: function(useIcons) { + this._useActionIcons = useIcons; + }, + _styleChanged: function() { this._spacing = this.actor.get_theme_node().get_length('spacing-columns'); }, diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index 88fbc00e0..5bebb170d 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -294,6 +294,7 @@ NotificationDaemon.prototype = { } if (actions.length) { + notification.setUseActionIcons(hints['action-icons'] == true); for (let i = 0; i < actions.length - 1; i += 2) notification.addButton(actions[i], actions[i + 1]); } @@ -317,6 +318,7 @@ NotificationDaemon.prototype = { GetCapabilities: function() { return [ 'actions', + 'action-icons', 'body', // 'body-hyperlinks', // 'body-images', @@ -325,7 +327,6 @@ NotificationDaemon.prototype = { 'icon-static', 'persistence', // 'sound', - 'x-gnome-icon-buttons' ]; }, From 0155226c73208dc3e57b8051c673ef61e6a691cd Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 29 Oct 2010 15:10:27 -0400 Subject: [PATCH 30/85] telepathy: makeProxyClass has been migrated to gjs's dbus module https://bugzilla.gnome.org/show_bug.cgi?id=633490 --- js/misc/telepathy.js | 43 +++++++++++++++---------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/js/misc/telepathy.js b/js/misc/telepathy.js index c1443fb30..3a8d7e809 100644 --- a/js/misc/telepathy.js +++ b/js/misc/telepathy.js @@ -2,20 +2,7 @@ const DBus = imports.dbus; -// D-Bus utils; should eventually move to gjs. -// https://bugzilla.gnome.org/show_bug.cgi?id=610859 - -function makeProxyClass(iface) { - let constructor = function() { this._init.apply(this, arguments); }; - - constructor.prototype._init = function(bus, name, path) { - bus.proxifyObject(this, name, path); - }; - - DBus.proxifyPrototype(constructor.prototype, iface); - return constructor; -} - +// D-Bus utils function nameToPath(name) { return '/' + name.replace(/\./g, '/'); }; @@ -118,7 +105,7 @@ const ChannelDispatchOperationIface = { outSignature: '' } ] }; -let ChannelDispatchOperation = makeProxyClass(ChannelDispatchOperationIface); +let ChannelDispatchOperation = DBus.makeProxyClass(ChannelDispatchOperationIface); const CONNECTION_NAME = TELEPATHY + '.Connection'; const ConnectionIface = { @@ -128,7 +115,7 @@ const ConnectionIface = { inSignature: 'uu' } ] }; -let Connection = makeProxyClass(ConnectionIface); +let Connection = DBus.makeProxyClass(ConnectionIface); const ConnectionStatus = { CONNECTED: 0, @@ -150,7 +137,7 @@ const ConnectionAliasingIface = { inSignature: 'a(us)' } ] }; -let ConnectionAliasing = makeProxyClass(ConnectionAliasingIface); +let ConnectionAliasing = DBus.makeProxyClass(ConnectionAliasingIface); const CONNECTION_AVATARS_NAME = CONNECTION_NAME + '.Interface.Avatars'; const ConnectionAvatarsIface = { @@ -174,7 +161,7 @@ const ConnectionAvatarsIface = { } ] }; -let ConnectionAvatars = makeProxyClass(ConnectionAvatarsIface); +let ConnectionAvatars = DBus.makeProxyClass(ConnectionAvatarsIface); const CONNECTION_CONTACTS_NAME = CONNECTION_NAME + '.Interface.Contacts'; const ConnectionContactsIface = { @@ -186,7 +173,7 @@ const ConnectionContactsIface = { } ] }; -let ConnectionContacts = makeProxyClass(ConnectionContactsIface); +let ConnectionContacts = DBus.makeProxyClass(ConnectionContactsIface); const CONNECTION_REQUESTS_NAME = CONNECTION_NAME + '.Interface.Requests'; const ConnectionRequestsIface = { @@ -215,7 +202,7 @@ const ConnectionRequestsIface = { } ] }; -let ConnectionRequests = makeProxyClass(ConnectionRequestsIface); +let ConnectionRequests = DBus.makeProxyClass(ConnectionRequestsIface); const CONNECTION_SIMPLE_PRESENCE_NAME = CONNECTION_NAME + '.Interface.SimplePresence'; const ConnectionSimplePresenceIface = { @@ -234,7 +221,7 @@ const ConnectionSimplePresenceIface = { inSignature: 'a{u(uss)}' } ] }; -let ConnectionSimplePresence = makeProxyClass(ConnectionSimplePresenceIface); +let ConnectionSimplePresence = DBus.makeProxyClass(ConnectionSimplePresenceIface); const ConnectionPresenceType = { UNSET: 0, @@ -264,7 +251,7 @@ const ChannelIface = { inSignature: '' } ] }; -let Channel = makeProxyClass(ChannelIface); +let Channel = DBus.makeProxyClass(ChannelIface); const CHANNEL_TEXT_NAME = CHANNEL_NAME + '.Type.Text'; const ChannelTextIface = { @@ -288,7 +275,7 @@ const ChannelTextIface = { inSignature: 'uuuuus' } ] }; -let ChannelText = makeProxyClass(ChannelTextIface); +let ChannelText = DBus.makeProxyClass(ChannelTextIface); const ChannelTextMessageType = { NORMAL: 0, @@ -315,7 +302,7 @@ const ChannelGroupIface = { inSignature: 'sauauauauuu' } ] }; -let ChannelGroup = makeProxyClass(ChannelGroupIface); +let ChannelGroup = DBus.makeProxyClass(ChannelGroupIface); const ACCOUNT_MANAGER_NAME = TELEPATHY + '.AccountManager'; const AccountManagerIface = { @@ -330,7 +317,7 @@ const AccountManagerIface = { inSignature: 'ob' } ] }; -let AccountManager = makeProxyClass(AccountManagerIface); +let AccountManager = DBus.makeProxyClass(AccountManagerIface); const ACCOUNT_NAME = TELEPATHY + '.Account'; const AccountIface = { @@ -341,7 +328,7 @@ const AccountIface = { access: 'read' } ] }; -let Account = makeProxyClass(AccountIface); +let Account = DBus.makeProxyClass(AccountIface); const CHANNEL_DISPATCHER_NAME = TELEPATHY + '.ChannelDispatcher'; const ChannelDispatcherIface = { @@ -352,7 +339,7 @@ const ChannelDispatcherIface = { outSignature: 'o' } ] }; -let ChannelDispatcher = makeProxyClass(ChannelDispatcherIface); +let ChannelDispatcher = DBus.makeProxyClass(ChannelDispatcherIface); const CHANNEL_REQUEST_NAME = TELEPATHY + '.ChannelRequest'; const ChannelRequestIface = { @@ -369,4 +356,4 @@ const ChannelRequestIface = { signature: '' } ] }; -let ChannelRequest = makeProxyClass(ChannelRequestIface); +let ChannelRequest = DBus.makeProxyClass(ChannelRequestIface); From 0428234c67de65a62812b2137d484c058582386d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Di=C3=A9guez?= Date: Wed, 3 Nov 2010 00:28:57 +0100 Subject: [PATCH 31/85] Updated Galician translations --- po/gl.po | 64 ++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/po/gl.po b/po/gl.po index c1378201f..e0c8bf60a 100644 --- a/po/gl.po +++ b/po/gl.po @@ -10,8 +10,8 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell master\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-10-26 16:28+0200\n" -"PO-Revision-Date: 2010-10-26 16:36+0200\n" +"POT-Creation-Date: 2010-11-03 00:26+0100\n" +"PO-Revision-Date: 2010-11-03 00:28+0100\n" "Last-Translator: Fran Diéguez \n" "Language-Team: Galician \n" "Language: gl\n" @@ -61,7 +61,7 @@ msgstr "Extensión de ficheiro usada para o almacenamento da screencast" #: ../data/org.gnome.shell.gschema.xml.in.h:5 msgid "Framerate used for recording screencasts." -msgstr "Taxa de marcos usada para gravar as capturas de pantalla" +msgstr "Taxa de marcos usada para gravar as capturas de pantalla." #: ../data/org.gnome.shell.gschema.xml.in.h:6 msgid "" @@ -73,7 +73,7 @@ msgstr "" #: ../data/org.gnome.shell.gschema.xml.in.h:7 msgid "History for command (Alt-F2) dialog" -msgstr "Hitorial do diálogo de orde (Alt-F)" +msgstr "Hitorial do diálogo de orde (Alt-F2)" #: ../data/org.gnome.shell.gschema.xml.in.h:8 msgid "Hour format" @@ -418,19 +418,19 @@ msgstr "APLICATIVOS" msgid "PREFERENCES" msgstr "PREFERENCIAS" -#: ../js/ui/appDisplay.js:648 +#: ../js/ui/appDisplay.js:647 msgid "New Window" msgstr "Xanela nova" -#: ../js/ui/appDisplay.js:652 +#: ../js/ui/appDisplay.js:651 msgid "Remove from Favorites" msgstr "Eliminar dos favoritos" -#: ../js/ui/appDisplay.js:653 +#: ../js/ui/appDisplay.js:652 msgid "Add to Favorites" msgstr "Engadir aos favoritos" -#: ../js/ui/appDisplay.js:830 +#: ../js/ui/appDisplay.js:829 msgid "Drag here to add favorites" msgstr "Arrastre aquí para engadir aos favoritos" @@ -476,7 +476,9 @@ msgstr "Non hai ningunha extensión instalada" msgid "Enabled" msgstr "Activado" -#: ../js/ui/lookingGlass.js:591 +#. translators: +#. * The device has been disabled +#: ../js/ui/lookingGlass.js:591 ../src/gvc/gvc-mixer-control.c:1087 msgid "Disabled" msgstr "Desactivado" @@ -559,7 +561,7 @@ msgstr "Actividades" #: ../js/ui/placeDisplay.js:111 #, c-format msgid "Failed to unmount '%s'" -msgstr "Produciuse un fallo ao montar «%s»" +msgstr "Produciuse un fallo ao desmontar «%s»" #: ../js/ui/placeDisplay.js:114 msgid "Retry" @@ -604,8 +606,8 @@ msgid "My Account..." msgstr "A miña conta..." #: ../js/ui/statusMenu.js:123 -msgid "System Preferences..." -msgstr "Preferencias do sistema..." +msgid "System Settings..." +msgstr "Configuracións do sistema..." #: ../js/ui/statusMenu.js:130 msgid "Lock Screen" @@ -696,32 +698,54 @@ msgstr "" msgid "Can't remove the first workspace." msgstr "Non é posíbel quitar a primeira área de traballo." -#: ../src/shell-global.c:1204 +#. translators: +#. * The number of sound outputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1094 +#, c-format +msgid "%u Output" +msgid_plural "%u Outputs" +msgstr[0] "%u saída" +msgstr[1] "%u saídas" + +#. translators: +#. * The number of sound inputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1104 +#, c-format +msgid "%u Input" +msgid_plural "%u Inputs" +msgstr[0] "%u entrada" +msgstr[1] "%u entradas" + +#: ../src/gvc/gvc-mixer-control.c:1402 +msgid "System Sounds" +msgstr "Sons do sistema" + +#: ../src/shell-global.c:1219 msgid "Less than a minute ago" msgstr "Hai menos dun minuto" -#: ../src/shell-global.c:1208 +#: ../src/shell-global.c:1223 #, c-format msgid "%d minute ago" msgid_plural "%d minutes ago" msgstr[0] "hai %d minuto" msgstr[1] "hai %d minutos" -#: ../src/shell-global.c:1213 +#: ../src/shell-global.c:1228 #, c-format msgid "%d hour ago" msgid_plural "%d hours ago" msgstr[0] "hai %d hora" msgstr[1] "hai %d horas" -#: ../src/shell-global.c:1218 +#: ../src/shell-global.c:1233 #, c-format msgid "%d day ago" msgid_plural "%d days ago" msgstr[0] "hai %d día" msgstr[1] "hai %d días" -#: ../src/shell-global.c:1223 +#: ../src/shell-global.c:1238 #, c-format msgid "%d week ago" msgid_plural "%d weeks ago" @@ -752,12 +776,12 @@ msgstr "Buscar" msgid "%1$s: %2$s" msgstr "%1$s: %2$s" +#~ msgid "System Preferences..." +#~ msgstr "Preferencias do sistema..." + #~ msgid "Account Information..." #~ msgstr "Información da conta..." -#~ msgid "System Settings..." -#~ msgstr "Configuracións do sistema..." - #~ msgid "ON" #~ msgstr "⚫" From dc58a4f407ad8a6456966e0f3ce596df48ba71a6 Mon Sep 17 00:00:00 2001 From: Yunqiang Su Date: Wed, 3 Nov 2010 16:18:31 +0800 Subject: [PATCH 32/85] Update Simplified Chinese translation. --- po/zh_CN.po | 118 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 75 insertions(+), 43 deletions(-) diff --git a/po/zh_CN.po b/po/zh_CN.po index b6642f113..ee6533960 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -3,21 +3,22 @@ # This file is distributed under the same license as the gnome-shell package. # Ray Wang , 2009. # jiero , 2010. -# YunQiang Su , 2010. # Aron Xu , 2010. # Jessica Ban , 2010. +# YunQiang Su , 2010. +# msgid "" msgstr "" "Project-Id-Version: gnome-shell master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" "shell&component=general\n" -"POT-Creation-Date: 2010-10-25 21:45+0000\n" -"PO-Revision-Date: 2010-10-28 00:26+0800\n" -"Last-Translator: Aron Xu \n" +"POT-Creation-Date: 2010-10-30 17:51+0000\n" +"PO-Revision-Date: 2010-10-28 01:24+0800\n" +"Last-Translator: YunQiang Su \n" "Language-Team: Chinese (simplified) \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../data/gnome-shell.desktop.in.in.h:1 @@ -206,17 +207,17 @@ msgstr "是否收集应用程序的使用情况" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:1 msgid "Clip the crosshairs at the center" -msgstr "" +msgstr "将十字夹在中间" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:2 msgid "Color of the crosshairs" -msgstr "" +msgstr "十字的颜色" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:3 msgid "" "Determines the length of the vertical and horizontal lines that make up the " "crosshairs." -msgstr "" +msgstr "确定组成十字的水平线和竖直线的长度。" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:4 msgid "" @@ -230,30 +231,35 @@ msgid "" "push: when the magnified mouse intersects a boundary of the zoom region, the " "contents are scrolled into view." msgstr "" +"确定放大了的鼠标图像在放大了的视图中的的位置,以及如何对系统鼠标的移动做出反" +"馈。可用的值有 - none:鼠标不跟踪;- centered:鼠标图像显示在放大区域的中心" +"(这也表示系统鼠标下的点),而且放大的内容也随着系统鼠标的移动而滚动;- " +"proportional:放大区域中,放大的鼠标的位置和系统鼠标在屏幕上的位置成比例相同" +"(数学上的“相似”);- push:当放大的鼠标与放大区域的边界相交时,将内容滚动进视" +"图。" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:5 msgid "" "Determines the transparency of the crosshairs, from fully opaque to fully " "transparent." -msgstr "" +msgstr "确定十字线的透明度,从全遮蔽到全透明。" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:6 msgid "" "Determines whether the crosshairs intersect the magnified mouse sprite, or " "are clipped such that the ends of the horizontal and vertical lines surround " "the mouse image." -msgstr "" +msgstr "确定十字是和放大的光标精灵交叉,还是固定来让水平和竖直线环绕鼠标形象。" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:7 -#, fuzzy msgid "Enable lens mode" -msgstr "启用" +msgstr "启用透镜模式" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:8 msgid "" "Enables/disables display of crosshairs centered on the magnified mouse " "sprite." -msgstr "" +msgstr "启用或禁用穿过放大的鼠标精灵的十字。" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:9 msgid "" @@ -261,22 +267,24 @@ msgid "" "of the screen, the magnified contents continue to scroll such that the " "screen edge moves into the magnified view." msgstr "" +"对于居中的鼠标跟踪,当系统指针位于或者接近屏幕的边缘时,放大的内容继续滚动," +"以便让屏幕边缘移动到放大的视图。" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:10 msgid "Length of the crosshairs" -msgstr "" +msgstr "十字长度" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:11 msgid "Magnification factor" -msgstr "" +msgstr "放大因子" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:12 msgid "Mouse Tracking Mode" -msgstr "" +msgstr "鼠标跟随模式" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:13 msgid "Opacity of the crosshairs" -msgstr "" +msgstr "十字的不透明度" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:14 msgid "Screen position" @@ -284,51 +292,51 @@ msgstr "屏幕位置" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:15 msgid "Scroll magnified contents beyond the edges of the desktop" -msgstr "" +msgstr "在桌面边界以外滚动放大内容" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:16 msgid "Show or hide crosshairs" -msgstr "" +msgstr "显示或隐藏十字线" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:17 msgid "Show or hide the magnifier" -msgstr "" +msgstr "显示或隐藏放大镜" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:18 msgid "Show or hide the magnifier and all of its zoom regions." -msgstr "" +msgstr "显示或隐藏放大镜及其全部放大区域。" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:19 msgid "" "The color of the the vertical and horizontal lines that make up the " "crosshairs." -msgstr "" +msgstr "组成十字的水平线和竖直线的颜色。" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:20 msgid "" "The magnified view either fills the entire screen, or occupies the top-half, " "bottom-half, left-half, or right-half of the screen." -msgstr "" +msgstr "放大的视图是充满整个屏幕还是占据屏幕的顶半部、底半部、左半部或右半部。" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:21 msgid "" "The power of the magnification. A value of 1.0 means no magnification. A " "value of 2.0 doubles the size." -msgstr "" +msgstr "边长的放大倍数。1.0 表示不放大,2.0 表示将长度增倍。" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:22 msgid "Thickness of the crosshairs" -msgstr "" +msgstr "十字的厚度" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:23 msgid "" "Whether the magnified view should be centered over the location of the " "system mouse and move with it." -msgstr "" +msgstr "放大的视图是否以系统鼠标为中心放置并且随之移动。" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:24 msgid "Width of the vertical and horizontal lines that make up the crosshairs." -msgstr "" +msgstr "组成十字的水平和竖直线的宽度。" #: ../data/clock-preferences.ui.h:1 msgid "Clock Format" @@ -367,19 +375,19 @@ msgstr "应用程序" msgid "PREFERENCES" msgstr "首选项" -#: ../js/ui/appDisplay.js:648 +#: ../js/ui/appDisplay.js:647 msgid "New Window" msgstr "新窗口" -#: ../js/ui/appDisplay.js:652 +#: ../js/ui/appDisplay.js:651 msgid "Remove from Favorites" msgstr "从收藏夹中移除" -#: ../js/ui/appDisplay.js:653 +#: ../js/ui/appDisplay.js:652 msgid "Add to Favorites" msgstr "添加到收藏夹" -#: ../js/ui/appDisplay.js:830 +#: ../js/ui/appDisplay.js:829 msgid "Drag here to add favorites" msgstr "拖到这里加入收藏夹" @@ -425,7 +433,9 @@ msgstr "未安装扩展" msgid "Enabled" msgstr "启用" -#: ../js/ui/lookingGlass.js:591 +#. translators: +#. * The device has been disabled +#: ../js/ui/lookingGlass.js:591 ../src/gvc/gvc-mixer-control.c:1087 msgid "Disabled" msgstr "禁用" @@ -525,7 +535,7 @@ msgstr "连接到..." #. simply result in invisible toggle switches. #: ../js/ui/popupMenu.js:33 msgid "toggle-switch-us" -msgstr "" +msgstr "toggle-switch-intl" #: ../js/ui/runDialog.js:233 msgid "Please enter a command:" @@ -553,7 +563,9 @@ msgid "My Account..." msgstr "我的帐户..." #: ../js/ui/statusMenu.js:123 -msgid "System Preferences..." +#, fuzzy +#| msgid "System Preferences..." +msgid "System Settings..." msgstr "系统首选项..." #: ../js/ui/statusMenu.js:130 @@ -582,7 +594,7 @@ msgstr "关机..." #: ../js/ui/status/accessibility.js:88 msgid "Screen Reader" -msgstr "" +msgstr "屏幕阅读器" #: ../js/ui/status/accessibility.js:91 msgid "Screen Keyboard" @@ -602,15 +614,15 @@ msgstr "慢速键" #: ../js/ui/status/accessibility.js:103 msgid "Bounce Keys" -msgstr "" +msgstr "筛选键" #: ../js/ui/status/accessibility.js:106 msgid "Mouse Keys" -msgstr "" +msgstr "鼠标按键" #: ../js/ui/status/accessibility.js:110 msgid "Universal Access Settings" -msgstr "" +msgstr "通用访问设置" #: ../js/ui/status/accessibility.js:163 msgid "High Contrast" @@ -643,29 +655,49 @@ msgstr "无法添加新工作区,因为已经达到了工作区数量限制。 msgid "Can't remove the first workspace." msgstr "不能移除第一个工作区。" -#: ../src/shell-global.c:1204 +#. translators: +#. * The number of sound outputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1094 +#, c-format +msgid "%u Output" +msgid_plural "%u Outputs" +msgstr[0] "" + +#. translators: +#. * The number of sound inputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1104 +#, c-format +msgid "%u Input" +msgid_plural "%u Inputs" +msgstr[0] "" + +#: ../src/gvc/gvc-mixer-control.c:1402 +msgid "System Sounds" +msgstr "" + +#: ../src/shell-global.c:1219 msgid "Less than a minute ago" msgstr "少于一分钟前" -#: ../src/shell-global.c:1208 +#: ../src/shell-global.c:1223 #, c-format msgid "%d minute ago" msgid_plural "%d minutes ago" msgstr[0] "%d 分钟前" -#: ../src/shell-global.c:1213 +#: ../src/shell-global.c:1228 #, c-format msgid "%d hour ago" msgid_plural "%d hours ago" msgstr[0] "%d 小时前" -#: ../src/shell-global.c:1218 +#: ../src/shell-global.c:1233 #, c-format msgid "%d day ago" msgid_plural "%d days ago" msgstr[0] "%d 天前" -#: ../src/shell-global.c:1223 +#: ../src/shell-global.c:1238 #, c-format msgid "%d week ago" msgid_plural "%d weeks ago" From 34aa46a844568432bf49163af3c0821a86e2e30a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 5 Nov 2010 18:48:04 +0100 Subject: [PATCH 33/85] app-menu: Fix quit menu item As popup menus now take focus for keyboard navigation, no application is focused when activating the menu. Use the target application instead, which keeps track of the application currently associated with the menu. https://bugzilla.gnome.org/show_bug.cgi?id=634103 --- js/ui/panel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/ui/panel.js b/js/ui/panel.js index eb1e4a378..286699516 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -408,9 +408,9 @@ AppMenuButton.prototype = { }, _onQuit: function() { - if (this._focusedApp == null) + if (this._targetApp == null) return; - this._focusedApp.request_quit(); + this._targetApp.request_quit(); }, _onAppStateChanged: function(tracker, app) { From a381017e83270bfa257d3ff3946e53cb9edea8ad Mon Sep 17 00:00:00 2001 From: "Henrique P. Machado" Date: Mon, 8 Nov 2010 15:21:44 -0200 Subject: [PATCH 34/85] Updated Brazilian Portuguese translation --- po/pt_BR.po | 640 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 571 insertions(+), 69 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index a3849b703..e2eb91636 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -4,14 +4,16 @@ # Og Maciel , 2009. # Rodrigo Flores , 2009. # Felipe Borges , 2010. +# Henrique P. Machado , 2010. # msgid "" msgstr "" "Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-17 14:02-0300\n" -"PO-Revision-Date: 2010-03-02 20:59-0300\n" -"Last-Translator: Rodrigo Flores \n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" +"shell&component=general\n" +"POT-Creation-Date: 2010-10-30 17:51+0000\n" +"PO-Revision-Date: 2010-09-02 17:36-0300\n" +"Last-Translator: Henrique P. Machado \n" "Language-Team: Brazilian Portuguese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -26,32 +28,386 @@ msgstr "GNOME Shell" msgid "Window management and application launching" msgstr "Gerenciamento de janelas e lançador de aplicativos" +#: ../data/gnome-shell-clock-preferences.desktop.in.in.h:1 +msgid "Clock" +msgstr "Relógio" + +#: ../data/gnome-shell-clock-preferences.desktop.in.in.h:2 +msgid "Customize the panel clock" +msgstr "Personalizar o relógio do painel" + +#: ../data/org.gnome.shell.gschema.xml.in.h:1 +msgid "" +"Allows access to internal debugging and monitoring tools using the Alt-F2 " +"dialog." +msgstr "" +"Permite acesso a ferramentas internas de depuração e monitoramento usando o " +"diálogo Alt-F2." + +#: ../data/org.gnome.shell.gschema.xml.in.h:2 +msgid "Custom format of the clock" +msgstr "Padrão personalizado do relógio" + +#: ../data/org.gnome.shell.gschema.xml.in.h:3 +msgid "Enable internal tools useful for developers and testers from Alt-F2" +msgstr "" +"Habilitar ferramentas internas úteis para desenvolvedores e testadores a " +"partir do Alt-F2" + +#: ../data/org.gnome.shell.gschema.xml.in.h:4 +msgid "File extension used for storing the screencast" +msgstr "Extensão de arquivo usada para armazenagem do screencast" + +#: ../data/org.gnome.shell.gschema.xml.in.h:5 +msgid "Framerate used for recording screencasts." +msgstr "Taxa de quadros usada para gravar screencasts." + +#: ../data/org.gnome.shell.gschema.xml.in.h:6 +msgid "" +"GNOME Shell extensions have a uuid property; this key lists extensions which " +"should not be loaded." +msgstr "" +"As extensões do GNOME Shell tem uma propriedade uuid; esta chave lista as " +"extensões que não devem ser carregadas." + +#: ../data/org.gnome.shell.gschema.xml.in.h:7 +msgid "History for command (Alt-F2) dialog" +msgstr "Histórico do diálogo comandos (Alt-F2)" + +#: ../data/org.gnome.shell.gschema.xml.in.h:8 +msgid "Hour format" +msgstr "Formato de horas" + +#: ../data/org.gnome.shell.gschema.xml.in.h:9 +msgid "" +"If true and format is either \"12-hour\" or \"24-hour\", display date in the " +"clock, in addition to time." +msgstr "" +"Se verdadeiro e o formato é \"12-horas\" ou \"24-horas\", mostra a data no " +"relógio, junto com o horário." + +#: ../data/org.gnome.shell.gschema.xml.in.h:10 +msgid "" +"If true and format is either \"12-hour\" or \"24-hour\", display seconds in " +"time." +msgstr "" +"Se verdadeiro e o formato é \"12-horas\" ou \"24-horas\", mostra os segundos " +"junto com o horário." + +#: ../data/org.gnome.shell.gschema.xml.in.h:11 +msgid "If true, display the ISO week date in the calendar." +msgstr "Se verdadeiro, exibe o número da semana no calendário." + +#: ../data/org.gnome.shell.gschema.xml.in.h:12 +msgid "List of desktop file IDs for favorite applications" +msgstr "" +"Lista dos IDs de arquivo de área de trabalho para os aplicativos favoritos" + +#: ../data/org.gnome.shell.gschema.xml.in.h:13 +msgid "Overview workspace view mode" +msgstr "Resumo do modo de visão de áreas de trabalho" + +#: ../data/org.gnome.shell.gschema.xml.in.h:14 +msgid "" +"Sets the GStreamer pipeline used to encode recordings. It follows the syntax " +"used for gst-launch. The pipeline should have an unconnected sink pad where " +"the recorded video is recorded. It will normally have a unconnected source " +"pad; output from that pad will be written into the output file. However the " +"pipeline can also take care of its own output - this might be used to send " +"the output to an icecast server via shout2send or similar. When unset or set " +"to an empty value, the default pipeline will be used. This is currently " +"'videorate ! theoraenc ! oggmux' and records to Ogg Theora." +msgstr "" +"Configura a fila de processamento usada para codificar gravações. Ela segue " +"a a sintaxe usada para gst-launch. A fila de processamento deve ter um sink " +"pad onde o vídeo gravado é retido. Ele normalmente terá um source pad " +"desconectado; saídas deste pad serão gravadas no arquivo de saída. Porém, a " +"fila de processamento pode também tomar conta de sua própria saída - isto " +"poderia ser usado para enviar a saída para um servidor icecast via " +"shout2send oiu similar. Quando não definido ou definido para um valor vazio, " +"o fluxo de processamento padrão será usado. Atualmente é 'videorate ! " +"theoraenc ! oggmux' e gravação no formato Ogg Theora." + +#: ../data/org.gnome.shell.gschema.xml.in.h:15 +msgid "Show date in clock" +msgstr "Mostrar data no relógio" + +#: ../data/org.gnome.shell.gschema.xml.in.h:16 +msgid "Show the week date in the calendar" +msgstr "Mostrar o número da semana no calendário" + +#: ../data/org.gnome.shell.gschema.xml.in.h:17 +msgid "Show time with seconds" +msgstr "Mostrar horário com segundos" + +#: ../data/org.gnome.shell.gschema.xml.in.h:18 +msgid "" +"The applications corresponding to these identifiers will be displayed in the " +"favorites area." +msgstr "" +"Os aplicativos correspondentes a estes identificadores serão exibidos na " +"área de favoritos." + +#: ../data/org.gnome.shell.gschema.xml.in.h:19 +msgid "" +"The filename for recorded screencasts will be a unique filename based on the " +"current date, and use this extension. It should be changed when recording to " +"a different container format." +msgstr "" +"O nome de arquivo para screencasts gravados será um nome de arquivo único " +"baseado na data atual e usará esta extensão. Ele deve ser alterado ao gravar " +"para um contêiner de formato diferente." + +#: ../data/org.gnome.shell.gschema.xml.in.h:20 +msgid "" +"The framerate of the resulting screencast recordered by GNOME Shell's " +"screencast recorder in frames-per-second." +msgstr "" +"A taxa de quadros do screencast resultante gravado pelo gravador de " +"screencastsdo GNOME Shell em quadros por segundo." + +#: ../data/org.gnome.shell.gschema.xml.in.h:21 +msgid "The gstreamer pipeline used to encode the screencast" +msgstr "A fila de processamento gstreamer usada para codificar o screencast" + +#: ../data/org.gnome.shell.gschema.xml.in.h:22 +msgid "" +"The selected workspace view mode in the overview. Supported values are " +"\"single\" and \"grid\"." +msgstr "" +"O o modo de visão do espaço de trabalho na visão geral. Valores aceitos são: " +"\"single\" e \"grid\"." + +#: ../data/org.gnome.shell.gschema.xml.in.h:23 +msgid "" +"The shell normally monitors active applications in order to present the most " +"used ones (e.g. in launchers). While this data will be kept private, you may " +"want to disable this for privacy reasons. Please note that doing so won't " +"remove already saved data." +msgstr "" +"O shell normalmente monitora os aplicativos em execução para apresentar os " +"mais usados (ex: em lançadores). Embora estes dados serão mantidos em em " +"segurança, você pode querer desabilitá-los por razões de privacidade. Por " +"favor, note que que ao fazer isso não removerá os dado já salvos." + +#: ../data/org.gnome.shell.gschema.xml.in.h:24 +msgid "" +"This key specifies the format used by the panel clock when the format key is " +"set to \"custom\". You can use conversion specifiers understood by strftime" +"() to obtain a specific format. See the strftime() manual for more " +"information." +msgstr "" +"Esta chave especifica o formato usado pelo relógio do painel quando a chave " +"de formato é atribuída como \"personalizado\". Você pode usar " +"especificadores de conversão entendidos pela função strftime() para obter um " +"formato específico. Veja o manual da strftime() para maiores informações." + +#: ../data/org.gnome.shell.gschema.xml.in.h:25 +msgid "" +"This key specifies the hour format used by the panel clock. Possible values " +"are \"12-hour\", \"24-hour\", \"unix\" and \"custom\". If set to \"unix\", " +"the clock will display time in seconds since Epoch, i.e. 1970-01-01. If set " +"to \"custom\", the clock will display time according to the format specified " +"in the custom_format key. Note that if set to either \"unix\" or \"custom\", " +"the show_date and show_seconds keys are ignored." +msgstr "" +"Esta chave especifica o formato de horas utilizado pelo relógio do painel. " +"Valores possíveis são \"12-hour\", \"24-hour\", \"unix\" e \"custom\". Se " +"definida como \"unix\", o relógio irá exibir as horas em segundos desde seu " +"lançamento, por exemplo 01/01/1970. Se definida como \"custom\", o relógio " +"irá exibir as horas de acordo com o formato especificado na chave " +"custom_format. Note que se definida tanto como \"unix\" ou \"custom\", as " +"chaves show_date e show_seconds serão igoradas." + +#: ../data/org.gnome.shell.gschema.xml.in.h:26 +msgid "Uuids of extensions to disable" +msgstr "Uuids das extensões a desabilitar" + +#: ../data/org.gnome.shell.gschema.xml.in.h:27 +msgid "Whether to collect stats about applications usage" +msgstr "Quando coletar dados sobre uso de aplicativos" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:1 +msgid "Clip the crosshairs at the center" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:2 +msgid "Color of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:3 +msgid "" +"Determines the length of the vertical and horizontal lines that make up the " +"crosshairs." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:4 +msgid "" +"Determines the position of the magnified mouse image within the magnified " +"view and how it reacts to system mouse movement. The values are - none: no " +"mouse tracking; - centered: the mouse image is displayed at the center of " +"the zoom region (which also represents the point under the system mouse) and " +"the magnified contents are scrolled as the system mouse moves; - " +"proportional: the position of the magnified mouse in the zoom region is " +"proportionally the same as the position of the system mouse on screen; - " +"push: when the magnified mouse intersects a boundary of the zoom region, the " +"contents are scrolled into view." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:5 +msgid "" +"Determines the transparency of the crosshairs, from fully opaque to fully " +"transparent." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:6 +msgid "" +"Determines whether the crosshairs intersect the magnified mouse sprite, or " +"are clipped such that the ends of the horizontal and vertical lines surround " +"the mouse image." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:7 +#, fuzzy +#| msgid "Enabled" +msgid "Enable lens mode" +msgstr "Habilitado" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:8 +msgid "" +"Enables/disables display of crosshairs centered on the magnified mouse " +"sprite." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:9 +msgid "" +"For centered mouse tracking, when the system pointer is at or near the edge " +"of the screen, the magnified contents continue to scroll such that the " +"screen edge moves into the magnified view." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:10 +msgid "Length of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:11 +msgid "Magnification factor" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:12 +msgid "Mouse Tracking Mode" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:13 +msgid "Opacity of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:14 +msgid "Screen position" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:15 +msgid "Scroll magnified contents beyond the edges of the desktop" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:16 +msgid "Show or hide crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:17 +msgid "Show or hide the magnifier" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:18 +msgid "Show or hide the magnifier and all of its zoom regions." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:19 +msgid "" +"The color of the the vertical and horizontal lines that make up the " +"crosshairs." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:20 +msgid "" +"The magnified view either fills the entire screen, or occupies the top-half, " +"bottom-half, left-half, or right-half of the screen." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:21 +msgid "" +"The power of the magnification. A value of 1.0 means no magnification. A " +"value of 2.0 doubles the size." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:22 +msgid "Thickness of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:23 +msgid "" +"Whether the magnified view should be centered over the location of the " +"system mouse and move with it." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:24 +msgid "Width of the vertical and horizontal lines that make up the crosshairs." +msgstr "" + +#: ../data/clock-preferences.ui.h:1 +msgid "Clock Format" +msgstr "Formato do relógio" + +#: ../data/clock-preferences.ui.h:2 +msgid "Clock Preferences" +msgstr "Preferências do Relógio" + +#: ../data/clock-preferences.ui.h:3 +msgid "Panel Display" +msgstr "Mostrador do painel" + +#: ../data/clock-preferences.ui.h:4 +msgid "Show seco_nds" +msgstr "Mostrar segundos" + +#: ../data/clock-preferences.ui.h:5 +msgid "Show the _date" +msgstr "Mostrar a _data" + +#: ../data/clock-preferences.ui.h:6 +msgid "_12 hour format" +msgstr "Formato de _12 horas" + +#: ../data/clock-preferences.ui.h:7 +msgid "_24 hour format" +msgstr "Formato de _24 horas" + #. **** Applications **** -#: ../js/ui/appDisplay.js:306 ../js/ui/dash.js:850 +#: ../js/ui/appDisplay.js:316 ../js/ui/dash.js:778 msgid "APPLICATIONS" msgstr "APLICATIVOS" -#: ../js/ui/appDisplay.js:338 +#: ../js/ui/appDisplay.js:348 msgid "PREFERENCES" msgstr "PREFERÊNCIAS" -#: ../js/ui/appDisplay.js:697 +#: ../js/ui/appDisplay.js:647 msgid "New Window" msgstr "Nova janela" -#: ../js/ui/appDisplay.js:701 +#: ../js/ui/appDisplay.js:651 msgid "Remove from Favorites" msgstr "Remover dos Favoritos" -#: ../js/ui/appDisplay.js:702 +#: ../js/ui/appDisplay.js:652 msgid "Add to Favorites" msgstr "Adicionar aos Favoritos" -#: ../js/ui/appDisplay.js:1029 +#: ../js/ui/appDisplay.js:829 msgid "Drag here to add favorites" msgstr "Arraste até aqui para adicionar aos favoritos" -#: ../js/ui/appFavorites.js:89 +#: ../js/ui/appFavorites.js:88 #, c-format msgid "%s has been added to your favorites." msgstr "%s foi adicionado aos seus favoritos." @@ -61,177 +417,314 @@ msgstr "%s foi adicionado aos seus favoritos." msgid "%s has been removed from your favorites." msgstr "%s foi removido dos seus favoritos." -#: ../js/ui/dash.js:189 +#: ../js/ui/dash.js:142 msgid "Find" msgstr "Localizar" -#: ../js/ui/dash.js:505 +#: ../js/ui/dash.js:473 msgid "Searching..." msgstr "Pesquisando..." -#: ../js/ui/dash.js:519 +#: ../js/ui/dash.js:487 msgid "No matching results." msgstr "Nenhum resultado encontrado." #. **** Places **** #. Translators: This is in the sense of locations for documents, #. network locations, etc. -#: ../js/ui/dash.js:869 ../js/ui/placeDisplay.js:543 +#: ../js/ui/dash.js:797 ../js/ui/placeDisplay.js:554 msgid "PLACES & DEVICES" msgstr "LOCAIS & DISPOSITIVOS" #. **** Documents **** -#: ../js/ui/dash.js:876 ../js/ui/docDisplay.js:489 +#: ../js/ui/dash.js:804 ../js/ui/docDisplay.js:494 msgid "RECENT ITEMS" msgstr "DOCUMENTOS RECENTES" -#: ../js/ui/lookingGlass.js:362 +#: ../js/ui/lookingGlass.js:552 msgid "No extensions installed" msgstr "Nenhuma extensão instalada" -#: ../js/ui/lookingGlass.js:399 +#: ../js/ui/lookingGlass.js:589 msgid "Enabled" msgstr "Habilitado" -#: ../js/ui/lookingGlass.js:401 +#. translators: +#. * The device has been disabled +#: ../js/ui/lookingGlass.js:591 ../src/gvc/gvc-mixer-control.c:1087 msgid "Disabled" msgstr "Desabilitado" -#: ../js/ui/lookingGlass.js:403 +#: ../js/ui/lookingGlass.js:593 msgid "Error" msgstr "Erro" -#: ../js/ui/lookingGlass.js:405 +#: ../js/ui/lookingGlass.js:595 msgid "Out of date" msgstr "Expirado" -#: ../js/ui/lookingGlass.js:430 +#: ../js/ui/lookingGlass.js:620 msgid "View Source" msgstr "Ver fonte" -#: ../js/ui/lookingGlass.js:436 +#: ../js/ui/lookingGlass.js:626 msgid "Web Page" msgstr "Página Web" -#: ../js/ui/overview.js:181 +#: ../js/ui/overview.js:160 msgid "Undo" msgstr "Desfazer" -#. Button on the left side of the panel. -#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview". -#: ../js/ui/panel.js:346 -msgid "Activities" -msgstr "Atividades" +#. TODO - _quit() doesn't really work on apps in state STARTING yet +#: ../js/ui/panel.js:469 +#, c-format +msgid "Quit %s" +msgstr "Sair de %s" -#. Translators: This is the time format used in 24-hour mode. -#: ../js/ui/panel.js:566 +#: ../js/ui/panel.js:494 +msgid "Preferences" +msgstr "Preferências" + +#. Translators: This is the time format with date used +#. in 24-hour mode. +#: ../js/ui/panel.js:580 +msgid "%a %b %e, %R:%S" +msgstr "%a %b %e, %R:%S" + +#: ../js/ui/panel.js:581 +msgid "%a %b %e, %R" +msgstr "%a %b %e, %R" + +#. Translators: This is the time format without date used +#. in 24-hour mode. +#: ../js/ui/panel.js:585 +msgid "%a %R:%S" +msgstr "%a %R:%S" + +#: ../js/ui/panel.js:586 msgid "%a %R" msgstr "%a %R" -#. Translators: This is a time format used for AM/PM. -#: ../js/ui/panel.js:569 -msgid "%a %l:%M %p" -msgstr "%a %l:%M %p" +#. Translators: This is a time format with date used +#. for AM/PM. +#: ../js/ui/panel.js:593 +msgid "%a %b %e, %l:%M:%S %p" +msgstr "%a %e de %b, %H:%M:%S" -#: ../js/ui/placeDisplay.js:108 +#: ../js/ui/panel.js:594 +msgid "%a %b %e, %l:%M %p" +msgstr "%a %e de %b, %H:%M" + +#. Translators: This is a time format without date used +#. for AM/PM. +#: ../js/ui/panel.js:598 +msgid "%a %l:%M:%S %p" +msgstr "%a %H:%M:%S" + +#: ../js/ui/panel.js:599 +msgid "%a %l:%M %p" +msgstr "%a %H:%M" + +#. Button on the left side of the panel. +#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview". +#: ../js/ui/panel.js:744 +msgid "Activities" +msgstr "Atividades" + +#: ../js/ui/placeDisplay.js:111 #, c-format msgid "Failed to unmount '%s'" msgstr "Erro ao desmontar \"%s\"" -#: ../js/ui/placeDisplay.js:111 +#: ../js/ui/placeDisplay.js:114 msgid "Retry" msgstr "Tentar novamente" -#: ../js/ui/placeDisplay.js:156 +#: ../js/ui/placeDisplay.js:159 msgid "Connect to..." msgstr "Conectar ao..." -#: ../js/ui/runDialog.js:231 +#. Translators: this MUST be either "toggle-switch-us" +#. (for toggle switches containing the English words +#. "ON" and "OFF") or "toggle-switch-intl" (for toggle +#. switches containing "◯" and "|"). Other values will +#. simply result in invisible toggle switches. +#: ../js/ui/popupMenu.js:33 +msgid "toggle-switch-us" +msgstr "" + +#: ../js/ui/runDialog.js:233 msgid "Please enter a command:" msgstr "Por favor digite um comando:" -#: ../js/ui/runDialog.js:375 +#: ../js/ui/runDialog.js:378 #, c-format msgid "Execution of '%s' failed:" msgstr "A execução de \"%s\" falhou:" -#: ../js/ui/statusMenu.js:105 +#: ../js/ui/statusMenu.js:101 msgid "Available" msgstr "Disponível" -#: ../js/ui/statusMenu.js:110 +#: ../js/ui/statusMenu.js:106 msgid "Busy" msgstr "Ocupado" -#: ../js/ui/statusMenu.js:115 +#: ../js/ui/statusMenu.js:111 msgid "Invisible" msgstr "Invisível" -#: ../js/ui/statusMenu.js:124 -msgid "Account Information..." -msgstr "Informação da conta..." +#: ../js/ui/statusMenu.js:119 +msgid "My Account..." +msgstr "" -#: ../js/ui/statusMenu.js:129 -msgid "System Preferences..." -msgstr "Preferências do sistema..." +#: ../js/ui/statusMenu.js:123 +#| msgid "System Preferences..." +msgid "System Settings..." +msgstr "Configurações do sistema..." -#: ../js/ui/statusMenu.js:138 +#: ../js/ui/statusMenu.js:130 msgid "Lock Screen" msgstr "Travar a tela" -#: ../js/ui/statusMenu.js:143 +#: ../js/ui/statusMenu.js:134 msgid "Switch User" msgstr "Alternar usuário" -#: ../js/ui/statusMenu.js:149 +#: ../js/ui/statusMenu.js:139 msgid "Log Out..." msgstr "Encerrar sessão..." +#: ../js/ui/statusMenu.js:146 +msgid "Suspend" +msgstr "" + +#: ../js/ui/statusMenu.js:150 +msgid "Restart..." +msgstr "" + #: ../js/ui/statusMenu.js:154 msgid "Shut Down..." msgstr "Desligar..." -#: ../js/ui/windowAttentionHandler.js:47 +#: ../js/ui/status/accessibility.js:88 +msgid "Screen Reader" +msgstr "" + +#: ../js/ui/status/accessibility.js:91 +msgid "Screen Keyboard" +msgstr "" + +#: ../js/ui/status/accessibility.js:94 +msgid "Visual Alerts" +msgstr "" + +#: ../js/ui/status/accessibility.js:97 +msgid "Sticky Keys" +msgstr "" + +#: ../js/ui/status/accessibility.js:100 +msgid "Slow Keys" +msgstr "" + +#: ../js/ui/status/accessibility.js:103 +msgid "Bounce Keys" +msgstr "" + +#: ../js/ui/status/accessibility.js:106 +msgid "Mouse Keys" +msgstr "" + +#: ../js/ui/status/accessibility.js:110 +msgid "Universal Access Settings" +msgstr "" + +#: ../js/ui/status/accessibility.js:163 +msgid "High Contrast" +msgstr "" + +#: ../js/ui/status/accessibility.js:202 +msgid "Large Text" +msgstr "" + +#: ../js/ui/status/accessibility.js:223 +msgid "Zoom" +msgstr "" + +#: ../js/ui/windowAttentionHandler.js:43 #, c-format msgid "%s has finished starting" msgstr "%s terminou sua inicialização" -#: ../js/ui/windowAttentionHandler.js:49 +#: ../js/ui/windowAttentionHandler.js:45 #, c-format msgid "'%s' is ready" msgstr "\"%s\" está pronto" -#: ../src/shell-global.c:967 -msgid "Less than a minute ago" -msgstr "Menos de um minuto atrás" +#: ../js/ui/workspacesView.js:229 +msgid "" +"Can't add a new workspace because maximum workspaces limit has been reached." +msgstr "" +"Não é possível adicionar um novo espaço de trabalho porque foi atingido o " +"limite." -#: ../src/shell-global.c:971 +#: ../js/ui/workspacesView.js:246 +msgid "Can't remove the first workspace." +msgstr "Não é possível remover o primeiro espaço de trabalho." + +#. translators: +#. * The number of sound outputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1094 +#, c-format +msgid "%u Output" +msgid_plural "%u Outputs" +msgstr[0] "" +msgstr[1] "" + +#. translators: +#. * The number of sound inputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1104 +#, c-format +msgid "%u Input" +msgid_plural "%u Inputs" +msgstr[0] "" +msgstr[1] "" + +#: ../src/gvc/gvc-mixer-control.c:1402 +msgid "System Sounds" +msgstr "" + +#: ../src/shell-global.c:1219 +msgid "Less than a minute ago" +msgstr "Há menos de um minuto" + +#: ../src/shell-global.c:1223 #, c-format msgid "%d minute ago" msgid_plural "%d minutes ago" -msgstr[0] "%d minuto atrás" -msgstr[1] "%d minutos atrás" +msgstr[0] "Há %d minuto" +msgstr[1] "Há %d minutos" -#: ../src/shell-global.c:976 +#: ../src/shell-global.c:1228 #, c-format msgid "%d hour ago" msgid_plural "%d hours ago" -msgstr[0] "%d hora atrás" -msgstr[1] "%d horas atrás" +msgstr[0] "Há %d hora" +msgstr[1] "Há %d horas" -#: ../src/shell-global.c:981 +#: ../src/shell-global.c:1233 #, c-format msgid "%d day ago" msgid_plural "%d days ago" -msgstr[0] "%d dia atrás" -msgstr[1] "%d dias atrás" +msgstr[0] "Há %d dia" +msgstr[1] "Há %d dias" -#: ../src/shell-global.c:986 +#: ../src/shell-global.c:1238 #, c-format msgid "%d week ago" msgid_plural "%d weeks ago" -msgstr[0] "%d semana atrás" -msgstr[1] "%d semanas atrás" +msgstr[0] "Há %d semana" +msgstr[1] "Há %d semanas" #: ../src/shell-uri-util.c:89 msgid "Home Folder" @@ -257,6 +750,15 @@ msgstr "Pesquisar" msgid "%1$s: %2$s" msgstr "%1$s: %2$s" +#~ msgid "ON" +#~ msgstr "⚪" + +#~ msgid "OFF" +#~ msgstr "⚫" + +#~ msgid "Account Information..." +#~ msgstr "Informação da conta..." + #~ msgid "Sidebar" #~ msgstr "Barra lateral" From 4c6dd64e8751419adefa5441a3960744f602e2c8 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 2 Nov 2010 13:24:29 -0400 Subject: [PATCH 35/85] StButton: fix code style https://bugzilla.gnome.org/show_bug.cgi?id=633853 --- src/st/st-button.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/st/st-button.c b/src/st/st-button.c index 81d4e88a6..9aefb04ba 100644 --- a/src/st/st-button.c +++ b/src/st/st-button.c @@ -88,13 +88,13 @@ st_button_update_label_style (StButton *button) { ClutterActor *label; - label = st_bin_get_child ((StBin*) button); + label = st_bin_get_child (ST_BIN (button)); /* check the child is really a label */ if (!CLUTTER_IS_TEXT (label)) return; - _st_set_text_from_style ((ClutterText*) label, st_widget_get_theme_node (ST_WIDGET (button))); + _st_set_text_from_style (CLUTTER_TEXT (label), st_widget_get_theme_node (ST_WIDGET (button))); } static void @@ -125,13 +125,13 @@ st_button_style_changed (StWidget *widget) static void st_button_real_pressed (StButton *button) { - st_widget_add_style_pseudo_class ((StWidget*) button, "active"); + st_widget_add_style_pseudo_class (ST_WIDGET (button), "active"); } static void st_button_real_released (StButton *button) { - st_widget_remove_style_pseudo_class ((StWidget*) button, "active"); + st_widget_remove_style_pseudo_class (ST_WIDGET (button), "active"); } static gboolean @@ -196,9 +196,9 @@ st_button_enter (ClutterActor *actor, { StButton *button = ST_BUTTON (actor); - st_widget_add_style_pseudo_class ((StWidget*) button, "hover"); + st_widget_add_style_pseudo_class (ST_WIDGET (button), "hover"); - button->priv->is_hover = 1; + button->priv->is_hover = TRUE; return CLUTTER_ACTOR_CLASS (st_button_parent_class)->enter_event (actor, event); } @@ -209,7 +209,7 @@ st_button_leave (ClutterActor *actor, { StButton *button = ST_BUTTON (actor); - button->priv->is_hover = 0; + button->priv->is_hover = FALSE; if (button->priv->is_pressed) { @@ -223,7 +223,7 @@ st_button_leave (ClutterActor *actor, klass->released (button); } - st_widget_remove_style_pseudo_class ((StWidget*) button, "hover"); + st_widget_remove_style_pseudo_class (ST_WIDGET (button), "hover"); return CLUTTER_ACTOR_CLASS (st_button_parent_class)->leave_event (actor, event); } @@ -360,7 +360,7 @@ st_button_init (StButton *button) button->priv = ST_BUTTON_GET_PRIVATE (button); button->priv->spacing = 6; - clutter_actor_set_reactive ((ClutterActor *) button, TRUE); + clutter_actor_set_reactive (CLUTTER_ACTOR (button), TRUE); } /** @@ -431,7 +431,7 @@ st_button_set_label (StButton *button, else priv->text = g_strdup (""); - label = st_bin_get_child ((StBin*) button); + label = st_bin_get_child (ST_BIN (button)); if (label && CLUTTER_IS_TEXT (label)) { @@ -445,7 +445,7 @@ st_button_set_label (StButton *button, "ellipsize", PANGO_ELLIPSIZE_END, "use-markup", TRUE, NULL); - st_bin_set_child ((StBin*) button, label); + st_bin_set_child (ST_BIN (button), label); } /* Fake a style change so that we reset the style properties on the label */ @@ -524,9 +524,9 @@ st_button_set_checked (StButton *button, button->priv->is_checked = checked; if (checked) - st_widget_add_style_pseudo_class ((StWidget*) button, "checked"); + st_widget_add_style_pseudo_class (ST_WIDGET (button), "checked"); else - st_widget_remove_style_pseudo_class ((StWidget*) button, "checked"); + st_widget_remove_style_pseudo_class (ST_WIDGET (button), "checked"); } g_object_notify (G_OBJECT (button), "checked"); From 4f1f2268289aa23a8998f9ac3360985c8a55ddc5 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 2 Nov 2010 13:24:29 -0400 Subject: [PATCH 36/85] StButton: fix hover and grab tracking Use StWidget:track-hover rather than doing it ourselves. Don't assume that hover is always TRUE after an enter_event or FALSE after a leave_event, since we have a pointer grab and will be getting other actors' events. Don't ungrab the pointer when it leaves the button, since that destroys the whole point of getting a grab in the first place. Only consider the button to have been clicked when it has both grab (meaning the mouse was pressed over the button) and hover (meaning the mouse was released over the button). Also remove the virtual pressed/released methods, which weren't being used anyway. https://bugzilla.gnome.org/show_bug.cgi?id=633853 --- src/st/st-button.c | 89 ++++++++++++++++++++++++---------------------- src/st/st-button.h | 2 -- 2 files changed, 47 insertions(+), 44 deletions(-) diff --git a/src/st/st-button.c b/src/st/st-button.c index 9aefb04ba..9095f7e3e 100644 --- a/src/st/st-button.c +++ b/src/st/st-button.c @@ -72,9 +72,9 @@ struct _StButtonPrivate gchar *text; guint is_pressed : 1; - guint is_hover : 1; guint is_checked : 1; guint is_toggle : 1; + guint has_grab : 1; gint spacing; }; @@ -123,15 +123,32 @@ st_button_style_changed (StWidget *widget) } static void -st_button_real_pressed (StButton *button) +st_button_press (StButton *button) { + if (button->priv->is_pressed) + return; + + button->priv->is_pressed = TRUE; st_widget_add_style_pseudo_class (ST_WIDGET (button), "active"); } static void -st_button_real_released (StButton *button) +st_button_release (StButton *button, + gboolean clicked) { + if (!button->priv->is_pressed) + return; + + button->priv->is_pressed = FALSE; st_widget_remove_style_pseudo_class (ST_WIDGET (button), "active"); + + if (clicked) + { + if (button->priv->is_toggle) + st_button_set_checked (button, !button->priv->is_checked); + + g_signal_emit (button, button_signals[CLICKED], 0); + } } static gboolean @@ -143,14 +160,10 @@ st_button_button_press (ClutterActor *actor, if (event->button == 1) { StButton *button = ST_BUTTON (actor); - StButtonClass *klass = ST_BUTTON_GET_CLASS (button); - - button->priv->is_pressed = TRUE; clutter_grab_pointer (actor); - - if (klass->pressed) - klass->pressed (button); + button->priv->has_grab = TRUE; + st_button_press (button); return TRUE; } @@ -165,25 +178,17 @@ st_button_button_release (ClutterActor *actor, if (event->button == 1) { StButton *button = ST_BUTTON (actor); - StButtonClass *klass = ST_BUTTON_GET_CLASS (button); + gboolean is_click; - if (!button->priv->is_pressed) - return FALSE; + is_click = button->priv->has_grab && st_widget_get_hover (ST_WIDGET (button)); + st_button_release (button, is_click); - clutter_ungrab_pointer (); - - if (button->priv->is_toggle) + if (button->priv->has_grab) { - st_button_set_checked (button, !button->priv->is_checked); + button->priv->has_grab = FALSE; + clutter_ungrab_pointer (); } - button->priv->is_pressed = FALSE; - - if (klass->released) - klass->released (button); - - g_signal_emit (button, button_signals[CLICKED], 0); - return TRUE; } @@ -195,12 +200,19 @@ st_button_enter (ClutterActor *actor, ClutterCrossingEvent *event) { StButton *button = ST_BUTTON (actor); + gboolean ret; - st_widget_add_style_pseudo_class (ST_WIDGET (button), "hover"); + ret = CLUTTER_ACTOR_CLASS (st_button_parent_class)->enter_event (actor, event); - button->priv->is_hover = TRUE; + if (button->priv->has_grab) + { + if (st_widget_get_hover (ST_WIDGET (button))) + st_button_press (button); + else + st_button_release (button, FALSE); + } - return CLUTTER_ACTOR_CLASS (st_button_parent_class)->enter_event (actor, event); + return ret; } static gboolean @@ -208,24 +220,19 @@ st_button_leave (ClutterActor *actor, ClutterCrossingEvent *event) { StButton *button = ST_BUTTON (actor); + gboolean ret; - button->priv->is_hover = FALSE; + ret = CLUTTER_ACTOR_CLASS (st_button_parent_class)->leave_event (actor, event); - if (button->priv->is_pressed) + if (button->priv->has_grab) { - StButtonClass *klass = ST_BUTTON_GET_CLASS (button); - - clutter_ungrab_pointer (); - - button->priv->is_pressed = FALSE; - - if (klass->released) - klass->released (button); + if (st_widget_get_hover (ST_WIDGET (button))) + st_button_press (button); + else + st_button_release (button, FALSE); } - st_widget_remove_style_pseudo_class (ST_WIDGET (button), "hover"); - - return CLUTTER_ACTOR_CLASS (st_button_parent_class)->leave_event (actor, event); + return ret; } static void @@ -302,9 +309,6 @@ st_button_class_init (StButtonClass *klass) g_type_class_add_private (klass, sizeof (StButtonPrivate)); - klass->pressed = st_button_real_pressed; - klass->released = st_button_real_released; - gobject_class->set_property = st_button_set_property; gobject_class->get_property = st_button_get_property; gobject_class->finalize = st_button_finalize; @@ -361,6 +365,7 @@ st_button_init (StButton *button) button->priv->spacing = 6; clutter_actor_set_reactive (CLUTTER_ACTOR (button), TRUE); + st_widget_set_track_hover (ST_WIDGET (button), TRUE); } /** diff --git a/src/st/st-button.h b/src/st/st-button.h index f17bc50b9..1b853769d 100644 --- a/src/st/st-button.h +++ b/src/st/st-button.h @@ -66,8 +66,6 @@ struct _StButtonClass StBinClass parent_class; /* vfuncs, not signals */ - void (* pressed) (StButton *button); - void (* released) (StButton *button); void (* transition) (StButton *button); /* signals */ From 35f806df4e2671c06552d0c18b79dd6de80a440f Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 13 Oct 2010 15:53:42 -0400 Subject: [PATCH 37/85] St: add keyboard support to StClickable and StButton Allow triggering clicks with space/return https://bugzilla.gnome.org/show_bug.cgi?id=633853 --- src/st/st-button.c | 32 ++++++++++++++++++++++++++++++++ src/st/st-clickable.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/src/st/st-button.c b/src/st/st-button.c index 9095f7e3e..92624cdf0 100644 --- a/src/st/st-button.c +++ b/src/st/st-button.c @@ -195,6 +195,36 @@ st_button_button_release (ClutterActor *actor, return FALSE; } +static gboolean +st_button_key_press (ClutterActor *actor, + ClutterKeyEvent *event) +{ + st_widget_hide_tooltip (ST_WIDGET (actor)); + + if (event->keyval == CLUTTER_KEY_space || + event->keyval == CLUTTER_KEY_Return) + { + st_button_press (ST_BUTTON (actor)); + return TRUE; + } + + return FALSE; +} + +static gboolean +st_button_key_release (ClutterActor *actor, + ClutterKeyEvent *event) +{ + if (event->keyval == CLUTTER_KEY_space || + event->keyval == CLUTTER_KEY_Return) + { + st_button_release (ST_BUTTON (actor), TRUE); + return TRUE; + } + + return FALSE; +} + static gboolean st_button_enter (ClutterActor *actor, ClutterCrossingEvent *event) @@ -315,6 +345,8 @@ st_button_class_init (StButtonClass *klass) actor_class->button_press_event = st_button_button_press; actor_class->button_release_event = st_button_button_release; + actor_class->key_press_event = st_button_key_press; + actor_class->key_release_event = st_button_key_release; actor_class->enter_event = st_button_enter; actor_class->leave_event = st_button_leave; diff --git a/src/st/st-clickable.c b/src/st/st-clickable.c index 38cc41f47..ab4920795 100644 --- a/src/st/st-clickable.c +++ b/src/st/st-clickable.c @@ -158,6 +158,37 @@ st_clickable_button_release_event (ClutterActor *actor, return TRUE; } +static gboolean +st_clickable_key_press_event (ClutterActor *actor, + ClutterKeyEvent *event) +{ + StClickable *self = ST_CLICKABLE (actor); + + if (event->keyval == CLUTTER_KEY_space || + event->keyval == CLUTTER_KEY_Return) + { + set_pressed (self, TRUE); + return TRUE; + } + return FALSE; +} + +static gboolean +st_clickable_key_release_event (ClutterActor *actor, + ClutterKeyEvent *event) +{ + StClickable *self = ST_CLICKABLE (actor); + + if (event->keyval != CLUTTER_KEY_space && + event->keyval != CLUTTER_KEY_Return) + return FALSE; + + set_pressed (self, FALSE); + + g_signal_emit (G_OBJECT (self), st_clickable_signals[CLICKED], 0, event); + return TRUE; +} + /** * st_clickable_fake_release: * @box: @@ -240,6 +271,8 @@ st_clickable_class_init (StClickableClass *klass) actor_class->leave_event = st_clickable_leave_event; actor_class->button_press_event = st_clickable_button_press_event; actor_class->button_release_event = st_clickable_button_release_event; + actor_class->key_press_event = st_clickable_key_press_event; + actor_class->key_release_event = st_clickable_key_release_event; /** * StClickable::clicked From 013f07278b206eca14df780030918e4666dce922 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 8 Nov 2010 15:14:09 -0500 Subject: [PATCH 38/85] Bump version to 2.91.2 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0a6ec3013..d935d0fcf 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.63) -AC_INIT([gnome-shell],[2.91.1],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell],[gnome-shell]) +AC_INIT([gnome-shell],[2.91.2],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell],[gnome-shell]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_SRCDIR([src/shell-global.c]) From 392999bc43b95ed22889370693586a61a425d701 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 9 Nov 2010 14:37:32 -0500 Subject: [PATCH 39/85] Make opening and closing LookingGlass slow-down independent Waiting for LookingGlass to close after calling St.set_slow_down_factor() is annoying so divide the time for opening and closing by the slow-down factor. --- js/ui/lookingGlass.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index e6bc65b33..4ef2057dc 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -940,7 +940,9 @@ LookingGlass.prototype = { global.stage.set_key_focus(this._entry); - Tweener.addTween(this.actor, { time: 0.5, + // We inverse compensate for the slow-down so you can change the factor + // through LookingGlass without long waits. + Tweener.addTween(this.actor, { time: 0.5 / St.get_slow_down_factor(), transition: 'easeOutQuad', y: this._targetY }); @@ -967,7 +969,7 @@ LookingGlass.prototype = { Main.popModal(this.actor); - Tweener.addTween(this.actor, { time: 0.5, + Tweener.addTween(this.actor, { time: 0.5 / St.get_slow_down_factor(), transition: 'easeOutQuad', y: this._hiddenY, onComplete: Lang.bind(this, function () { From 6df21fd5ff86702a9ccb2cb9cbccb60c0457b620 Mon Sep 17 00:00:00 2001 From: Maxim Ermilov Date: Fri, 5 Nov 2010 19:47:50 +0300 Subject: [PATCH 40/85] never fall back to the window title as application name https://bugzilla.gnome.org/show_bug.cgi?id=624935 --- src/shell-app-system.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/shell-app-system.c b/src/shell-app-system.c index 3bfca45aa..4bc5e454e 100644 --- a/src/shell-app-system.c +++ b/src/shell-app-system.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "shell-app-private.h" #include "shell-global.h" @@ -1004,11 +1005,12 @@ shell_app_info_get_name (ShellAppInfo *info) return g_key_file_get_locale_string (info->keyfile, DESKTOP_ENTRY_GROUP, "Name", NULL, NULL); case SHELL_APP_INFO_TYPE_WINDOW: { - char *title; - g_object_get (info->window, "title", &title, NULL); - if (!title) - title = g_strdup (""); - return title; + const char *name; + + name = meta_window_get_wm_class (info->window); + if (!name) + name = _("Unknown"); + return g_strdup (name); } } g_assert_not_reached (); From ad624d546f154685cefdb477df2d5eeda36f7b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 11 Nov 2010 01:38:17 +0100 Subject: [PATCH 41/85] st-texture-cache: Fix include The file gnome-desktop-thumbnail.h was moved from libgnomeui to libgnome-desktop. https://bugzilla.gnome.org/show_bug.cgi?id=634555 --- src/st/st-texture-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c index a40590e7d..0d8aac2fb 100644 --- a/src/st/st-texture-cache.c +++ b/src/st/st-texture-cache.c @@ -5,7 +5,7 @@ #include "st-texture-cache.h" #include #define GNOME_DESKTOP_USE_UNSTABLE_API -#include +#include #include #include From f25e6916bdf6f7837466443b2382d731c5450117 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Wed, 10 Nov 2010 15:37:39 -0500 Subject: [PATCH 42/85] Remove unused StSubtexture --- src/Makefile-st.am | 2 - src/st/st-subtexture.c | 576 ----------------------------------------- src/st/st-subtexture.h | 97 ------- 3 files changed, 675 deletions(-) delete mode 100644 src/st/st-subtexture.c delete mode 100644 src/st/st-subtexture.h diff --git a/src/Makefile-st.am b/src/Makefile-st.am index 0423da40a..71db6935e 100644 --- a/src/Makefile-st.am +++ b/src/Makefile-st.am @@ -87,7 +87,6 @@ st_source_h = \ st/st-scroll-bar.h \ st/st-scroll-view.h \ st/st-shadow.h \ - st/st-subtexture.h \ st/st-table.h \ st/st-table-child.h \ st/st-texture-cache.h \ @@ -137,7 +136,6 @@ st_source_c = \ st/st-scroll-bar.c \ st/st-scroll-view.c \ st/st-shadow.c \ - st/st-subtexture.c \ st/st-table.c \ st/st-table-child.c \ st/st-texture-cache.c \ diff --git a/src/st/st-subtexture.c b/src/st/st-subtexture.c deleted file mode 100644 index c51fc50de..000000000 --- a/src/st/st-subtexture.c +++ /dev/null @@ -1,576 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ -/* - * st-subtexture.h: Class to wrap a texture and "subframe" it. - * based on - * st-texture-frame.c: Expandible texture actor - * - * Copyright 2007 OpenedHand - * Copyright 2009 Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU Lesser General Public License, - * version 2.1, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include "st-subtexture.h" - -enum -{ - PROP_0, - - PROP_PARENT_TEXTURE, - - PROP_TOP, - PROP_LEFT, - PROP_WIDTH, - PROP_HEIGHT -}; - -G_DEFINE_TYPE (StSubtexture, st_subtexture, CLUTTER_TYPE_ACTOR); - -#define ST_SUBTEXTURE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ST_TYPE_SUBTEXTURE, StSubtexturePrivate)) - -struct _StSubtexturePrivate -{ - ClutterTexture *parent_texture; - - int left; - int top; - int width; - int height; - - CoglHandle material; -}; - -static void -st_subtexture_get_preferred_width (ClutterActor *self, - gfloat for_height, - gfloat *min_width_p, - gfloat *natural_width_p) -{ - StSubtexturePrivate *priv = ST_SUBTEXTURE (self)->priv; - - if (G_UNLIKELY (priv->parent_texture == NULL)) - { - if (min_width_p) - *min_width_p = 0; - - if (natural_width_p) - *natural_width_p = 0; - } - else - { - if (min_width_p) - *min_width_p = priv->width; - if (natural_width_p) - *natural_width_p = priv->width; - } -} - -static void -st_subtexture_get_preferred_height (ClutterActor *self, - gfloat for_width, - gfloat *min_height_p, - gfloat *natural_height_p) -{ - StSubtexturePrivate *priv = ST_SUBTEXTURE (self)->priv; - - if (G_UNLIKELY (priv->parent_texture == NULL)) - { - if (min_height_p) - *min_height_p = 0; - - if (natural_height_p) - *natural_height_p = 0; - } - else - { - if (min_height_p) - *min_height_p = priv->height; - if (natural_height_p) - *natural_height_p = priv->height; - } -} - -static void -st_subtexture_realize (ClutterActor *self) -{ - StSubtexturePrivate *priv = ST_SUBTEXTURE (self)->priv; - - if (priv->material != COGL_INVALID_HANDLE) - return; - - priv->material = cogl_material_new (); - - CLUTTER_ACTOR_SET_FLAGS (self, CLUTTER_ACTOR_REALIZED); -} - -static void -st_subtexture_unrealize (ClutterActor *self) -{ - StSubtexturePrivate *priv = ST_SUBTEXTURE (self)->priv; - - if (priv->material == COGL_INVALID_HANDLE) - return; - - cogl_handle_unref (priv->material); - priv->material = COGL_INVALID_HANDLE; - - CLUTTER_ACTOR_UNSET_FLAGS (self, CLUTTER_ACTOR_REALIZED); -} - -static void -st_subtexture_paint (ClutterActor *self) -{ - StSubtexturePrivate *priv = ST_SUBTEXTURE (self)->priv; - CoglHandle cogl_texture = COGL_INVALID_HANDLE; - ClutterActorBox box = { 0, 0, 0, 0 }; - gfloat tx1, ty1, tx2, ty2, tex_width, tex_height, width, height; - guint8 opacity; - - /* no need to paint stuff if we don't have a texture */ - if (G_UNLIKELY (priv->parent_texture == NULL)) - return; - - /* parent texture may have been hidden, so need to make sure it gets - * realized - */ - if (!CLUTTER_ACTOR_IS_REALIZED (priv->parent_texture)) - clutter_actor_realize (CLUTTER_ACTOR (priv->parent_texture)); - - cogl_texture = clutter_texture_get_cogl_texture (priv->parent_texture); - if (cogl_texture == COGL_INVALID_HANDLE) - return; - - tex_width = cogl_texture_get_width (cogl_texture); - tex_height = cogl_texture_get_height (cogl_texture); - - clutter_actor_get_allocation_box (self, &box); - - width = box.x2 - box.x1; - height = box.y2 - box.y1; - - tx1 = 1.0 * priv->left / tex_width; - ty1 = 1.0 * priv->top / tex_height; - - tx2 = 1.0 * (priv->left + priv->width) / tex_width; - ty2 = 1.0 * (priv->top + priv->height) / tex_height; - - - opacity = clutter_actor_get_paint_opacity (self); - - g_assert (priv->material != COGL_INVALID_HANDLE); - - /* set the source material using the parent texture's COGL handle */ - cogl_material_set_color4ub (priv->material, 255, 255, 255, opacity); - cogl_material_set_layer (priv->material, 0, cogl_texture); - cogl_set_source (priv->material); - - cogl_rectangle_with_texture_coords (0,0, (float) width, (float) height, - tx1, ty1, tx2, ty2); -} - -static inline void -st_subtexture_set_frame_internal (StSubtexture *frame, - int left, - int top, - int width, - int height) -{ - StSubtexturePrivate *priv = frame->priv; - GObject *gobject = G_OBJECT (frame); - gboolean changed = FALSE; - - g_object_freeze_notify (gobject); - - if (priv->top != top) - { - priv->top = top; - g_object_notify (gobject, "top"); - changed = TRUE; - } - - if (priv->left != left) - { - priv->left = left; - g_object_notify (gobject, "left"); - changed = TRUE; - } - - if (priv->width != width) - { - priv->width = width; - g_object_notify (gobject, "width"); - changed = TRUE; - } - - if (priv->height != height) - { - priv->height = height; - g_object_notify (gobject, "height"); - changed = TRUE; - } - - if (changed && CLUTTER_ACTOR_IS_VISIBLE (frame)) - clutter_actor_queue_redraw (CLUTTER_ACTOR (frame)); - - g_object_thaw_notify (gobject); -} - -static void -st_subtexture_set_property (GObject *gobject, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - StSubtexture *frame = ST_SUBTEXTURE (gobject); - StSubtexturePrivate *priv = frame->priv; - - switch (prop_id) - { - case PROP_PARENT_TEXTURE: - st_subtexture_set_parent_texture (frame, - g_value_get_object (value)); - break; - - case PROP_TOP: - st_subtexture_set_frame_internal (frame, - priv->left, - g_value_get_int (value), - priv->width, - priv->height); - break; - - case PROP_LEFT: - st_subtexture_set_frame_internal (frame, - g_value_get_int (value), - priv->top, - priv->width, - priv->height); - break; - - case PROP_WIDTH: - st_subtexture_set_frame_internal (frame, - priv->left, - priv->top, - g_value_get_int (value), - priv->height); - break; - - case PROP_HEIGHT: - st_subtexture_set_frame_internal (frame, - priv->left, - priv->top, - priv->width, - g_value_get_int (value)); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -st_subtexture_get_property (GObject *gobject, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - StSubtexturePrivate *priv = ST_SUBTEXTURE (gobject)->priv; - - switch (prop_id) - { - case PROP_PARENT_TEXTURE: - g_value_set_object (value, priv->parent_texture); - break; - - case PROP_LEFT: - g_value_set_int (value, priv->left); - break; - - case PROP_TOP: - g_value_set_int (value, priv->top); - break; - - case PROP_WIDTH: - g_value_set_int (value, priv->width); - break; - - case PROP_HEIGHT: - g_value_set_int (value, priv->height); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -st_subtexture_dispose (GObject *gobject) -{ - StSubtexturePrivate *priv = ST_SUBTEXTURE (gobject)->priv; - - if (priv->parent_texture) - { - g_object_unref (priv->parent_texture); - priv->parent_texture = NULL; - } - - if (priv->material) - { - cogl_handle_unref (priv->material); - priv->material = COGL_INVALID_HANDLE; - } - - G_OBJECT_CLASS (st_subtexture_parent_class)->dispose (gobject); -} - -static void -st_subtexture_class_init (StSubtextureClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - GParamSpec *pspec; - - g_type_class_add_private (gobject_class, sizeof (StSubtexturePrivate)); - - actor_class->get_preferred_width = - st_subtexture_get_preferred_width; - actor_class->get_preferred_height = - st_subtexture_get_preferred_height; - actor_class->realize = st_subtexture_realize; - actor_class->unrealize = st_subtexture_unrealize; - actor_class->paint = st_subtexture_paint; - - gobject_class->set_property = st_subtexture_set_property; - gobject_class->get_property = st_subtexture_get_property; - gobject_class->dispose = st_subtexture_dispose; - - pspec = g_param_spec_object ("parent-texture", - "Parent Texture", - "The parent ClutterTexture", - CLUTTER_TYPE_TEXTURE, - G_PARAM_READWRITE | - G_PARAM_CONSTRUCT); - g_object_class_install_property (gobject_class, PROP_PARENT_TEXTURE, pspec); - - pspec = g_param_spec_int ("left", - "Left", - "Left offset", - 0, G_MAXINT, - 0, - G_PARAM_READWRITE); - g_object_class_install_property (gobject_class, PROP_LEFT, pspec); - - pspec = g_param_spec_int ("top", - "Top", - "Top offset", - 0, G_MAXINT, - 0, - G_PARAM_READWRITE); - g_object_class_install_property (gobject_class, PROP_TOP, pspec); - - pspec = g_param_spec_int ("width", - "Width", - "Width", - 0, G_MAXINT, - 0, - G_PARAM_READWRITE); - g_object_class_install_property (gobject_class, PROP_WIDTH, pspec); - - pspec = g_param_spec_int ("height", - "Height", - "Height", - 0, G_MAXINT, - 0, - G_PARAM_READWRITE); - g_object_class_install_property (gobject_class, PROP_HEIGHT, pspec); -} - -static void -st_subtexture_init (StSubtexture *self) -{ - StSubtexturePrivate *priv; - - self->priv = priv = ST_SUBTEXTURE_GET_PRIVATE (self); - - priv->material = COGL_INVALID_HANDLE; -} - -/** - * st_subtexture_new: - * @texture: a #ClutterTexture or %NULL - * @left: left - * @top: top - * @width: width - * @height: height - * - * A #StSubtexture is a specialized texture that efficiently clones - * an area of the given @texture while keeping preserving portions of the - * same texture. - * - * A #StSubtexture can be used to make a rectangular texture fit a - * given size without stretching its borders. - * - * Return value: the newly created #StSubtexture - */ -ClutterActor* -st_subtexture_new (ClutterTexture *texture, - gint left, - gint top, - gint width, - gint height) -{ - g_return_val_if_fail (texture == NULL || CLUTTER_IS_TEXTURE (texture), NULL); - - return g_object_new (ST_TYPE_SUBTEXTURE, - "parent-texture", texture, - "top", top, - "left", left, - "width", width, - "height", height, - NULL); -} - -/** - * st_subtexture_get_parent_texture: - * @frame: A #StSubtexture - * - * Return the texture used by the #StSubtexture - * - * Returns: (transfer none): a #ClutterTexture owned by the #StSubtexture - */ -ClutterTexture * -st_subtexture_get_parent_texture (StSubtexture *frame) -{ - g_return_val_if_fail (ST_IS_SUBTEXTURE (frame), NULL); - - return frame->priv->parent_texture; -} - -/** - * st_subtexture_set_parent_texture: - * @frame: A #StSubtexture - * @texture: A #ClutterTexture - * - * Set the #ClutterTexture used by this #StSubtexture - * - */ -void -st_subtexture_set_parent_texture (StSubtexture *frame, - ClutterTexture *texture) -{ - StSubtexturePrivate *priv; - gboolean was_visible; - - g_return_if_fail (ST_IS_SUBTEXTURE (frame)); - g_return_if_fail (texture == NULL || CLUTTER_IS_TEXTURE (texture)); - - priv = frame->priv; - - was_visible = CLUTTER_ACTOR_IS_VISIBLE (frame); - - if (priv->parent_texture == texture) - return; - - if (priv->parent_texture) - { - g_object_unref (priv->parent_texture); - priv->parent_texture = NULL; - - if (was_visible) - clutter_actor_hide (CLUTTER_ACTOR (frame)); - } - - if (texture) - { - priv->parent_texture = g_object_ref (texture); - - if (was_visible && CLUTTER_ACTOR_IS_VISIBLE (priv->parent_texture)) - clutter_actor_show (CLUTTER_ACTOR (frame)); - } - - clutter_actor_queue_relayout (CLUTTER_ACTOR (frame)); - - g_object_notify (G_OBJECT (frame), "parent-texture"); -} - -/** - * st_subtexture_set_frame: - * @frame: A #StSubtexture - * @left: left - * @top: top - * @width: width - * @height: height - * - * Set the frame of the subtexture - * - */ -void -st_subtexture_set_frame (StSubtexture *frame, - gint left, - gint top, - gint width, - gint height) -{ - g_return_if_fail (ST_IS_SUBTEXTURE (frame)); - - st_subtexture_set_frame_internal (frame, left, top, width, height); -} - -/** - * st_subtexture_get_frame: - * @frame: A #StSubtexture - * @left: left - * @top: top - * @width: width - * @height: height - * - * Retrieve the current frame. - * - */ -void -st_subtexture_get_frame (StSubtexture *frame, - gint *left, - gint *top, - gint *width, - gint *height) -{ - StSubtexturePrivate *priv; - - g_return_if_fail (ST_IS_SUBTEXTURE (frame)); - - priv = frame->priv; - - if (top) - *top = priv->top; - - if (left) - *left = priv->left; - - if (width) - *width = priv->width; - - if (height) - *height = priv->height; -} diff --git a/src/st/st-subtexture.h b/src/st/st-subtexture.h deleted file mode 100644 index d038ca98e..000000000 --- a/src/st/st-subtexture.h +++ /dev/null @@ -1,97 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ -/* - * st-subtexture.h: Class to wrap a texture and "subframe" it. - * - * Based on - * st-texture-frame.h: Expandible texture actor - * - * Copyright 2007, 2008 OpenedHand Ltd - * Copyright 2009 Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU Lesser General Public License, - * version 2.1, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - */ - -#if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) -#error "Only can be included directly.h" -#endif - -#ifndef __ST_SUBTEXTURE_H__ -#define __ST_SUBTEXTURE_H__ - -#include - -G_BEGIN_DECLS - -#define ST_TYPE_SUBTEXTURE (st_subtexture_get_type ()) -#define ST_SUBTEXTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_SUBTEXTURE, StSubtexture)) -#define ST_SUBTEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_SUBTEXTURE, StSubtextureClass)) -#define ST_IS_SUBTEXTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_SUBTEXTURE)) -#define ST_IS_SUBTEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_SUBTEXTURE)) -#define ST_SUBTEXTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_SUBTEXTURE, StSubtextureClass)) - -typedef struct _StSubtexture StSubtexture; -typedef struct _StSubtexturePrivate StSubtexturePrivate; -typedef struct _StSubtextureClass StSubtextureClass; - -/** - * StSubtexture: - * - * The contents of this structure are private and should only be accessed - * through the public API. - */ -struct _StSubtexture -{ - /*< private >*/ - ClutterActor parent_instance; - - StSubtexturePrivate *priv; -}; - -struct _StSubtextureClass -{ - ClutterActorClass parent_class; - - /* padding for future expansion */ - void (*_st_box_1) (void); - void (*_st_box_2) (void); - void (*_st_box_3) (void); - void (*_st_box_4) (void); -}; - -GType st_subtexture_get_type (void) G_GNUC_CONST; - -ClutterActor * st_subtexture_new (ClutterTexture *texture, - gint top, - gint left, - gint width, - gint height); -void st_subtexture_set_parent_texture (StSubtexture *frame, - ClutterTexture *texture); -ClutterTexture *st_subtexture_get_parent_texture (StSubtexture *frame); -void st_subtexture_set_frame (StSubtexture *frame, - gint top, - gint left, - gint width, - gint height); -void st_subtexture_get_frame (StSubtexture *frame, - gint *top, - gint *left, - gint *width, - gint *height); - -G_END_DECLS - -#endif /* __ST_SUBTEXTURE_H__ */ From e4cf3f144d25482951ffc81598898fa2f6f2c7cb Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Wed, 10 Nov 2010 22:24:53 -0500 Subject: [PATCH 43/85] Mark gsettings-desktop-schemas as a dependency of gnome-desktop-3 gsettings-desktop-schemas is required by, so needs to be built before gnome-desktop-3. https://bugzilla.gnome.org/show_bug.cgi?id=634552 --- tools/build/gnome-shell.modules | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/build/gnome-shell.modules b/tools/build/gnome-shell.modules index dd02aa08a..ff5d5ed09 100644 --- a/tools/build/gnome-shell.modules +++ b/tools/build/gnome-shell.modules @@ -160,19 +160,20 @@ + + + + + - - - - From b856e2990ba1ee29379f3f64ee07ef4bb746dee6 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Thu, 11 Nov 2010 08:37:57 -0500 Subject: [PATCH 44/85] StScrollView: null out the right variable in dispose We weren't properly nulling out the vadjustment variable in dispose() which meant in the case of explicit-destroy followed some time later by garbage collection and disposing the actor again we would crash. --- src/st/st-scroll-view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/st/st-scroll-view.c b/src/st/st-scroll-view.c index fbe0a03fd..1e30314ff 100644 --- a/src/st/st-scroll-view.c +++ b/src/st/st-scroll-view.c @@ -284,7 +284,7 @@ st_scroll_view_dispose (GObject *object) { g_object_run_dispose (G_OBJECT (priv->vadjustment)); g_object_unref (priv->vadjustment); - priv->hadjustment = NULL; + priv->vadjustment = NULL; } /* since it's impossible to get a handle to these actors, we can From c171ea12df5cea7ba1300c9d0b2c5dfa8bdedcd6 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sun, 7 Nov 2010 20:51:25 +0100 Subject: [PATCH 45/85] Transition the ShellApp state when ready. shell_app_state_transition emits a signal, so invoke it only when ready, or signal handlers will see an object which is in an invalid state. https://bugzilla.gnome.org/show_bug.cgi?id=632501 --- src/shell-app.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shell-app.c b/src/shell-app.c index fae61c4d4..d685be225 100644 --- a/src/shell-app.c +++ b/src/shell-app.c @@ -739,9 +739,6 @@ _shell_app_add_window (ShellApp *app, g_object_freeze_notify (G_OBJECT (app)); - if (app->state != SHELL_APP_STATE_STARTING) - shell_app_state_transition (app, SHELL_APP_STATE_RUNNING); - if (!app->running_state) create_running_state (app); @@ -754,6 +751,9 @@ _shell_app_add_window (ShellApp *app, if (user_time > app->running_state->last_user_time) app->running_state->last_user_time = user_time; + if (app->state != SHELL_APP_STATE_STARTING && app->state != SHELL_APP_STATE_RUNNING) + shell_app_state_transition (app, SHELL_APP_STATE_RUNNING); + g_object_thaw_notify (G_OBJECT (app)); g_signal_emit (app, shell_app_signals[WINDOWS_CHANGED], 0); From 614bcd8016ea5c2df44c903dccceed92871452e1 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Wed, 10 Nov 2010 16:06:24 +0100 Subject: [PATCH 46/85] Update volume indicator labels It turns out 'Output' and 'Input' are too technical for the novice user. Use 'Volume' and 'Microphone' instead. https://bugzilla.gnome.org/show_bug.cgi?id=634329 --- js/ui/status/volume.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js index be8abd635..87e4bd153 100644 --- a/js/ui/status/volume.js +++ b/js/ui/status/volume.js @@ -38,7 +38,7 @@ Indicator.prototype = { this._output = null; this._outputVolumeId = 0; this._outputMutedId = 0; - this._outputSwitch = new PopupMenu.PopupSwitchMenuItem(_("Output: Muted"), false); + this._outputSwitch = new PopupMenu.PopupSwitchMenuItem(_("Volume: Muted"), false); this._outputSwitch.connect('toggled', Lang.bind(this, this._switchToggled, '_output')); this._outputSlider = new PopupMenu.PopupSliderMenuItem(0); this._outputSlider.connect('value-changed', Lang.bind(this, this._sliderChanged, '_output')); @@ -52,7 +52,7 @@ Indicator.prototype = { this._input = null; this._inputVolumeId = 0; this._inputMutedId = 0; - this._inputSwitch = new PopupMenu.PopupSwitchMenuItem(_("Input: Muted"), false); + this._inputSwitch = new PopupMenu.PopupSwitchMenuItem(_("Microphone: Muted"), false); this._inputSwitch.connect('toggled', Lang.bind(this, this._switchToggled, '_input')); this._inputSlider = new PopupMenu.PopupSliderMenuItem(0); this._inputSlider.connect('value-changed', Lang.bind(this, this._sliderChanged, '_input')); @@ -103,7 +103,7 @@ Indicator.prototype = { this._mutedChanged (null, null, '_output'); this._volumeChanged (null, null, '_output'); } else { - this._outputSwitch.label.text = _("Output: Muted"); + this._outputSwitch.label.text = _("Volume: Muted"); this._outputSwitch.setToggleState(false); this.setIcon('audio-volume-muted-symbolic'); } @@ -214,9 +214,9 @@ Indicator.prototype = { _updateLabel: function(property) { let label; if (this[property].is_muted) - label = (property == '_output' ? _("Output: Muted") : _("Input: Muted")); + label = (property == '_output' ? _("Volume: Muted") : _("Microphone: Muted")); else - label = (property == '_output' ? _("Output: %3.0f%%") : _("Input: %3.0f%%")).format(this[property].volume / VOLUME_MAX * 100); + label = (property == '_output' ? _("Volume: %3.0f%%") : _("Microphone: %3.0f%%")).format(this[property].volume / VOLUME_MAX * 100); this[property+'Switch'].label.text = label; } }; From ac1b81485186506d87f9a14aa8c0d02f67e85c02 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Fri, 12 Nov 2010 18:41:54 +0100 Subject: [PATCH 47/85] Revert "Transition the ShellApp state when ready." This reverts commit c171ea12df5cea7ba1300c9d0b2c5dfa8bdedcd6. --- src/shell-app.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shell-app.c b/src/shell-app.c index d685be225..fae61c4d4 100644 --- a/src/shell-app.c +++ b/src/shell-app.c @@ -739,6 +739,9 @@ _shell_app_add_window (ShellApp *app, g_object_freeze_notify (G_OBJECT (app)); + if (app->state != SHELL_APP_STATE_STARTING) + shell_app_state_transition (app, SHELL_APP_STATE_RUNNING); + if (!app->running_state) create_running_state (app); @@ -751,9 +754,6 @@ _shell_app_add_window (ShellApp *app, if (user_time > app->running_state->last_user_time) app->running_state->last_user_time = user_time; - if (app->state != SHELL_APP_STATE_STARTING && app->state != SHELL_APP_STATE_RUNNING) - shell_app_state_transition (app, SHELL_APP_STATE_RUNNING); - g_object_thaw_notify (G_OBJECT (app)); g_signal_emit (app, shell_app_signals[WINDOWS_CHANGED], 0); From f0c6e96e828c630207db95a9072e49e5c78e4b9b Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Fri, 12 Nov 2010 17:36:41 +0100 Subject: [PATCH 48/85] Status area: update accessibility menu gnome-settings-daemon has moved to GSettings for most settings, we should adapt as well. The only remaining GConf key is for metacity (visual bell). https://bugzilla.gnome.org/show_bug.cgi?id=634693 --- js/ui/status/accessibility.js | 53 ++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/js/ui/status/accessibility.js b/js/ui/status/accessibility.js index f1d458809..ce930d603 100644 --- a/js/ui/status/accessibility.js +++ b/js/ui/status/accessibility.js @@ -17,16 +17,18 @@ const PopupMenu = imports.ui.popupMenu; const Gettext = imports.gettext.domain('gnome-shell'); const _ = Gettext.gettext; -const KEY_A11Y_DIR = "/desktop/gnome/accessibility"; -const KEY_STICKY_KEYS_ENABLED = KEY_A11Y_DIR + "/keyboard/stickykeys_enable"; -const KEY_BOUNCE_KEYS_ENABLED = KEY_A11Y_DIR + "/keyboard/bouncekeys_enable"; -const KEY_SLOW_KEYS_ENABLED = KEY_A11Y_DIR + "/keyboard/slowkeys_enable"; -const KEY_MOUSE_KEYS_ENABLED = KEY_A11Y_DIR + "/keyboard/mousekeys_enable"; +const A11Y_SCHEMA = "org.gnome.desktop.a11y.keyboard"; +const KEY_STICKY_KEYS_ENABLED = "stickykeys-enable"; +const KEY_BOUNCE_KEYS_ENABLED = "bouncekeys-enable"; +const KEY_SLOW_KEYS_ENABLED = "slowkeys-enable"; +const KEY_MOUSE_KEYS_ENABLED = "mousekeys-enable"; const AT_SCREEN_KEYBOARD_SCHEMA = "org.gnome.desktop.default-applications.at.mobility"; const AT_SCREEN_READER_SCHEMA = "org.gnome.desktop.default-applications.at.visual"; -const KEY_FONT_DPI = "/desktop/gnome/font_rendering/dpi"; +const XSETTINGS_SCHEMA = "org.gnome.settings-daemon.plugins.xsettings"; +const KEY_DPI = "dpi"; + const DPI_LOW_REASONABLE_VALUE = 50; const DPI_HIGH_REASONABLE_VALUE = 500; @@ -71,8 +73,6 @@ ATIndicator.prototype = { PanelMenu.SystemStatusButton.prototype._init.call(this, 'preferences-desktop-accessibility', null); let client = GConf.Client.get_default(); - client.add_dir(KEY_A11Y_DIR, GConf.ClientPreloadType.PRELOAD_ONELEVEL, null); - client.notify_add(KEY_A11Y_DIR, Lang.bind(this, this._keyChanged), null, null); client.add_dir(KEY_META_DIR, GConf.ClientPreloadType.PRELOAD_ONELEVEL, null); client.notify_add(KEY_META_DIR, Lang.bind(this, this._keyChanged), null, null); @@ -94,16 +94,16 @@ ATIndicator.prototype = { let visualBell = this._buildItemGConf(_("Visual Alerts"), client, KEY_VISUAL_BELL); this.menu.addMenuItem(visualBell); - let stickyKeys = this._buildItemGConf(_("Sticky Keys"), client, KEY_STICKY_KEYS_ENABLED); + let stickyKeys = this._buildItem(_("Sticky Keys"), A11Y_SCHEMA, KEY_STICKY_KEYS_ENABLED); this.menu.addMenuItem(stickyKeys); - let slowKeys = this._buildItemGConf(_("Slow Keys"), client, KEY_SLOW_KEYS_ENABLED); + let slowKeys = this._buildItem(_("Slow Keys"), A11Y_SCHEMA, KEY_SLOW_KEYS_ENABLED); this.menu.addMenuItem(slowKeys); - let bounceKeys = this._buildItemGConf(_("Bounce Keys"), client, KEY_BOUNCE_KEYS_ENABLED); + let bounceKeys = this._buildItem(_("Bounce Keys"), A11Y_SCHEMA, KEY_BOUNCE_KEYS_ENABLED); this.menu.addMenuItem(bounceKeys); - let mouseKeys = this._buildItemGConf(_("Mouse Keys"), client, KEY_MOUSE_KEYS_ENABLED); + let mouseKeys = this._buildItem(_("Mouse Keys"), A11Y_SCHEMA, KEY_MOUSE_KEYS_ENABLED); this.menu.addMenuItem(mouseKeys); this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); @@ -190,30 +190,31 @@ ATIndicator.prototype = { }, _buildFontItem: function(client) { - let first_gconf_value = client.get_without_default(KEY_FONT_DPI); - let default_value = getDPIFromX(); - let first_value = first_gconf_value ? first_gconf_value.get_float() : default_value; + let settings = new Gio.Settings({ schema: XSETTINGS_SCHEMA }); + + // we assume this never changes (which is not true if resolution + // is changed, but we would need XRandR events for that) + let x_value = getDPIFromX(); + let user_value; function on_get() { - let u_dpi = client.get_float(KEY_FONT_DPI); - let x_dpi = getDPIFromX(); - return (u_dpi - (DPI_FACTOR_LARGE * x_dpi) > -1); + user_value = settings.get_double(KEY_DPI); + return (user_value - (DPI_FACTOR_LARGE * x_value) > -1); } let initial_setting = on_get(); + let default_value = initial_setting ? x_value : user_value; let widget = this._buildItemExtended(_("Large Text"), initial_setting, - client.key_is_writable(KEY_FONT_DPI), + settings.is_writable(KEY_DPI), function (enabled) { if (enabled) - client.set_float(KEY_FONT_DPI, DPI_FACTOR_LARGE * getDPIFromX()); + client.set_float(KEY_DPI, DPI_FACTOR_LARGE * default_value); else - client.set_float(KEY_FONT_DPI, (first_value && !initial_setting) ? first_value : default_value); + client.set_float(KEY_DPI, default_value); }); - this.connect('gconf-changed', function() { + settings.connect('changed::' + KEY_DPI, function() { let active = on_get(); - if (!active) - // setting was modified manually, update it - first_value = client.get_float(KEY_FONT_DPI); - widget.setToggleState(on_get()); + default_value = active ? x_value : user_value; + widget.setToggleState(active); }); return widget; }, From b2495a0e25953330087a393c21ebaa8ce4ef191c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 12 Nov 2010 19:37:51 +0100 Subject: [PATCH 49/85] a11y-status: Fix left over GConf usage Commit f0c6e96e828 updated the "Large Text" action to use a GSettings key, but left some code accessing the setting via GConf. https://bugzilla.gnome.org/show_bug.cgi?id=634693 --- js/ui/status/accessibility.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/ui/status/accessibility.js b/js/ui/status/accessibility.js index ce930d603..a1e9ee431 100644 --- a/js/ui/status/accessibility.js +++ b/js/ui/status/accessibility.js @@ -82,7 +82,7 @@ ATIndicator.prototype = { let magnifier = this._buildMagItem(); this.menu.addMenuItem(magnifier); - let textZoom = this._buildFontItem(client); + let textZoom = this._buildFontItem(); this.menu.addMenuItem(textZoom); let screenReader = this._buildItem(_("Screen Reader"), AT_SCREEN_READER_SCHEMA, 'startup'); @@ -189,7 +189,7 @@ ATIndicator.prototype = { return highContrast; }, - _buildFontItem: function(client) { + _buildFontItem: function() { let settings = new Gio.Settings({ schema: XSETTINGS_SCHEMA }); // we assume this never changes (which is not true if resolution @@ -207,9 +207,9 @@ ATIndicator.prototype = { settings.is_writable(KEY_DPI), function (enabled) { if (enabled) - client.set_float(KEY_DPI, DPI_FACTOR_LARGE * default_value); + settings.set_double(KEY_DPI, DPI_FACTOR_LARGE * default_value); else - client.set_float(KEY_DPI, default_value); + settings.set_double(KEY_DPI, default_value); }); settings.connect('changed::' + KEY_DPI, function() { let active = on_get(); From d79cae07a43e4580c1265f59642ebfd7a385abdf Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Fri, 12 Nov 2010 19:27:55 +0100 Subject: [PATCH 50/85] Depend on master gnome-settings-daemon The new Universal Access menu uses GSettings schema from master g-s-d. Ensure that these are installed, or we crash. https://bugzilla.gnome.org/show_bug.cgi?id=634693 --- tools/build/gnome-shell.modules | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tools/build/gnome-shell.modules b/tools/build/gnome-shell.modules index ff5d5ed09..7357e29ba 100644 --- a/tools/build/gnome-shell.modules +++ b/tools/build/gnome-shell.modules @@ -205,6 +205,7 @@ + @@ -227,4 +228,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + From ce72aaf0081dd2885c5a441509346c25200fe71c Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Wed, 10 Nov 2010 17:00:45 -0500 Subject: [PATCH 51/85] Fix up copyright and license notices for St * Make sure all source files have a LGPL copyright header, and standardize non-standard variations of the header to a common form. * Check and update all copyright notices. * Remove 'Written By:' lines. They are universally incomplete and typically indicate only who started a particular file. https://bugzilla.gnome.org/show_bug.cgi?id=634550 --- src/st/st-adjustment.c | 11 ++----- src/st/st-adjustment.h | 7 +--- src/st/st-bin.c | 9 ++---- src/st/st-bin.h | 7 +--- src/st/st-border-image.c | 18 +++++++++++ src/st/st-border-image.h | 19 +++++++++++ src/st/st-box-layout-child.c | 5 +-- src/st/st-box-layout-child.h | 5 +-- src/st/st-box-layout.c | 9 +++--- src/st/st-box-layout.h | 7 ++-- src/st/st-button.c | 8 ++--- src/st/st-button.h | 8 +---- src/st/st-clickable.c | 18 +++++++++++ src/st/st-clickable.h | 19 +++++++++++ src/st/st-clipboard.c | 6 +--- src/st/st-clipboard.h | 6 +--- src/st/st-container.c | 10 ++---- src/st/st-container.h | 5 +-- src/st/st-drawing-area.c | 18 +++++++++++ src/st/st-drawing-area.h | 19 +++++++++++ src/st/st-entry.c | 8 ++--- src/st/st-entry.h | 7 +--- src/st/st-focus-manager.c | 12 +++---- src/st/st-focus-manager.h | 11 +++---- src/st/st-group.c | 8 ++--- src/st/st-group.h | 7 ++-- src/st/st-im-text.c | 10 +++--- src/st/st-im-text.h | 10 +++--- src/st/st-label.c | 8 ++--- src/st/st-label.h | 7 +--- src/st/st-overflow-box.c | 12 +++---- src/st/st-overflow-box.h | 6 ++-- src/st/st-private.c | 20 ++++++++++++ src/st/st-private.h | 9 +++--- src/st/st-scroll-bar.c | 11 +++---- src/st/st-scroll-bar.h | 8 +---- src/st/st-scroll-view.c | 9 ++---- src/st/st-scroll-view.h | 10 ++---- src/st/st-scrollable.c | 8 ++--- src/st/st-scrollable.h | 8 +---- src/st/st-shadow.c | 19 +++++++++++ src/st/st-shadow.h | 19 +++++++++++ src/st/st-table-child.c | 8 ++--- src/st/st-table-child.h | 7 +--- src/st/st-table-private.h | 5 +-- src/st/st-table.c | 9 ++---- src/st/st-table.h | 7 +--- src/st/st-texture-cache.c | 19 +++++++++++ src/st/st-texture-cache.h | 20 ++++++++++++ src/st/st-theme-context.c | 19 +++++++++++ src/st/st-theme-context.h | 20 ++++++++++++ src/st/st-theme-node-drawing.c | 54 +++++++++++++++---------------- src/st/st-theme-node-private.h | 19 +++++++++++ src/st/st-theme-node-transition.c | 28 ++++++++-------- src/st/st-theme-node-transition.h | 19 +++++++++++ src/st/st-theme-node.c | 22 +++++++++++++ src/st/st-theme-node.h | 21 ++++++++++++ src/st/st-theme-private.h | 19 +++++++++++ src/st/st-theme.c | 42 +++++++++++------------- src/st/st-theme.h | 18 +++++++++++ src/st/st-tooltip.c | 8 ++--- src/st/st-tooltip.h | 8 +---- src/st/st-types.h | 4 +-- src/st/st-widget.c | 11 +++---- src/st/st-widget.h | 8 ++--- src/st/test-theme.c | 18 +++++++++++ 66 files changed, 548 insertions(+), 306 deletions(-) diff --git a/src/st/st-adjustment.c b/src/st/st-adjustment.c index 0a6817824..cb284c1a9 100644 --- a/src/st/st-adjustment.c +++ b/src/st/st-adjustment.c @@ -2,8 +2,8 @@ /* * st-adjustment.c: Adjustment object * - * Copyright (C) 2008 OpenedHand - * Copyright (c) 2009 Intel Corporation. + * Copyright 2008 OpenedHand + * Copyright 2009 Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -15,12 +15,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Chris Lord , inspired by GtkAdjustment - * Port to St by: Robert Staudinger - * + * along with this program. If not, see . */ /** diff --git a/src/st/st-adjustment.h b/src/st/st-adjustment.h index b816191e5..3cfce640b 100644 --- a/src/st/st-adjustment.h +++ b/src/st/st-adjustment.h @@ -15,12 +15,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Chris Lord , inspired by GtkAdjustment - * Port to St by: Robert Staudinger - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-bin.c b/src/st/st-bin.c index d6223956c..af6c2f7dd 100644 --- a/src/st/st-bin.c +++ b/src/st/st-bin.c @@ -2,7 +2,8 @@ /* * st-bin.c: Basic container actor * - * Copyright (c) 2009 Intel Corporation. + * Copyright 2009 Intel Corporation. + * Copyright 2009, 2010 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -14,11 +15,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Emmanuele Bassi - * + * along with this program. If not, see . */ /** diff --git a/src/st/st-bin.h b/src/st/st-bin.h index 8e671a0ba..2c2e58898 100644 --- a/src/st/st-bin.h +++ b/src/st/st-bin.h @@ -14,12 +14,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - * Written by: Emmanuele Bassi - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-border-image.c b/src/st/st-border-image.c index 1a67a9542..c55ee9b20 100644 --- a/src/st/st-border-image.c +++ b/src/st/st-border-image.c @@ -1,4 +1,22 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-border-image.c: store information about an image with borders + * + * Copyright 2009, 2010 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ #include diff --git a/src/st/st-border-image.h b/src/st/st-border-image.h index c1bb7e477..f0941602e 100644 --- a/src/st/st-border-image.h +++ b/src/st/st-border-image.h @@ -1,4 +1,23 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-border-image.h: store information about an image with borders + * + * Copyright 2009, 2010 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + #ifndef __ST_BORDER_IMAGE_H__ #define __ST_BORDER_IMAGE_H__ diff --git a/src/st/st-box-layout-child.c b/src/st/st-box-layout-child.c index cee0b785d..3d748d519 100644 --- a/src/st/st-box-layout-child.c +++ b/src/st/st-box-layout-child.c @@ -14,10 +14,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Thomas Wood + * along with this program. If not, see . */ /** diff --git a/src/st/st-box-layout-child.h b/src/st/st-box-layout-child.h index aa8051a68..097da0e22 100644 --- a/src/st/st-box-layout-child.h +++ b/src/st/st-box-layout-child.h @@ -14,10 +14,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Thomas Wood + * along with this program. If not, see . */ #ifndef _ST_BOX_LAYOUT_CHILD_H diff --git a/src/st/st-box-layout.c b/src/st/st-box-layout.c index 98fe29100..3a912fa97 100644 --- a/src/st/st-box-layout.c +++ b/src/st/st-box-layout.c @@ -3,6 +3,9 @@ * st-box-layout.h: box layout actor * * Copyright 2009 Intel Corporation. + * Copyright 2009 Abderrahim Kitouni + * Copyright 2009, 2010 Red Hat, Inc. + * Copyright 2010 Florian Muellner * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -14,11 +17,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Thomas Wood - * + * along with this program. If not, see . */ /* Portions copied from Clutter: diff --git a/src/st/st-box-layout.h b/src/st/st-box-layout.h index 74644c9f7..54372d53c 100644 --- a/src/st/st-box-layout.h +++ b/src/st/st-box-layout.h @@ -3,6 +3,7 @@ * st-box-layout.h: box layout actor * * Copyright 2009 Intel Corporation. + * Copyright 2009, 2010 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -14,11 +15,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Thomas Wood - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-button.c b/src/st/st-button.c index 92624cdf0..dfee0265e 100644 --- a/src/st/st-button.c +++ b/src/st/st-button.c @@ -4,6 +4,7 @@ * * Copyright 2007 OpenedHand * Copyright 2008, 2009 Intel Corporation. + * Copyright 2009, 2010 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -15,12 +16,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Emmanuele Bassi - * Thomas Wood - * + * along with this program. If not, see . */ /** diff --git a/src/st/st-button.h b/src/st/st-button.h index 1b853769d..15a6983dd 100644 --- a/src/st/st-button.h +++ b/src/st/st-button.h @@ -15,13 +15,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - * Written by: Emmanuele Bassi - * Thomas Wood - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-clickable.c b/src/st/st-clickable.c index ab4920795..5787aaf42 100644 --- a/src/st/st-clickable.c +++ b/src/st/st-clickable.c @@ -1,4 +1,22 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-clickable.h: A bin with methods and properties useful for implementing buttons + * + * Copyright 2009, 2010 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ /** * SECTION:st-clickable diff --git a/src/st/st-clickable.h b/src/st/st-clickable.h index 1c59447d7..2f1c3b0ee 100644 --- a/src/st/st-clickable.h +++ b/src/st/st-clickable.h @@ -1,4 +1,23 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-clickable.h: A bin with methods and properties useful for implementing buttons + * + * Copyright 2009, 2010 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + #ifndef __ST_CLICKABLE_H__ #define __ST_CLICKABLE_H__ diff --git a/src/st/st-clipboard.c b/src/st/st-clipboard.c index 833de4bbf..6d98c959d 100644 --- a/src/st/st-clipboard.c +++ b/src/st/st-clipboard.c @@ -14,11 +14,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Thomas Wood - * + * along with this program. If not, see . */ /** diff --git a/src/st/st-clipboard.h b/src/st/st-clipboard.h index 7b687d589..20759d43d 100644 --- a/src/st/st-clipboard.h +++ b/src/st/st-clipboard.h @@ -14,11 +14,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Thomas Wood - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-container.c b/src/st/st-container.c index 2c828496f..4d140a16a 100644 --- a/src/st/st-container.c +++ b/src/st/st-container.c @@ -4,6 +4,8 @@ * * Copyright 2007 OpenedHand * Copyright 2008, 2009 Intel Corporation. + * Copyright 2010 Florian Müllner + * Copyright 2010 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -15,13 +17,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - * Written by: Emmanuele Bassi - * Thomas Wood - * + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H diff --git a/src/st/st-container.h b/src/st/st-container.h index a19a742b7..f5f04aa09 100644 --- a/src/st/st-container.h +++ b/src/st/st-container.h @@ -15,10 +15,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-drawing-area.c b/src/st/st-drawing-area.c index a10da15db..2235842d8 100644 --- a/src/st/st-drawing-area.c +++ b/src/st/st-drawing-area.c @@ -1,4 +1,22 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-drawing-area.c: A dynamically-sized Cairo drawing area + * + * Copyright 2009, 2010 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ /** * SECTION:st-drawing-area diff --git a/src/st/st-drawing-area.h b/src/st/st-drawing-area.h index 429e749b0..fddd7dfa5 100644 --- a/src/st/st-drawing-area.h +++ b/src/st/st-drawing-area.h @@ -1,4 +1,23 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-drawing-area.h: A dynamically-sized Cairo drawing area + * + * Copyright 2009, 2010 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + #ifndef __ST_DRAWING_AREA_H__ #define __ST_DRAWING_AREA_H__ diff --git a/src/st/st-entry.c b/src/st/st-entry.c index b82da8afe..fe0fe34bb 100644 --- a/src/st/st-entry.c +++ b/src/st/st-entry.c @@ -3,6 +3,8 @@ * st-entry.c: Plain entry actor * * Copyright 2008, 2009 Intel Corporation + * Copyright 2009, 2010 Red Hat, Inc. + * Copyright 2010 Florian Müllner * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -14,11 +16,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Thomas Wood - * + * along with this program. If not, see . */ /** diff --git a/src/st/st-entry.h b/src/st/st-entry.h index bf14dcd6b..581ad4d5e 100644 --- a/src/st/st-entry.h +++ b/src/st/st-entry.h @@ -14,12 +14,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - * Written by: Thomas Wood - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-focus-manager.c b/src/st/st-focus-manager.c index 50cb0bdaa..542fc5ab3 100644 --- a/src/st/st-focus-manager.c +++ b/src/st/st-focus-manager.c @@ -2,11 +2,12 @@ /* * st-focus-manager.c: Keyboard focus manager * - * Copyright (c) 2010 Red Hat, Inc. + * Copyright 2010 Red Hat, Inc. * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU Lesser General Public License, - * version 2.1, as published by the Free Software Foundation. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. * * This program is distributed in the hope it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS @@ -14,8 +15,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + * along with this program. If not, see . */ /** diff --git a/src/st/st-focus-manager.h b/src/st/st-focus-manager.h index 365cf970f..9d4dc30d9 100644 --- a/src/st/st-focus-manager.h +++ b/src/st/st-focus-manager.h @@ -4,9 +4,10 @@ * * Copyright 2010 Red Hat, Inc. * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU Lesser General Public License, - * version 2.1, as published by the Free Software Foundation. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. * * This program is distributed in the hope it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS @@ -14,9 +15,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-group.c b/src/st/st-group.c index 0942be13c..b981de056 100644 --- a/src/st/st-group.c +++ b/src/st/st-group.c @@ -1,6 +1,8 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* - * st-group.h: A fixed layout container based on ClutterGroup + * st-group.c: A fixed layout container based on ClutterGroup + * + * Copyright 2010 Florian Müllner * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -12,9 +14,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * + * along with this program. If not, see . */ /** diff --git a/src/st/st-group.h b/src/st/st-group.h index bf7e34b6f..af2428758 100644 --- a/src/st/st-group.h +++ b/src/st/st-group.h @@ -2,6 +2,8 @@ /* * st-group.h: A fixed layout container based on ClutterGroup * + * Copyright 2010 Florian Müllner + * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, * version 2.1, as published by the Free Software Foundation. @@ -12,10 +14,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-im-text.c b/src/st/st-im-text.c index 23657ae87..5f00abfca 100644 --- a/src/st/st-im-text.c +++ b/src/st/st-im-text.c @@ -1,6 +1,8 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* - * st-im-text.c + * st-im-text.c: Text widget with input method support + * + * Copyright 2009 Red Hat, Inc. * * This started as a copy of ClutterIMText converted to use * GtkIMContext rather than ClutterIMContext. Original code: @@ -18,10 +20,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . */ /** diff --git a/src/st/st-im-text.h b/src/st/st-im-text.h index e897b1041..d6f10f412 100644 --- a/src/st/st-im-text.h +++ b/src/st/st-im-text.h @@ -1,6 +1,8 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* - * st-imtext.h + * st-im-text.h: Text widget with input method support + * + * Copyright 2009 Red Hat, Inc. * * This is a copy of ClutterIMText converted to use GtkIMContext rather * than ClutterIMContext. Original code: @@ -18,10 +20,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-label.c b/src/st/st-label.c index cf7ae5a7f..38a7d715e 100644 --- a/src/st/st-label.c +++ b/src/st/st-label.c @@ -3,6 +3,8 @@ * st-label.c: Plain label actor * * Copyright 2008,2009 Intel Corporation + * Copyright 2009 Red Hat, Inc. + * Copyright 2010 Florian Müllner * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -14,11 +16,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Thomas Wood - * + * along with this program. If not, see . */ /** diff --git a/src/st/st-label.h b/src/st/st-label.h index 934a49420..abe32d9d8 100644 --- a/src/st/st-label.h +++ b/src/st/st-label.h @@ -14,12 +14,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - * Written by: Thomas Wood - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-overflow-box.c b/src/st/st-overflow-box.c index 23e11534a..9996b2a18 100644 --- a/src/st/st-overflow-box.c +++ b/src/st/st-overflow-box.c @@ -1,9 +1,9 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* - * Portions derived from st-box-layout.c, which is - * Copyright 2009 Intel Corporation. - * Modified into -overflow-box, by Colin Walters , which is - * Copyright 2009 Red Hat, Inc. + * st-overflow-box.c: A vertical box which paints as many actors as it can fit + * + * Copyright 2009, 2010 Red Hat, Inc. + * Copyright 2009 Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -15,9 +15,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * + * along with this program. If not, see . */ /** diff --git a/src/st/st-overflow-box.h b/src/st/st-overflow-box.h index 47632ade0..5bba7fb4f 100644 --- a/src/st/st-overflow-box.h +++ b/src/st/st-overflow-box.h @@ -1,6 +1,6 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* - * st-overflow-box.h: box which hides actors that don't fit + * st-overflow-box.h: A vertical box which paints as many actors as it can fit * * Copyright 2009 Red Hat, Inc. * @@ -14,9 +14,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-private.c b/src/st/st-private.c index f1f3aab86..f4707691e 100644 --- a/src/st/st-private.c +++ b/src/st/st-private.c @@ -1,4 +1,24 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-private.h: Private declarations and functions + * + * Copyright 2009, 2010 Red Hat, Inc. + * Copyright 2010 Florian Müllner + * Copyright 2010 Intel Corporation + * Copyright 2010 Giovanni Campagna + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU Lesser General Public License, + * version 2.1, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ #include #include diff --git a/src/st/st-private.h b/src/st/st-private.h index 0d0e6422a..f958842d3 100644 --- a/src/st/st-private.h +++ b/src/st/st-private.h @@ -1,9 +1,11 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* - * st-private.h: Private declarations + * st-private.h: Private declarations and functions * * Copyright 2007 OpenedHand * Copyright 2009 Intel Corporation. + * Copyright 2010 Red Hat, Inc. + * Copyright 2010 Florian Müllner * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -15,10 +17,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * + * along with this program. If not, see . */ #ifndef __ST_PRIVATE_H__ diff --git a/src/st/st-scroll-bar.c b/src/st/st-scroll-bar.c index f6b798ee8..61acdf06e 100644 --- a/src/st/st-scroll-bar.c +++ b/src/st/st-scroll-bar.c @@ -3,7 +3,9 @@ * st-scroll-bar.c: Scroll bar actor * * Copyright 2008 OpenedHand - * Copyright 2009 Intel Corporation. + * Copyright 2008, 2009 Intel Corporation. + * Copyright 2009, 2010 Red Hat, Inc. + * Copyright 2010 Maxim Ermilov * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -15,12 +17,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Chris Lord - * Port to St by: Robert Staudinger - * + * along with this program. If not, see . */ /** diff --git a/src/st/st-scroll-bar.h b/src/st/st-scroll-bar.h index 2505dd347..371e2a58f 100644 --- a/src/st/st-scroll-bar.h +++ b/src/st/st-scroll-bar.h @@ -15,13 +15,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - * Written by: Chris Lord - * Port to St by: Robert Staudinger - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-scroll-view.c b/src/st/st-scroll-view.c index 1e30314ff..14df6005b 100644 --- a/src/st/st-scroll-view.c +++ b/src/st/st-scroll-view.c @@ -4,6 +4,8 @@ * * Copyright 2008 OpenedHand * Copyright 2009 Intel Corporation. + * Copyright 2009, 2010 Red Hat, Inc. + * Copyright 2010 Maxim Ermilov * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -15,12 +17,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Chris Lord - * Port to St by: Robert Staudinger - * + * along with this program. If not, see . */ /** diff --git a/src/st/st-scroll-view.h b/src/st/st-scroll-view.h index bcd4bbb5a..ddb1ebb7d 100644 --- a/src/st/st-scroll-view.h +++ b/src/st/st-scroll-view.h @@ -4,6 +4,8 @@ * * Copyright 2008 OpenedHand * Copyright 2009 Intel Corporation. + * Copyright 2010 Red Hat, Inc. + * Copyright 2010 Maxim Ermilov * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -15,13 +17,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - * Written by: Chris Lord - * Port to St by: Robert Staudinger - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-scrollable.c b/src/st/st-scrollable.c index f10f9a5b2..b2c5451b8 100644 --- a/src/st/st-scrollable.c +++ b/src/st/st-scrollable.c @@ -4,6 +4,7 @@ * * Copyright 2008 OpenedHand * Copyright 2009 Intel Corporation. + * Copyright 2010 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -15,12 +16,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Chris Lord - * Port to St by: Robert Staudinger - * + * along with this program. If not, see . */ #include "st-scrollable.h" diff --git a/src/st/st-scrollable.h b/src/st/st-scrollable.h index 22884eb15..5c8d32ef3 100644 --- a/src/st/st-scrollable.h +++ b/src/st/st-scrollable.h @@ -15,13 +15,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - * Written by: Chris Lord - * Port to St by: Robert Staudinger - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-shadow.c b/src/st/st-shadow.c index 29bcd08c1..78cf3dea4 100644 --- a/src/st/st-shadow.c +++ b/src/st/st-shadow.c @@ -1,4 +1,23 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-shadow.c: Boxed type holding for -st-shadow attributes + * + * Copyright 2009, 2010 Florian Müllner + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + #include "config.h" #include "st-shadow.h" diff --git a/src/st/st-shadow.h b/src/st/st-shadow.h index f5fe82332..1a057c307 100644 --- a/src/st/st-shadow.h +++ b/src/st/st-shadow.h @@ -1,4 +1,23 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-shadow.h: Boxed type holding for -st-shadow attributes + * + * Copyright 2009, 2010 Florian Müllner + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + #ifndef __ST_SHADOW__ #define __ST_SHADOW__ diff --git a/src/st/st-table-child.c b/src/st/st-table-child.c index 7d8feaf53..90c7186fa 100644 --- a/src/st/st-table-child.c +++ b/src/st/st-table-child.c @@ -3,6 +3,7 @@ * st-table-child.h: Table child implementation * * Copyright 2008, 2009 Intel Corporation. + * Copyright 2010 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -14,12 +15,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - * Written by: Thomas Wood - * + * along with this program. If not, see . */ #include "st-private.h" diff --git a/src/st/st-table-child.h b/src/st/st-table-child.h index 14df7ecd5..080522f94 100644 --- a/src/st/st-table-child.h +++ b/src/st/st-table-child.h @@ -14,12 +14,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - * Written by: Thomas Wood - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-table-private.h b/src/st/st-table-private.h index 6115cdf60..6c270e2c0 100644 --- a/src/st/st-table-private.h +++ b/src/st/st-table-private.h @@ -15,10 +15,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * + * along with this program. If not, see . */ #ifndef __ST_TABLE_PRIVATE_H__ diff --git a/src/st/st-table.c b/src/st/st-table.c index f92c810cb..26fb42ed0 100644 --- a/src/st/st-table.c +++ b/src/st/st-table.c @@ -3,6 +3,8 @@ * st-table.c: Table layout widget * * Copyright 2008, 2009 Intel Corporation. + * Copyright 2009, 2010 Red Hat, Inc. + * Copyright 2009 Abderrahim Kitouni * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -14,12 +16,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - * Written by: Thomas Wood - * + * along with this program. If not, see . */ /** diff --git a/src/st/st-table.h b/src/st/st-table.h index bce6084d5..f6b8d7181 100644 --- a/src/st/st-table.h +++ b/src/st/st-table.h @@ -14,12 +14,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - * Written by: Thomas Wood - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c index 0d8aac2fb..b4aa8a7da 100644 --- a/src/st/st-texture-cache.c +++ b/src/st/st-texture-cache.c @@ -1,4 +1,23 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-texture-cache.h: Object for loading and caching images as textures + * + * Copyright 2009, 2010 Red Hat, Inc. + * Copyright 2010, Maxim Ermilov + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ #include "config.h" diff --git a/src/st/st-texture-cache.h b/src/st/st-texture-cache.h index df4ef4352..ec61c90e1 100644 --- a/src/st/st-texture-cache.h +++ b/src/st/st-texture-cache.h @@ -1,4 +1,24 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-texture-cache.h: Object for loading and caching images as textures + * + * Copyright 2009, 2010 Red Hat, Inc. + * Copyright 2010, Maxim Ermilov + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + #ifndef __ST_TEXTURE_CACHE_H__ #define __ST_TEXTURE_CACHE_H__ diff --git a/src/st/st-theme-context.c b/src/st/st-theme-context.c index a3e25ca83..378db306e 100644 --- a/src/st/st-theme-context.c +++ b/src/st/st-theme-context.c @@ -1,4 +1,23 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-theme-context.c: holds global information about a tree of styled objects + * + * Copyright 2009, 2010 Red Hat, Inc. + * Copyright 2009 Florian Müllner + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ #include diff --git a/src/st/st-theme-context.h b/src/st/st-theme-context.h index b55f31c49..6e6ee3cb2 100644 --- a/src/st/st-theme-context.h +++ b/src/st/st-theme-context.h @@ -1,4 +1,24 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-theme-context.c: holds global information about a tree of styled objects + * + * Copyright 2009, 2010 Red Hat, Inc. + * Copyright 2009 Florian Müllner + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + #ifndef __ST_THEME_CONTEXT_H__ #define __ST_THEME_CONTEXT_H__ diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c index 8bc191555..173dbf553 100644 --- a/src/st/st-theme-node-drawing.c +++ b/src/st/st-theme-node-drawing.c @@ -1,32 +1,30 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ -/* Drawing for StWidget. - - Copyright (C) 2009,2010 Red Hat, Inc. - - Contains code derived from: - rectangle.c: Rounded rectangle. - Copyright (C) 2008 litl, LLC. - st-shadow-texture.c: a class for creating soft shadow texture - Copyright (C) 2009 Florian Müllner - st-texture-frame.h: Expandible texture actor - Copyright 2007 OpenedHand - Copyright 2009 Intel Corporation. - - The St is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The St is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the St; see the file COPYING.LIB. - If not, write to the Free Software Foundation, Inc., 59 Temple Place - - Suite 330, Boston, MA 02111-1307, USA. -*/ +/* + * st-theme-node-drawing.c: Code to draw themed elements + * + * Copyright 2009, 2010 Red Hat, Inc. + * Copyright 2009, 2010 Florian Müllner + * Copyright 2010 Intel Corporation. + * + * Contains code derived from: + * rectangle.c: Rounded rectangle. + * Copyright 2008 litl, LLC. + * st-texture-frame.h: Expandible texture actor + * Copyright 2007 OpenedHand + * Copyright 2009 Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU Lesser General Public License, + * version 2.1, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ #include #include diff --git a/src/st/st-theme-node-private.h b/src/st/st-theme-node-private.h index a13df17c6..1ced764f1 100644 --- a/src/st/st-theme-node-private.h +++ b/src/st/st-theme-node-private.h @@ -1,4 +1,23 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-theme-node-private.h: private structures and functions for StThemeNode + * + * Copyright 2009, 2010 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + #ifndef __ST_THEME_NODE_PRIVATE_H__ #define __ST_THEME_NODE_PRIVATE_H__ diff --git a/src/st/st-theme-node-transition.c b/src/st/st-theme-node-transition.c index 319cea7c3..ea1ba1c9e 100644 --- a/src/st/st-theme-node-transition.c +++ b/src/st/st-theme-node-transition.c @@ -1,22 +1,22 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ -/* Theme node transitions for StWidget. +/* + * st-theme-node-transition.c: Theme node transitions for StWidget. * - * Copyright (C) 2010 Florian Müllner + * Copyright 2010 Florian Müllner + * Copyright 2010 Adel Gadllah * - * The St is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. * - * The St is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. * - * You should have received a copy of the GNU Library General Public - * License along with the St; see the file COPYING.LIB. - * If not, write to the Free Software Foundation, Inc., 59 Temple Place - - * Suite 330, Boston, MA 02111-1307, USA. + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . */ #include "st-theme-node-transition.h" diff --git a/src/st/st-theme-node-transition.h b/src/st/st-theme-node-transition.h index 2f237b189..3bcef9beb 100644 --- a/src/st/st-theme-node-transition.h +++ b/src/st/st-theme-node-transition.h @@ -1,4 +1,23 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-theme-node-transition.h: Theme node transitions for StWidget. + * + * Copyright 2010 Florian Müllner + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + #ifndef __ST_THEME_NODE_TRANSITION_H__ #define __ST_THEME_NODE_TRANSITION_H__ diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c index 1a23399be..d325be0c2 100644 --- a/src/st/st-theme-node.c +++ b/src/st/st-theme-node.c @@ -1,4 +1,26 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-theme-node.c: style information for one node in a tree of themed objects + * + * Copyright 2008-2010 Red Hat, Inc. + * Copyright 2009 Steve Frécinaux + * Copyright 2009, 2010 Florian Müllner + * Copyright 2010 Adel Gadllah + * Copyright 2010 Giovanni Campagna + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ #include #include diff --git a/src/st/st-theme-node.h b/src/st/st-theme-node.h index ec567c305..aeb80d9af 100644 --- a/src/st/st-theme-node.h +++ b/src/st/st-theme-node.h @@ -1,4 +1,25 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-theme-node.h: style information for one node in a tree of themed objects + * + * Copyright 2008-2010 Red Hat, Inc. + * Copyright 2009, 2010 Florian Müllner + * Copyright 2010 Giovanni Campagna + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + #ifndef __ST_THEME_NODE_H__ #define __ST_THEME_NODE_H__ diff --git a/src/st/st-theme-private.h b/src/st/st-theme-private.h index 92e87e833..ecd2639be 100644 --- a/src/st/st-theme-private.h +++ b/src/st/st-theme-private.h @@ -1,4 +1,23 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-theme-private.h: Private StThemeMethods + * + * Copyright 2008, 2009 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + #ifndef __ST_THEME_PRIVATE_H__ #define __ST_THEME_PRIVATE_H__ diff --git a/src/st/st-theme.c b/src/st/st-theme.c index 6e2fd2c74..bce53b429 100644 --- a/src/st/st-theme.c +++ b/src/st/st-theme.c @@ -1,6 +1,23 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ - -/* This file started as a cut-and-paste of cr-sel-eng.c from libcroco. +/* + * st-theme.c: A set of CSS stylesheets used for rule matching + * + * Copyright 2003-2004 Dodji Seketeli + * Copyright 2008, 2009 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU Lesser General Public License, + * version 2.1, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * This file started as a cut-and-paste of cr-sel-eng.c from libcroco. * * In moving it to hippo-canvas: * - Reformatted and otherwise edited to match our coding style @@ -19,27 +36,6 @@ * - Some code simplification */ -/* - * This file is part of The Croco Library - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2.1 of the GNU Lesser General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser - * 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 - * - * Copyright (C) 2003-2004 Dodji Seketeli. All Rights Reserved. - */ - #include #include diff --git a/src/st/st-theme.h b/src/st/st-theme.h index 1a55b29fb..003c2a7c1 100644 --- a/src/st/st-theme.h +++ b/src/st/st-theme.h @@ -1,4 +1,22 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-theme.h: A set of CSS stylesheets used for rule matching + * + * Copyright 2008, 2009 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ #ifndef __ST_THEME_H__ #define __ST_THEME_H__ diff --git a/src/st/st-tooltip.c b/src/st/st-tooltip.c index c458fb561..52419f680 100644 --- a/src/st/st-tooltip.c +++ b/src/st/st-tooltip.c @@ -3,6 +3,7 @@ * st-tooltip.c: Plain tooltip actor * * Copyright 2008, 2009 Intel Corporation + * Copyright 2009 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -14,12 +15,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - * Written by: Thomas Wood - * + * along with this program. If not, see . */ /** diff --git a/src/st/st-tooltip.h b/src/st/st-tooltip.h index ab7b943b8..087518180 100644 --- a/src/st/st-tooltip.h +++ b/src/st/st-tooltip.h @@ -14,13 +14,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Written by: Thomas Wood - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/st-types.h b/src/st/st-types.h index a103e1c3b..b1706dbef 100644 --- a/src/st/st-types.h +++ b/src/st/st-types.h @@ -12,9 +12,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * + * along with this program. If not, see . */ /** diff --git a/src/st/st-widget.c b/src/st/st-widget.c index 32a5d2388..a03af9af1 100644 --- a/src/st/st-widget.c +++ b/src/st/st-widget.c @@ -4,6 +4,9 @@ * * Copyright 2007 OpenedHand * Copyright 2008, 2009 Intel Corporation. + * Copyright 2009, 2010 Red Hat, Inc. + * Copyright 2009 Abderrahim Kitouni + * Copyright 2009, 2010 Florian Müllner * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -15,13 +18,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * - * Written by: Emmanuele Bassi - * Thomas Wood - * + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H diff --git a/src/st/st-widget.h b/src/st/st-widget.h index 3f0e87902..ba474208f 100644 --- a/src/st/st-widget.h +++ b/src/st/st-widget.h @@ -4,6 +4,9 @@ * * Copyright 2007 OpenedHand * Copyright 2008, 2009 Intel Corporation. + * Copyright 2009, 2010 Red Hat, Inc. + * Copyright 2009 Abderrahim Kitouni + * Copyright 2010 Florian Müllner * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -15,10 +18,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * Boston, MA 02111-1307, USA. - * + * along with this program. If not, see . */ #if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) diff --git a/src/st/test-theme.c b/src/st/test-theme.c index 425fc5773..43e14452d 100644 --- a/src/st/test-theme.c +++ b/src/st/test-theme.c @@ -1,4 +1,22 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * test-theme.c: test program for CSS styling code + * + * Copyright 2009, 2010 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ #include #include "st-theme.h" From e381f0f4926c188a14a5276eaec6e615d51a6843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 12 Nov 2010 21:28:07 +0100 Subject: [PATCH 52/85] build-setup: Add missing build-dependency polkit requires pam-devel to build. Add the package to the list of dependencies in the setup script. --- tools/build/gnome-shell-build-setup.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/build/gnome-shell-build-setup.sh b/tools/build/gnome-shell-build-setup.sh index e4dc26c9c..74bf69080 100755 --- a/tools/build/gnome-shell-build-setup.sh +++ b/tools/build/gnome-shell-build-setup.sh @@ -59,7 +59,7 @@ fi # Devel packages needed by gnome-shell and its deps: # dbus-glib, GL, gnome-menus, gstreamer, libffi, # libjasper, libjpeg, libpng, libpulse, libtiff, libwnck, -# libxml2, ORBit2, python, readline, +# libxml2, ORBit2, pam, python, readline, # spidermonkey ({mozilla,firefox,xulrunner}-js), startup-notification # xdamage, icon-naming-utils, libtool-ltdl, libvorbis # @@ -84,7 +84,7 @@ if test "x$system" = xUbuntu -o "x$system" = xDebian -o "x$system" = xLinuxMint libdbus-glib-1-dev libffi-dev libgnome-menu-dev libgnome-desktop-dev \ libjasper-dev libjpeg-dev libpng-dev libstartup-notification0-dev libtiff-dev \ libwnck-dev libgl1-mesa-dev liborbit2-dev libpulse-dev libreadline5-dev libxml2-dev \ - mesa-common-dev mesa-utils python-dev python-gconf python-gobject \ + mesa-common-dev mesa-utils libpam-dev python-dev python-gconf python-gobject \ xulrunner-dev xserver-xephyr gnome-terminal libcroco3-dev \ libgstreamer0.10-dev gstreamer0.10-plugins-base gstreamer0.10-plugins-good \ libltdl-dev libvorbis-dev \ @@ -106,10 +106,11 @@ if test "x$system" = xFedora ; then automake bison flex gettext git gnome-common gnome-doc-utils gvfs intltool libtool pkgconfig dbus-glib-devel gnome-desktop-devel gnome-menus-devel gnome-python2-gconf jasper-devel libffi-devel libjpeg-devel libpng-devel - libtiff-devel libwnck-devel mesa-libGL-devel ORBit2-devel pulseaudio-libs-devel - python-devel pygobject2 readline-devel xulrunner-devel libXdamage-devel libcroco-devel - libxml2-devel gstreamer-devel gstreamer-plugins-base gstreamer-plugins-good - glx-utils startup-notification-devel xorg-x11-server-Xephyr gnome-terminal zenity + libtiff-devel libwnck-devel mesa-libGL-devel ORBit2-devel pam-devel + pulseaudio-libs-devel python-devel pygobject2 readline-devel xulrunner-devel + libXdamage-devel libcroco-devel libxml2-devel gstreamer-devel + gstreamer-plugins-base gstreamer-plugins-good glx-utils + startup-notification-devel xorg-x11-server-Xephyr gnome-terminal zenity icon-naming-utils libtool-ltdl-devel libvorbis-devel " From 86f3a637f1a47cae5bfd0959447fb91604a0d051 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sat, 30 Oct 2010 19:46:50 -0400 Subject: [PATCH 53/85] st_texture_cache_load_from_raw: Don't pointlessly include size in cache key The texture is independent of the size that the user passed in; so there is no obvious reason to include the texture in the cache key. https://bugzilla.gnome.org/show_bug.cgi?id=633595 --- src/st/st-texture-cache.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c index b4aa8a7da..cbbe7b1c5 100644 --- a/src/st/st-texture-cache.c +++ b/src/st/st-texture-cache.c @@ -1505,11 +1505,13 @@ st_texture_cache_load_from_raw (StTextureCache *cache, texture = create_default_texture (cache); clutter_actor_set_size (CLUTTER_ACTOR (texture), size, size); - /* In theory, two images of different size could have the same - * pixel data. We ignore that theory. + /* In theory, two images of with different width and height could have the same + * pixel data and thus hash the same. (Say, a 16x16 and a 8x32 blank image.) + * We ignore this for now. If anybody hits this problem they should use + * GChecksum directly to compute a checksum including the width and height. */ checksum = g_compute_checksum_for_data (G_CHECKSUM_SHA1, data, len); - key = g_strdup_printf (CACHE_PREFIX_RAW_CHECKSUM "checksum=%s,size=%d", checksum, size); + key = g_strdup_printf (CACHE_PREFIX_RAW_CHECKSUM "checksum=%s", checksum); g_free (checksum); texdata = g_hash_table_lookup (cache->priv->keyed_cache, key); From c98103ffc81eff4416f3fe04b12e21545b9131b7 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sun, 31 Oct 2010 15:28:06 -0400 Subject: [PATCH 54/85] Add run-js-test executable to run tests ST makes use of GTK+ for input methods and for icon themes; therefore we have need to initialize GTK+ in order to test these parts of Clutter. Instead of LD_PRELOADING our module, use a separately compiled executable that links to the UI components in GNOME Shell, initializes Clutter and GTK+ and hooks them together. Getting all the symbols from St and the GUI components exported for use via GJS requires a bit of contortion: we need to actually link the St convenience library into a shared library and link the executable to that since there is no way with libtool to take a convenience library and put all its symbols into an executable --whole-archive style. https://bugzilla.gnome.org/show_bug.cgi?id=633657 --- .gitignore | 1 + configure.ac | 2 + src/Makefile.am | 31 +++++++++ src/run-js-test.c | 144 +++++++++++++++++++++++++++++++++++++++++ tests/run-test.sh.in | 9 ++- tests/testcommon/ui.js | 1 - 6 files changed, 182 insertions(+), 6 deletions(-) create mode 100644 src/run-js-test.c diff --git a/.gitignore b/.gitignore index eca8c9034..f717e24bb 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ src/Makefile.in src/gnomeshell-taskpanel src/gnome-shell src/gnome-shell-clock-preferences +src/run-js-test src/test-recorder src/test-recorder.ogg src/test-theme diff --git a/configure.ac b/configure.ac index d935d0fcf..a02faf584 100644 --- a/configure.ac +++ b/configure.ac @@ -93,6 +93,8 @@ PKG_CHECK_MODULES(GDMUSER, dbus-glib-1 gtk+-3.0) PKG_CHECK_MODULES(TRAY, gtk+-3.0) PKG_CHECK_MODULES(GVC, libpulse libpulse-mainloop-glib gobject-2.0) +PKG_CHECK_MODULES(JS_TEST, clutter-x11-1.0 gjs-1.0 gobject-introspection-1.0 gtk+-3.0) + MUTTER_BIN_DIR=`$PKG_CONFIG --variable=exec_prefix mutter-plugins`/bin # FIXME: metacity-plugins.pc should point directly to its .gir file MUTTER_LIB_DIR=`$PKG_CONFIG --variable=libdir mutter-plugins` diff --git a/src/Makefile.am b/src/Makefile.am index 6bdc0d261..5d05b5768 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -117,6 +117,8 @@ libgnome_shell_la_SOURCES = \ libgnome_shell_la_gir_sources = \ $(filter-out %-private.h $(shell_recorder_non_gir_sources), $(shell_public_headers_h) $(libgnome_shell_la_SOURCES)) +######################################## + shell_recorder_sources = \ shell-recorder.c \ shell-recorder.h @@ -139,6 +141,35 @@ test_recorder_SOURCES = \ test-recorder.c endif BUILD_RECORDER +######################################## + +# In order to run the interactive tests for GUI components, we need to have +# an executable that exports the St components. Libtool doesn't have a way +# to include all the symbols from a convenience library into a executable +# so what we do is build a small uninstalled library that pulls in the +# St convenience library and link the test running program to that. + +noinst_LTLIBRARIES += libjs-test.la + +libjs_test_la_LDFLAGS = -rpath $(libdir) +libjs_test_la_CPPFLAGS = $(JS_TEST_CFLAGS) +libjs_test_la_LIBADD = $(JS_TEST_LIBS) libst-1.0.la + +# The tests use or reference a couple of Shell classes +libjs_test_la_SOURCES = \ + shell-generic-container.c \ + shell-perf-log.c + +noinst_PROGRAMS += run-js-test + +run_js_test_CPPFLAGS = $(JS_TEST_CFLAGS) +run_js_test_LDADD = $(EST_UI_LIBS) libjs-test.la +run_js_test_LDFLAGS = -export-dynamic + +run_js_test_SOURCES = \ + run-js-test.c + +######################################## shell-marshal.h: stamp-shell-marshal.h @true diff --git a/src/run-js-test.c b/src/run-js-test.c new file mode 100644 index 000000000..5be4eaddd --- /dev/null +++ b/src/run-js-test.c @@ -0,0 +1,144 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * Based on gjs/console.c from GJS + * + * Copyright (c) 2008 litl, LLC + * Copyright (c) 2010 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +static char **include_path = NULL; +static char *command = NULL; + +static GOptionEntry entries[] = { + { "command", 'c', 0, G_OPTION_ARG_STRING, &command, "Program passed in as a string", "COMMAND" }, + { "include-path", 'I', 0, G_OPTION_ARG_STRING_ARRAY, &include_path, "Add the directory DIR to the list of directories to search for js files.", "DIR" }, + { NULL } +}; + +static GdkFilterReturn +event_filter (GdkXEvent *xevent, + GdkEvent *event, + gpointer data) +{ + XEvent *xev = (XEvent *)xevent; + + if (clutter_x11_handle_event (xev) == CLUTTER_X11_FILTER_CONTINUE) + return GDK_FILTER_CONTINUE; + else + return GDK_FILTER_REMOVE; +} + +int +main(int argc, char **argv) +{ + char *command_line; + GOptionContext *context; + ClutterActor *stage; + GError *error = NULL; + GjsContext *js_context; + char *script; + const char *filename; + char *title; + gsize len; + int code; + + g_thread_init (NULL); + + gtk_init (&argc, &argv); + + clutter_x11_set_display (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ())); + clutter_x11_disable_event_retrieval (); + + clutter_init (&argc, &argv); + + gdk_window_add_filter (NULL, event_filter, NULL); + + context = g_option_context_new (NULL); + + /* pass unknown through to the JS script */ + g_option_context_set_ignore_unknown_options (context, TRUE); + + g_option_context_add_main_entries (context, entries, NULL); + if (!g_option_context_parse (context, &argc, &argv, &error)) + g_error ("option parsing failed: %s", error->message); + + setlocale (LC_ALL, ""); + g_type_init (); + + command_line = g_strjoinv (" ", argv); + g_debug ("Command line: %s", command_line); + g_free (command_line); + + g_debug ("Creating new context to eval console script"); + js_context = gjs_context_new_with_search_path (include_path); + + /* prepare command line arguments */ + if (!gjs_context_define_string_array (js_context, "ARGV", + argc - 2, (const char**)argv + 2, + &error)) { + g_printerr ("Failed to defined ARGV: %s", error->message); + exit (1); + } + + if (command != NULL) { + script = command; + len = strlen (script); + filename = ""; + } else if (argc <= 1) { + script = g_strdup ("const Console = imports.console; Console.interact();"); + len = strlen (script); + filename = ""; + } else /*if (argc >= 2)*/ { + error = NULL; + if (!g_file_get_contents (argv[1], &script, &len, &error)) { + g_printerr ("%s\n", error->message); + exit (1); + } + filename = argv[1]; + } + + stage = clutter_stage_get_default (); + title = g_filename_display_basename (filename); + clutter_stage_set_title (CLUTTER_STAGE (stage), title); + g_free (title); + + /* evaluate the script */ + error = NULL; + if (!gjs_context_eval (js_context, script, len, + filename, &code, &error)) { + g_free (script); + g_printerr ("%s\n", error->message); + exit (1); + } + + g_free (script); + exit (code); +} diff --git a/tests/run-test.sh.in b/tests/run-test.sh.in index 1ee197eb2..af905cbc8 100644 --- a/tests/run-test.sh.in +++ b/tests/run-test.sh.in @@ -11,7 +11,7 @@ debug= for arg in $@ ; do case $arg in -g|--debug) - debug="gdb --args" + debug="libtool --mode=execute gdb --args" ;; -v|--verbose) verbose=true @@ -34,15 +34,14 @@ GI_TYPELIB_PATH="@MUTTER_LIB_DIR@/mutter:$builddir/../src" GJS_DEBUG_OUTPUT=stderr $verbose || GJS_DEBUG_TOPICS="JS ERROR;JS LOG" GNOME_SHELL_TESTSDIR="$srcdir/" -LD_PRELOAD="$builddir/../src/.libs/libgnome-shell.so" export GI_TYPELIB_PATH GJS_DEBUG_OUTPUT GJS_DEBUG_TOPICS GNOME_SHELL_JS GNOME_SHELL_TESTSDIR LD_PRELOAD -gjs_args= +run_js_test_args= for i in $srcdir $srcdir/../js @GJS_JS_DIR@ @GJS_JS_NATIVE_DIR@ ; do - gjs_args="$gjs_args -I $i" + run_js_test_args="$run_js_test_args -I $i" done for test in $tests ; do - $debug gjs-console $gjs_args $test || exit $? + $debug $builddir/../src/run-js-test $run_js_test_args $test || exit $? done diff --git a/tests/testcommon/ui.js b/tests/testcommon/ui.js index 7110c65a1..82d5861d5 100644 --- a/tests/testcommon/ui.js +++ b/tests/testcommon/ui.js @@ -8,7 +8,6 @@ const Shell = imports.gi.Shell; const Environment = imports.ui.environment; function init() { - Clutter.init(null, null); Environment.init(); let stage = Clutter.Stage.get_default(); From 839492f15bc583bfb3b6643f4ae6fc1735acfe93 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sat, 30 Oct 2010 19:57:59 -0400 Subject: [PATCH 55/85] Import MxIcon as StIcon https://bugzilla.gnome.org/show_bug.cgi?id=633865 --- src/Makefile-st.am | 2 + src/st/st-icon.c | 553 +++++++++++++++++++++++++++++++++++++++++++++ src/st/st-icon.h | 95 ++++++++ 3 files changed, 650 insertions(+) create mode 100644 src/st/st-icon.c create mode 100644 src/st/st-icon.h diff --git a/src/Makefile-st.am b/src/Makefile-st.am index 71db6935e..b0272ae38 100644 --- a/src/Makefile-st.am +++ b/src/Makefile-st.am @@ -79,6 +79,7 @@ st_source_h = \ st/st-entry.h \ st/st-focus-manager.h \ st/st-group.h \ + st/st-icon.h \ st/st-im-text.h \ st/st-label.h \ st/st-overflow-box.h \ @@ -128,6 +129,7 @@ st_source_c = \ st/st-entry.c \ st/st-focus-manager.c \ st/st-group.c \ + st/st-icon.c \ st/st-im-text.c \ st/st-label.c \ st/st-overflow-box.c \ diff --git a/src/st/st-icon.c b/src/st/st-icon.c new file mode 100644 index 000000000..7a8192dfc --- /dev/null +++ b/src/st/st-icon.c @@ -0,0 +1,553 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-icon.c: icon widget + * + * Copyright 2009, 2010 Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU Lesser General Public License, + * version 2.1, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + * + * Written by: Thomas Wood , + * Chris Lord + * + */ + +/** + * SECTION:st-icon + * @short_description: a simple styled icon actor + * + * #StIcon is a simple styled texture actor that displays an image from + * a stylesheet. + */ + +#include "st-icon.h" +#include "st-icon-theme.h" +#include "st-stylable.h" + +#include "st-private.h" + +enum +{ + PROP_0, + + PROP_ICON_NAME, + PROP_ICON_SIZE +}; + +static void st_stylable_iface_init (StStylableIface *iface); + +G_DEFINE_TYPE_WITH_CODE (StIcon, st_icon, ST_TYPE_WIDGET, + G_IMPLEMENT_INTERFACE (ST_TYPE_STYLABLE, + st_stylable_iface_init)) + +#define ST_ICON_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ST_TYPE_ICON, StIconPrivate)) + +struct _StIconPrivate +{ + ClutterActor *icon_texture; + gboolean is_content_image; + + gchar *icon_name; + gint icon_size; +}; + +static void st_icon_update (StIcon *icon); + +static void +st_stylable_iface_init (StStylableIface *iface) +{ + static gboolean is_initialized = FALSE; + + if (G_UNLIKELY (!is_initialized)) + { + GParamSpec *pspec; + + is_initialized = TRUE; + + pspec = g_param_spec_boxed ("x-st-content-image", + "Content Image", + "Image used as the button", + ST_TYPE_BORDER_IMAGE, + G_PARAM_READWRITE); + st_stylable_iface_install_property (iface, ST_TYPE_ICON, pspec); + + pspec = g_param_spec_string ("x-st-icon-name", + "Icon name", + "Icon name to load from the theme", + NULL, + G_PARAM_READWRITE); + st_stylable_iface_install_property (iface, ST_TYPE_ICON, pspec); + + pspec = g_param_spec_int ("x-st-icon-size", + "Icon size", + "Size to use for icon", + -1, G_MAXINT, -1, + G_PARAM_READWRITE); + st_stylable_iface_install_property (iface, ST_TYPE_ICON, pspec); + } +} + +static void +st_icon_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + StIcon *icon = ST_ICON (gobject); + + switch (prop_id) + { + case PROP_ICON_NAME: + st_icon_set_icon_name (icon, g_value_get_string (value)); + break; + + case PROP_ICON_SIZE: + st_icon_set_icon_size (icon, g_value_get_int (value)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +st_icon_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + StIcon *icon = ST_ICON (gobject); + + switch (prop_id) + { + case PROP_ICON_NAME: + g_value_set_string (value, st_icon_get_icon_name (icon)); + break; + + case PROP_ICON_SIZE: + g_value_set_int (value, st_icon_get_icon_size (icon)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +st_icon_notify_theme_name_cb (StIconTheme *theme, + GParamSpec *pspec, + StIcon *self) +{ + st_icon_update (self); +} + +static void +st_icon_dispose (GObject *gobject) +{ + StIconTheme *theme; + StIconPrivate *priv = ST_ICON (gobject)->priv; + + if (priv->icon_texture) + { + clutter_actor_destroy (priv->icon_texture); + priv->icon_texture = NULL; + } + + if ((theme = st_icon_theme_get_default ())) + { + g_signal_handlers_disconnect_by_func (st_icon_theme_get_default (), + st_icon_notify_theme_name_cb, + gobject); + } + + G_OBJECT_CLASS (st_icon_parent_class)->dispose (gobject); +} + +static void +st_icon_get_preferred_height (ClutterActor *actor, + gfloat for_width, + gfloat *min_height_p, + gfloat *nat_height_p) +{ + StPadding padding; + gfloat pref_height; + + StIconPrivate *priv = ST_ICON (actor)->priv; + + if (priv->icon_texture) + { + gint width, height; + clutter_texture_get_base_size (CLUTTER_TEXTURE (priv->icon_texture), + &width, + &height); + + if (!priv->is_content_image) + { + if (width <= height) + pref_height = priv->icon_size; + else + pref_height = height / (gfloat)width * priv->icon_size; + } + else + pref_height = height; + } + else + pref_height = 0; + + st_widget_get_padding (ST_WIDGET (actor), &padding); + pref_height += padding.top + padding.bottom; + + if (min_height_p) + *min_height_p = pref_height; + + if (nat_height_p) + *nat_height_p = pref_height; +} + +static void +st_icon_get_preferred_width (ClutterActor *actor, + gfloat for_height, + gfloat *min_width_p, + gfloat *nat_width_p) +{ + StPadding padding; + gfloat pref_width; + + StIconPrivate *priv = ST_ICON (actor)->priv; + + if (priv->icon_texture) + { + gint width, height; + clutter_texture_get_base_size (CLUTTER_TEXTURE (priv->icon_texture), + &width, + &height); + + if (!priv->is_content_image) + { + if (height <= width) + pref_width = priv->icon_size; + else + pref_width = width / (gfloat)height * priv->icon_size; + } + else + pref_width = width; + } + else + pref_width = 0; + + st_widget_get_padding (ST_WIDGET (actor), &padding); + pref_width += padding.left + padding.right; + + if (min_width_p) + *min_width_p = pref_width; + + if (nat_width_p) + *nat_width_p = pref_width; +} + +static void +st_icon_allocate (ClutterActor *actor, + const ClutterActorBox *box, + ClutterAllocationFlags flags) +{ + StIconPrivate *priv = ST_ICON (actor)->priv; + + CLUTTER_ACTOR_CLASS (st_icon_parent_class)->allocate (actor, box, flags); + + if (priv->icon_texture) + { + StPadding padding; + ClutterActorBox child_box; + + st_widget_get_padding (ST_WIDGET (actor), &padding); + child_box.x1 = padding.left; + child_box.y1 = padding.top; + child_box.x2 = box->x2 - box->x1 - padding.right; + child_box.y2 = box->y2 - box->y1 - padding.bottom; + + clutter_actor_allocate (priv->icon_texture, &child_box, flags); + } +} + +static void +st_icon_paint (ClutterActor *actor) +{ + StIconPrivate *priv = ST_ICON (actor)->priv; + + /* Chain up to paint background */ + if (!priv->is_content_image) + CLUTTER_ACTOR_CLASS (st_icon_parent_class)->paint (actor); + + if (priv->icon_texture) + clutter_actor_paint (priv->icon_texture); +} + +static void +st_icon_map (ClutterActor *actor) +{ + StIconPrivate *priv = ST_ICON (actor)->priv; + + CLUTTER_ACTOR_CLASS (st_icon_parent_class)->map (actor); + + if (priv->icon_texture) + clutter_actor_map (priv->icon_texture); +} + +static void +st_icon_unmap (ClutterActor *actor) +{ + StIconPrivate *priv = ST_ICON (actor)->priv; + + CLUTTER_ACTOR_CLASS (st_icon_parent_class)->unmap (actor); + + if (priv->icon_texture) + clutter_actor_unmap (priv->icon_texture); +} + +static void +st_icon_class_init (StIconClass *klass) +{ + GParamSpec *pspec; + + GObjectClass *object_class = G_OBJECT_CLASS (klass); + ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + + g_type_class_add_private (klass, sizeof (StIconPrivate)); + + object_class->get_property = st_icon_get_property; + object_class->set_property = st_icon_set_property; + object_class->dispose = st_icon_dispose; + + actor_class->get_preferred_height = st_icon_get_preferred_height; + actor_class->get_preferred_width = st_icon_get_preferred_width; + actor_class->allocate = st_icon_allocate; + actor_class->paint = st_icon_paint; + actor_class->map = st_icon_map; + actor_class->unmap = st_icon_unmap; + + pspec = g_param_spec_string ("icon-name", + "Icon name", + "An icon name", + NULL, ST_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_ICON_NAME, pspec); + + pspec = g_param_spec_int ("icon-size", + "Icon size", + "Size of the icon", + 1, G_MAXINT, 48, + ST_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_ICON_SIZE, pspec); +} + +static void +st_icon_update (StIcon *icon) +{ + StIconPrivate *priv = icon->priv; + + if (priv->is_content_image) + { + priv->is_content_image = FALSE; + g_signal_connect (st_icon_theme_get_default (), "notify::theme-name", + G_CALLBACK (st_icon_notify_theme_name_cb), icon); + } + + /* Get rid of the old one */ + if (priv->icon_texture) + { + clutter_actor_destroy (priv->icon_texture); + priv->icon_texture = NULL; + } + + /* Try to lookup the new one */ + if (priv->icon_name) + { + StIconTheme *theme = st_icon_theme_get_default (); + priv->icon_texture = (ClutterActor *) + st_icon_theme_lookup_texture (theme, priv->icon_name, priv->icon_size); + + /* If the icon is missing, use the image-missing icon */ + if (!priv->icon_texture) + priv->icon_texture = (ClutterActor *) + st_icon_theme_lookup_texture (theme, + "image-missing", + priv->icon_size); + + if (priv->icon_texture) + clutter_actor_set_parent (priv->icon_texture, CLUTTER_ACTOR (icon)); + } + + clutter_actor_queue_relayout (CLUTTER_ACTOR (icon)); +} + +static void +st_icon_style_changed_cb (StWidget *widget) +{ + StIcon *self = ST_ICON (widget); + StIconPrivate *priv = self->priv; + + StBorderImage *content_image = NULL; + gboolean changed = FALSE; + gchar *icon_name = NULL; + gint icon_size = -1; + + st_stylable_get (ST_STYLABLE (widget), + "x-st-content-image", &content_image, + "x-st-icon-name", &icon_name, + "x-st-icon-size", &icon_size, + NULL); + + /* Content-image overrides drawing of the icon, so + * don't bother reading those properties if it's set. + */ + if (content_image) + { + GError *error = NULL; + + priv->is_content_image = TRUE; + g_signal_handlers_disconnect_by_func (st_icon_theme_get_default (), + st_icon_notify_theme_name_cb, + self); + + if (priv->icon_texture) + clutter_actor_destroy (priv->icon_texture); + + priv->icon_texture = clutter_texture_new_from_file (content_image->uri, + &error); + if (priv->icon_texture) + clutter_actor_set_parent (priv->icon_texture, CLUTTER_ACTOR (widget)); + + if (error) + { + g_warning ("Could not load content image: %s", error->message); + g_error_free (error); + } + + g_boxed_free (ST_TYPE_BORDER_IMAGE, content_image); + g_free (icon_name); + + return; + } + + if (icon_name && (!priv->icon_name || + !g_str_equal (icon_name, priv->icon_name))) + { + g_free (priv->icon_name); + priv->icon_name = g_strdup (icon_name); + changed = TRUE; + + g_object_notify (G_OBJECT (self), "icon-name"); + } + + if ((icon_size > 0) && (priv->icon_size != icon_size)) + { + priv->icon_size = icon_size; + changed = TRUE; + + g_object_notify (G_OBJECT (self), "icon-size"); + } + + if (changed) + st_icon_update (self); +} + +static void +st_icon_init (StIcon *self) +{ + self->priv = ST_ICON_GET_PRIVATE (self); + + self->priv->icon_size = 48; + + g_signal_connect (self, "style-changed", + G_CALLBACK (st_icon_style_changed_cb), NULL); + + /* make sure we are not reactive */ + clutter_actor_set_reactive (CLUTTER_ACTOR (self), FALSE); + + /* Reload the icon when the theme changes */ + g_signal_connect (st_icon_theme_get_default (), "notify::theme-name", + G_CALLBACK (st_icon_notify_theme_name_cb), self); +} + +/** + * st_icon_new: + * + * Create a newly allocated #StIcon + * + * Returns: A newly allocated #StIcon + */ +ClutterActor * +st_icon_new (void) +{ + return g_object_new (ST_TYPE_ICON, NULL); +} + + +const gchar * +st_icon_get_icon_name (StIcon *icon) +{ + g_return_val_if_fail (ST_IS_ICON (icon), NULL); + + return icon->priv->icon_name; +} + +void +st_icon_set_icon_name (StIcon *icon, + const gchar *icon_name) +{ + StIconPrivate *priv; + + g_return_if_fail (ST_IS_ICON (icon)); + + priv = icon->priv; + + /* Check if there's no change */ + if ((!priv->icon_name && !icon_name) || + (priv->icon_name && icon_name && + g_str_equal (priv->icon_name, icon_name))) + return; + + g_free (priv->icon_name); + priv->icon_name = g_strdup (icon_name); + + st_icon_update (icon); + + g_object_notify (G_OBJECT (icon), "icon-name"); +} + +gint +st_icon_get_icon_size (StIcon *icon) +{ + g_return_val_if_fail (ST_IS_ICON (icon), -1); + + return icon->priv->icon_size; +} +void +st_icon_set_icon_size (StIcon *icon, + gint size) +{ + StIconPrivate *priv; + + g_return_if_fail (ST_IS_ICON (icon)); + g_return_if_fail (size > 0); + + priv = icon->priv; + if (priv->icon_size != size) + { + priv->icon_size = size; + st_icon_update (icon); + g_object_notify (G_OBJECT (icon), "icon-size"); + } +} diff --git a/src/st/st-icon.h b/src/st/st-icon.h new file mode 100644 index 000000000..4fcde24f3 --- /dev/null +++ b/src/st/st-icon.h @@ -0,0 +1,95 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-icon.h: icon widget + * + * Copyright 2009, 2010 Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU Lesser General Public License, + * version 2.1, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + * + * Written by: Thomas Wood + * + */ + +#if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) +#error "Only can be included directly.h" +#endif + +#ifndef _ST_ICON +#define _ST_ICON + +#include +#include "st-widget.h" + +G_BEGIN_DECLS + +#define ST_TYPE_ICON st_icon_get_type() + +#define ST_ICON(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_ICON, StIcon)) + +#define ST_ICON_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_ICON, StIconClass)) + +#define ST_IS_ICON(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_ICON)) + +#define ST_IS_ICON_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_ICON)) + +#define ST_ICON_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_ICON, StIconClass)) + +typedef struct _StIconPrivate StIconPrivate; + +/** + * StIcon: + * + * The contents of this structure are private and should only be accessed + * through the public API. + */ +typedef struct { + /*< private >*/ + StWidget parent; + + StIconPrivate *priv; +} StIcon; + +typedef struct { + StWidgetClass parent_class; + + /* padding for future expansion */ + void (*_padding_0) (void); + void (*_padding_1) (void); + void (*_padding_2) (void); + void (*_padding_3) (void); + void (*_padding_4) (void); +} StIconClass; + +GType st_icon_get_type (void); + +ClutterActor* st_icon_new (void); + + + +const gchar *st_icon_get_icon_name (StIcon *icon); +void st_icon_set_icon_name (StIcon *icon, const gchar *icon_name); + +gint st_icon_get_icon_size (StIcon *icon); +void st_icon_set_icon_size (StIcon *icon, gint size); + + +G_END_DECLS + +#endif /* _ST_ICON */ + From 32fc25a3accadd3f43248aa0132943429c4f855b Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Fri, 12 Nov 2010 15:52:20 -0500 Subject: [PATCH 56/85] StIcon: Adopt copyright notice to standard - Replace FSF address with URL - Remove explicit Authors: list https://bugzilla.gnome.org/show_bug.cgi?id=633865 --- src/st/st-icon.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/st/st-icon.c b/src/st/st-icon.c index 7a8192dfc..abbab1f2d 100644 --- a/src/st/st-icon.c +++ b/src/st/st-icon.c @@ -14,12 +14,7 @@ * more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * Written by: Thomas Wood , - * Chris Lord - * + * along with this program. If not, see . */ /** From b0e713b7758356f38ee1617945a538990330077d Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Fri, 12 Nov 2010 15:57:04 -0500 Subject: [PATCH 57/85] StIcon: use g_strcmp0() Simplify a check for an unchanged string with g_strcmp0(). https://bugzilla.gnome.org/show_bug.cgi?id=633865 --- src/st/st-icon.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/st/st-icon.c b/src/st/st-icon.c index abbab1f2d..2534fef90 100644 --- a/src/st/st-icon.c +++ b/src/st/st-icon.c @@ -509,9 +509,7 @@ st_icon_set_icon_name (StIcon *icon, priv = icon->priv; /* Check if there's no change */ - if ((!priv->icon_name && !icon_name) || - (priv->icon_name && icon_name && - g_str_equal (priv->icon_name, icon_name))) + if (g_strcmp0 (priv->icon_name, icon_name) == 0) return; g_free (priv->icon_name); From a9a8b1ec6aa19ca92816140edd9f020620e10eb4 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sat, 30 Oct 2010 20:08:49 -0400 Subject: [PATCH 58/85] StIcon: Remove content-image capability The ability to set a "content image" on an icon relies on the ability to have custom theme properties of a "border image" (9-slice) type. We don't have this, and the capability of a bordered image specified by the theme can be achieved more naturally with standard CSS facilities. https://bugzilla.gnome.org/show_bug.cgi?id=633865 --- src/st/st-icon.c | 74 +++++------------------------------------------- 1 file changed, 7 insertions(+), 67 deletions(-) diff --git a/src/st/st-icon.c b/src/st/st-icon.c index 2534fef90..f17511762 100644 --- a/src/st/st-icon.c +++ b/src/st/st-icon.c @@ -51,7 +51,6 @@ G_DEFINE_TYPE_WITH_CODE (StIcon, st_icon, ST_TYPE_WIDGET, struct _StIconPrivate { ClutterActor *icon_texture; - gboolean is_content_image; gchar *icon_name; gint icon_size; @@ -70,13 +69,6 @@ st_stylable_iface_init (StStylableIface *iface) is_initialized = TRUE; - pspec = g_param_spec_boxed ("x-st-content-image", - "Content Image", - "Image used as the button", - ST_TYPE_BORDER_IMAGE, - G_PARAM_READWRITE); - st_stylable_iface_install_property (iface, ST_TYPE_ICON, pspec); - pspec = g_param_spec_string ("x-st-icon-name", "Icon name", "Icon name to load from the theme", @@ -189,15 +181,10 @@ st_icon_get_preferred_height (ClutterActor *actor, &width, &height); - if (!priv->is_content_image) - { - if (width <= height) - pref_height = priv->icon_size; - else - pref_height = height / (gfloat)width * priv->icon_size; - } + if (width <= height) + pref_height = priv->icon_size; else - pref_height = height; + pref_height = height / (gfloat)width * priv->icon_size; } else pref_height = 0; @@ -230,15 +217,10 @@ st_icon_get_preferred_width (ClutterActor *actor, &width, &height); - if (!priv->is_content_image) - { - if (height <= width) - pref_width = priv->icon_size; - else - pref_width = width / (gfloat)height * priv->icon_size; - } + if (height <= width) + pref_width = priv->icon_size; else - pref_width = width; + pref_width = width / (gfloat)height * priv->icon_size; } else pref_width = 0; @@ -283,8 +265,7 @@ st_icon_paint (ClutterActor *actor) StIconPrivate *priv = ST_ICON (actor)->priv; /* Chain up to paint background */ - if (!priv->is_content_image) - CLUTTER_ACTOR_CLASS (st_icon_parent_class)->paint (actor); + CLUTTER_ACTOR_CLASS (st_icon_parent_class)->paint (actor); if (priv->icon_texture) clutter_actor_paint (priv->icon_texture); @@ -352,13 +333,6 @@ st_icon_update (StIcon *icon) { StIconPrivate *priv = icon->priv; - if (priv->is_content_image) - { - priv->is_content_image = FALSE; - g_signal_connect (st_icon_theme_get_default (), "notify::theme-name", - G_CALLBACK (st_icon_notify_theme_name_cb), icon); - } - /* Get rid of the old one */ if (priv->icon_texture) { @@ -393,49 +367,15 @@ st_icon_style_changed_cb (StWidget *widget) StIcon *self = ST_ICON (widget); StIconPrivate *priv = self->priv; - StBorderImage *content_image = NULL; gboolean changed = FALSE; gchar *icon_name = NULL; gint icon_size = -1; st_stylable_get (ST_STYLABLE (widget), - "x-st-content-image", &content_image, "x-st-icon-name", &icon_name, "x-st-icon-size", &icon_size, NULL); - /* Content-image overrides drawing of the icon, so - * don't bother reading those properties if it's set. - */ - if (content_image) - { - GError *error = NULL; - - priv->is_content_image = TRUE; - g_signal_handlers_disconnect_by_func (st_icon_theme_get_default (), - st_icon_notify_theme_name_cb, - self); - - if (priv->icon_texture) - clutter_actor_destroy (priv->icon_texture); - - priv->icon_texture = clutter_texture_new_from_file (content_image->uri, - &error); - if (priv->icon_texture) - clutter_actor_set_parent (priv->icon_texture, CLUTTER_ACTOR (widget)); - - if (error) - { - g_warning ("Could not load content image: %s", error->message); - g_error_free (error); - } - - g_boxed_free (ST_TYPE_BORDER_IMAGE, content_image); - g_free (icon_name); - - return; - } - if (icon_name && (!priv->icon_name || !g_str_equal (icon_name, priv->icon_name))) { From aed6375a2d7e848df960232c5653744aa6f6384c Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sun, 31 Oct 2010 15:39:32 -0400 Subject: [PATCH 59/85] Move StIconType to st-types.h from st-texture-cache.h StIconType will be used by a new StIcon class, so move it to the header file of common enumerations. Including st-types.h which had the St single-include check revealed that st-texture-cache.h didn't have that check and several places were including that directly. Fix that up. https://bugzilla.gnome.org/show_bug.cgi?id=633865 --- src/shell-app-system.c | 2 +- src/shell-window-tracker.c | 2 +- src/st/st-texture-cache.h | 13 ++++++------- src/st/st-types.h | 7 +++++++ 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/shell-app-system.c b/src/shell-app-system.c index 4bc5e454e..7df763f05 100644 --- a/src/shell-app-system.c +++ b/src/shell-app-system.c @@ -13,8 +13,8 @@ #include "shell-app-private.h" #include "shell-global.h" -#include "st/st-texture-cache.h" #include "display.h" +#include "st.h" #define GMENU_I_KNOW_THIS_IS_UNSTABLE #include diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c index cb276e4e0..ad8bc478d 100644 --- a/src/shell-window-tracker.c +++ b/src/shell-window-tracker.c @@ -16,9 +16,9 @@ #include "shell-window-tracker-private.h" #include "shell-app-system.h" #include "shell-app-private.h" -#include "st/st-texture-cache.h" #include "shell-global.h" #include "shell-marshal.h" +#include "st.h" #include "display.h" #include "window.h" diff --git a/src/st/st-texture-cache.h b/src/st/st-texture-cache.h index ec61c90e1..25c4df7ca 100644 --- a/src/st/st-texture-cache.h +++ b/src/st/st-texture-cache.h @@ -22,11 +22,17 @@ #ifndef __ST_TEXTURE_CACHE_H__ #define __ST_TEXTURE_CACHE_H__ +#if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION) +#error "Only can be included directly.h" +#endif + #include #include #include #include +#include + #define ST_TYPE_TEXTURE_CACHE (st_texture_cache_get_type ()) #define ST_TEXTURE_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_TEXTURE_CACHE, StTextureCache)) #define ST_TEXTURE_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_TEXTURE_CACHE, StTextureCacheClass)) @@ -52,13 +58,6 @@ struct _StTextureCacheClass }; -typedef enum { - ST_ICON_SYMBOLIC, - ST_ICON_FULLCOLOR, - ST_ICON_APPLICATION, - ST_ICON_DOCUMENT -} StIconType; - typedef enum { ST_TEXTURE_CACHE_POLICY_NONE, ST_TEXTURE_CACHE_POLICY_FOREVER diff --git a/src/st/st-types.h b/src/st/st-types.h index b1706dbef..335c2a094 100644 --- a/src/st/st-types.h +++ b/src/st/st-types.h @@ -42,6 +42,13 @@ typedef enum { ST_ALIGN_END } StAlign; +typedef enum { + ST_ICON_SYMBOLIC, + ST_ICON_FULLCOLOR, + ST_ICON_APPLICATION, + ST_ICON_DOCUMENT +} StIconType; + G_END_DECLS #endif /* __ST_TYPES_H__ */ From 439d7f036f92f1fd744b5d908973b2afdb0efd86 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sun, 31 Oct 2010 16:02:24 -0400 Subject: [PATCH 60/85] Port StIcon from MX framework to St framework Make StIcon compile and work in St. Changes: * ::icon-type and st_icon_set_icon_type are added to allow specifying SYMBOLIC/FULLCOLOR for an icon. * Ability to set the icon name from the theme is removed; it wouldn't easily fit into our framework and two levels of abstraction between code and image doesn't seem that useful. * size CSS property is renamed from x-st-icon-size to icon-size to correspond to what we are doing elsewhere. * CSS and property based icon sizing are cleanly layered - if you set the icon-size property, the CSS size is ignored. * Add a simple JS test of StIcon. https://bugzilla.gnome.org/show_bug.cgi?id=633865 --- src/st/st-icon.c | 290 +++++++++++++++++++------------------ src/st/st-icon.h | 7 +- tests/Makefile.am | 1 + tests/interactive/icons.js | 53 +++++++ 4 files changed, 213 insertions(+), 138 deletions(-) create mode 100644 tests/interactive/icons.js diff --git a/src/st/st-icon.c b/src/st/st-icon.c index f17511762..ebcf0f823 100644 --- a/src/st/st-icon.c +++ b/src/st/st-icon.c @@ -3,6 +3,7 @@ * st-icon.c: icon widget * * Copyright 2009, 2010 Intel Corporation. + * Copyright 2010 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -25,10 +26,9 @@ * a stylesheet. */ +#include "st-enum-types.h" #include "st-icon.h" -#include "st-icon-theme.h" -#include "st-stylable.h" - +#include "st-texture-cache.h" #include "st-private.h" enum @@ -36,14 +36,11 @@ enum PROP_0, PROP_ICON_NAME, + PROP_ICON_TYPE, PROP_ICON_SIZE }; -static void st_stylable_iface_init (StStylableIface *iface); - -G_DEFINE_TYPE_WITH_CODE (StIcon, st_icon, ST_TYPE_WIDGET, - G_IMPLEMENT_INTERFACE (ST_TYPE_STYLABLE, - st_stylable_iface_init)) +G_DEFINE_TYPE (StIcon, st_icon, ST_TYPE_WIDGET) #define ST_ICON_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ST_TYPE_ICON, StIconPrivate)) @@ -53,37 +50,17 @@ struct _StIconPrivate ClutterActor *icon_texture; gchar *icon_name; - gint icon_size; + StIconType icon_type; + gint prop_icon_size; /* icon size set as property */ + gint theme_icon_size; /* icon size from theme node */ + gint icon_size; /* icon size we are using */ }; -static void st_icon_update (StIcon *icon); +static void st_icon_update (StIcon *icon); +static void st_icon_update_icon_size (StIcon *icon); -static void -st_stylable_iface_init (StStylableIface *iface) -{ - static gboolean is_initialized = FALSE; - - if (G_UNLIKELY (!is_initialized)) - { - GParamSpec *pspec; - - is_initialized = TRUE; - - pspec = g_param_spec_string ("x-st-icon-name", - "Icon name", - "Icon name to load from the theme", - NULL, - G_PARAM_READWRITE); - st_stylable_iface_install_property (iface, ST_TYPE_ICON, pspec); - - pspec = g_param_spec_int ("x-st-icon-size", - "Icon size", - "Size to use for icon", - -1, G_MAXINT, -1, - G_PARAM_READWRITE); - st_stylable_iface_install_property (iface, ST_TYPE_ICON, pspec); - } -} +#define DEFAULT_ICON_SIZE 48 +#define DEFAULT_ICON_TYPE ST_ICON_SYMBOLIC static void st_icon_set_property (GObject *gobject, @@ -99,6 +76,10 @@ st_icon_set_property (GObject *gobject, st_icon_set_icon_name (icon, g_value_get_string (value)); break; + case PROP_ICON_TYPE: + st_icon_set_icon_type (icon, g_value_get_enum (value)); + break; + case PROP_ICON_SIZE: st_icon_set_icon_size (icon, g_value_get_int (value)); break; @@ -123,6 +104,10 @@ st_icon_get_property (GObject *gobject, g_value_set_string (value, st_icon_get_icon_name (icon)); break; + case PROP_ICON_TYPE: + g_value_set_enum (value, st_icon_get_icon_type (icon)); + break; + case PROP_ICON_SIZE: g_value_set_int (value, st_icon_get_icon_size (icon)); break; @@ -133,18 +118,9 @@ st_icon_get_property (GObject *gobject, } } -static void -st_icon_notify_theme_name_cb (StIconTheme *theme, - GParamSpec *pspec, - StIcon *self) -{ - st_icon_update (self); -} - static void st_icon_dispose (GObject *gobject) { - StIconTheme *theme; StIconPrivate *priv = ST_ICON (gobject)->priv; if (priv->icon_texture) @@ -153,13 +129,6 @@ st_icon_dispose (GObject *gobject) priv->icon_texture = NULL; } - if ((theme = st_icon_theme_get_default ())) - { - g_signal_handlers_disconnect_by_func (st_icon_theme_get_default (), - st_icon_notify_theme_name_cb, - gobject); - } - G_OBJECT_CLASS (st_icon_parent_class)->dispose (gobject); } @@ -169,10 +138,9 @@ st_icon_get_preferred_height (ClutterActor *actor, gfloat *min_height_p, gfloat *nat_height_p) { - StPadding padding; - gfloat pref_height; - StIconPrivate *priv = ST_ICON (actor)->priv; + StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor)); + gfloat pref_height; if (priv->icon_texture) { @@ -189,14 +157,13 @@ st_icon_get_preferred_height (ClutterActor *actor, else pref_height = 0; - st_widget_get_padding (ST_WIDGET (actor), &padding); - pref_height += padding.top + padding.bottom; - if (min_height_p) *min_height_p = pref_height; if (nat_height_p) *nat_height_p = pref_height; + + st_theme_node_adjust_preferred_height (theme_node, min_height_p, nat_height_p); } static void @@ -205,10 +172,9 @@ st_icon_get_preferred_width (ClutterActor *actor, gfloat *min_width_p, gfloat *nat_width_p) { - StPadding padding; - gfloat pref_width; - StIconPrivate *priv = ST_ICON (actor)->priv; + StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor)); + gfloat pref_width; if (priv->icon_texture) { @@ -225,14 +191,13 @@ st_icon_get_preferred_width (ClutterActor *actor, else pref_width = 0; - st_widget_get_padding (ST_WIDGET (actor), &padding); - pref_width += padding.left + padding.right; - if (min_width_p) *min_width_p = pref_width; if (nat_width_p) *nat_width_p = pref_width; + + st_theme_node_adjust_preferred_width (theme_node, min_width_p, nat_width_p); } static void @@ -241,21 +206,16 @@ st_icon_allocate (ClutterActor *actor, ClutterAllocationFlags flags) { StIconPrivate *priv = ST_ICON (actor)->priv; + StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor)); CLUTTER_ACTOR_CLASS (st_icon_parent_class)->allocate (actor, box, flags); if (priv->icon_texture) { - StPadding padding; - ClutterActorBox child_box; + ClutterActorBox content_box; - st_widget_get_padding (ST_WIDGET (actor), &padding); - child_box.x1 = padding.left; - child_box.y1 = padding.top; - child_box.x2 = box->x2 - box->x1 - padding.right; - child_box.y2 = box->y2 - box->y1 - padding.bottom; - - clutter_actor_allocate (priv->icon_texture, &child_box, flags); + st_theme_node_get_content_box (theme_node, box, &content_box); + clutter_actor_allocate (priv->icon_texture, &content_box, flags); } } @@ -293,6 +253,17 @@ st_icon_unmap (ClutterActor *actor) clutter_actor_unmap (priv->icon_texture); } +static void +st_icon_style_changed (StWidget *widget) +{ + StIcon *self = ST_ICON (widget); + StThemeNode *theme_node = st_widget_get_theme_node (widget); + StIconPrivate *priv = self->priv; + + priv->theme_icon_size = st_theme_node_get_length (theme_node, "icon-size"); + st_icon_update_icon_size (self); +} + static void st_icon_class_init (StIconClass *klass) { @@ -300,6 +271,7 @@ st_icon_class_init (StIconClass *klass) GObjectClass *object_class = G_OBJECT_CLASS (klass); ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + StWidgetClass *widget_class = ST_WIDGET_CLASS (klass); g_type_class_add_private (klass, sizeof (StIconPrivate)); @@ -314,20 +286,40 @@ st_icon_class_init (StIconClass *klass) actor_class->map = st_icon_map; actor_class->unmap = st_icon_unmap; + widget_class->style_changed = st_icon_style_changed; + pspec = g_param_spec_string ("icon-name", "Icon name", "An icon name", NULL, ST_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_ICON_NAME, pspec); + pspec = g_param_spec_enum ("icon-type", + "Icon type", + "The type of icon that should be used", + ST_TYPE_ICON_TYPE, + DEFAULT_ICON_TYPE, + ST_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_ICON_TYPE, pspec); + pspec = g_param_spec_int ("icon-size", "Icon size", - "Size of the icon", - 1, G_MAXINT, 48, + "The size if the icon, if positive. Otherwise the size will be derived from the current style", + -1, G_MAXINT, -1, ST_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_ICON_SIZE, pspec); } +static void +st_icon_init (StIcon *self) +{ + self->priv = ST_ICON_GET_PRIVATE (self); + + self->priv->icon_size = DEFAULT_ICON_SIZE; + self->priv->prop_icon_size = -1; + self->priv->icon_type = DEFAULT_ICON_TYPE; +} + static void st_icon_update (StIcon *icon) { @@ -343,16 +335,12 @@ st_icon_update (StIcon *icon) /* Try to lookup the new one */ if (priv->icon_name) { - StIconTheme *theme = st_icon_theme_get_default (); - priv->icon_texture = (ClutterActor *) - st_icon_theme_lookup_texture (theme, priv->icon_name, priv->icon_size); + StTextureCache *cache = st_texture_cache_get_default (); - /* If the icon is missing, use the image-missing icon */ - if (!priv->icon_texture) - priv->icon_texture = (ClutterActor *) - st_icon_theme_lookup_texture (theme, - "image-missing", - priv->icon_size); + priv->icon_texture = st_texture_cache_load_icon_name (cache, + priv->icon_name, + priv->icon_type, + priv->icon_size); if (priv->icon_texture) clutter_actor_set_parent (priv->icon_texture, CLUTTER_ACTOR (icon)); @@ -362,58 +350,23 @@ st_icon_update (StIcon *icon) } static void -st_icon_style_changed_cb (StWidget *widget) +st_icon_update_icon_size (StIcon *icon) { - StIcon *self = ST_ICON (widget); - StIconPrivate *priv = self->priv; + StIconPrivate *priv = icon->priv; + int new_size; - gboolean changed = FALSE; - gchar *icon_name = NULL; - gint icon_size = -1; + if (priv->prop_icon_size > 0) + new_size = priv->prop_icon_size; + else if (priv->theme_icon_size > 0) + new_size = priv->theme_icon_size; + else + new_size = DEFAULT_ICON_SIZE; - st_stylable_get (ST_STYLABLE (widget), - "x-st-icon-name", &icon_name, - "x-st-icon-size", &icon_size, - NULL); - - if (icon_name && (!priv->icon_name || - !g_str_equal (icon_name, priv->icon_name))) + if (new_size != priv->icon_size) { - g_free (priv->icon_name); - priv->icon_name = g_strdup (icon_name); - changed = TRUE; - - g_object_notify (G_OBJECT (self), "icon-name"); + priv->icon_size = new_size; + st_icon_update (icon); } - - if ((icon_size > 0) && (priv->icon_size != icon_size)) - { - priv->icon_size = icon_size; - changed = TRUE; - - g_object_notify (G_OBJECT (self), "icon-size"); - } - - if (changed) - st_icon_update (self); -} - -static void -st_icon_init (StIcon *self) -{ - self->priv = ST_ICON_GET_PRIVATE (self); - - self->priv->icon_size = 48; - - g_signal_connect (self, "style-changed", - G_CALLBACK (st_icon_style_changed_cb), NULL); - - /* make sure we are not reactive */ - clutter_actor_set_reactive (CLUTTER_ACTOR (self), FALSE); - - /* Reload the icon when the theme changes */ - g_signal_connect (st_icon_theme_get_default (), "notify::theme-name", - G_CALLBACK (st_icon_notify_theme_name_cb), self); } /** @@ -429,7 +382,6 @@ st_icon_new (void) return g_object_new (ST_TYPE_ICON, NULL); } - const gchar * st_icon_get_icon_name (StIcon *icon) { @@ -460,13 +412,77 @@ st_icon_set_icon_name (StIcon *icon, g_object_notify (G_OBJECT (icon), "icon-name"); } +/** + * st_icon_get_icon_type: + * @icon: a #StIcon + * + * Gets the type of icon we'll look up to display in the actor. + * See st_icon_set_icon_type(). + * + * Return value: the icon type. + */ +StIconType +st_icon_get_icon_type (StIcon *icon) +{ + g_return_val_if_fail (ST_IS_ICON (icon), DEFAULT_ICON_TYPE); + + return icon->priv->icon_type; +} + +/** + * st_icon_set_icon_type: + * @icon: a #StIcon + * @icon_type: the type of icon to use + * + * Sets the type of icon we'll look up to display in the actor. + * The icon type determines whether we use a symbolic icon or + * a full color icon and also is used for specific handling for + * application and document icons. + */ +void +st_icon_set_icon_type (StIcon *icon, + StIconType icon_type) +{ + StIconPrivate *priv; + + g_return_if_fail (ST_IS_ICON (icon)); + + priv = icon->priv; + + if (icon_type == priv->icon_type) + return; + + priv->icon_type = icon_type; + st_icon_update (icon); + + g_object_notify (G_OBJECT (icon), "icon-type"); +} + +/** + * st_icon_get_icon_size: + * @icon: an icon + * + * Gets the size explicit size on the icon. This is not necesariily + * the size that the icon will actually be displayed at. + * + * Return value: the size explicitly set, or -1 if no size has been set + */ gint st_icon_get_icon_size (StIcon *icon) { g_return_val_if_fail (ST_IS_ICON (icon), -1); - return icon->priv->icon_size; + return icon->priv->prop_icon_size; } + +/** + * st_icon_set_icon_size: + * @icon: an icon + * @size: if positive, the new size, otherwise the size will be + * derived from the current style + * + * Sets an explicit size for the icon. + */ void st_icon_set_icon_size (StIcon *icon, gint size) @@ -474,13 +490,13 @@ st_icon_set_icon_size (StIcon *icon, StIconPrivate *priv; g_return_if_fail (ST_IS_ICON (icon)); - g_return_if_fail (size > 0); priv = icon->priv; - if (priv->icon_size != size) + if (priv->prop_icon_size != size) { - priv->icon_size = size; - st_icon_update (icon); + priv->prop_icon_size = size; + st_icon_update_icon_size (icon); + g_object_notify (G_OBJECT (icon), "icon-size"); } } diff --git a/src/st/st-icon.h b/src/st/st-icon.h index 4fcde24f3..bddb41d89 100644 --- a/src/st/st-icon.h +++ b/src/st/st-icon.h @@ -29,7 +29,9 @@ #define _ST_ICON #include -#include "st-widget.h" +#include + +#include G_BEGIN_DECLS @@ -85,6 +87,9 @@ ClutterActor* st_icon_new (void); const gchar *st_icon_get_icon_name (StIcon *icon); void st_icon_set_icon_name (StIcon *icon, const gchar *icon_name); +void st_icon_set_icon_type (StIcon *icon, StIconType icon_type); +StIconType st_icon_get_icon_type (StIcon *icon); + gint st_icon_get_icon_size (StIcon *icon); void st_icon_set_icon_size (StIcon *icon, gint size); diff --git a/tests/Makefile.am b/tests/Makefile.am index ea2164587..42a92a3a1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -8,6 +8,7 @@ TEST_JS = \ interactive/calendar.js \ interactive/css-fonts.js \ interactive/entry.js \ + interactive/icons.js \ interactive/inline-style.js \ interactive/scrolling.js \ interactive/scroll-view-sizing.js \ diff --git a/tests/interactive/icons.js b/tests/interactive/icons.js new file mode 100644 index 000000000..0c5a879ce --- /dev/null +++ b/tests/interactive/icons.js @@ -0,0 +1,53 @@ +/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */ + +const Clutter = imports.gi.Clutter; +const St = imports.gi.St; + +const UI = imports.testcommon.ui; + +UI.init(); +let stage = Clutter.Stage.get_default(); + +let b = new St.BoxLayout({ vertical: true, + width: stage.width, + height: stage.height }); +stage.add_actor(b); + +function addTest(label, icon_props) { + if (b.get_children().length > 0) + b.add (new St.BoxLayout({ style: 'background: #cccccc; border: 10px transparent white; height: 1px; ' })); + + let hb = new St.BoxLayout({ vertical: false }); + + hb.add(new St.Label({ text: label })); + hb.add(new St.Icon(icon_props)); + + b.add(hb); +} + +addTest("Symbolic", + { icon_name: 'zoom-in', + icon_type: St.IconType.SYMBOLIC, + icon_size: 48 }); +addTest("Full color", + { icon_name: 'zoom-in', + icon_type: St.IconType.FULLCOLOR, + icon_size: 48 }); +addTest("Default size", + { icon_name: 'zoom-in', + icon_type: St.IconType.SYMBOLIC }); +addTest("Size set by property", + { icon_name: 'zoom-in', + icon_type: St.IconType.SYMBOLIC, + icon_size: 32 }); +addTest("Size set by style", + { icon_name: 'zoom-in', + icon_type: St.IconType.SYMBOLIC, + style: 'icon-size: 1em;' }); +addTest("16px icon in 48px icon widget", + { icon_name: 'zoom-in', + icon_type: St.IconType.SYMBOLIC, + style: 'icon-size: 16px; width: 48px; height: 48px;' }); + +stage.show(); +Clutter.main(); From 35400238aaaaa3bfee4ac5cd3c3f4d7b877e3fcd Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 2 Nov 2010 17:11:28 -0400 Subject: [PATCH 61/85] StIcon: Always request a square icon size We don't want the layout to change when we say, change from battery-full to battery-full-charging, so we should request a square based on the icon size unconditionally and not try to adapt to the size of the texture we loaded. This also means that our layout is independent of the loaded texure which, if we switch away from using a ClutterActor child will allow us not queue a relayout when the icon finishes loading. https://bugzilla.gnome.org/show_bug.cgi?id=633865 --- src/st/st-icon.c | 43 +++++-------------------------------------- 1 file changed, 5 insertions(+), 38 deletions(-) diff --git a/src/st/st-icon.c b/src/st/st-icon.c index ebcf0f823..1e9295594 100644 --- a/src/st/st-icon.c +++ b/src/st/st-icon.c @@ -140,28 +140,12 @@ st_icon_get_preferred_height (ClutterActor *actor, { StIconPrivate *priv = ST_ICON (actor)->priv; StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor)); - gfloat pref_height; - - if (priv->icon_texture) - { - gint width, height; - clutter_texture_get_base_size (CLUTTER_TEXTURE (priv->icon_texture), - &width, - &height); - - if (width <= height) - pref_height = priv->icon_size; - else - pref_height = height / (gfloat)width * priv->icon_size; - } - else - pref_height = 0; if (min_height_p) - *min_height_p = pref_height; + *min_height_p = priv->icon_size; if (nat_height_p) - *nat_height_p = pref_height; + *nat_height_p = priv->icon_size; st_theme_node_adjust_preferred_height (theme_node, min_height_p, nat_height_p); } @@ -174,28 +158,12 @@ st_icon_get_preferred_width (ClutterActor *actor, { StIconPrivate *priv = ST_ICON (actor)->priv; StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor)); - gfloat pref_width; - - if (priv->icon_texture) - { - gint width, height; - clutter_texture_get_base_size (CLUTTER_TEXTURE (priv->icon_texture), - &width, - &height); - - if (height <= width) - pref_width = priv->icon_size; - else - pref_width = width / (gfloat)height * priv->icon_size; - } - else - pref_width = 0; if (min_width_p) - *min_width_p = pref_width; + *min_width_p = priv->icon_size; if (nat_width_p) - *nat_width_p = pref_width; + *nat_width_p = priv->icon_size; st_theme_node_adjust_preferred_width (theme_node, min_width_p, nat_width_p); } @@ -345,8 +313,6 @@ st_icon_update (StIcon *icon) if (priv->icon_texture) clutter_actor_set_parent (priv->icon_texture, CLUTTER_ACTOR (icon)); } - - clutter_actor_queue_relayout (CLUTTER_ACTOR (icon)); } static void @@ -364,6 +330,7 @@ st_icon_update_icon_size (StIcon *icon) if (new_size != priv->icon_size) { + clutter_actor_queue_relayout (CLUTTER_ACTOR (icon)); priv->icon_size = new_size; st_icon_update (icon); } From 3ca86b2197335b5c592f4652cc2778a59e1aa42d Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 2 Nov 2010 17:35:22 -0400 Subject: [PATCH 62/85] StIcon: Center the icon rather than scaling it up Scaling up icons from the loaded size to a larger size is uniformly ugly and results in a long series of "fuzzy icon" bugs. It's better to just load at the specified size and center. (Centering can be overridden by packing not-fill in the parent container.) https://bugzilla.gnome.org/show_bug.cgi?id=633865 --- src/st/st-icon.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/st/st-icon.c b/src/st/st-icon.c index 1e9295594..171698694 100644 --- a/src/st/st-icon.c +++ b/src/st/st-icon.c @@ -183,6 +183,21 @@ st_icon_allocate (ClutterActor *actor, ClutterActorBox content_box; st_theme_node_get_content_box (theme_node, box, &content_box); + + /* Center the texture in the allocation; scaling up the icon from the size + * we loaded it at is just a bad idea and probably accidental. Main downside + * of doing this is that it may not be obvious that they have to turn off + * fill to align the icon non-centered in the parent container. + * + * We don't use _st_allocate_fill() for a bit of efficiency and because we + * expect to get rid of the child actor in favor of a CoglTexture in the + * future. + */ + content_box.x1 = (int)(0.5 + content_box.x1 + (content_box.x2 - content_box.x1 - priv->icon_size) / 2.); + content_box.x2 = content_box.x1 + priv->icon_size; + content_box.y1 = (int)(0.5 + content_box.y1 + (content_box.y2 - content_box.y1 - priv->icon_size) / 2.); + content_box.y2 = content_box.y1 + priv->icon_size; + clutter_actor_allocate (priv->icon_texture, &content_box, flags); } } From 04da2a61dbee891b1db63e4f71e3da2af9b37a48 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sun, 31 Oct 2010 22:06:48 -0400 Subject: [PATCH 63/85] Add StIconColors object, compute in StThemeNode A new StIconColors object is used to efficiently track the colors we need to colorize a symbolic icon. st_theme_node_compute_icon_colors() is added to compute the StIconColors for a theme node. (Refcounting of StIconColors means that we'll typically share the colors object of the parent node.) https://bugzilla.gnome.org/show_bug.cgi?id=633865 --- src/Makefile-st.am | 2 + src/st/st-icon-colors.c | 108 +++++++++++++++++++++++++++++ src/st/st-icon-colors.h | 41 +++++++++++ src/st/st-theme-node-private.h | 1 + src/st/st-theme-node.c | 122 +++++++++++++++++++++++++++++++++ src/st/st-theme-node.h | 3 + 6 files changed, 277 insertions(+) create mode 100644 src/st/st-icon-colors.c create mode 100644 src/st/st-icon-colors.h diff --git a/src/Makefile-st.am b/src/Makefile-st.am index b0272ae38..40d27c56e 100644 --- a/src/Makefile-st.am +++ b/src/Makefile-st.am @@ -80,6 +80,7 @@ st_source_h = \ st/st-focus-manager.h \ st/st-group.h \ st/st-icon.h \ + st/st-icon-colors.h \ st/st-im-text.h \ st/st-label.h \ st/st-overflow-box.h \ @@ -130,6 +131,7 @@ st_source_c = \ st/st-focus-manager.c \ st/st-group.c \ st/st-icon.c \ + st/st-icon-colors.c \ st/st-im-text.c \ st/st-label.c \ st/st-overflow-box.c \ diff --git a/src/st/st-icon-colors.c b/src/st/st-icon-colors.c new file mode 100644 index 000000000..0655246c8 --- /dev/null +++ b/src/st/st-icon-colors.c @@ -0,0 +1,108 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * st-icon-colors.c: Colors for colorizing a symbolic icon + * + * Copyright 2010 Red Hat, Inc. + * Copyright 2010 Florian Müllner + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include "st-icon-colors.h" + +/** + * st_icon_colors_new: + * + * Creates a new #StIconColors. All colors are initialized to transparent black. + * + * Return value: a newly created #StIconColors. Free with st_icon_colors_unref() + */ +StIconColors * +st_icon_colors_new (void) +{ + StIconColors *colors; + + colors = g_slice_new0 (StIconColors); + colors->ref_count = 1; + + return colors; +} + +/** + * st_icon_colors_ref: + * @colors: a #StIconColors + * + * Atomically increments the reference count of @colors by one. + * + * Returns: the passed in #StIconColors. + */ +StIconColors * +st_icon_colors_ref (StIconColors *colors) +{ + g_return_val_if_fail (colors != NULL, NULL); + g_return_val_if_fail (colors->ref_count > 0, colors); + + g_atomic_int_add ((volatile int *)&colors->ref_count, 1); + return colors; +} + +/** + * st_icon_colors_unref: + * @colors: a #StIconColors + * + * Atomically decrements the reference count of @colors by one. + * If the reference count drops to 0, all memory allocated by the + * #StIconColors is released. + */ +void +st_icon_colors_unref (StIconColors *colors) +{ + g_return_if_fail (colors != NULL); + g_return_if_fail (colors->ref_count > 0); + + if (g_atomic_int_exchange_and_add ((volatile int *)&colors->ref_count, -1) - 1 == 0) + g_slice_free (StIconColors, colors); +} + +/** + * st_icon_colors_copy: + * @colors: a #StIconColors + * + * Creates a new StIconColors structure that is a copy of the passed + * in @colors. You would use this function instead of st_icon_colors_ref() + * if you were planning to change colors in the result. + * + * Returns: a newly created #StIconColors. + */ +StIconColors * +st_icon_colors_copy (StIconColors *colors) +{ + StIconColors *copy; + + g_return_val_if_fail (colors != NULL, NULL); + + copy = st_icon_colors_new (); + + copy->foreground = colors->foreground; + copy->warning = colors->warning; + copy->error = colors->error; + copy->success = colors->success; + + return copy; +} + +G_DEFINE_BOXED_TYPE (StIconColors, + st_icon_colors, + st_icon_colors_ref, + st_icon_colors_unref) diff --git a/src/st/st-icon-colors.h b/src/st/st-icon-colors.h new file mode 100644 index 000000000..b582308a5 --- /dev/null +++ b/src/st/st-icon-colors.h @@ -0,0 +1,41 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +#ifndef __ST_ICON_COLORS__ +#define __ST_ICON_COLORS__ + +#include + +G_BEGIN_DECLS + +#define ST_TYPE_ICON_COLORS (st_icon_colors_get_type ()) + +typedef struct _StIconColors StIconColors; + +/** + * StIconColors: + * @foreground: foreground color + * @warning: color indicating a warning state + * @error: color indicating an error state + * @success: color indicating a successful operation + * + * The #StIconColors structure encapsulates colors for colorizing a symbolic + * icon. + */ +struct _StIconColors { + volatile guint ref_count; + + ClutterColor foreground; + ClutterColor warning; + ClutterColor error; + ClutterColor success; +}; + +GType st_icon_colors_get_type (void) G_GNUC_CONST; + +StIconColors *st_icon_colors_new (void); +StIconColors *st_icon_colors_ref (StIconColors *colors); +void st_icon_colors_unref (StIconColors *colors); +StIconColors *st_icon_colors_copy (StIconColors *colors); + +G_END_DECLS + +#endif /* __ST_ICON_COLORS__ */ diff --git a/src/st/st-theme-node-private.h b/src/st/st-theme-node-private.h index 1ced764f1..7673755e9 100644 --- a/src/st/st-theme-node-private.h +++ b/src/st/st-theme-node-private.h @@ -67,6 +67,7 @@ struct _StThemeNode { StBorderImage *border_image; StShadow *shadow; StShadow *text_shadow; + StIconColors *icon_colors; GType element_type; char *element_id; diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c index d325be0c2..a9d1c2f6d 100644 --- a/src/st/st-theme-node.c +++ b/src/st/st-theme-node.c @@ -36,6 +36,9 @@ static void st_theme_node_finalize (GObject *object); static const ClutterColor BLACK_COLOR = { 0, 0, 0, 0xff }; static const ClutterColor TRANSPARENT_COLOR = { 0, 0, 0, 0 }; +static const ClutterColor DEFAULT_SUCCESS_COLOR = { 0x4e, 0x9a, 0x06, 0xff }; +static const ClutterColor DEFAULT_WARNING_COLOR = { 0xf5, 0x79, 0x3e, 0xff }; +static const ClutterColor DEFAULT_ERROR_COLOR = { 0xcc, 0x00, 0x00, 0xff }; extern gfloat st_slow_down_factor; @@ -2748,6 +2751,125 @@ st_theme_node_get_text_shadow (StThemeNode *node) return result; } +/** + * st_theme_node_get_icon_colors: + * @node: a #StThemeNode + * + * Gets the colors that should be used for colorizing symbolic icons according + * the style of this node. + * + * Return value: (transfer none): the icon colors to use for this theme node + */ +StIconColors * +st_theme_node_get_icon_colors (StThemeNode *node) +{ + /* Foreground here will always be the same as st_theme_node_get_foreground_color(), + * but there's a loss of symmetry and little efficiency win if we try to exploit + * that. */ + + enum { + FOREGROUND = 1 << 0, + WARNING = 1 << 1, + ERROR = 1 << 2, + SUCCESS = 1 << 3 + }; + + gboolean shared_with_parent; + int i; + ClutterColor color = { 0, }; + + guint still_need = FOREGROUND | WARNING | ERROR | SUCCESS; + + g_return_val_if_fail (ST_IS_THEME_NODE (node), NULL); + + if (node->icon_colors) + return node->icon_colors; + + if (node->parent_node) + { + node->icon_colors = st_theme_node_get_icon_colors (node->parent_node); + shared_with_parent = TRUE; + } + else + { + node->icon_colors = st_icon_colors_new (); + node->icon_colors->foreground = BLACK_COLOR; + node->icon_colors->warning = DEFAULT_WARNING_COLOR; + node->icon_colors->error = DEFAULT_ERROR_COLOR; + node->icon_colors->success = DEFAULT_SUCCESS_COLOR; + shared_with_parent = FALSE; + } + + ensure_properties (node); + + for (i = node->n_properties - 1; i >= 0 && still_need != 0; i--) + { + CRDeclaration *decl = node->properties[i]; + GetFromTermResult result = VALUE_NOT_FOUND; + guint found = 0; + + if ((still_need & FOREGROUND) != 0 && + strcmp (decl->property->stryng->str, "color") == 0) + { + found = FOREGROUND; + result = get_color_from_term (node, decl->value, &color); + } + else if ((still_need & WARNING) != 0 && + strcmp (decl->property->stryng->str, "warning-color") == 0) + { + found = WARNING; + result = get_color_from_term (node, decl->value, &color); + } + else if ((still_need & ERROR) != 0 && + strcmp (decl->property->stryng->str, "error-color") == 0) + { + found = ERROR; + result = get_color_from_term (node, decl->value, &color); + } + else if ((still_need & SUCCESS) != 0 && + strcmp (decl->property->stryng->str, "success-color") == 0) + { + found = SUCCESS; + result = get_color_from_term (node, decl->value, &color); + } + + if (result == VALUE_INHERIT) + { + still_need &= ~found; + } + else if (result == VALUE_FOUND) + { + still_need &= ~found; + if (shared_with_parent) + { + node->icon_colors = st_icon_colors_copy (node->icon_colors); + shared_with_parent = FALSE; + } + + switch (found) + { + case FOREGROUND: + node->icon_colors->foreground = color; + break; + case WARNING: + node->icon_colors->warning = color; + break; + case ERROR: + node->icon_colors->error = color; + break; + case SUCCESS: + node->icon_colors->success = color; + break; + } + } + } + + if (shared_with_parent) + st_icon_colors_ref (node->icon_colors); + + return node->icon_colors; +} + static float get_width_inc (StThemeNode *node) { diff --git a/src/st/st-theme-node.h b/src/st/st-theme-node.h index aeb80d9af..13e0bf63c 100644 --- a/src/st/st-theme-node.h +++ b/src/st/st-theme-node.h @@ -25,6 +25,7 @@ #include #include "st-border-image.h" +#include "st-icon-colors.h" #include "st-shadow.h" G_BEGIN_DECLS @@ -197,6 +198,8 @@ StBorderImage *st_theme_node_get_border_image (StThemeNode *node); StShadow *st_theme_node_get_shadow (StThemeNode *node); StShadow *st_theme_node_get_text_shadow (StThemeNode *node); +StIconColors *st_theme_node_get_icon_colors (StThemeNode *node); + /* Helpers for get_preferred_width()/get_preferred_height() ClutterActor vfuncs */ void st_theme_node_adjust_for_height (StThemeNode *node, float *for_height); From 4917c79d09416b2e061aba664cfede6594bc6754 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 2 Nov 2010 16:12:56 -0400 Subject: [PATCH 64/85] StTextureCache: support loading a named icon with colors from a theme node Add st_texture_cache_load_icon_name_for_theme() which, when loading a symbolic icon, gets a #StIconColors from the theme node and uses that to colorize the icon. https://bugzilla.gnome.org/show_bug.cgi?id=633865 --- src/st/st-texture-cache.c | 161 ++++++++++++++++++++++++++++++-------- src/st/st-texture-cache.h | 7 ++ 2 files changed, 134 insertions(+), 34 deletions(-) diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c index cbbe7b1c5..9d61129bf 100644 --- a/src/st/st-texture-cache.c +++ b/src/st/st-texture-cache.c @@ -127,6 +127,7 @@ typedef struct { GtkIconInfo *icon_info; gint width; gint height; + StIconColors *colors; gpointer user_data; } AsyncIconLookupData; @@ -181,16 +182,49 @@ compute_pixbuf_scale (gint width, return FALSE; } +static void +rgba_from_clutter (GdkRGBA *rgba, + ClutterColor *color) +{ + rgba->red = color->red / 255.; + rgba->green = color->green / 255.; + rgba->blue = color->blue / 255.; + rgba->alpha = color->alpha / 255.; +} + static GdkPixbuf * -impl_load_pixbuf_gicon (GIcon *icon, - GtkIconInfo *info, - int size, - GError **error) +impl_load_pixbuf_gicon (GIcon *icon, + GtkIconInfo *info, + int size, + StIconColors *colors, + GError **error) { int scaled_width, scaled_height; - GdkPixbuf *pixbuf = gtk_icon_info_load_icon (info, error); + GdkPixbuf *pixbuf; int width, height; + if (colors) + { + GdkRGBA foreground_color; + GdkRGBA success_color; + GdkRGBA warning_color; + GdkRGBA error_color; + + rgba_from_clutter (&foreground_color, &colors->foreground); + rgba_from_clutter (&success_color, &colors->success); + rgba_from_clutter (&warning_color, &colors->warning); + rgba_from_clutter (&error_color, &colors->error); + + pixbuf = gtk_icon_info_load_symbolic (info, + &foreground_color, &success_color, + &warning_color, &error_color, + NULL, error); + } + else + { + pixbuf = gtk_icon_info_load_icon (info, error); + } + if (!pixbuf) return NULL; @@ -231,6 +265,8 @@ icon_lookup_data_destroy (gpointer p) g_free (data->mimetype); if (data->recent_info) gtk_recent_info_unref (data->recent_info); + if (data->colors) + st_icon_colors_unref (data->colors); g_free (data); } @@ -464,7 +500,7 @@ load_pixbuf_thread (GSimpleAsyncResult *result, else if (data->uri) pixbuf = impl_load_pixbuf_file (data->uri, data->width, data->height, &error); else if (data->icon) - pixbuf = impl_load_pixbuf_gicon (data->icon, data->icon_info, data->width, &error); + pixbuf = impl_load_pixbuf_gicon (data->icon, data->icon_info, data->width, data->colors, &error); else g_assert_not_reached (); @@ -490,6 +526,7 @@ load_icon_pixbuf_async (StTextureCache *cache, GIcon *icon, GtkIconInfo *icon_info, gint size, + StIconColors *colors, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) @@ -502,6 +539,10 @@ load_icon_pixbuf_async (StTextureCache *cache, data->icon = g_object_ref (icon); data->icon_info = gtk_icon_info_copy (icon_info); data->width = data->height = size; + if (colors) + data->colors = st_icon_colors_ref (colors); + else + data->colors = NULL; data->user_data = user_data; result = g_simple_async_result_new (G_OBJECT (cache), callback, user_data, load_icon_pixbuf_async); @@ -944,25 +985,11 @@ create_texture_and_ensure_request (StTextureCache *cache, return had_pending; } -/** - * st_texture_cache_load_gicon: - * @cache: The texture cache instance - * @icon: the #GIcon to load - * @size: Size of themed - * - * This method returns a new #ClutterActor for a given #GIcon. If the - * icon isn't loaded already, the texture will be filled - * asynchronously. - * - * This will load @icon as a full-color icon; if you want a symbolic - * icon, you must use st_texture_cache_load_icon_name(). - * - * Return Value: (transfer none): A new #ClutterActor for the icon - */ -ClutterActor * -st_texture_cache_load_gicon (StTextureCache *cache, - GIcon *icon, - gint size) +static ClutterActor * +load_gicon_with_colors (StTextureCache *cache, + GIcon *icon, + gint size, + StIconColors *colors) { AsyncTextureLoadData *request; ClutterActor *texture; @@ -972,7 +999,21 @@ st_texture_cache_load_gicon (StTextureCache *cache, GtkIconInfo *info; gicon_string = g_icon_to_string (icon); - key = g_strdup_printf (CACHE_PREFIX_GICON "icon=%s,size=%d", gicon_string, size); + if (colors) + { + /* This raises some doubts about the practice of using string keys */ + key = g_strdup_printf (CACHE_PREFIX_GICON "icon=%s,size=%d,colors=%2x%2x%2x%2x,%2x%2x%2x%2x,%2x%2x%2x%2x,%2x%2x%2x%2x", + gicon_string, size, + colors->foreground.red, colors->foreground.blue, colors->foreground.green, colors->foreground.alpha, + colors->warning.red, colors->warning.blue, colors->warning.green, colors->warning.alpha, + colors->error.red, colors->error.blue, colors->error.green, colors->error.alpha, + colors->success.red, colors->success.blue, colors->success.green, colors->success.alpha); + } + else + { + key = g_strdup_printf (CACHE_PREFIX_GICON "icon=%s,size=%d", + gicon_string, size); + } g_free (gicon_string); if (create_texture_and_ensure_request (cache, key, size, &request, &texture)) @@ -995,7 +1036,7 @@ st_texture_cache_load_gicon (StTextureCache *cache, request->icon_info = info; request->width = request->height = size; - load_icon_pixbuf_async (cache, icon, info, size, NULL, on_pixbuf_loaded, request); + load_icon_pixbuf_async (cache, icon, info, size, colors, NULL, on_pixbuf_loaded, request); } else { @@ -1012,6 +1053,29 @@ st_texture_cache_load_gicon (StTextureCache *cache, return CLUTTER_ACTOR (texture); } +/** + * st_texture_cache_load_gicon: + * @cache: The texture cache instance + * @icon: the #GIcon to load + * @size: Size of themed + * + * This method returns a new #ClutterActor for a given #GIcon. If the + * icon isn't loaded already, the texture will be filled + * asynchronously. + * + * This will load @icon as a full-color icon; if you want a symbolic + * icon, you must use st_texture_cache_load_icon_name(). + * + * Return Value: (transfer none): A new #ClutterActor for the icon + */ +ClutterActor * +st_texture_cache_load_gicon (StTextureCache *cache, + GIcon *icon, + gint size) +{ + return load_gicon_with_colors (cache, icon, size, NULL); +} + typedef struct { gchar *path; gint grid_width, grid_height; @@ -1171,22 +1235,25 @@ st_texture_cache_load_sliced_image (StTextureCache *cache, */ /** - * st_texture_cache_load_icon_name: + * st_texture_cache_load_icon_name_for_theme: * @cache: The texture cache instance + * @theme_node: a #StThemeNode * @name: Name of a themed icon * @icon_type: the type of icon to load * @size: Size of themed * * Load a themed icon into a texture. See the #StIconType documentation - * for an explanation of how @icon_type affects the returned icon. + * for an explanation of how @icon_type affects the returned icon. The + * colors used for symbolic icons are derived from @theme_node. * * Return Value: (transfer none): A new #ClutterTexture for the icon */ ClutterActor * -st_texture_cache_load_icon_name (StTextureCache *cache, - const char *name, - StIconType icon_type, - gint size) +st_texture_cache_load_icon_name_for_theme (StTextureCache *cache, + StThemeNode *theme_node, + const char *name, + StIconType icon_type, + gint size) { ClutterActor *texture; GIcon *themed; @@ -1206,7 +1273,12 @@ st_texture_cache_load_icon_name (StTextureCache *cache, symbolic = g_strconcat (name, "-symbolic", NULL); themed = g_themed_icon_new_with_default_fallbacks ((const gchar*)symbolic); g_free (symbolic); - texture = st_texture_cache_load_gicon (cache, themed, size); + if (theme_node) + texture = load_gicon_with_colors (cache, themed, size, + st_theme_node_get_icon_colors (theme_node)); + else + texture = st_texture_cache_load_gicon (cache, themed, size); + g_object_unref (themed); return CLUTTER_ACTOR (texture); @@ -1222,6 +1294,27 @@ st_texture_cache_load_icon_name (StTextureCache *cache, } } +/** + * st_texture_cache_load_icon_name: + * @cache: The texture cache instance + * @name: Name of a themed icon + * @icon_type: the type of icon to load + * @size: Size of themed + * + * Load a themed icon into a texture. See the #StIconType documentation + * for an explanation of how @icon_type affects the returned icon. + * + * Return Value: (transfer none): A new #ClutterTexture for the icon + */ +ClutterActor * +st_texture_cache_load_icon_name (StTextureCache *cache, + const char *name, + StIconType icon_type, + gint size) +{ + return st_texture_cache_load_icon_name_for_theme (cache, NULL, name, icon_type, size); +} + /** * st_texture_cache_load_uri_async: * diff --git a/src/st/st-texture-cache.h b/src/st/st-texture-cache.h index 25c4df7ca..80b3060df 100644 --- a/src/st/st-texture-cache.h +++ b/src/st/st-texture-cache.h @@ -32,6 +32,7 @@ #include #include +#include #define ST_TYPE_TEXTURE_CACHE (st_texture_cache_get_type ()) #define ST_TEXTURE_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_TEXTURE_CACHE, StTextureCache)) @@ -82,6 +83,12 @@ ClutterActor *st_texture_cache_load_icon_name (StTextureCache *cache, StIconType icon_type, gint size); +ClutterActor *st_texture_cache_load_icon_name_for_theme (StTextureCache *cache, + StThemeNode *theme_node, + const char *name, + StIconType icon_type, + gint size); + ClutterActor *st_texture_cache_load_gicon (StTextureCache *cache, GIcon *icon, gint size); From 8d6ab6fe844fd57316a68a79a0862f1a7ead2cb6 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 2 Nov 2010 16:09:49 -0400 Subject: [PATCH 65/85] Add st_widget_peek_theme_node() Sometimes it's useful to get the theme node if there is one and do nothing and wait for the ::style-changed signal if there is no theme node. Add st_widget_peek_theme_node() that just gets the current theme node if available. The caller must handle a %NULL return. https://bugzilla.gnome.org/show_bug.cgi?id=633865 --- src/st/st-widget.c | 26 ++++++++++++++++++++++++++ src/st/st-widget.h | 1 + 2 files changed, 27 insertions(+) diff --git a/src/st/st-widget.c b/src/st/st-widget.c index a03af9af1..312661d9c 100644 --- a/src/st/st-widget.c +++ b/src/st/st-widget.c @@ -522,6 +522,9 @@ get_root_theme_node (ClutterStage *stage) * The theme node is used to access standard and custom CSS * properties of the widget. * + * Note: it is a fatal error to call this on a widget that is + * not been added to a stage. + * * Return value: (transfer none): the theme node for the widget. * This is owned by the widget. When attributes of the widget * or the environment that affect the styling change (for example @@ -570,6 +573,29 @@ st_widget_get_theme_node (StWidget *widget) return priv->theme_node; } +/** + * st_widget_peek_theme_node: + * @widget: a #StWidget + * + * Returns the theme node for the widget if it has already been + * computed, %NULL if the widget hasn't been added to a stage or the theme + * node hasn't been computed. If %NULL is returned, then ::style-changed + * will be reliably emitted before the widget is allocated or painted. + * + * Return value: (transfer none): the theme node for the widget. + * This is owned by the widget. When attributes of the widget + * or the environment that affect the styling change (for example + * the style_class property of the widget), it will be recreated, + * and the ::style-changed signal will be emitted on the widget. + */ +StThemeNode * +st_widget_peek_theme_node (StWidget *widget) +{ + StWidgetPrivate *priv = widget->priv; + + return priv->theme_node; +} + static gboolean st_widget_enter (ClutterActor *actor, ClutterCrossingEvent *event) diff --git a/src/st/st-widget.h b/src/st/st-widget.h index ba474208f..cc3b47c01 100644 --- a/src/st/st-widget.h +++ b/src/st/st-widget.h @@ -151,6 +151,7 @@ gboolean st_widget_navigate_focus (StWidget *widg /* Only to be used by sub-classes of StWidget */ void st_widget_style_changed (StWidget *widget); StThemeNode * st_widget_get_theme_node (StWidget *widget); +StThemeNode * st_widget_peek_theme_node (StWidget *widget); /* debug methods */ char *st_describe_actor (ClutterActor *actor); From af7ba00e97d97fab8516d6f7b8bb3bc16567a243 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 2 Nov 2010 16:15:53 -0400 Subject: [PATCH 66/85] StIcon: pass in the StThemeNode to get colorized symbolic icons Use st_texture_cache_load_icon_name_for_theme() so that we get the right colors for symbolic icons. The code refactoring to achieve this also avoids constantly starting a new icon load each time we set a property on initialization ... the icon is loaded only after we have a #StThemeNode assigned. https://bugzilla.gnome.org/show_bug.cgi?id=633865 --- src/st/st-icon.c | 34 +++++++++++++++++----------- tests/interactive/icons.js | 46 +++++++++++++++++++++++++++++++++----- 2 files changed, 61 insertions(+), 19 deletions(-) diff --git a/src/st/st-icon.c b/src/st/st-icon.c index 171698694..bd7e9eb99 100644 --- a/src/st/st-icon.c +++ b/src/st/st-icon.c @@ -56,8 +56,8 @@ struct _StIconPrivate gint icon_size; /* icon size we are using */ }; -static void st_icon_update (StIcon *icon); -static void st_icon_update_icon_size (StIcon *icon); +static void st_icon_update (StIcon *icon); +static gboolean st_icon_update_icon_size (StIcon *icon); #define DEFAULT_ICON_SIZE 48 #define DEFAULT_ICON_TYPE ST_ICON_SYMBOLIC @@ -245,6 +245,7 @@ st_icon_style_changed (StWidget *widget) priv->theme_icon_size = st_theme_node_get_length (theme_node, "icon-size"); st_icon_update_icon_size (self); + st_icon_update (self); } static void @@ -318,19 +319,24 @@ st_icon_update (StIcon *icon) /* Try to lookup the new one */ if (priv->icon_name) { - StTextureCache *cache = st_texture_cache_get_default (); + StThemeNode *theme_node = st_widget_peek_theme_node (ST_WIDGET (icon)); - priv->icon_texture = st_texture_cache_load_icon_name (cache, - priv->icon_name, - priv->icon_type, - priv->icon_size); + if (theme_node) + { + StTextureCache *cache = st_texture_cache_get_default (); + priv->icon_texture = st_texture_cache_load_icon_name_for_theme (cache, + theme_node, + priv->icon_name, + priv->icon_type, + priv->icon_size); - if (priv->icon_texture) - clutter_actor_set_parent (priv->icon_texture, CLUTTER_ACTOR (icon)); + if (priv->icon_texture) + clutter_actor_set_parent (priv->icon_texture, CLUTTER_ACTOR (icon)); + } } } -static void +static gboolean st_icon_update_icon_size (StIcon *icon) { StIconPrivate *priv = icon->priv; @@ -347,8 +353,10 @@ st_icon_update_icon_size (StIcon *icon) { clutter_actor_queue_relayout (CLUTTER_ACTOR (icon)); priv->icon_size = new_size; - st_icon_update (icon); + return TRUE; } + else + return FALSE; } /** @@ -477,8 +485,8 @@ st_icon_set_icon_size (StIcon *icon, if (priv->prop_icon_size != size) { priv->prop_icon_size = size; - st_icon_update_icon_size (icon); - + if (st_icon_update_icon_size (icon)) + st_icon_update (icon); g_object_notify (G_OBJECT (icon), "icon-size"); } } diff --git a/tests/interactive/icons.js b/tests/interactive/icons.js index 0c5a879ce..829516de9 100644 --- a/tests/interactive/icons.js +++ b/tests/interactive/icons.js @@ -8,6 +8,9 @@ const UI = imports.testcommon.ui; UI.init(); let stage = Clutter.Stage.get_default(); +stage.width = 400; +stage.height = 700; + let b = new St.BoxLayout({ vertical: true, width: stage.width, height: stage.height }); @@ -26,28 +29,59 @@ function addTest(label, icon_props) { } addTest("Symbolic", - { icon_name: 'zoom-in', + { icon_name: 'battery-full', icon_type: St.IconType.SYMBOLIC, icon_size: 48 }); addTest("Full color", - { icon_name: 'zoom-in', + { icon_name: 'battery-full', icon_type: St.IconType.FULLCOLOR, icon_size: 48 }); addTest("Default size", - { icon_name: 'zoom-in', + { icon_name: 'battery-full', icon_type: St.IconType.SYMBOLIC }); addTest("Size set by property", - { icon_name: 'zoom-in', + { icon_name: 'battery-full', icon_type: St.IconType.SYMBOLIC, icon_size: 32 }); addTest("Size set by style", - { icon_name: 'zoom-in', + { icon_name: 'battery-full', icon_type: St.IconType.SYMBOLIC, style: 'icon-size: 1em;' }); addTest("16px icon in 48px icon widget", - { icon_name: 'zoom-in', + { icon_name: 'battery-full', icon_type: St.IconType.SYMBOLIC, style: 'icon-size: 16px; width: 48px; height: 48px;' }); +function iconRow(icons, box_style) { + let hb = new St.BoxLayout({ vertical: false, style: box_style }); + + for each (let iconName in icons) { + hb.add(new St.Icon({ icon_name: iconName, + icon_type: St.IconType.SYMBOLIC, + icon_size: 48 })); + } + + b.add(hb); +} + +let normalCss = 'background: white; color: black; padding: 10px 10px;'; +let reversedCss = 'background: black; color: white; warning-color: #ffcc00; error-color: #ff0000; padding: 10px 10px;'; + +let batteryIcons = ['battery-full-charging', + 'battery-full', + 'battery-good', + 'battery-low', + 'battery-caution' ]; + +let volumeIcons = ['audio-volume-high', + 'audio-volume-medium', + 'audio-volume-low', + 'audio-volume-muted' ]; + +iconRow(batteryIcons, normalCss); +iconRow(batteryIcons, reversedCss); +iconRow(volumeIcons, normalCss); +iconRow(volumeIcons, reversedCss); + stage.show(); Clutter.main(); From 0e3431ac47ec3c5f69933ec5df78b922fc7f8976 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 2 Nov 2010 18:33:22 -0400 Subject: [PATCH 67/85] Use St.Icon for named icons Switch from St.TextureCache.load_named_icon() to using St.Icon for named icons. Along with the advantage of getting colorization right for symbolic icons, this allows moving some icon sizes into the CSS. In the CSS, the system status icon size is changed to be 1em (=16px for the default font size), at the request of the artists. See bug 613448. https://bugzilla.gnome.org/show_bug.cgi?id=633865 --- data/theme/gnome-shell.css | 12 ++++++++++++ js/ui/lookingGlass.js | 5 ++--- js/ui/messageTray.js | 4 +--- js/ui/notificationDaemon.js | 8 ++++++-- js/ui/panelMenu.js | 3 ++- js/ui/placeDisplay.js | 8 ++++++-- js/ui/popupMenu.js | 12 +++--------- js/ui/statusMenu.js | 8 ++++---- js/ui/telepathyClient.js | 4 +++- 9 files changed, 39 insertions(+), 25 deletions(-) diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index ee5b14edb..15755ffde 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -153,6 +153,10 @@ StTooltip { -slider-handle-radius: 0.5em; } +.popup-menu-icon { + icon-size: 1em; +} + /* Switches (to be used in menus) */ .toggle-switch { width: 4.5em; @@ -240,6 +244,10 @@ StTooltip { spacing: 8px; } +.system-status-icon { + icon-size: 1em; +} + /* Overview */ .overview { @@ -916,6 +924,10 @@ StTooltip { background: rgba(128,128,128,0.7); } +.notification-icon-button > StIcon { + icon-size: 36px; +} + .chat-received { background-gradient-direction: horizontal; background-gradient-start: rgba(255, 255, 255, 0.2); diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index 4ef2057dc..8daa9ff1a 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -678,9 +678,8 @@ LookingGlass.prototype = { let toolbar = new St.BoxLayout({ name: 'Toolbar' }); this.actor.add_actor(toolbar); - let inspectIcon = St.TextureCache.get_default().load_icon_name('gtk-color-picker', - St.IconType.SYMBOLIC, - 24); + let inspectIcon = new St.Icon({ icon_name: 'gtk-color-picker', + icon_size: 24 }); toolbar.add_actor(inspectIcon); inspectIcon.reactive = true; inspectIcon.connect('button-press-event', Lang.bind(this, function () { diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index d11051943..e0c4ecc86 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -22,8 +22,6 @@ const SUMMARY_TIMEOUT = 1; const HIDE_TIMEOUT = 0.2; const LONGER_HIDE_TIMEOUT = 0.6; -const BUTTON_ICON_SIZE = 36; - const MAX_SOURCE_TITLE_WIDTH = 180; // We delay hiding of the tray if the mouse is within MOUSE_LEFT_ACTOR_THRESHOLD @@ -349,7 +347,7 @@ Notification.prototype = { if (this._useActionIcons && Gtk.IconTheme.get_default().has_icon(id)) { button.add_style_class_name('notification-icon-button'); - button.child = St.TextureCache.get_default().load_icon_name(id, St.IconType.SYMBOLIC, BUTTON_ICON_SIZE); + button.child = new St.Icon({ icon_name: id }); } else { button.add_style_class_name('notification-button'); button.label = label; diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index 5bebb170d..c62cb4c20 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -150,7 +150,9 @@ NotificationDaemon.prototype = { let uri = GLib.filename_to_uri(icon, null); return textureCache.load_uri_async(uri, size, size); } else - return textureCache.load_icon_name(icon, St.IconType.FULLCOLOR, size); + return new St.Icon({ icon_name: icon, + icon_type: St.IconType.FULLCOLOR, + icon_size: size }); } else if (hints.icon_data) { let [width, height, rowStride, hasAlpha, bitsPerSample, nChannels, data] = hints.icon_data; @@ -167,7 +169,9 @@ NotificationDaemon.prototype = { stockIcon = 'gtk-dialog-error'; break; } - return textureCache.load_icon_name(stockIcon, St.IconType.FULLCOLOR, size); + return new St.Icon({ icon_name: stockIcon, + icon_type: St.IconType.FULLCOLOR, + icon_size: size }); } }, diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js index 95c203baf..9888d2388 100644 --- a/js/ui/panelMenu.js +++ b/js/ui/panelMenu.js @@ -81,7 +81,8 @@ SystemStatusButton.prototype = { this._iconName = iconName; if (this._iconActor) this._iconActor.destroy(); - this._iconActor = St.TextureCache.get_default().load_icon_name(this._iconName, St.IconType.SYMBOLIC, 24); + this._iconActor = new St.Icon({ icon_name: this._iconName, + style_class: 'system-status-icon' }); this.actor.set_child(this._iconActor); }, diff --git a/js/ui/placeDisplay.js b/js/ui/placeDisplay.js index 0e5d4fabc..d22f422b7 100644 --- a/js/ui/placeDisplay.js +++ b/js/ui/placeDisplay.js @@ -158,7 +158,9 @@ PlacesManager.prototype = { this._connect = new PlaceInfo('special:connect', _("Connect to..."), function (size) { - return St.TextureCache.get_default().load_icon_name('applications-internet', St.IconType.FULLCOLOR, size); + return new St.Icon({ icon_name: 'applications-internet', + icon_type: St.IconType.FULLCOLOR, + icon_size: size }); }, function () { new Shell.Process({ args: ['nautilus-connect-server'] }).run(); @@ -432,7 +434,9 @@ DashPlaceDisplayItem.prototype = { box.add(text, { expand: true, x_fill: true }); if (info.isRemovable()) { - let removeIcon = St.TextureCache.get_default().load_icon_name ('media-eject', St.IconType.FULLCOLOR, PLACES_ICON_SIZE); + let removeIcon = new St.Icon({ icon_name: 'media-eject', + icon_type: St.IconType.FULLCOLOR, + icon_size: PLACES_ICON_SIZE }); let removeIconBox = new St.Clickable({ child: removeIcon, reactive: true }); box.add(removeIconBox); diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index b6b2b8c2c..7227f90e5 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -566,22 +566,16 @@ PopupImageMenuItem.prototype = { _init: function (text, iconName) { PopupBaseMenuItem.prototype._init.call(this); - this._size = 16; - this.label = new St.Label({ text: text }); this.addActor(this.label); - this._imageBin = new St.Bin({ width: this._size, height: this._size }); - this.addActor(this._imageBin); + this._icon = new St.Icon({ style_class: 'popup-menu-icon' }); + this.addActor(this._icon); this.setIcon(iconName); }, setIcon: function(name) { - if (this._imageBin.child) - this._imageBin.child.destroy(); - - let img = St.TextureCache.get_default().load_icon_name(name, St.IconType.SYMBOLIC, this._size); - this._imageBin.set_child(img); + this._icon.icon_name = name; } }; diff --git a/js/ui/statusMenu.js b/js/ui/statusMenu.js index 3f2029cf8..f8f7daeee 100644 --- a/js/ui/statusMenu.js +++ b/js/ui/statusMenu.js @@ -43,10 +43,10 @@ StatusMenuButton.prototype = { box.add(this._iconBox, { y_align: St.Align.MIDDLE, y_fill: false }); let textureCache = St.TextureCache.get_default(); - this._availableIcon = textureCache.load_icon_name('user-available', St.IconType.SYMBOLIC, 16); - this._busyIcon = textureCache.load_icon_name('user-busy', St.IconType.SYMBOLIC, 16); - this._invisibleIcon = textureCache.load_icon_name('user-invisible', St.IconType.SYMBOLIC, 16); - this._idleIcon = textureCache.load_icon_name('user-idle', St.IconType.SYMBOLIC, 16); + this._availableIcon = new St.Icon({ icon_name: 'user-available', style_class: 'popup-menu-icon' }); + this._busyIcon = new St.Icon({ icon_name: 'user-busy', style_class: 'popup-menu-icon' }); + this._invisibleIcon = new St.Icon({ icon_name: 'user-invisible', style_class: 'popup-menu-icon' }); + this._idleIcon = new St.Icon({ icon_name: 'user-idle', style_class: 'popup-menu-icon' }); this._presence.connect('StatusChanged', Lang.bind(this, this._updatePresenceIcon)); this._presence.getStatus(Lang.bind(this, this._updatePresenceIcon)); diff --git a/js/ui/telepathyClient.js b/js/ui/telepathyClient.js index d2269f6c2..01186d6b0 100644 --- a/js/ui/telepathyClient.js +++ b/js/ui/telepathyClient.js @@ -347,7 +347,9 @@ ContactManager.prototype = { let uri = GLib.filename_to_uri(file, null); iconBox.child = textureCache.load_uri_async(uri, iconBox._size, iconBox._size); } else { - iconBox.child = textureCache.load_icon_name('stock_person', St.IconType.FULLCOLOR, iconBox._size); + iconBox.child = St.Icon({ icon_name: 'stock_person', + icon_type: St.IconType.FULLCOLOR, + icon_size: iconBox._size }); } }, From dc1e23501c14e4e6bf40c206d1e1f8e9dcc255d3 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Fri, 12 Nov 2010 17:07:05 -0500 Subject: [PATCH 68/85] Remove _for_theme() variant of st_texture_cache_load_icon_name() Now that we're using St.Icon in the Javascript, there is no reason to have separate st_texture_cache_load_icon_name() and st_texture_cache_load_icon_name_for_theme(), instead just add the StThemeNode argument to st_texture_cache_load_icon_name(). https://bugzilla.gnome.org/show_bug.cgi?id=633866 --- src/st/st-icon.c | 10 ++++----- src/st/st-texture-cache.c | 45 ++++++++++----------------------------- src/st/st-texture-cache.h | 7 +----- 3 files changed, 17 insertions(+), 45 deletions(-) diff --git a/src/st/st-icon.c b/src/st/st-icon.c index bd7e9eb99..94e6842df 100644 --- a/src/st/st-icon.c +++ b/src/st/st-icon.c @@ -324,11 +324,11 @@ st_icon_update (StIcon *icon) if (theme_node) { StTextureCache *cache = st_texture_cache_get_default (); - priv->icon_texture = st_texture_cache_load_icon_name_for_theme (cache, - theme_node, - priv->icon_name, - priv->icon_type, - priv->icon_size); + priv->icon_texture = st_texture_cache_load_icon_name (cache, + theme_node, + priv->icon_name, + priv->icon_type, + priv->icon_size); if (priv->icon_texture) clutter_actor_set_parent (priv->icon_texture, CLUTTER_ACTOR (icon)); diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c index 9d61129bf..cdea84811 100644 --- a/src/st/st-texture-cache.c +++ b/src/st/st-texture-cache.c @@ -1235,9 +1235,9 @@ st_texture_cache_load_sliced_image (StTextureCache *cache, */ /** - * st_texture_cache_load_icon_name_for_theme: + * st_texture_cache_load_icon_name: * @cache: The texture cache instance - * @theme_node: a #StThemeNode + * @theme_node: (allow-none): a #StThemeNode * @name: Name of a themed icon * @icon_type: the type of icon to load * @size: Size of themed @@ -1249,16 +1249,18 @@ st_texture_cache_load_sliced_image (StTextureCache *cache, * Return Value: (transfer none): A new #ClutterTexture for the icon */ ClutterActor * -st_texture_cache_load_icon_name_for_theme (StTextureCache *cache, - StThemeNode *theme_node, - const char *name, - StIconType icon_type, - gint size) +st_texture_cache_load_icon_name (StTextureCache *cache, + StThemeNode *theme_node, + const char *name, + StIconType icon_type, + gint size) { ClutterActor *texture; GIcon *themed; char *symbolic; + g_return_val_if_fail (!(icon_type == ST_ICON_SYMBOLIC && theme_node == NULL), NULL); + switch (icon_type) { case ST_ICON_APPLICATION: @@ -1273,12 +1275,8 @@ st_texture_cache_load_icon_name_for_theme (StTextureCache *cache, symbolic = g_strconcat (name, "-symbolic", NULL); themed = g_themed_icon_new_with_default_fallbacks ((const gchar*)symbolic); g_free (symbolic); - if (theme_node) - texture = load_gicon_with_colors (cache, themed, size, - st_theme_node_get_icon_colors (theme_node)); - else - texture = st_texture_cache_load_gicon (cache, themed, size); - + texture = load_gicon_with_colors (cache, themed, size, + st_theme_node_get_icon_colors (theme_node)); g_object_unref (themed); return CLUTTER_ACTOR (texture); @@ -1294,27 +1292,6 @@ st_texture_cache_load_icon_name_for_theme (StTextureCache *cache, } } -/** - * st_texture_cache_load_icon_name: - * @cache: The texture cache instance - * @name: Name of a themed icon - * @icon_type: the type of icon to load - * @size: Size of themed - * - * Load a themed icon into a texture. See the #StIconType documentation - * for an explanation of how @icon_type affects the returned icon. - * - * Return Value: (transfer none): A new #ClutterTexture for the icon - */ -ClutterActor * -st_texture_cache_load_icon_name (StTextureCache *cache, - const char *name, - StIconType icon_type, - gint size) -{ - return st_texture_cache_load_icon_name_for_theme (cache, NULL, name, icon_type, size); -} - /** * st_texture_cache_load_uri_async: * diff --git a/src/st/st-texture-cache.h b/src/st/st-texture-cache.h index 80b3060df..e8fc586c5 100644 --- a/src/st/st-texture-cache.h +++ b/src/st/st-texture-cache.h @@ -79,16 +79,11 @@ ClutterActor *st_texture_cache_bind_pixbuf_property (StTextureCache *cache, const char *property_name); ClutterActor *st_texture_cache_load_icon_name (StTextureCache *cache, + StThemeNode *theme_node, const char *name, StIconType icon_type, gint size); -ClutterActor *st_texture_cache_load_icon_name_for_theme (StTextureCache *cache, - StThemeNode *theme_node, - const char *name, - StIconType icon_type, - gint size); - ClutterActor *st_texture_cache_load_gicon (StTextureCache *cache, GIcon *icon, gint size); From a2f4e196a19263708d055fd4036028c91f1cb034 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 5 Nov 2010 10:04:10 -0400 Subject: [PATCH 69/85] Icon test case fixes put a border around the "16px icon in 48px icon widget" test, to verify that the icon is being centered correctly add spacing and fix alignment for general prettiness https://bugzilla.gnome.org/show_bug.cgi?id=633865 --- tests/interactive/icons.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/interactive/icons.js b/tests/interactive/icons.js index 829516de9..5ccd9abfd 100644 --- a/tests/interactive/icons.js +++ b/tests/interactive/icons.js @@ -20,9 +20,10 @@ function addTest(label, icon_props) { if (b.get_children().length > 0) b.add (new St.BoxLayout({ style: 'background: #cccccc; border: 10px transparent white; height: 1px; ' })); - let hb = new St.BoxLayout({ vertical: false }); + let hb = new St.BoxLayout({ vertical: false, + style: 'spacing: 10px;' }); - hb.add(new St.Label({ text: label })); + hb.add(new St.Label({ text: label }), { y_fill: false }); hb.add(new St.Icon(icon_props)); b.add(hb); @@ -50,7 +51,7 @@ addTest("Size set by style", addTest("16px icon in 48px icon widget", { icon_name: 'battery-full', icon_type: St.IconType.SYMBOLIC, - style: 'icon-size: 16px; width: 48px; height: 48px;' }); + style: 'icon-size: 16px; width: 48px; height: 48px; border: 1px solid black;' }); function iconRow(icons, box_style) { let hb = new St.BoxLayout({ vertical: false, style: box_style }); From e8917e2d6fdd8672c8aea4e5188ddbaac92774c2 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Sat, 13 Nov 2010 10:00:54 +0100 Subject: [PATCH 70/85] Fix build of run-js-test https://bugzilla.gnome.org/show_bug.cgi?id=634736 Signed-off-by: Adel Gadllah --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 5d05b5768..013a884fb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -163,7 +163,7 @@ libjs_test_la_SOURCES = \ noinst_PROGRAMS += run-js-test run_js_test_CPPFLAGS = $(JS_TEST_CFLAGS) -run_js_test_LDADD = $(EST_UI_LIBS) libjs-test.la +run_js_test_LDADD = $(JS_TEST_LIBS) libjs-test.la run_js_test_LDFLAGS = -export-dynamic run_js_test_SOURCES = \ From 63e89482fe8a4bc409a2991b73490a6dabd683fe Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Tue, 9 Nov 2010 14:38:30 -0500 Subject: [PATCH 71/85] Use Settings and not Preferences for sound menu To match the tool that it launches. --- js/ui/status/volume.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js index 87e4bd153..09684e606 100644 --- a/js/ui/status/volume.js +++ b/js/ui/status/volume.js @@ -61,7 +61,7 @@ Indicator.prototype = { this.menu.addMenuItem(this._inputSlider); this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - this.menu.addAction(_("Sound Preferences"), function() { + this.menu.addAction(_("Sound Settings"), function() { let p = new Shell.Process({ args: ['gnome-control-center', 'sound'] }); p.run(); }); From 32cc13656343236b2e6716b6d6371fc76a919dd9 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Sat, 13 Nov 2010 08:39:53 -0500 Subject: [PATCH 72/85] Remove Restart option from session menu The action is far less common than powering off. It is mostly used for performing system updates so the update tool should offer the option directly. Also, currently the Shut Down option dialog offers Restart anyway. We would like to keep the number of entries in this menu as limited (close to 7) as we can. --- js/ui/statusMenu.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/js/ui/statusMenu.js b/js/ui/statusMenu.js index f8f7daeee..927fb21c2 100644 --- a/js/ui/statusMenu.js +++ b/js/ui/statusMenu.js @@ -147,10 +147,6 @@ StatusMenuButton.prototype = { item.connect('activate', Lang.bind(this, this._onShutDownActivate)); this.menu.addMenuItem(item); - item = new PopupMenu.PopupMenuItem(_("Restart...")); - item.connect('activate', Lang.bind(this, this._onShutDownActivate)); - this.menu.addMenuItem(item); - item = new PopupMenu.PopupMenuItem(_("Shut Down...")); item.connect('activate', Lang.bind(this, this._onShutDownActivate)); this.menu.addMenuItem(item); From c3fb3a98b86775cfcf5750089c62bf2086d3f7e8 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Sat, 13 Nov 2010 08:42:20 -0500 Subject: [PATCH 73/85] Remove invisible status from menu It was decided at GNOME Summit that we would remove the invisible setting until we have a better story for how it works with chat and other sharing/messaging applications. We'd also need to figure out how it relates to busy. --- js/ui/statusMenu.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/js/ui/statusMenu.js b/js/ui/statusMenu.js index 927fb21c2..67fcd71f9 100644 --- a/js/ui/statusMenu.js +++ b/js/ui/statusMenu.js @@ -108,11 +108,6 @@ StatusMenuButton.prototype = { this.menu.addMenuItem(item); this._presenceItems[GnomeSession.PresenceStatus.BUSY] = item; - item = new PopupMenu.PopupImageMenuItem(_("Invisible"), 'user-invisible', true); - item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.INVISIBLE)); - this.menu.addMenuItem(item); - this._presenceItems[GnomeSession.PresenceStatus.INVISIBLE] = item; - item = new PopupMenu.PopupSeparatorMenuItem(); this.menu.addMenuItem(item); From 3138b20b11d67eb05fdda1926b7b0550dc2724d8 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sat, 13 Nov 2010 08:11:03 -0500 Subject: [PATCH 74/85] Skip drawing transparent borders and backgrounds We were always drawing the border and background of each StThemeNode, even if they were transparent. The simple optimization of checking the alpha provides a significant performance boost (in a quick test, it increased the overviewFpsSubsequent metric in the core performance test from 28fps to 35fps). https://bugzilla.gnome.org/show_bug.cgi?id=634752 --- src/st/st-theme-node-drawing.c | 284 +++++++++++++++++---------------- 1 file changed, 149 insertions(+), 135 deletions(-) diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c index 173dbf553..847c7bb75 100644 --- a/src/st/st-theme-node-drawing.c +++ b/src/st/st-theme-node-drawing.c @@ -262,6 +262,11 @@ st_theme_node_lookup_corner (StThemeNode *node, break; } + if (corner.color.alpha == 0 && + corner.border_color_1.alpha == 0 && + corner.border_color_2.alpha == 0) + return COGL_INVALID_HANDLE; + key = corner_to_string (&corner); data.node = node; @@ -676,6 +681,7 @@ st_theme_node_paint_borders (StThemeNode *node, int max_width_radius[4]; int corner_id; ClutterColor border_color; + guint8 alpha; width = box->x2 - box->x1; height = box->y2 - box->y1; @@ -697,58 +703,62 @@ st_theme_node_paint_borders (StThemeNode *node, float x1, y1, x2, y2; over (&border_color, &node->background_color, &effective_border); + alpha = paint_opacity * effective_border.alpha / 255; - cogl_set_source_color4ub (effective_border.red, - effective_border.green, - effective_border.blue, - paint_opacity * effective_border.alpha / 255); + if (alpha > 0) + { + cogl_set_source_color4ub (effective_border.red, + effective_border.green, + effective_border.blue, + alpha); - /* NORTH */ - skip_corner_1 = node->border_radius[ST_CORNER_TOPLEFT] > 0; - skip_corner_2 = node->border_radius[ST_CORNER_TOPRIGHT] > 0; + /* NORTH */ + skip_corner_1 = node->border_radius[ST_CORNER_TOPLEFT] > 0; + skip_corner_2 = node->border_radius[ST_CORNER_TOPRIGHT] > 0; - x1 = skip_corner_1 ? max_width_radius[ST_CORNER_TOPLEFT] : 0; - y1 = 0; - x2 = skip_corner_2 ? width - max_width_radius[ST_CORNER_TOPRIGHT] : width; - y2 = border_width; - cogl_rectangle (x1, y1, x2, y2); + x1 = skip_corner_1 ? max_width_radius[ST_CORNER_TOPLEFT] : 0; + y1 = 0; + x2 = skip_corner_2 ? width - max_width_radius[ST_CORNER_TOPRIGHT] : width; + y2 = border_width; + cogl_rectangle (x1, y1, x2, y2); - /* EAST */ - skip_corner_1 = node->border_radius[ST_CORNER_TOPRIGHT] > 0; - skip_corner_2 = node->border_radius[ST_CORNER_BOTTOMRIGHT] > 0; + /* EAST */ + skip_corner_1 = node->border_radius[ST_CORNER_TOPRIGHT] > 0; + skip_corner_2 = node->border_radius[ST_CORNER_BOTTOMRIGHT] > 0; - x1 = width - border_width; - y1 = skip_corner_1 ? max_width_radius[ST_CORNER_TOPRIGHT] : border_width; - x2 = width; - y2 = skip_corner_2 ? height - max_width_radius[ST_CORNER_BOTTOMRIGHT] - : height - border_width; - cogl_rectangle (x1, y1, x2, y2); + x1 = width - border_width; + y1 = skip_corner_1 ? max_width_radius[ST_CORNER_TOPRIGHT] : border_width; + x2 = width; + y2 = skip_corner_2 ? height - max_width_radius[ST_CORNER_BOTTOMRIGHT] + : height - border_width; + cogl_rectangle (x1, y1, x2, y2); - /* SOUTH */ - skip_corner_1 = node->border_radius[ST_CORNER_BOTTOMLEFT] > 0; - skip_corner_2 = node->border_radius[ST_CORNER_BOTTOMRIGHT] > 0; + /* SOUTH */ + skip_corner_1 = node->border_radius[ST_CORNER_BOTTOMLEFT] > 0; + skip_corner_2 = node->border_radius[ST_CORNER_BOTTOMRIGHT] > 0; - x1 = skip_corner_1 ? max_width_radius[ST_CORNER_BOTTOMLEFT] : 0; - y1 = height - border_width; - x2 = skip_corner_2 ? width - max_width_radius[ST_CORNER_BOTTOMRIGHT] - : width; - y2 = height; - cogl_rectangle (x1, y1, x2, y2); + x1 = skip_corner_1 ? max_width_radius[ST_CORNER_BOTTOMLEFT] : 0; + y1 = height - border_width; + x2 = skip_corner_2 ? width - max_width_radius[ST_CORNER_BOTTOMRIGHT] + : width; + y2 = height; + cogl_rectangle (x1, y1, x2, y2); - /* WEST */ - skip_corner_1 = node->border_radius[ST_CORNER_TOPLEFT] > 0; - skip_corner_2 = node->border_radius[ST_CORNER_BOTTOMLEFT] > 0; + /* WEST */ + skip_corner_1 = node->border_radius[ST_CORNER_TOPLEFT] > 0; + skip_corner_2 = node->border_radius[ST_CORNER_BOTTOMLEFT] > 0; - x1 = 0; - y1 = skip_corner_1 ? max_width_radius[ST_CORNER_TOPLEFT] : border_width; - x2 = border_width; - y2 = skip_corner_2 ? height - max_width_radius[ST_CORNER_BOTTOMLEFT] - : height - border_width; - cogl_rectangle (x1, y1, x2, y2); + x1 = 0; + y1 = skip_corner_1 ? max_width_radius[ST_CORNER_TOPLEFT] : border_width; + x2 = border_width; + y2 = skip_corner_2 ? height - max_width_radius[ST_CORNER_BOTTOMLEFT] + : height - border_width; + cogl_rectangle (x1, y1, x2, y2); + } } /* corners */ - if (max_border_radius > 0) + if (max_border_radius > 0 && paint_opacity > 0) { for (corner_id = 0; corner_id < 4; corner_id++) { @@ -787,105 +797,109 @@ st_theme_node_paint_borders (StThemeNode *node, } /* background color */ - cogl_set_source_color4ub (node->background_color.red, - node->background_color.green, - node->background_color.blue, - paint_opacity * node->background_color.alpha / 255); - - /* We add padding to each corner, so that all corners end up as if they - * had a border-radius of max_border_radius, which allows us to treat - * corners as uniform further on. - */ - for (corner_id = 0; corner_id < 4; corner_id++) + alpha = paint_opacity * node->background_color.alpha / 255; + if (alpha > 0) { - float verts[8]; - int n_rects; + cogl_set_source_color4ub (node->background_color.red, + node->background_color.green, + node->background_color.blue, + alpha); - /* corner texture does not need padding */ - if (max_border_radius == node->border_radius[corner_id]) - continue; - - n_rects = node->border_radius[corner_id] == 0 ? 1 : 2; - - switch (corner_id) - { - case ST_CORNER_TOPLEFT: - verts[0] = border_width; - verts[1] = max_width_radius[ST_CORNER_TOPLEFT]; - verts[2] = max_border_radius; - verts[3] = max_border_radius; - if (n_rects == 2) - { - verts[4] = max_width_radius[ST_CORNER_TOPLEFT]; - verts[5] = border_width; - verts[6] = max_border_radius; - verts[7] = max_width_radius[ST_CORNER_TOPLEFT]; - } - break; - case ST_CORNER_TOPRIGHT: - verts[0] = width - max_border_radius; - verts[1] = max_width_radius[ST_CORNER_TOPRIGHT]; - verts[2] = width - border_width; - verts[3] = max_border_radius; - if (n_rects == 2) - { - verts[4] = width - max_border_radius; - verts[5] = border_width; - verts[6] = width - max_width_radius[ST_CORNER_TOPRIGHT]; - verts[7] = max_width_radius[ST_CORNER_TOPRIGHT]; - } - break; - case ST_CORNER_BOTTOMRIGHT: - verts[0] = width - max_border_radius; - verts[1] = height - max_border_radius; - verts[2] = width - border_width; - verts[3] = height - max_width_radius[ST_CORNER_BOTTOMRIGHT]; - if (n_rects == 2) - { - verts[4] = width - max_border_radius; - verts[5] = height - max_width_radius[ST_CORNER_BOTTOMRIGHT]; - verts[6] = width - max_width_radius[ST_CORNER_BOTTOMRIGHT]; - verts[7] = height - border_width; - } - break; - case ST_CORNER_BOTTOMLEFT: - verts[0] = border_width; - verts[1] = height - max_border_radius; - verts[2] = max_border_radius; - verts[3] = height - max_width_radius[ST_CORNER_BOTTOMLEFT]; - if (n_rects == 2) - { - verts[4] = max_width_radius[ST_CORNER_BOTTOMLEFT]; - verts[5] = height - max_width_radius[ST_CORNER_BOTTOMLEFT]; - verts[6] = max_border_radius; - verts[7] = height - border_width; - } - break; - } - cogl_rectangles (verts, n_rects); - } - - if (max_border_radius > border_width) - { - /* Once we've drawn the borders and corners, if the corners are bigger - * the the border width, the remaining area is shaped like - * - * ######## - * ########## - * ########## - * ######## - * - * We draw it in 3 pieces - first the top and bottom, then the main - * rectangle + /* We add padding to each corner, so that all corners end up as if they + * had a border-radius of max_border_radius, which allows us to treat + * corners as uniform further on. */ - cogl_rectangle (max_border_radius, border_width, - width - max_border_radius, max_border_radius); - cogl_rectangle (max_border_radius, height - max_border_radius, - width - max_border_radius, height - border_width); - } + for (corner_id = 0; corner_id < 4; corner_id++) + { + float verts[8]; + int n_rects; - cogl_rectangle (border_width, MAX(border_width, max_border_radius), - width - border_width, height - MAX(border_width, max_border_radius)); + /* corner texture does not need padding */ + if (max_border_radius == node->border_radius[corner_id]) + continue; + + n_rects = node->border_radius[corner_id] == 0 ? 1 : 2; + + switch (corner_id) + { + case ST_CORNER_TOPLEFT: + verts[0] = border_width; + verts[1] = max_width_radius[ST_CORNER_TOPLEFT]; + verts[2] = max_border_radius; + verts[3] = max_border_radius; + if (n_rects == 2) + { + verts[4] = max_width_radius[ST_CORNER_TOPLEFT]; + verts[5] = border_width; + verts[6] = max_border_radius; + verts[7] = max_width_radius[ST_CORNER_TOPLEFT]; + } + break; + case ST_CORNER_TOPRIGHT: + verts[0] = width - max_border_radius; + verts[1] = max_width_radius[ST_CORNER_TOPRIGHT]; + verts[2] = width - border_width; + verts[3] = max_border_radius; + if (n_rects == 2) + { + verts[4] = width - max_border_radius; + verts[5] = border_width; + verts[6] = width - max_width_radius[ST_CORNER_TOPRIGHT]; + verts[7] = max_width_radius[ST_CORNER_TOPRIGHT]; + } + break; + case ST_CORNER_BOTTOMRIGHT: + verts[0] = width - max_border_radius; + verts[1] = height - max_border_radius; + verts[2] = width - border_width; + verts[3] = height - max_width_radius[ST_CORNER_BOTTOMRIGHT]; + if (n_rects == 2) + { + verts[4] = width - max_border_radius; + verts[5] = height - max_width_radius[ST_CORNER_BOTTOMRIGHT]; + verts[6] = width - max_width_radius[ST_CORNER_BOTTOMRIGHT]; + verts[7] = height - border_width; + } + break; + case ST_CORNER_BOTTOMLEFT: + verts[0] = border_width; + verts[1] = height - max_border_radius; + verts[2] = max_border_radius; + verts[3] = height - max_width_radius[ST_CORNER_BOTTOMLEFT]; + if (n_rects == 2) + { + verts[4] = max_width_radius[ST_CORNER_BOTTOMLEFT]; + verts[5] = height - max_width_radius[ST_CORNER_BOTTOMLEFT]; + verts[6] = max_border_radius; + verts[7] = height - border_width; + } + break; + } + cogl_rectangles (verts, n_rects); + } + + if (max_border_radius > border_width) + { + /* Once we've drawn the borders and corners, if the corners are bigger + * the the border width, the remaining area is shaped like + * + * ######## + * ########## + * ########## + * ######## + * + * We draw it in 3 pieces - first the top and bottom, then the main + * rectangle + */ + cogl_rectangle (max_border_radius, border_width, + width - max_border_radius, max_border_radius); + cogl_rectangle (max_border_radius, height - max_border_radius, + width - max_border_radius, height - border_width); + } + + cogl_rectangle (border_width, MAX(border_width, max_border_radius), + width - border_width, height - MAX(border_width, max_border_radius)); + } } static void From d11ea7d6cd3e907723368b05c2b2ea636d80ef15 Mon Sep 17 00:00:00 2001 From: "Gheyret T.Kenji" Date: Sat, 13 Nov 2010 22:26:32 +0100 Subject: [PATCH 75/85] Added UG translation --- po/ug.po | 694 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 694 insertions(+) create mode 100644 po/ug.po diff --git a/po/ug.po b/po/ug.po new file mode 100644 index 000000000..dc8bb1eac --- /dev/null +++ b/po/ug.po @@ -0,0 +1,694 @@ +# Uyghur translation for gnome-shell. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Gheyret Kenji,2010. +# Sahran , 2010. +# Zeper , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: gnome-shell\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell&component=general\n" +"POT-Creation-Date: 2010-11-11 00:43+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Gheyret Kenji\n" +"Language-Team: Uyghur Computer Science Association \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: ../data/gnome-shell.desktop.in.in.h:1 +msgid "GNOME Shell" +msgstr "GNOME چاپان" + +#: ../data/gnome-shell.desktop.in.in.h:2 +msgid "Window management and application launching" +msgstr "كۆزنەك باشقۇرغۇچ ۋە پروگرامما قوزغاتقۇچ" + +#: ../data/gnome-shell-clock-preferences.desktop.in.in.h:1 +msgid "Clock" +msgstr "سائەت" + +#: ../data/gnome-shell-clock-preferences.desktop.in.in.h:2 +msgid "Customize the panel clock" +msgstr "ئىختىيارىچە تاختا سائەت" + +#: ../data/org.gnome.shell.gschema.xml.in.h:1 +msgid "" +"Allows access to internal debugging and monitoring tools using the Alt-F2 " +"dialog." +msgstr "ئىچكى سازلاش ۋە كۆزىتىش قورالىنى زىيارەت قىلىشتا Alt-F2 ئىشلىتىلىدۇ." + +#: ../data/org.gnome.shell.gschema.xml.in.h:2 +msgid "Custom format of the clock" +msgstr "ئىختىيارىي سائەت فورماتى" + +#: ../data/org.gnome.shell.gschema.xml.in.h:3 +msgid "Enable internal tools useful for developers and testers from Alt-F2" +msgstr "ئىچكى قورال قوزغىتىلسا ئىجادكارلار ۋە سىنىغۇچىلارنىڭ Alt-F2 ئارقىلىق كىرىشىگە قۇلايلىق" + +#: ../data/org.gnome.shell.gschema.xml.in.h:4 +msgid "File extension used for storing the screencast" +msgstr "ھۆججەت كېڭەيتىلگەن ئاتى ئېكران كەسمىسى (screencasts) ساقلاشقا ئىشلىتىلىدۇ" + +#: ../data/org.gnome.shell.gschema.xml.in.h:5 +msgid "Framerate used for recording screencasts." +msgstr "كاندۇك نىسبىتى ئېكران كەسمىسى (screencasts) خاتىرىلەشكە ئىشلىتىلىدۇ" + +#: ../data/org.gnome.shell.gschema.xml.in.h:6 +msgid "" +"GNOME Shell extensions have a uuid property; this key lists extensions which " +"should not be loaded." +msgstr "GNOME چاپان (Shell)كېڭەيتىلمىسىنىڭ uuid خاسلىقى بار؛ بۇ كۇنۇپكا يۈكلەنمەيدىغان كېڭەيتىلمىلەر تىزىملىكىنى كۆرسىتىدۇ." + +#: ../data/org.gnome.shell.gschema.xml.in.h:7 +msgid "History for command (Alt-F2) dialog" +msgstr "بۇيرۇق (Alt-F2) سۆزلەشكۈنىڭ تارىخى" + +#: ../data/org.gnome.shell.gschema.xml.in.h:8 +msgid "Hour format" +msgstr "سائەت فورماتى" + +#: ../data/org.gnome.shell.gschema.xml.in.h:9 +msgid "" +"If true and format is either \"12-hour\" or \"24-hour\", display date in the " +"clock, in addition to time." +msgstr "ئەگەر راست (true) بولسا سائەتتە ۋاقىت فورماتىنى «12 سائەت» ياكى «24 سائەت» كۆرسەتكەندىن سىرت چېسلانىمۇ كۆرسىتىدۇ." + +#: ../data/org.gnome.shell.gschema.xml.in.h:10 +msgid "" +"If true and format is either \"12-hour\" or \"24-hour\", display seconds in " +"time." +msgstr "ئەگەر راست (true) بولسا سائەتتە ۋاقىت فورماتىنى «12 سائەت» ياكى «24 سائەت» كۆرسەتكەندىن سىرت سېكۇنتنىمۇ كۆرسىتىدۇ." + +#: ../data/org.gnome.shell.gschema.xml.in.h:11 +msgid "If true, display the ISO week date in the calendar." +msgstr "ئەگەر راست(true) بولسا يىلنامىدىكى ISO ھەپتە چېسلانى كۆرسىتىدۇ." + +#: ../data/org.gnome.shell.gschema.xml.in.h:12 +msgid "List of desktop file IDs for favorite applications" +msgstr "ئامراق پروگراممىلارنىڭ ئۈستەل ئۈستى ھۆججەت ID تىزىملىكى" + +#: ../data/org.gnome.shell.gschema.xml.in.h:13 +msgid "Overview workspace view mode" +msgstr "قىسقىچە بايان خىزمەت رايون كۆرۈنۈش ھالىتى" + +#: ../data/org.gnome.shell.gschema.xml.in.h:14 +msgid "" +"Sets the GStreamer pipeline used to encode recordings. It follows the syntax " +"used for gst-launch. The pipeline should have an unconnected sink pad where " +"the recorded video is recorded. It will normally have a unconnected source " +"pad; output from that pad will be written into the output file. However the " +"pipeline can also take care of its own output - this might be used to send " +"the output to an icecast server via shout2send or similar. When unset or set " +"to an empty value, the default pipeline will be used. This is currently " +"'videorate ! theoraenc ! oggmux' and records to Ogg Theora." +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:15 +msgid "Show date in clock" +msgstr "سائەت ئىچىدە چېسلا كۆرسەت" + +#: ../data/org.gnome.shell.gschema.xml.in.h:16 +msgid "Show the week date in the calendar" +msgstr "يىلنامىدە ھەپتە كۆرسەت" + +#: ../data/org.gnome.shell.gschema.xml.in.h:17 +msgid "Show time with seconds" +msgstr "ۋاقىت ئىچىدە سېكۇنتنى بىللە كۆرسەت" + +#: ../data/org.gnome.shell.gschema.xml.in.h:18 +msgid "" +"The applications corresponding to these identifiers will be displayed in the " +"favorites area." +msgstr "مۇناسىپ پروگرامما بەلگىسى يىغقۇچ رايونىدا كۆرسىتىلىدۇ." + +#: ../data/org.gnome.shell.gschema.xml.in.h:19 +msgid "" +"The filename for recorded screencasts will be a unique filename based on the " +"current date, and use this extension. It should be changed when recording to " +"a different container format." +msgstr "خاتىرىلەنگەن ئېكراننىڭ ھۆججەت ئاتى نۆۋەتتىكى چېسلا ئاساسىدا بىردىنبىر بولۇپ بۇ كېڭەيتىلگەن ئاتىنى ئىشلىتىدۇ. ئۇ ئۆزگەرسە ئوخشاش بولمىغان قاچا فورماتىدا خاتىرىلەيدۇ." + +#: ../data/org.gnome.shell.gschema.xml.in.h:20 +msgid "" +"The framerate of the resulting screencast recordered by GNOME Shell's " +"screencast recorder in frames-per-second." +msgstr "GNOME Shell ئېكران خاتىرىلىگۈچ ھەر سېكۇنتتا خاتىرىلەيدىغان ئېكران كەسمىسى كاندۇك نىسبىتى" + +#: ../data/org.gnome.shell.gschema.xml.in.h:21 +msgid "The gstreamer pipeline used to encode the screencast" +msgstr "" + +#: ../data/org.gnome.shell.gschema.xml.in.h:22 +msgid "" +"The selected workspace view mode in the overview. Supported values are " +"\"single\" and \"grid\"." +msgstr "تاللانغان قىسقىچە مەزمۇن خىزمەت رايونى كۆرۈنۈشىدە قوللايدىغان قىممەت «يەككە» ۋە «سېتكا»" + +#: ../data/org.gnome.shell.gschema.xml.in.h:23 +msgid "" +"The shell normally monitors active applications in order to present the most " +"used ones (e.g. in launchers). While this data will be kept private, you may " +"want to disable this for privacy reasons. Please note that doing so won't " +"remove already saved data." +msgstr "چاپان (shell) ئادەتتىكى ئەھۋالدا كۆپ ئىشلىتىلىدىغان ئاكتىپ پروگراممىلار(مەسىلەن، ئىجرا قىلىنىۋاتقان)نى كۆزىتىدۇ. گەرچە بۇ سانلىق مەلۇماتلار مەخپىي ساقلانسىمۇ، شەخسىي سىر سەۋەبىدىن بۇنى چەكلىشىڭىز مۇمكىن. دىققەت بۇنداق قىلغاندا ئاللىبۇرۇن ساقلانغان سانلىق مەلۇماتلار چىقىرىۋېتىلمەيدۇ." + +#: ../data/org.gnome.shell.gschema.xml.in.h:24 +msgid "" +"This key specifies the format used by the panel clock when the format key is " +"set to \"custom\". You can use conversion specifiers understood by strftime" +"() to obtain a specific format. See the strftime() manual for more " +"information." +msgstr "format (فورمات) كۇنۇپكىسى \"custom\" (ئىختىيارى) قىلىپ تەڭشەلسە بۇ كۇنۇپكا تاختا سائەت ئىشلىتىدىغان فورماتنى بەلگىلەيدۇ. سىز strftime()نىڭ فورمات بەلگىسىنى ئىشلىتىپ بەلگىلەنگەن فورماتقا ئېرىشەلەيسىز. تەپسىلاتىنى strftime() نىڭ قوللانمىسىدىن كۆرۈڭ." + +#: ../data/org.gnome.shell.gschema.xml.in.h:25 +msgid "" +"This key specifies the hour format used by the panel clock. Possible values " +"are \"12-hour\", \"24-hour\", \"unix\" and \"custom\". If set to \"unix\", " +"the clock will display time in seconds since Epoch, i.e. 1970-01-01. If set " +"to \"custom\", the clock will display time according to the format specified " +"in the custom_format key. Note that if set to either \"unix\" or \"custom\", " +"the show_date and show_seconds keys are ignored." +msgstr "بۇ كۇنۇپكا تاختا سائەت ئىشلەتكەن سائەت فورماتىنى بەلگىلىگەن. ئىشلەتكىلى بولىدىغان قىممىتى \"12-hour\" يەنى (12 سائەت)، \"24-hour\" يەنى (24 سائەت)، \"unix\" ۋە \"custom\" (ئىختىيارى). ئەگەر \"unix\" قىلىپ تەڭشەلسە سائەت ئۆزلۈكىدىن يېڭى ئېرا (يەنى، 1970-01-01) دىن ئۆتكەن سېكۇنتنى ئاساس قىلىدۇ. ئەگەر \"custom\" قىلىپ تەڭشەلسە سائەت custom_format كۇنۇپكا قىممىتىگە ئاساسەن ۋاقىتنى كۆرسىتىدۇ. ئەگەر \"unix\" ياكى \"custom\" قىلىپ تەڭشەلسە show_date ۋە show_seconds قىممىتىگە پەرۋا قىلمايدۇ" + +#: ../data/org.gnome.shell.gschema.xml.in.h:26 +msgid "Uuids of extensions to disable" +msgstr "كېڭەيتىلمىنىڭ Uuid چەكلەندى" + +#: ../data/org.gnome.shell.gschema.xml.in.h:27 +msgid "Whether to collect stats about applications usage" +msgstr "پروگراممىنىڭ ئىشلىتىلىشى ھەققىدىكى ستاتىستىكىنى توپلامدۇ يوق" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:1 +msgid "Clip the crosshairs at the center" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:2 +msgid "Color of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:3 +msgid "" +"Determines the length of the vertical and horizontal lines that make up the " +"crosshairs." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:4 +msgid "" +"Determines the position of the magnified mouse image within the magnified " +"view and how it reacts to system mouse movement. The values are - none: no " +"mouse tracking; - centered: the mouse image is displayed at the center of " +"the zoom region (which also represents the point under the system mouse) and " +"the magnified contents are scrolled as the system mouse moves; - " +"proportional: the position of the magnified mouse in the zoom region is " +"proportionally the same as the position of the system mouse on screen; - " +"push: when the magnified mouse intersects a boundary of the zoom region, the " +"contents are scrolled into view." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:5 +msgid "" +"Determines the transparency of the crosshairs, from fully opaque to fully " +"transparent." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:6 +msgid "" +"Determines whether the crosshairs intersect the magnified mouse sprite, or " +"are clipped such that the ends of the horizontal and vertical lines surround " +"the mouse image." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:7 +msgid "Enable lens mode" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:8 +msgid "" +"Enables/disables display of crosshairs centered on the magnified mouse " +"sprite." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:9 +msgid "" +"For centered mouse tracking, when the system pointer is at or near the edge " +"of the screen, the magnified contents continue to scroll such that the " +"screen edge moves into the magnified view." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:10 +msgid "Length of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:11 +msgid "Magnification factor" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:12 +msgid "Mouse Tracking Mode" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:13 +msgid "Opacity of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:14 +msgid "Screen position" +msgstr "ئېكران ئورنى" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:15 +msgid "Scroll magnified contents beyond the edges of the desktop" +msgstr "دومىلىما چوڭايتقۇچ ئۈستەل ئۈستى گىرۋەك مەزمۇنىدىن ھالقىپ كەتتى" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:16 +msgid "Show or hide crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:17 +msgid "Show or hide the magnifier" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:18 +msgid "Show or hide the magnifier and all of its zoom regions." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:19 +msgid "" +"The color of the the vertical and horizontal lines that make up the " +"crosshairs." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:20 +msgid "" +"The magnified view either fills the entire screen, or occupies the top-half, " +"bottom-half, left-half, or right-half of the screen." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:21 +msgid "" +"The power of the magnification. A value of 1.0 means no magnification. A " +"value of 2.0 doubles the size." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:22 +msgid "Thickness of the crosshairs" +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:23 +msgid "" +"Whether the magnified view should be centered over the location of the " +"system mouse and move with it." +msgstr "" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:24 +msgid "Width of the vertical and horizontal lines that make up the crosshairs." +msgstr "" + +#: ../data/clock-preferences.ui.h:1 +msgid "Clock Format" +msgstr "سائەت فورماتى" + +#: ../data/clock-preferences.ui.h:2 +msgid "Clock Preferences" +msgstr "سائەت مايىللىقى" + +#: ../data/clock-preferences.ui.h:3 +msgid "Panel Display" +msgstr "تاختا كۆرسەت" + +#: ../data/clock-preferences.ui.h:4 +msgid "Show seco_nds" +msgstr "سېكۇنت كۆرسەت(_N)" + +#: ../data/clock-preferences.ui.h:5 +msgid "Show the _date" +msgstr "چېسلانى كۆرسەت(_D)" + +#: ../data/clock-preferences.ui.h:6 +msgid "_12 hour format" +msgstr "_12 سائەت فورماتى" + +#: ../data/clock-preferences.ui.h:7 +msgid "_24 hour format" +msgstr "_24 سائەت فورماتى" + +#. **** Applications **** +#: ../js/ui/appDisplay.js:316 ../js/ui/dash.js:778 +msgid "APPLICATIONS" +msgstr "پروگراممىلار" + +#: ../js/ui/appDisplay.js:348 +msgid "PREFERENCES" +msgstr "مايىللىق" + +#: ../js/ui/appDisplay.js:647 +msgid "New Window" +msgstr "يېڭى كۆزنەك" + +#: ../js/ui/appDisplay.js:651 +msgid "Remove from Favorites" +msgstr "يىغقۇچتىن چىقىرىۋەت" + +#: ../js/ui/appDisplay.js:652 +msgid "Add to Favorites" +msgstr "يىغقۇچقا قوش" + +#: ../js/ui/appDisplay.js:829 +msgid "Drag here to add favorites" +msgstr "بۇ جايغا سۆرەپ قىسقۇچقا قوش" + +#: ../js/ui/appFavorites.js:88 +#, c-format +msgid "%s has been added to your favorites." +msgstr "%s يىغقۇچىڭىزغا قوشۇلىدۇ." + +#: ../js/ui/appFavorites.js:107 +#, c-format +msgid "%s has been removed from your favorites." +msgstr "%s يىغقۇچىڭىزدىن چىقىرىۋېتىلىدۇ." + +#: ../js/ui/dash.js:142 +msgid "Find" +msgstr "ئىزدە" + +#: ../js/ui/dash.js:473 +msgid "Searching..." +msgstr "ئىزدەۋاتىدۇ…" + +#: ../js/ui/dash.js:487 +msgid "No matching results." +msgstr "ماس كېلىدىغان نەتىجە يوق." + +#. **** Places **** +#. Translators: This is in the sense of locations for documents, +#. network locations, etc. +#: ../js/ui/dash.js:797 ../js/ui/placeDisplay.js:554 +msgid "PLACES & DEVICES" +msgstr "ئورۇن ۋە ئۈسكۈنىلەر" + +#. **** Documents **** +#: ../js/ui/dash.js:804 ../js/ui/docDisplay.js:494 +msgid "RECENT ITEMS" +msgstr "يېقىنقى تۈرلەر" + +#: ../js/ui/lookingGlass.js:552 +msgid "No extensions installed" +msgstr "ھېچقانداق كېڭەيتىلمە ئورنىتىلمىغان" + +#: ../js/ui/lookingGlass.js:589 +msgid "Enabled" +msgstr "قوزغىتىلغان" + +#. translators: +#. * The device has been disabled +#: ../js/ui/lookingGlass.js:591 ../src/gvc/gvc-mixer-control.c:1087 +msgid "Disabled" +msgstr "چەكلەنگەن" + +#: ../js/ui/lookingGlass.js:593 +msgid "Error" +msgstr "خاتالىق" + +#: ../js/ui/lookingGlass.js:595 +msgid "Out of date" +msgstr "ۋاقتى ئۆتۈپ كەتكەن" + +#: ../js/ui/lookingGlass.js:620 +msgid "View Source" +msgstr "مەنبەنى كۆرسەت" + +#: ../js/ui/lookingGlass.js:626 +msgid "Web Page" +msgstr "تور بەت" + +#: ../js/ui/overview.js:160 +msgid "Undo" +msgstr "يېنىۋال" + +#. TODO - _quit() doesn't really work on apps in state STARTING yet +#: ../js/ui/panel.js:469 +#, c-format +msgid "Quit %s" +msgstr "%s چېكىن" + +#: ../js/ui/panel.js:494 +msgid "Preferences" +msgstr "مايىللىق" + +#. Translators: This is the time format with date used +#. in 24-hour mode. +#: ../js/ui/panel.js:580 +msgid "%a %b %e, %R:%S" +msgstr "%a %b %e، %R:%S" + +#: ../js/ui/panel.js:581 +msgid "%a %b %e, %R" +msgstr "%a %b %e، %R" + +#. Translators: This is the time format without date used +#. in 24-hour mode. +#: ../js/ui/panel.js:585 +msgid "%a %R:%S" +msgstr "%a %R:%S" + +#: ../js/ui/panel.js:586 +msgid "%a %R" +msgstr "%a %R" + +#. Translators: This is a time format with date used +#. for AM/PM. +#: ../js/ui/panel.js:593 +msgid "%a %b %e, %l:%M:%S %p" +msgstr "%a %b %e, %l:%M:%S %p" + +#: ../js/ui/panel.js:594 +msgid "%a %b %e, %l:%M %p" +msgstr "%a %b %e, %l:%M %p" + +#. Translators: This is a time format without date used +#. for AM/PM. +#: ../js/ui/panel.js:598 +msgid "%a %l:%M:%S %p" +msgstr "%a %l:%M:%S %p" + +#: ../js/ui/panel.js:599 +msgid "%a %l:%M %p" +msgstr "%p%l:%M (%a)" + +#. Button on the left side of the panel. +#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview". +#: ../js/ui/panel.js:744 +msgid "Activities" +msgstr "ھەرىكەتچان" + +#: ../js/ui/placeDisplay.js:111 +#, c-format +msgid "Failed to unmount '%s'" +msgstr "%s نىڭ ئېگەرنى يېشىش مەغلۇپ بولدى." + +#: ../js/ui/placeDisplay.js:114 +msgid "Retry" +msgstr "قايتا سىنا" + +#: ../js/ui/placeDisplay.js:159 +msgid "Connect to..." +msgstr "باغلانماق..." + +#. Translators: this MUST be either "toggle-switch-us" +#. (for toggle switches containing the English words +#. "ON" and "OFF") or "toggle-switch-intl" (for toggle +#. switches containing "◯" and "|"). Other values will +#. simply result in invisible toggle switches. +#: ../js/ui/popupMenu.js:33 +msgid "toggle-switch-us" +msgstr "" + +#: ../js/ui/runDialog.js:233 +msgid "Please enter a command:" +msgstr "بۇيرۇق كىرگۈزۈڭ:" + +#: ../js/ui/runDialog.js:378 +#, c-format +msgid "Execution of '%s' failed:" +msgstr "'%s' ئىجرا قىلالمىدى:" + +#: ../js/ui/statusMenu.js:101 +msgid "Available" +msgstr "ئىشلىتىلىشچان" + +#: ../js/ui/statusMenu.js:106 +msgid "Busy" +msgstr "ئالدىراش" + +#: ../js/ui/statusMenu.js:111 +msgid "Invisible" +msgstr "يوشۇرۇن" + +#: ../js/ui/statusMenu.js:119 +msgid "My Account..." +msgstr "" + +#: ../js/ui/statusMenu.js:123 +msgid "System Settings..." +msgstr "سىستېما تەڭشەكلىرى" + +#: ../js/ui/statusMenu.js:130 +msgid "Lock Screen" +msgstr "ئېكراننى قۇلۇپلا" + +#: ../js/ui/statusMenu.js:134 +msgid "Switch User" +msgstr "ئىشلەتكۈچى ئالماشتۇر" + +#: ../js/ui/statusMenu.js:139 +msgid "Log Out..." +msgstr "تىزىمدىن چىق…" + +#: ../js/ui/statusMenu.js:146 +msgid "Suspend" +msgstr "ۋاقىتلىق توختىتىش" + +#: ../js/ui/statusMenu.js:150 +msgid "Restart..." +msgstr "" + +#: ../js/ui/statusMenu.js:154 +msgid "Shut Down..." +msgstr "تاقا…" + +#: ../js/ui/status/accessibility.js:88 +msgid "Screen Reader" +msgstr "ئېكران ئوقۇغۇچ" + +#: ../js/ui/status/accessibility.js:91 +msgid "Screen Keyboard" +msgstr "ئېكران ھەرپتاختىسى" + +#: ../js/ui/status/accessibility.js:94 +msgid "Visual Alerts" +msgstr "كۆرۈنمە ئاگاھلاندۇرۇش" + +#: ../js/ui/status/accessibility.js:97 +msgid "Sticky Keys" +msgstr "چاپلاش كۇنۇپكىسى" + +#: ../js/ui/status/accessibility.js:100 +msgid "Slow Keys" +msgstr "ئاستا كۇنۇپكا" + +#: ../js/ui/status/accessibility.js:103 +msgid "Bounce Keys" +msgstr "قاڭقىش كۇنۇپكىسى" + +#: ../js/ui/status/accessibility.js:106 +msgid "Mouse Keys" +msgstr "چاشقىنەك كۇنۇپكا" + +#: ../js/ui/status/accessibility.js:110 +msgid "Universal Access Settings" +msgstr "ھەممىباب زىيارەت تەڭشىكى" + +#: ../js/ui/status/accessibility.js:163 +msgid "High Contrast" +msgstr "يۇقىرى ئاق-قارىلىقى" + +#: ../js/ui/status/accessibility.js:202 +msgid "Large Text" +msgstr "چوڭ تېكىست" + +#: ../js/ui/status/accessibility.js:223 +msgid "Zoom" +msgstr "كېڭەيت تارايت" + +#: ../js/ui/windowAttentionHandler.js:43 +#, c-format +msgid "%s has finished starting" +msgstr "%s باشلاشنى تاماملىدى" + +#: ../js/ui/windowAttentionHandler.js:45 +#, c-format +msgid "'%s' is ready" +msgstr "'%s' تەييار بولدى" + +#: ../js/ui/workspacesView.js:229 +msgid "" +"Can't add a new workspace because maximum workspaces limit has been reached." +msgstr "يېڭى خىزمەت رايونى قوشالمايدۇ چۈنكى ئەڭ كۆپ خىزمەت رايون چېكىگە يەتتى." + +#: ../js/ui/workspacesView.js:246 +msgid "Can't remove the first workspace." +msgstr "بىرىنچى خىزمەت رايونىنى چىقىرىۋېتەلمەيدۇ." + +#. translators: +#. * The number of sound outputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1094 +#, c-format +msgid "%u Output" +msgid_plural "%u Outputs" +msgstr[0] "%u چىقار" + +#. translators: +#. * The number of sound inputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1104 +#, c-format +msgid "%u Input" +msgid_plural "%u Inputs" +msgstr[0] "%u كىرگۈز" + +#: ../src/gvc/gvc-mixer-control.c:1402 +msgid "System Sounds" +msgstr "سىستېما ئاۋازى" + +#: ../src/shell-global.c:1219 +msgid "Less than a minute ago" +msgstr "بىر مىنۇتتىنمۇ ئىلگىرى" + +#: ../src/shell-global.c:1223 +#, c-format +msgid "%d minute ago" +msgid_plural "%d minutes ago" +msgstr[0] "%d مىنۇت ئىلگىرى" + +#: ../src/shell-global.c:1228 +#, c-format +msgid "%d hour ago" +msgid_plural "%d hours ago" +msgstr[0] "%d سائەت ئىلگىرى" + +#: ../src/shell-global.c:1233 +#, c-format +msgid "%d day ago" +msgid_plural "%d days ago" +msgstr[0] "%d كۈن ئىلگىرى" + +#: ../src/shell-global.c:1238 +#, c-format +msgid "%d week ago" +msgid_plural "%d weeks ago" +msgstr[0] "%d ھەپتە ئىلگىرى" + +#: ../src/shell-uri-util.c:89 +msgid "Home Folder" +msgstr "باش مۇندەرىجە" + +#. Translators: this is the same string as the one found in +#. * nautilus +#: ../src/shell-uri-util.c:104 +msgid "File System" +msgstr "ھۆججەت سىستېمىسى" + +#: ../src/shell-uri-util.c:250 +msgid "Search" +msgstr "ئىزدە" + +#. Translators: the first string is the name of a gvfs +#. * method, and the second string is a path. For +#. * example, "Trash: some-directory". It means that the +#. * directory called "some-directory" is in the trash. +#. +#: ../src/shell-uri-util.c:300 +#, c-format +msgid "%1$s: %2$s" +msgstr "%1$s: %2$s" From 35d87801861bd3fe5d235f899cf2664d33b38607 Mon Sep 17 00:00:00 2001 From: "Gheyret T.Kenji" Date: Sun, 14 Nov 2010 00:05:37 +0100 Subject: [PATCH 76/85] Added UG translation --- po/LINGUAS | 1 + 1 file changed, 1 insertion(+) diff --git a/po/LINGUAS b/po/LINGUAS index 10f2c29b1..f28ead6b0 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -35,6 +35,7 @@ sv ta th tr +ug uk vi zh_CN From 141b4ffe877948335ddf5e09722cb618935fa192 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sat, 13 Nov 2010 23:11:42 +0100 Subject: [PATCH 77/85] StFocusManager: don't unref removed groups It is not referencing them when adding, and also it is connecting to the "destroy" signal, emitted on dispose, so there is no risk of storing finalized objects. https://bugzilla.gnome.org/show_bug.cgi?id=634781 --- src/st/st-focus-manager.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/st/st-focus-manager.c b/src/st/st-focus-manager.c index 542fc5ab3..8c7bc9dfd 100644 --- a/src/st/st-focus-manager.c +++ b/src/st/st-focus-manager.c @@ -70,8 +70,7 @@ static void st_focus_manager_init (StFocusManager *manager) { manager->priv = ST_FOCUS_MANAGER_GET_PRIVATE (manager); - manager->priv->groups = g_hash_table_new_full (NULL, NULL, - g_object_unref, NULL); + manager->priv->groups = g_hash_table_new (NULL, NULL); } static gboolean From 3c33cf425ef068984454f129925d089405f661a9 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Sun, 14 Nov 2010 18:54:49 -0500 Subject: [PATCH 78/85] gnome-shell-build-setup.sh: add libxklavier-devel & expat-devel to deps Add to deps for Fedora and Debian: expat: needed by polkit libxklavier-devel: need by libgnomekbd Based on a patch by Kiyoshi Aman . https://bugzilla.gnome.org/show_bug.cgi?id=634865 --- tools/build/gnome-shell-build-setup.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/build/gnome-shell-build-setup.sh b/tools/build/gnome-shell-build-setup.sh index 74bf69080..ee0e83e68 100755 --- a/tools/build/gnome-shell-build-setup.sh +++ b/tools/build/gnome-shell-build-setup.sh @@ -57,9 +57,9 @@ fi # libtool, pkgconfig # # Devel packages needed by gnome-shell and its deps: -# dbus-glib, GL, gnome-menus, gstreamer, libffi, +# dbus-glib, expat, GL, gnome-menus, gstreamer, libffi, # libjasper, libjpeg, libpng, libpulse, libtiff, libwnck, -# libxml2, ORBit2, pam, python, readline, +# libxklavier, libxml2, ORBit2, pam, python, readline, # spidermonkey ({mozilla,firefox,xulrunner}-js), startup-notification # xdamage, icon-naming-utils, libtool-ltdl, libvorbis # @@ -81,13 +81,13 @@ if test "x$system" = xUbuntu -o "x$system" = xDebian -o "x$system" = xLinuxMint build-essential curl \ automake bison flex gettext git-core gnome-common gtk-doc-tools \ gvfs gvfs-backends icon-naming-utils \ - libdbus-glib-1-dev libffi-dev libgnome-menu-dev libgnome-desktop-dev \ + libdbus-glib-1-dev libexpat-dev libffi-dev libgnome-menu-dev libgnome-desktop-dev \ libjasper-dev libjpeg-dev libpng-dev libstartup-notification0-dev libtiff-dev \ libwnck-dev libgl1-mesa-dev liborbit2-dev libpulse-dev libreadline5-dev libxml2-dev \ mesa-common-dev mesa-utils libpam-dev python-dev python-gconf python-gobject \ xulrunner-dev xserver-xephyr gnome-terminal libcroco3-dev \ libgstreamer0.10-dev gstreamer0.10-plugins-base gstreamer0.10-plugins-good \ - libltdl-dev libvorbis-dev \ + libltdl-dev libvorbis-dev libxklavier-dev \ ; do if ! dpkg-checkbuilddeps -d $pkg /dev/null 2> /dev/null; then reqd="$pkg $reqd" @@ -109,9 +109,9 @@ if test "x$system" = xFedora ; then libtiff-devel libwnck-devel mesa-libGL-devel ORBit2-devel pam-devel pulseaudio-libs-devel python-devel pygobject2 readline-devel xulrunner-devel libXdamage-devel libcroco-devel libxml2-devel gstreamer-devel - gstreamer-plugins-base gstreamer-plugins-good glx-utils + gstreamer-plugins-base gstreamer-plugins-good glx-utils expat-devel startup-notification-devel xorg-x11-server-Xephyr gnome-terminal zenity - icon-naming-utils libtool-ltdl-devel libvorbis-devel + icon-naming-utils libtool-ltdl-devel libvorbis-devel libxklavier-devel " if expr $version \>= 14 > /dev/null ; then From f6e9ae35fd7e6684496873b1598a0c26cab7dd10 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 15 Nov 2010 08:17:08 -0500 Subject: [PATCH 79/85] gnome-shell-build-setup.sh: Conditionally check for autopoint on Debian/Ubuntu. autopoint was split out into its own package in Debian lenny and thus Ubuntu 10.10 https://bugzilla.gnome.org/show_bug.cgi?id=632824 --- tools/build/gnome-shell-build-setup.sh | 38 +++++++++++++++----------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/tools/build/gnome-shell-build-setup.sh b/tools/build/gnome-shell-build-setup.sh index ee0e83e68..3ffa1ae77 100755 --- a/tools/build/gnome-shell-build-setup.sh +++ b/tools/build/gnome-shell-build-setup.sh @@ -71,30 +71,36 @@ fi # (*) only needed for --xephyr if test "x$system" = xUbuntu -o "x$system" = xDebian -o "x$system" = xLinuxMint ; then - reqd="" + reqd=" + build-essential curl + automake bison flex gettext git-core gnome-common gtk-doc-tools + gvfs gvfs-backends icon-naming-utils + libdbus-glib-1-dev libexpat-dev libffi-dev libgnome-menu-dev libgnome-desktop-dev + libjasper-dev libjpeg-dev libpng-dev libstartup-notification0-dev libtiff-dev + libwnck-dev libgl1-mesa-dev liborbit2-dev libpulse-dev libreadline5-dev libxml2-dev + mesa-common-dev mesa-utils libpam-dev python-dev python-gconf python-gobject + xulrunner-dev xserver-xephyr gnome-terminal libcroco3-dev + libgstreamer0.10-dev gstreamer0.10-plugins-base gstreamer0.10-plugins-good + libltdl-dev libvorbis-dev libxklavier-dev + " + + if apt-cache show autopoint > /dev/null 2> /dev/null; then + reqd="$reqd autopoint" + fi + if [ ! -x /usr/bin/dpkg-checkbuilddeps ]; then echo "Please run 'sudo apt-get install dpkg-dev' and try again." echo exit 1 fi - for pkg in \ - build-essential curl \ - automake bison flex gettext git-core gnome-common gtk-doc-tools \ - gvfs gvfs-backends icon-naming-utils \ - libdbus-glib-1-dev libexpat-dev libffi-dev libgnome-menu-dev libgnome-desktop-dev \ - libjasper-dev libjpeg-dev libpng-dev libstartup-notification0-dev libtiff-dev \ - libwnck-dev libgl1-mesa-dev liborbit2-dev libpulse-dev libreadline5-dev libxml2-dev \ - mesa-common-dev mesa-utils libpam-dev python-dev python-gconf python-gobject \ - xulrunner-dev xserver-xephyr gnome-terminal libcroco3-dev \ - libgstreamer0.10-dev gstreamer0.10-plugins-base gstreamer0.10-plugins-good \ - libltdl-dev libvorbis-dev libxklavier-dev \ - ; do + + for pkg in $reqd ; do if ! dpkg-checkbuilddeps -d $pkg /dev/null 2> /dev/null; then - reqd="$pkg $reqd" + missing="$pkg $missing" fi done - if test ! "x$reqd" = x; then - echo "Please run 'sudo apt-get install $reqd' and try again." + if test ! "x$missing" = x; then + echo "Please run 'sudo apt-get install $missing' and try again." echo exit 1 fi From a3e3d61d5887ba1580b3ce44a7b382dac910590b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C8=98erb=C4=83nescu?= Date: Mon, 15 Nov 2010 22:22:03 +0200 Subject: [PATCH 80/85] Updated Romanian translation --- po/ro.po | 863 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 727 insertions(+), 136 deletions(-) diff --git a/po/ro.po b/po/ro.po index 79e7c307f..5bfef855d 100644 --- a/po/ro.po +++ b/po/ro.po @@ -1,20 +1,23 @@ # Romanian translation for gnome-shell. -# Copyright (C) 2009 gnome-shell's COPYRIGHT HOLDER # This file is distributed under the same license as the gnome-shell package. -# Lucian Adrian Grijincu , 2009. +# Lucian Adrian Grijincu , 2009, 2010. +# Daniel Șerbănescu , 2010. msgid "" msgstr "" "Project-Id-Version: gnome-shell master\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-10-28 22:25+0200\n" -"PO-Revision-Date: 2009-10-28 22:33+0200\n" -"Last-Translator: Lucian Adrian Grijincu \n" -"Language-Team: Romanian \n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" +"shell&component=general\n" +"POT-Creation-Date: 2010-11-15 13:50+0000\n" +"PO-Revision-Date: 2010-11-15 21:58+0300\n" +"Last-Translator: Daniel Șerbănescu \n" +"Language-Team: Romanian Gnome Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: ro\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " "20)) ? 1 : 2);;\n" +"X-Generator: Virtaal 0.6.1\n" #: ../data/gnome-shell.desktop.in.in.h:1 msgid "GNOME Shell" @@ -24,199 +27,736 @@ msgstr "GNOME Shell" msgid "Window management and application launching" msgstr "Administrare de ferestre și lansare de aplicații" -#: ../js/ui/appDisplay.js:332 -msgid "Frequent" -msgstr "Frecvent" +#: ../data/gnome-shell-clock-preferences.desktop.in.in.h:1 +msgid "Clock" +msgstr "Ceas" -#: ../js/ui/appDisplay.js:867 -msgid "Drag here to add favorites" -msgstr "Adăugați aici favorite cu mausul" +#: ../data/gnome-shell-clock-preferences.desktop.in.in.h:2 +msgid "Customize the panel clock" +msgstr "Personalizați ceasul din panou" -#: ../js/ui/appIcon.js:426 +#: ../data/org.gnome.shell.gschema.xml.in.h:1 +msgid "" +"Allows access to internal debugging and monitoring tools using the Alt-F2 " +"dialog." +msgstr "" +"Permite accesul la informațiile interne utilitarelor de depanare și " +"monitorizare folosind dialogul Alt-F2." + +#: ../data/org.gnome.shell.gschema.xml.in.h:2 +msgid "Custom format of the clock" +msgstr "Format personalizat pentru ceas" + +#: ../data/org.gnome.shell.gschema.xml.in.h:3 +msgid "Enable internal tools useful for developers and testers from Alt-F2" +msgstr "" +"Activează utilitarele interne pentru dezvoltatori și testeri din Alt-F2" + +#: ../data/org.gnome.shell.gschema.xml.in.h:4 +msgid "File extension used for storing the screencast" +msgstr "Extensia de fișier utilizată pentru stocarea înregistrărilor de ecran" + +#: ../data/org.gnome.shell.gschema.xml.in.h:5 +msgid "Framerate used for recording screencasts." +msgstr "Frecvența de cadre utilizată pentru înregistrările de ecran." + +#: ../data/org.gnome.shell.gschema.xml.in.h:6 +msgid "" +"GNOME Shell extensions have a uuid property; this key lists extensions which " +"should not be loaded." +msgstr "" +"Extensiile GNOME Shell au o proprietate uuid; această cheie listează " +"extensiile care nu ar trebui încărcate." + +#: ../data/org.gnome.shell.gschema.xml.in.h:7 +msgid "History for command (Alt-F2) dialog" +msgstr "Istoricul dialogului de comenzi (Alt-F2)" + +#: ../data/org.gnome.shell.gschema.xml.in.h:8 +msgid "Hour format" +msgstr "Format oră" + +#: ../data/org.gnome.shell.gschema.xml.in.h:9 +msgid "" +"If true and format is either \"12-hour\" or \"24-hour\", display date in the " +"clock, in addition to time." +msgstr "" +"Dacă este adevărat, și formatul este fie „12-hour” fie „24-hour”, pe lângă " +"oră, în ceas se afișează și data." + +#: ../data/org.gnome.shell.gschema.xml.in.h:10 +msgid "" +"If true and format is either \"12-hour\" or \"24-hour\", display seconds in " +"time." +msgstr "" +"Dacă este adevărat, și formatul este fie „12-hour” fie „24-hour”, pe lângă " +"oră, în ceas se afișează și secundele." + +#: ../data/org.gnome.shell.gschema.xml.in.h:11 +msgid "If true, display the ISO week date in the calendar." +msgstr "Dacă este adevărat, se afișează săptămână ISO în calendar." + +#: ../data/org.gnome.shell.gschema.xml.in.h:12 +msgid "List of desktop file IDs for favorite applications" +msgstr "Listă de identificatori de fișiere desktop pentru aplicațiile favorite" + +#: ../data/org.gnome.shell.gschema.xml.in.h:13 +msgid "Overview workspace view mode" +msgstr "Modul de vizualizare a spațiilor de lucru în prezentarea generală" + +#: ../data/org.gnome.shell.gschema.xml.in.h:14 +msgid "" +"Sets the GStreamer pipeline used to encode recordings. It follows the syntax " +"used for gst-launch. The pipeline should have an unconnected sink pad where " +"the recorded video is recorded. It will normally have a unconnected source " +"pad; output from that pad will be written into the output file. However the " +"pipeline can also take care of its own output - this might be used to send " +"the output to an icecast server via shout2send or similar. When unset or set " +"to an empty value, the default pipeline will be used. This is currently " +"'videorate ! theoraenc ! oggmux' and records to Ogg Theora." +msgstr "" +"Definește linia de asamblare GStreamer utilizată pentru a codifica " +"înregistrările. Folosiți aceeași sintaxă ca la gst-launch. Linia de " +"asamblare ar trebui să aibă o intrare neconectată unde va fi înregistrat " +"ecranul. În mod normal va avea o intrare neconectată și o ieșire care va fi " +"scrisă în fișierul de ieșire. Cu toate acestea, linia de asamblare poate să " +"aibă grijă de ieșirea proprie - aceasta ar putea fi utilizată pentru a " +"trimite ieșirea la un server icecast, shout2send sau un alt server similar. " +"Când este dezactivată, sau are o valoare vidă, se utilizează linia de " +"asamblare implicită. Aceasta este acum definită ca „videorate ! theoraenc ! " +"oggmux” și înregistrează în formatul Ogg Theora." + +#: ../data/org.gnome.shell.gschema.xml.in.h:15 +msgid "Show date in clock" +msgstr "Afișează data în ceas" + +#: ../data/org.gnome.shell.gschema.xml.in.h:16 +msgid "Show the week date in the calendar" +msgstr "Afișează săptămâna în calendar" + +#: ../data/org.gnome.shell.gschema.xml.in.h:17 +msgid "Show time with seconds" +msgstr "Afișează timpul cu secunde " + +#: ../data/org.gnome.shell.gschema.xml.in.h:18 +msgid "" +"The applications corresponding to these identifiers will be displayed in the " +"favorites area." +msgstr "" +"Aplicațiile corespunzătoare acestor identificatori vor fi afișate în zona " +"favoritelor." + +#: ../data/org.gnome.shell.gschema.xml.in.h:19 +msgid "" +"The filename for recorded screencasts will be a unique filename based on the " +"current date, and use this extension. It should be changed when recording to " +"a different container format." +msgstr "" +"Numele fișierelor înregistrărilor de ecran vor fi unice, bazate pe data " +"curentă și vor folosi această extensie. Ar trebui să fie modificată când se " +"înregistrează într-un format de container diferit." + +#: ../data/org.gnome.shell.gschema.xml.in.h:20 +msgid "" +"The framerate of the resulting screencast recordered by GNOME Shell's " +"screencast recorder in frames-per-second." +msgstr "" +"Frecvența de cadre a înregistrărilor de ecran efectuare de Înregistratorul " +"de ecran al GNOME Shell, în cadre pe secundă." + +#: ../data/org.gnome.shell.gschema.xml.in.h:21 +msgid "The gstreamer pipeline used to encode the screencast" +msgstr "" +"Linia de asamblare gstreamer folosită pentru a codifica înregistrarea de " +"ecran" + +#: ../data/org.gnome.shell.gschema.xml.in.h:22 +msgid "" +"The selected workspace view mode in the overview. Supported values are " +"\"single\" and \"grid\"." +msgstr "" +"Modul de vizualizare a spațiilor de lucru în prezentarea generală. Valorile " +"suportate sunt „single” și „grid”." + +#: ../data/org.gnome.shell.gschema.xml.in.h:23 +msgid "" +"The shell normally monitors active applications in order to present the most " +"used ones (e.g. in launchers). While this data will be kept private, you may " +"want to disable this for privacy reasons. Please note that doing so won't " +"remove already saved data." +msgstr "" +"În mod normal, shell-ul monitorizează aplicațiile active pentru a le " +"prezenta pe cele mai utilizate (de ex. în lansatoare de aplicații). Deși " +"aceste date vor fi păstrate în mod privat, s-ar putea să doriți să " +"dezactivați această funcționalitate din motive de intimitate. Dezactivarea " +"nu va șterge datele deja salvate." + +#: ../data/org.gnome.shell.gschema.xml.in.h:24 +msgid "" +"This key specifies the format used by the panel clock when the format key is " +"set to \"custom\". You can use conversion specifiers understood by strftime" +"() to obtain a specific format. See the strftime() manual for more " +"information." +msgstr "" +"Această cheie specifică formatul utilizat în ceasul de panou când cheia de " +"format are valoarea „custom”. Puteți utiliza specificatorii de conversie " +"specifici strftime() pentru a obține un anumit format. Consultați manualul " +"strftime() pentru mai multe informații." + +#: ../data/org.gnome.shell.gschema.xml.in.h:25 +msgid "" +"This key specifies the hour format used by the panel clock. Possible values " +"are \"12-hour\", \"24-hour\", \"unix\" and \"custom\". If set to \"unix\", " +"the clock will display time in seconds since Epoch, i.e. 1970-01-01. If set " +"to \"custom\", the clock will display time according to the format specified " +"in the custom_format key. Note that if set to either \"unix\" or \"custom\", " +"the show_date and show_seconds keys are ignored." +msgstr "" +"Această cheie specifică formatul orei afișate de ceasul din panou. Valorile " +"posibile sunt „12-hour”, „24-hour”, „unix” și „custom”. Dacă valoarea este " +"„unix”, ceasul va afișa timpul în secunde de la începutul Epocii Unix (1 " +"ianuarie 1970). Dacă valoarea este „custom”, ceasul va afișa timpul conform " +"formatului din cheia custom_format. Dacă valoarea este fie „unix” fie " +"„custom” se ignoră valoarea cheilor show_date și show_seconds." + +#: ../data/org.gnome.shell.gschema.xml.in.h:26 +msgid "Uuids of extensions to disable" +msgstr "Uuid-urile extensiilor de dezactivat" + +#: ../data/org.gnome.shell.gschema.xml.in.h:27 +msgid "Whether to collect stats about applications usage" +msgstr "Dacă să se colecteze statistici despre utilizarea aplicațiilor" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:1 +msgid "Clip the crosshairs at the center" +msgstr "Prinde cursoarele în centru" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:2 +msgid "Color of the crosshairs" +msgstr "Culoarea cursoarelor" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:3 +msgid "" +"Determines the length of the vertical and horizontal lines that make up the " +"crosshairs." +msgstr "" +"Determină lungimea liniilor verticale și orizontale care alcătuiesc cursorul." + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:4 +msgid "" +"Determines the position of the magnified mouse image within the magnified " +"view and how it reacts to system mouse movement. The values are - none: no " +"mouse tracking; - centered: the mouse image is displayed at the center of " +"the zoom region (which also represents the point under the system mouse) and " +"the magnified contents are scrolled as the system mouse moves; - " +"proportional: the position of the magnified mouse in the zoom region is " +"proportionally the same as the position of the system mouse on screen; - " +"push: when the magnified mouse intersects a boundary of the zoom region, the " +"contents are scrolled into view." +msgstr "" +"Determină poziția imaginii mărite a mausului în vizualizarea mărită și cum " +"reacționează la mișcarea mausului a sistemului. Valorile sunt - none: nu se " +"urmărește mausul; - centered: imaginea mausului este afișată în centrul " +"regiunii zoom (care reprezintă de asemenea punctul de sub mausul sistemului) " +"și proportional: poziția mausului mărit în regiunea zoom este proporțională " +"la fel ca poziția mausului sistemului de pe ecran; - push: când mausul mărit " +"intersectează o graniță a regiunii zoom, conținutul acesteia este derulat în " +"câmpul vizibil." + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:5 +msgid "" +"Determines the transparency of the crosshairs, from fully opaque to fully " +"transparent." +msgstr "" +"Determină transparența cursoarelor, de la complet opac la deplin " +"transparente." + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:6 +msgid "" +"Determines whether the crosshairs intersect the magnified mouse sprite, or " +"are clipped such that the ends of the horizontal and vertical lines surround " +"the mouse image." +msgstr "" +"Determină dacă cursoarele intersectează umbra mausului mărit, sau sunt " +"prinse astfel încât capetele liniilor orizontale și verticale înconjoară " +"imaginea mausului." + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:7 +msgid "Enable lens mode" +msgstr "Activează modul lentile" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:8 +msgid "" +"Enables/disables display of crosshairs centered on the magnified mouse " +"sprite." +msgstr "" +"Activează/dezactivează afișarea cursoarelor centrate pe umbra mausului mărit." + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:9 +msgid "" +"For centered mouse tracking, when the system pointer is at or near the edge " +"of the screen, the magnified contents continue to scroll such that the " +"screen edge moves into the magnified view." +msgstr "" +"Pentru urmărirea centrată a mausului, când indicatorul sistemului este pe " +"sau lângă marginea ecranului, conținutul mărit continuă să se deruleze " +"astfel încât marginile ecranului se mută în modul mărit." + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:10 +msgid "Length of the crosshairs" +msgstr "Lungimea cursoarelor" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:11 +msgid "Magnification factor" +msgstr "Factorul de mărire" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:12 +msgid "Mouse Tracking Mode" +msgstr "Mod Urmărire maus" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:13 +msgid "Opacity of the crosshairs" +msgstr "Opacitatea cursoarelor" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:14 +msgid "Screen position" +msgstr "Poziția ecranului" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:15 +msgid "Scroll magnified contents beyond the edges of the desktop" +msgstr "Derulează conținutul mărit în afara marginilor ecranului" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:16 +msgid "Show or hide crosshairs" +msgstr "Arată sau ascunde cursoarele" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:17 +msgid "Show or hide the magnifier" +msgstr "Arată sau ascunde lupa" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:18 +msgid "Show or hide the magnifier and all of its zoom regions." +msgstr "Arată sau ascunde lupa și toate regiunile ei de zoom." + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:19 +msgid "" +"The color of the the vertical and horizontal lines that make up the " +"crosshairs." +msgstr "Culoarea liniilor verticale și orizontale ce compun cursorul." + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:20 +msgid "" +"The magnified view either fills the entire screen, or occupies the top-half, " +"bottom-half, left-half, or right-half of the screen." +msgstr "" +"Vizualizarea mărită fie se aplică întregului ecran, fie ocupă jumătatea de " +"sus, jumătatea de jos, jumătatea din stânga, sau jumătatea din dreapta a " +"ecranului." + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:21 +msgid "" +"The power of the magnification. A value of 1.0 means no magnification. A " +"value of 2.0 doubles the size." +msgstr "" +"Putere de mărire. O valoare de 1.0 nu înseamnă mărire. O valoare de 2.0 " +"dublează mărimea." + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:22 +msgid "Thickness of the crosshairs" +msgstr "Grosimea cursoarelor" + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:23 +msgid "" +"Whether the magnified view should be centered over the location of the " +"system mouse and move with it." +msgstr "" +"Dacă vizualizarea mărită ar trebui centrată asupra locației mausului " +"sistemului și dacă ar trebui să se miște odată cu el." + +#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:24 +msgid "Width of the vertical and horizontal lines that make up the crosshairs." +msgstr "Lățimea liniilor verticale și orizontale ce compun cursoarele." + +#: ../data/clock-preferences.ui.h:1 +msgid "Clock Format" +msgstr "Format ceas" + +#: ../data/clock-preferences.ui.h:2 +msgid "Clock Preferences" +msgstr "Preferințe ceas" + +#: ../data/clock-preferences.ui.h:3 +msgid "Panel Display" +msgstr "Afișajul panoului" + +#: ../data/clock-preferences.ui.h:4 +msgid "Show seco_nds" +msgstr "Afișează secu_nde" + +#: ../data/clock-preferences.ui.h:5 +msgid "Show the _date" +msgstr "Afișează _data" + +#: ../data/clock-preferences.ui.h:6 +msgid "_12 hour format" +msgstr "Format cu _12 ore" + +#: ../data/clock-preferences.ui.h:7 +msgid "_24 hour format" +msgstr "Format cu _24 de ore" + +#. **** Applications **** +#: ../js/ui/appDisplay.js:316 ../js/ui/dash.js:778 +msgid "APPLICATIONS" +msgstr "APPLICAȚII" + +#: ../js/ui/appDisplay.js:348 +msgid "PREFERENCES" +msgstr "PREFERINȚE" + +#: ../js/ui/appDisplay.js:647 msgid "New Window" msgstr "Fereastră nouă" -#: ../js/ui/appIcon.js:430 +#: ../js/ui/appDisplay.js:651 msgid "Remove from Favorites" -msgstr "Șterge din favorite" +msgstr "Elimină de la favorite" -#: ../js/ui/appIcon.js:431 +#: ../js/ui/appDisplay.js:652 msgid "Add to Favorites" msgstr "Adaugă la favorite" -#: ../js/ui/dash.js:283 -msgid "Find..." -msgstr "Caută..." +#: ../js/ui/appDisplay.js:829 +msgid "Drag here to add favorites" +msgstr "Trageți aici pentru a adăuga favorite" -#: ../js/ui/dash.js:400 -msgid "More" -msgstr "Mai multe" +#: ../js/ui/appFavorites.js:88 +#, c-format +msgid "%s has been added to your favorites." +msgstr "%s a fost adăugat la favorite." -#: ../js/ui/dash.js:543 -msgid "(see all)" -msgstr "(arată tot)" +#: ../js/ui/appFavorites.js:107 +#, c-format +msgid "%s has been removed from your favorites." +msgstr "%s a fost eliminat de la favorite." -#. **** Applications **** -#: ../js/ui/dash.js:725 ../js/ui/dash.js:787 -msgid "APPLICATIONS" -msgstr "APPLICAȚII" +#: ../js/ui/dash.js:142 +msgid "Find" +msgstr "Caută" + +#: ../js/ui/dash.js:473 +msgid "Searching..." +msgstr "Se caută..." + +#: ../js/ui/dash.js:487 +msgid "No matching results." +msgstr "Niciun rezultat care să se potrivească." #. **** Places **** #. Translators: This is in the sense of locations for documents, #. network locations, etc. -#: ../js/ui/dash.js:745 -msgid "PLACES" -msgstr "LOCAȚII" +#: ../js/ui/dash.js:797 ../js/ui/placeDisplay.js:558 +msgid "PLACES & DEVICES" +msgstr "LOCAȚII & DISPOZITIVE" #. **** Documents **** -#: ../js/ui/dash.js:752 ../js/ui/dash.js:797 -msgid "RECENT DOCUMENTS" -msgstr "DOCUMENTE RECENTE" +#: ../js/ui/dash.js:804 ../js/ui/docDisplay.js:494 +msgid "RECENT ITEMS" +msgstr "ELEMENTE RECENTE" -#. **** Search Results **** -#: ../js/ui/dash.js:777 ../js/ui/dash.js:961 -msgid "SEARCH RESULTS" -msgstr "REZULTATELE CĂUTĂRII" +#: ../js/ui/lookingGlass.js:552 +msgid "No extensions installed" +msgstr "Nicio extensie instalată" -#: ../js/ui/dash.js:792 -msgid "PREFERENCES" -msgstr "PREFERINȚE" +#: ../js/ui/lookingGlass.js:589 +msgid "Enabled" +msgstr "Activat" -#. Button on the left side of the panel. -#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview". -#: ../js/ui/panel.js:274 -msgid "Activities" -msgstr "Activități" +#. translators: +#. * The device has been disabled +#: ../js/ui/lookingGlass.js:591 ../src/gvc/gvc-mixer-control.c:1087 +msgid "Disabled" +msgstr "Dezactivat" -#. Translators: This is a time format. -#: ../js/ui/panel.js:491 +#: ../js/ui/lookingGlass.js:593 +msgid "Error" +msgstr "Eroare" + +#: ../js/ui/lookingGlass.js:595 +msgid "Out of date" +msgstr "Învechit" + +#: ../js/ui/lookingGlass.js:620 +msgid "View Source" +msgstr "Vezi sursa" + +#: ../js/ui/lookingGlass.js:626 +msgid "Web Page" +msgstr "Pagină web" + +#: ../js/ui/overview.js:160 +msgid "Undo" +msgstr "Anulează" + +#. TODO - _quit() doesn't really work on apps in state STARTING yet +#: ../js/ui/panel.js:469 +#, c-format +msgid "Quit %s" +msgstr "Închide %s" + +#: ../js/ui/panel.js:494 +msgid "Preferences" +msgstr "Preferințe" + +#. Translators: This is the time format with date used +#. in 24-hour mode. +#: ../js/ui/panel.js:580 +msgid "%a %b %e, %R:%S" +msgstr "%a %e %b, %R:%S" + +#: ../js/ui/panel.js:581 +msgid "%a %b %e, %R" +msgstr "%a %e %b, %R" + +#. Translators: This is the time format without date used +#. in 24-hour mode. +#: ../js/ui/panel.js:585 +msgid "%a %R:%S" +msgstr "%a %R:%S" + +#: ../js/ui/panel.js:586 +msgid "%a %R" +msgstr "%a %R" + +#. Translators: This is a time format with date used +#. for AM/PM. +#: ../js/ui/panel.js:593 +msgid "%a %b %e, %l:%M:%S %p" +msgstr "%a %e %b, %l:%M:%S %p" + +#: ../js/ui/panel.js:594 +msgid "%a %b %e, %l:%M %p" +msgstr "%a %e %b, %l:%M %p" + +#. Translators: This is a time format without date used +#. for AM/PM. +#: ../js/ui/panel.js:598 +msgid "%a %l:%M:%S %p" +msgstr "%a %l:%M:%S %p" + +#: ../js/ui/panel.js:599 msgid "%a %l:%M %p" msgstr "%a %l:%M %p" -#: ../js/ui/places.js:178 +#. Button on the left side of the panel. +#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview". +#: ../js/ui/panel.js:744 +msgid "Activities" +msgstr "Activități" + +#: ../js/ui/placeDisplay.js:111 +#, c-format +msgid "Failed to unmount '%s'" +msgstr "Nu s-a putut demonta „%s”" + +#: ../js/ui/placeDisplay.js:114 +msgid "Retry" +msgstr "Reîncearcă" + +#: ../js/ui/placeDisplay.js:159 msgid "Connect to..." msgstr "Conectare la..." -#: ../js/ui/runDialog.js:96 +#. Translators: this MUST be either "toggle-switch-us" +#. (for toggle switches containing the English words +#. "ON" and "OFF") or "toggle-switch-intl" (for toggle +#. switches containing "◯" and "|"). Other values will +#. simply result in invisible toggle switches. +#: ../js/ui/popupMenu.js:33 +msgid "toggle-switch-us" +msgstr "toggle-switch-us" + +#: ../js/ui/runDialog.js:233 msgid "Please enter a command:" msgstr "Introduceți o comandă:" -#: ../js/ui/runDialog.js:173 +#: ../js/ui/runDialog.js:378 #, c-format msgid "Execution of '%s' failed:" msgstr "Execuția comenzii „%s” a eșuat:" -#. Translators: This is a time format. -#: ../js/ui/widget.js:163 -msgid "%H:%M" -msgstr "%H:%M" +#: ../js/ui/statusMenu.js:101 +msgid "Available" +msgstr "Disponibil" -#: ../js/ui/widget.js:317 -msgid "Applications" -msgstr "Aplicații" +#: ../js/ui/statusMenu.js:106 +msgid "Busy" +msgstr "Ocupat" -#: ../js/ui/widget.js:339 -msgid "Recent Documents" -msgstr "Documente recente" +#: ../js/ui/statusMenu.js:114 +msgid "My Account..." +msgstr "Contul meu..." -#: ../src/shell-global.c:821 +#: ../js/ui/statusMenu.js:118 +msgid "System Settings..." +msgstr "Configurări sistem..." + +#: ../js/ui/statusMenu.js:125 +msgid "Lock Screen" +msgstr "Blochează ecranul" + +#: ../js/ui/statusMenu.js:129 +msgid "Switch User" +msgstr "Schimbă utilizatorul" + +#: ../js/ui/statusMenu.js:134 +msgid "Log Out..." +msgstr "Ieși din sesiune..." + +#: ../js/ui/statusMenu.js:141 +msgid "Suspend" +msgstr "Suspendă" + +#: ../js/ui/statusMenu.js:145 +msgid "Shut Down..." +msgstr "Oprește..." + +#: ../js/ui/status/accessibility.js:88 +msgid "Screen Reader" +msgstr "Cititor de ecran" + +#: ../js/ui/status/accessibility.js:91 +msgid "Screen Keyboard" +msgstr "Tastatură pe ecran" + +#: ../js/ui/status/accessibility.js:94 +msgid "Visual Alerts" +msgstr "Alerte vizuale" + +#: ../js/ui/status/accessibility.js:97 +msgid "Sticky Keys" +msgstr "Taste lipicioase" + +#: ../js/ui/status/accessibility.js:100 +msgid "Slow Keys" +msgstr "Taste încete" + +#: ../js/ui/status/accessibility.js:103 +msgid "Bounce Keys" +msgstr "Taste fără repetiție" + +#: ../js/ui/status/accessibility.js:106 +msgid "Mouse Keys" +msgstr "Taste maus" + +#: ../js/ui/status/accessibility.js:110 +msgid "Universal Access Settings" +msgstr "Configurări acces universal" + +#: ../js/ui/status/accessibility.js:163 +msgid "High Contrast" +msgstr "Contrast puternic" + +#: ../js/ui/status/accessibility.js:205 +msgid "Large Text" +msgstr "Text mare" + +#: ../js/ui/status/accessibility.js:224 +msgid "Zoom" +msgstr "Zoom" + +#: ../js/ui/windowAttentionHandler.js:43 +#, c-format +msgid "%s has finished starting" +msgstr "Pornirea %s s-a finalizat" + +#: ../js/ui/windowAttentionHandler.js:45 +#, c-format +msgid "'%s' is ready" +msgstr "„%s” este gata" + +#: ../js/ui/workspacesView.js:229 +msgid "" +"Can't add a new workspace because maximum workspaces limit has been reached." +msgstr "" +"Nu se poate adăuga un nou spațiu de lucru pentru că s-a atins limita maximă " +"a numărului de spații." + +#: ../js/ui/workspacesView.js:246 +msgid "Can't remove the first workspace." +msgstr "Nu se poate elimina primul spațiu de lucru." + +#. translators: +#. * The number of sound outputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1094 +#, c-format +msgid "%u Output" +msgid_plural "%u Outputs" +msgstr[0] "o ieșire" +msgstr[1] "%u ieșiri" +msgstr[2] "%u de ieșiri" + +#. translators: +#. * The number of sound inputs on a particular device +#: ../src/gvc/gvc-mixer-control.c:1104 +#, c-format +msgid "%u Input" +msgid_plural "%u Inputs" +msgstr[0] "o intrare" +msgstr[1] "%u intrări" +msgstr[2] "%u de intrări" + +#: ../src/gvc/gvc-mixer-control.c:1402 +msgid "System Sounds" +msgstr "Sunetele sistemului" + +#: ../src/shell-global.c:1219 msgid "Less than a minute ago" -msgstr "În ultimul minut" +msgstr "Cu mai puțin de un minut în urmă" -#: ../src/shell-global.c:824 +#: ../src/shell-global.c:1223 #, c-format msgid "%d minute ago" msgid_plural "%d minutes ago" -msgstr[0] "acum un minut" -msgstr[1] "acum %d minute" -msgstr[2] "acum %d de minute" +msgstr[0] "Acum un minut" +msgstr[1] "Acum %d minute" +msgstr[2] "Acum %d de minute" -#: ../src/shell-global.c:827 +#: ../src/shell-global.c:1228 #, c-format msgid "%d hour ago" msgid_plural "%d hours ago" -msgstr[0] "acum o oră" -msgstr[1] "acum %d ore" -msgstr[2] "acum %d de ore" +msgstr[0] "Acum o oră" +msgstr[1] "Acum %d ore" +msgstr[2] "Acum %d de ore" -#: ../src/shell-global.c:830 +#: ../src/shell-global.c:1233 #, c-format msgid "%d day ago" msgid_plural "%d days ago" -msgstr[0] "acum o zi" -msgstr[1] "acum %d zile" -msgstr[2] "acum %d de zile" +msgstr[0] "Acum o zi" +msgstr[1] "Acum %d zile" +msgstr[2] "Acum %d de zile" -#: ../src/shell-global.c:833 +#: ../src/shell-global.c:1238 #, c-format msgid "%d week ago" msgid_plural "%d weeks ago" -msgstr[0] "acum o săptămână" -msgstr[1] "acum %d săptămâni" -msgstr[2] "acum %d de săptămâni" +msgstr[0] "Acum o săptămână" +msgstr[1] "Acum %d săptămâni" +msgstr[2] "Acum %d de săptămâni" -#: ../src/shell-status-menu.c:156 -msgid "Unknown" -msgstr "Necunoscut" - -#: ../src/shell-status-menu.c:212 -#, c-format -msgid "Can't lock screen: %s" -msgstr "Nu s-a putut bloca ecranul: %s" - -#: ../src/shell-status-menu.c:227 -#, c-format -msgid "Can't temporarily set screensaver to blank screen: %s" -msgstr "Nu s-a putut folosi temporar un ecran gol pentru economizorul de " -"ecran: %s" - -#: ../src/shell-status-menu.c:351 -#, c-format -msgid "Can't logout: %s" -msgstr "Nu se poate ieși din sesiune: %s" - -#: ../src/shell-status-menu.c:492 -msgid "Account Information..." -msgstr "Informații despre cont..." - -#: ../src/shell-status-menu.c:502 -msgid "Sidebar" -msgstr "Bară laterală" - -#: ../src/shell-status-menu.c:510 -msgid "System Preferences..." -msgstr "Preferințe de sistem..." - -#: ../src/shell-status-menu.c:525 -msgid "Lock Screen" -msgstr "Blocare ecran" - -#: ../src/shell-status-menu.c:535 -msgid "Switch User" -msgstr "Alt utilizator" - -#. Only show switch user if there are other users -#. Log Out -#: ../src/shell-status-menu.c:546 -msgid "Log Out..." -msgstr "Ieșire..." - -#. Shut down -#: ../src/shell-status-menu.c:557 -msgid "Shut Down..." -msgstr "Oprire..." - -#: ../src/shell-uri-util.c:87 +#: ../src/shell-uri-util.c:89 msgid "Home Folder" msgstr "Dosar personal" #. Translators: this is the same string as the one found in #. * nautilus -#: ../src/shell-uri-util.c:102 +#: ../src/shell-uri-util.c:104 msgid "File System" msgstr "Sistem de fișiere" -#: ../src/shell-uri-util.c:248 +#: ../src/shell-uri-util.c:250 msgid "Search" msgstr "Caută" @@ -225,8 +765,59 @@ msgstr "Caută" #. * example, "Trash: some-directory". It means that the #. * directory called "some-directory" is in the trash. #. -#: ../src/shell-uri-util.c:298 +#: ../src/shell-uri-util.c:300 #, c-format msgid "%1$s: %2$s" msgstr "%1$s: %2$s" +#~ msgid "ON" +#~ msgstr "Pornit" + +#~ msgid "OFF" +#~ msgstr "Oprit" + +#~ msgid "Invisible" +#~ msgstr "Invizibil" + +#~ msgid "Account Information..." +#~ msgstr "Informații despre cont..." + +#~ msgid "Frequent" +#~ msgstr "Frecvent" + +#~ msgid "More" +#~ msgstr "Mai multe" + +#~ msgid "(see all)" +#~ msgstr "(arată tot)" + +#~ msgid "PLACES" +#~ msgstr "LOCAȚII" + +#~ msgid "SEARCH RESULTS" +#~ msgstr "REZULTATELE CĂUTĂRII" + +#~ msgid "%H:%M" +#~ msgstr "%H:%M" + +#~ msgid "Applications" +#~ msgstr "Aplicații" + +#~ msgid "Recent Documents" +#~ msgstr "Documente recente" + +#~ msgid "Unknown" +#~ msgstr "Necunoscut" + +#~ msgid "Can't lock screen: %s" +#~ msgstr "Nu s-a putut bloca ecranul: %s" + +#~ msgid "Can't temporarily set screensaver to blank screen: %s" +#~ msgstr "" +#~ "Nu s-a putut folosi temporar un ecran gol pentru economizorul de ecran: %s" + +#~ msgid "Can't logout: %s" +#~ msgstr "Nu se poate ieși din sesiune: %s" + +#~ msgid "Sidebar" +#~ msgstr "Bară laterală" From 1dc559740fa173daa782f8fe6ccec82a4f899c5e Mon Sep 17 00:00:00 2001 From: Lucian Adrian Grijincu Date: Mon, 15 Nov 2010 22:22:14 +0200 Subject: [PATCH 81/85] Updated Romanian translation --- po/ro.po | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/po/ro.po b/po/ro.po index 5bfef855d..2408ad862 100644 --- a/po/ro.po +++ b/po/ro.po @@ -8,13 +8,13 @@ msgstr "" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" "shell&component=general\n" "POT-Creation-Date: 2010-11-15 13:50+0000\n" -"PO-Revision-Date: 2010-11-15 21:58+0300\n" -"Last-Translator: Daniel Șerbănescu \n" +"PO-Revision-Date: 2010-11-15 22:20+0300\n" +"Last-Translator: Lucian Adrian Grijincu \n" "Language-Team: Romanian Gnome Team \n" +"Language: ro\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ro\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " "20)) ? 1 : 2);;\n" "X-Generator: Virtaal 0.6.1\n" @@ -229,18 +229,19 @@ msgstr "Dacă să se colecteze statistici despre utilizarea aplicațiilor" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:1 msgid "Clip the crosshairs at the center" -msgstr "Prinde cursoarele în centru" +msgstr "Prinde reticulele în centru" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:2 msgid "Color of the crosshairs" -msgstr "Culoarea cursoarelor" +msgstr "Culoarea reticulelor" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:3 msgid "" "Determines the length of the vertical and horizontal lines that make up the " "crosshairs." msgstr "" -"Determină lungimea liniilor verticale și orizontale care alcătuiesc cursorul." +"Determină lungimea liniilor verticale și orizontale care alcătuiesc " +"reticulele." #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:4 msgid "" @@ -268,7 +269,7 @@ msgid "" "Determines the transparency of the crosshairs, from fully opaque to fully " "transparent." msgstr "" -"Determină transparența cursoarelor, de la complet opac la deplin " +"Determină transparența reticulelor, de la complet opac la deplin " "transparente." #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:6 @@ -277,7 +278,7 @@ msgid "" "are clipped such that the ends of the horizontal and vertical lines surround " "the mouse image." msgstr "" -"Determină dacă cursoarele intersectează umbra mausului mărit, sau sunt " +"Determină dacă reticulele intersectează umbra mausului mărit, sau sunt " "prinse astfel încât capetele liniilor orizontale și verticale înconjoară " "imaginea mausului." @@ -290,7 +291,8 @@ msgid "" "Enables/disables display of crosshairs centered on the magnified mouse " "sprite." msgstr "" -"Activează/dezactivează afișarea cursoarelor centrate pe umbra mausului mărit." +"Activează/dezactivează afișarea reticulelor centrate pe umbra mausului " +"mărit." #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:9 msgid "" @@ -304,7 +306,7 @@ msgstr "" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:10 msgid "Length of the crosshairs" -msgstr "Lungimea cursoarelor" +msgstr "Lungimea reticulelor" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:11 msgid "Magnification factor" @@ -316,7 +318,7 @@ msgstr "Mod Urmărire maus" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:13 msgid "Opacity of the crosshairs" -msgstr "Opacitatea cursoarelor" +msgstr "Opacitatea reticulelor" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:14 msgid "Screen position" @@ -328,7 +330,7 @@ msgstr "Derulează conținutul mărit în afara marginilor ecranului" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:16 msgid "Show or hide crosshairs" -msgstr "Arată sau ascunde cursoarele" +msgstr "Arată sau ascunde reticulele" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:17 msgid "Show or hide the magnifier" @@ -342,7 +344,7 @@ msgstr "Arată sau ascunde lupa și toate regiunile ei de zoom." msgid "" "The color of the the vertical and horizontal lines that make up the " "crosshairs." -msgstr "Culoarea liniilor verticale și orizontale ce compun cursorul." +msgstr "Culoarea liniilor verticale și orizontale ce compun reticul." #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:20 msgid "" @@ -363,7 +365,7 @@ msgstr "" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:22 msgid "Thickness of the crosshairs" -msgstr "Grosimea cursoarelor" +msgstr "Grosimea reticulelor" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:23 msgid "" @@ -375,7 +377,7 @@ msgstr "" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:24 msgid "Width of the vertical and horizontal lines that make up the crosshairs." -msgstr "Lățimea liniilor verticale și orizontale ce compun cursoarele." +msgstr "Lățimea liniilor verticale și orizontale ce compun reticulele." #: ../data/clock-preferences.ui.h:1 msgid "Clock Format" From d67aa39bb124b65af5507a10c70fe57a8176bf45 Mon Sep 17 00:00:00 2001 From: Lucian Adrian Grijincu Date: Mon, 15 Nov 2010 23:36:41 +0200 Subject: [PATCH 82/85] Updated Romanian translation --- po/ro.po | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/po/ro.po b/po/ro.po index 2408ad862..d9f88d600 100644 --- a/po/ro.po +++ b/po/ro.po @@ -8,7 +8,7 @@ msgstr "" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" "shell&component=general\n" "POT-Creation-Date: 2010-11-15 13:50+0000\n" -"PO-Revision-Date: 2010-11-15 22:20+0300\n" +"PO-Revision-Date: 2010-11-15 22:34+0300\n" "Last-Translator: Lucian Adrian Grijincu \n" "Language-Team: Romanian Gnome Team \n" "Language: ro\n" @@ -49,8 +49,7 @@ msgstr "Format personalizat pentru ceas" #: ../data/org.gnome.shell.gschema.xml.in.h:3 msgid "Enable internal tools useful for developers and testers from Alt-F2" -msgstr "" -"Activează utilitarele interne pentru dezvoltatori și testeri din Alt-F2" +msgstr "Activează utilitarele interne pentru dezvoltatori și testeri din Alt-F2" #: ../data/org.gnome.shell.gschema.xml.in.h:4 msgid "File extension used for storing the screencast" @@ -94,7 +93,7 @@ msgstr "" #: ../data/org.gnome.shell.gschema.xml.in.h:11 msgid "If true, display the ISO week date in the calendar." -msgstr "Dacă este adevărat, se afișează săptămână ISO în calendar." +msgstr "Dacă este adevărat, se afișează săptămâna ISO în calendar." #: ../data/org.gnome.shell.gschema.xml.in.h:12 msgid "List of desktop file IDs for favorite applications" @@ -152,7 +151,7 @@ msgid "" "current date, and use this extension. It should be changed when recording to " "a different container format." msgstr "" -"Numele fișierelor înregistrărilor de ecran vor fi unice, bazate pe data " +"Numele de fișier ale înregistrărilor de ecran vor fi unice, bazate pe data " "curentă și vor folosi această extensie. Ar trebui să fie modificată când se " "înregistrează într-un format de container diferit." @@ -260,9 +259,9 @@ msgstr "" "urmărește mausul; - centered: imaginea mausului este afișată în centrul " "regiunii zoom (care reprezintă de asemenea punctul de sub mausul sistemului) " "și proportional: poziția mausului mărit în regiunea zoom este proporțională " -"la fel ca poziția mausului sistemului de pe ecran; - push: când mausul mărit " -"intersectează o graniță a regiunii zoom, conținutul acesteia este derulat în " -"câmpul vizibil." +"la fel ca poziția mausului sistemului de pe ecran; - push: când mausul " +"mărit intersectează o graniță a regiunii zoom, conținutul acesteia este " +"derulat în câmpul vizibil." #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:5 msgid "" @@ -284,7 +283,7 @@ msgstr "" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:7 msgid "Enable lens mode" -msgstr "Activează modul lentile" +msgstr "Activează modul cu lupă" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:8 msgid "" @@ -314,7 +313,7 @@ msgstr "Factorul de mărire" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:12 msgid "Mouse Tracking Mode" -msgstr "Mod Urmărire maus" +msgstr "Mod urmărire maus" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:13 msgid "Opacity of the crosshairs" @@ -360,8 +359,8 @@ msgid "" "The power of the magnification. A value of 1.0 means no magnification. A " "value of 2.0 doubles the size." msgstr "" -"Putere de mărire. O valoare de 1.0 nu înseamnă mărire. O valoare de 2.0 " -"dublează mărimea." +"Factor de mărire. Valoarea 1.0 înseamnă afișare fără mărire sau " +"micșorare. Valoarea 2.0 dublează mărimea." #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:22 msgid "Thickness of the crosshairs" @@ -389,7 +388,7 @@ msgstr "Preferințe ceas" #: ../data/clock-preferences.ui.h:3 msgid "Panel Display" -msgstr "Afișajul panoului" +msgstr "Afișaj panou" #: ../data/clock-preferences.ui.h:4 msgid "Show seco_nds" From e90504953f10c80279d9d0ee5ad4473485aae318 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 15 Nov 2010 18:42:19 -0500 Subject: [PATCH 83/85] gnome-shell: When creating an extension, print where we created it This makes it easier to find. --- src/gnome-shell.in | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gnome-shell.in b/src/gnome-shell.in index b523bde75..c855c0180 100755 --- a/src/gnome-shell.in +++ b/src/gnome-shell.in @@ -717,6 +717,7 @@ function main() { ''') f.close() + print "Created extension in %r" % (extension_path, ) subprocess.Popen(['gnome-open', extensionjs_path]) sys.exit(0) From 8734a59cd7d930019b4187399646d97bce57465a Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Fri, 12 Nov 2010 19:15:09 -0500 Subject: [PATCH 84/85] Handle icon theme changes Connect to the "changed" signal on the default icon theme, and when it triggers: - Evict all cached looked up icons from the StTextureCache - Fake a style change on all StThemeContext; this will result in StIcon looking up icons again. https://bugzilla.gnome.org/show_bug.cgi?id=633866 --- src/st/st-texture-cache.c | 64 ++++++++++++++++++++++++++++++++++++++- src/st/st-theme-context.c | 24 +++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c index cdea84811..cd84bdb10 100644 --- a/src/st/st-texture-cache.c +++ b/src/st/st-texture-cache.c @@ -36,6 +36,8 @@ struct _StTextureCachePrivate { + GtkIconTheme *icon_theme; + /* Things that were loaded with a cache policy != NONE */ GHashTable *keyed_cache; /* char * -> CoglTexture* */ /* Presently this is used to de-duplicate requests for GIcons, @@ -49,6 +51,14 @@ struct _StTextureCachePrivate static void st_texture_cache_dispose (GObject *object); static void st_texture_cache_finalize (GObject *object); +enum +{ + ICON_THEME_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0, }; G_DEFINE_TYPE(StTextureCache, st_texture_cache, G_TYPE_OBJECT); /* We want to preserve the aspect ratio by default, also the default @@ -78,12 +88,56 @@ st_texture_cache_class_init (StTextureCacheClass *klass) gobject_class->dispose = st_texture_cache_dispose; gobject_class->finalize = st_texture_cache_finalize; + + signals[ICON_THEME_CHANGED] = + g_signal_new ("icon-theme-changed", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + 0, /* no default handler slot */ + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); +} + +/* Evicts all cached textures for named icons */ +static void +st_texture_cache_evict_icons (StTextureCache *cache) +{ + GHashTableIter iter; + gpointer key; + gpointer value; + + g_hash_table_iter_init (&iter, cache->priv->keyed_cache); + while (g_hash_table_iter_next (&iter, &key, &value)) + { + const char *cache_key = key; + + /* This is too conservative - it takes out all cached textures + * for GIcons even when they aren't named icons, but it's not + * worth the complexity of parsing the key and calling + * g_icon_new_for_string(); icon theme changes aren't normal */ + if (g_str_has_prefix (cache_key, "gicon:")) + g_hash_table_iter_remove (&iter); + } +} + +static void +on_icon_theme_changed (GtkIconTheme *icon_theme, + StTextureCache *cache) +{ + st_texture_cache_evict_icons (cache); + g_signal_emit (cache, signals[ICON_THEME_CHANGED], 0); } static void st_texture_cache_init (StTextureCache *self) { self->priv = g_new0 (StTextureCachePrivate, 1); + + self->priv->icon_theme = gtk_icon_theme_get_default (); + g_signal_connect (self->priv->icon_theme, "changed", + G_CALLBACK (on_icon_theme_changed), self); + self->priv->keyed_cache = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, cogl_handle_unref); self->priv->outstanding_requests = g_hash_table_new_full (g_str_hash, g_str_equal, @@ -96,6 +150,14 @@ st_texture_cache_dispose (GObject *object) { StTextureCache *self = (StTextureCache*)object; + if (self->priv->icon_theme) + { + g_signal_handlers_disconnect_by_func (self->priv->icon_theme, + (gpointer) on_icon_theme_changed, + self); + self->priv->icon_theme = NULL; + } + if (self->priv->keyed_cache) g_hash_table_destroy (self->priv->keyed_cache); self->priv->keyed_cache = NULL; @@ -1023,7 +1085,7 @@ load_gicon_with_colors (StTextureCache *cache, } /* Do theme lookups in the main thread to avoid thread-unsafety */ - theme = gtk_icon_theme_get_default (); + theme = cache->priv->icon_theme; info = gtk_icon_theme_lookup_by_gicon (theme, icon, size, GTK_ICON_LOOKUP_USE_BUILTIN); if (info != NULL) diff --git a/src/st/st-theme-context.c b/src/st/st-theme-context.c index 378db306e..80a00e5d0 100644 --- a/src/st/st-theme-context.c +++ b/src/st/st-theme-context.c @@ -21,6 +21,7 @@ #include +#include "st-texture-cache.h" #include "st-theme.h" #include "st-theme-context.h" @@ -51,11 +52,18 @@ static guint signals[LAST_SIGNAL] = { 0, }; G_DEFINE_TYPE (StThemeContext, st_theme_context, G_TYPE_OBJECT) +static void on_icon_theme_changed (StTextureCache *cache, + StThemeContext *context); + static void st_theme_context_finalize (GObject *object) { StThemeContext *context = ST_THEME_CONTEXT (object); + g_signal_handlers_disconnect_by_func (st_texture_cache_get_default (), + (gpointer) on_icon_theme_changed, + context); + if (context->root_node) g_object_unref (context->root_node); if (context->theme) @@ -88,6 +96,11 @@ st_theme_context_init (StThemeContext *context) { context->resolution = DEFAULT_RESOLUTION; context->font = pango_font_description_from_string (DEFAULT_FONT); + + g_signal_connect (st_texture_cache_get_default (), + "icon-theme-changed", + G_CALLBACK (on_icon_theme_changed), + context); } /** @@ -129,6 +142,17 @@ st_theme_context_changed (StThemeContext *context) g_object_unref (old_root); } +static void +on_icon_theme_changed (StTextureCache *cache, + StThemeContext *context) +{ + /* Note that an icon theme change isn't really a change of the StThemeContext; + * the style information has changed. But since the style factors into the + * icon_name => icon lookup, faking a theme context change is a good way + * to force users such as StIcon to look up icons again */ + st_theme_context_changed (context); +} + /** * st_theme_context_get_for_stage: * @stage: a #ClutterStage From b8a5d3fd9b6be48c774d49a76db276a8e8ef7d90 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 15 Nov 2010 10:29:45 -0500 Subject: [PATCH 85/85] Handle new name for gnome-volume-control-applet gnome-volume-control-applet was renamed to gnome-sound-applet when moved to the control-center module, so we need to check for both names when identifying the legacy status icon. --- js/ui/statusIconDispatcher.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/ui/statusIconDispatcher.js b/js/ui/statusIconDispatcher.js index 8c796acd6..474cf54d3 100644 --- a/js/ui/statusIconDispatcher.js +++ b/js/ui/statusIconDispatcher.js @@ -9,7 +9,9 @@ const NotificationDaemon = imports.ui.notificationDaemon; const STANDARD_TRAY_ICON_IMPLEMENTATIONS = { 'bluetooth-applet': 'bluetooth', - 'gnome-volume-control-applet': 'volume', + 'gnome-volume-control-applet': 'volume', // renamed to gnome-sound-applet + // when moved to control center + 'gnome-sound-applet': 'volume', 'nm-applet': 'network', 'gnome-power-manager': 'battery', 'keyboard': 'keyboard',