Merge branch 'master' into datetime

Conflicts:
	configure.ac
This commit is contained in:
David Zeuthen 2010-10-26 11:48:34 -04:00
commit 3d1063dacb
42 changed files with 1021 additions and 571 deletions

View File

@ -70,7 +70,7 @@ PKG_CHECK_MODULES(MUTTER_PLUGIN, gio-2.0 >= $GIO_MIN_VERSION
gio-unix-2.0 dbus-glib-1 gio-unix-2.0 dbus-glib-1
gtk+-3.0 >= $GTK_MIN_VERSION gtk+-3.0 >= $GTK_MIN_VERSION
mutter-plugins >= $MUTTER_MIN_VERSION mutter-plugins >= $MUTTER_MIN_VERSION
gjs-gi-1.0 >= $GJS_MIN_VERSION gjs-internals-1.0 >= $GJS_MIN_VERSION
libical >= $LIBICAL_MIN_VERSION libical >= $LIBICAL_MIN_VERSION
libgnome-menu $recorder_modules gconf-2.0 libgnome-menu $recorder_modules gconf-2.0
gdk-x11-3.0 gdk-x11-3.0

View File

@ -5,6 +5,7 @@
<Menuname>Tools</Menuname> <Menuname>Tools</Menuname>
</DefaultLayout> </DefaultLayout>
<Name>Applications</Name> <Name>Applications</Name>
<AppDir>/usr/local/share/applications</AppDir>
<DefaultAppDirs/> <DefaultAppDirs/>
<Menu> <Menu>
<Name>Games</Name> <Name>Games</Name>

View File

@ -121,11 +121,12 @@ StTooltip {
* override .popup-menu.font-size, everything else will scale with it. * override .popup-menu.font-size, everything else will scale with it.
*/ */
.popup-menu-content { .popup-menu-content {
padding: 1em .5em; padding: 1em 0em;
} }
.popup-menu-item { .popup-menu-item {
padding: .4em 1.25em; padding: .4em 1.75em;
spacing: 1em;
} }
.popup-menu-item:active { .popup-menu-item:active {
@ -133,11 +134,6 @@ StTooltip {
} }
.popup-image-menu-item { .popup-image-menu-item {
spacing: .75em;
}
.popup-switch-menu-item {
spacing: 2em;
} }
.popup-separator-menu-item { .popup-separator-menu-item {

View File

@ -102,9 +102,7 @@ AltTabPopup.prototype = {
childBox.x1 = Math.max(primary.x + leftPadding, childBox.x1 - offset - hPadding); childBox.x1 = Math.max(primary.x + leftPadding, childBox.x1 - offset - hPadding);
} }
let [found, spacing] = this.actor.get_theme_node().get_length('spacing', false); let spacing = this.actor.get_theme_node().get_length('spacing');
if (!found)
spacing = 0;
childBox.x2 = childBox.x1 + childNaturalWidth; childBox.x2 = childBox.x1 + childNaturalWidth;
if (childBox.x2 > primary.x + primary.width - rightPadding) if (childBox.x2 > primary.x + primary.width - rightPadding)
@ -501,8 +499,7 @@ SwitcherList.prototype = {
this._list = new Shell.GenericContainer({ style_class: 'switcher-list-item-container' }); this._list = new Shell.GenericContainer({ style_class: 'switcher-list-item-container' });
this._list.spacing = 0; this._list.spacing = 0;
this._list.connect('style-changed', Lang.bind(this, function() { this._list.connect('style-changed', Lang.bind(this, function() {
let [found, spacing] = this._list.get_theme_node().get_length('spacing', false); this._list.spacing = this._list.get_theme_node().get_length('spacing');
this._list.spacing = (found) ? spacing : 0;
})); }));
this._list.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth)); this._list.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
@ -1035,9 +1032,7 @@ ThumbnailList.prototype = {
let totalPadding = this._items[0].get_theme_node().get_horizontal_padding() + this._items[0].get_theme_node().get_vertical_padding(); let totalPadding = this._items[0].get_theme_node().get_horizontal_padding() + this._items[0].get_theme_node().get_vertical_padding();
totalPadding += this.actor.get_theme_node().get_horizontal_padding() + this.actor.get_theme_node().get_vertical_padding(); totalPadding += this.actor.get_theme_node().get_horizontal_padding() + this.actor.get_theme_node().get_vertical_padding();
let [labelMinHeight, labelNaturalHeight] = this._labels[0].get_preferred_height(-1); let [labelMinHeight, labelNaturalHeight] = this._labels[0].get_preferred_height(-1);
let [found, spacing] = this._items[0].child.get_theme_node().get_length('spacing', false); let spacing = this._items[0].child.get_theme_node().get_length('spacing');
if (!found)
spacing = 0;
availHeight = Math.min(availHeight - labelNaturalHeight - totalPadding - spacing, THUMBNAIL_DEFAULT_SIZE); availHeight = Math.min(availHeight - labelNaturalHeight - totalPadding - spacing, THUMBNAIL_DEFAULT_SIZE);
let binHeight = availHeight + this._items[0].get_theme_node().get_vertical_padding() + this.actor.get_theme_node().get_vertical_padding() - spacing; let binHeight = availHeight + this._items[0].get_theme_node().get_vertical_padding() + this.actor.get_theme_node().get_vertical_padding() - spacing;

View File

@ -46,9 +46,7 @@ BoxPointer.prototype = {
let x = this.actor.x; let x = this.actor.x;
let y = this.actor.y; let y = this.actor.y;
let themeNode = this.actor.get_theme_node(); let themeNode = this.actor.get_theme_node();
let [found, rise] = themeNode.get_length('-arrow-rise', false); let rise = themeNode.get_length('-arrow-rise');
if (!found)
rise = 0;
this.actor.opacity = 0; this.actor.opacity = 0;
this.actor.show(); this.actor.show();
@ -82,9 +80,7 @@ BoxPointer.prototype = {
let originalX = this.actor.x; let originalX = this.actor.x;
let originalY = this.actor.y; let originalY = this.actor.y;
let themeNode = this.actor.get_theme_node(); let themeNode = this.actor.get_theme_node();
let [found, rise] = themeNode.get_length('-arrow-rise', false); let rise = themeNode.get_length('-arrow-rise');
if (!found)
rise = 0;
switch (this._arrowSide) { switch (this._arrowSide) {
case St.Side.TOP: case St.Side.TOP:
@ -118,13 +114,12 @@ BoxPointer.prototype = {
_adjustAllocationForArrow: function(isWidth, alloc) { _adjustAllocationForArrow: function(isWidth, alloc) {
let themeNode = this.actor.get_theme_node(); let themeNode = this.actor.get_theme_node();
let found, borderWidth, base, rise; let borderWidth = themeNode.get_length('-arrow-border-width');
[found, borderWidth] = themeNode.get_length('-arrow-border-width', false);
alloc.min_size += borderWidth * 2; alloc.min_size += borderWidth * 2;
alloc.natural_size += borderWidth * 2; alloc.natural_size += borderWidth * 2;
if ((!isWidth && (this._arrowSide == St.Side.TOP || this._arrowSide == St.Side.BOTTOM)) if ((!isWidth && (this._arrowSide == St.Side.TOP || this._arrowSide == St.Side.BOTTOM))
|| (isWidth && (this._arrowSide == St.Side.LEFT || this._arrowSide == St.Side.RIGHT))) { || (isWidth && (this._arrowSide == St.Side.LEFT || this._arrowSide == St.Side.RIGHT))) {
let [found, rise] = themeNode.get_length('-arrow-rise', false); let rise = themeNode.get_length('-arrow-rise');
alloc.min_size += rise; alloc.min_size += rise;
alloc.natural_size += rise; alloc.natural_size += rise;
} }
@ -146,9 +141,8 @@ BoxPointer.prototype = {
_allocate: function(actor, box, flags) { _allocate: function(actor, box, flags) {
let themeNode = this.actor.get_theme_node(); let themeNode = this.actor.get_theme_node();
let found, borderWidth, borderRadius, rise, base; let borderWidth = themeNode.get_length('-arrow-border-width');
[found, borderWidth] = themeNode.get_length('-arrow-border-width', false); let rise = themeNode.get_length('-arrow-rise');
[found, rise] = themeNode.get_length('-arrow-rise', false);
let childBox = new Clutter.ActorBox(); let childBox = new Clutter.ActorBox();
let availWidth = box.x2 - box.x1; let availWidth = box.x2 - box.x1;
let availHeight = box.y2 - box.y1; let availHeight = box.y2 - box.y1;
@ -183,19 +177,18 @@ BoxPointer.prototype = {
_drawBorder: function(area) { _drawBorder: function(area) {
let themeNode = this.actor.get_theme_node(); let themeNode = this.actor.get_theme_node();
let found, borderWidth, borderRadius, rise, base; let borderWidth = themeNode.get_length('-arrow-border-width');
[found, borderWidth] = themeNode.get_length('-arrow-border-width', false); let base = themeNode.get_length('-arrow-base');
[found, base] = themeNode.get_length('-arrow-base', false); let rise = themeNode.get_length('-arrow-rise');
[found, rise] = themeNode.get_length('-arrow-rise', false); let borderRadius = themeNode.get_length('-arrow-border-radius');
[found, borderRadius] = themeNode.get_length('-arrow-border-radius', false);
let halfBorder = borderWidth / 2; let halfBorder = borderWidth / 2;
let halfBase = Math.floor(base/2); let halfBase = Math.floor(base/2);
let borderColor = new Clutter.Color(); let borderColor = new Clutter.Color();
themeNode.get_color('-arrow-border-color', false, borderColor); themeNode.get_color('-arrow-border-color', borderColor);
let backgroundColor = new Clutter.Color(); let backgroundColor = new Clutter.Color();
themeNode.get_color('-arrow-background-color', false, backgroundColor); themeNode.get_color('-arrow-background-color', backgroundColor);
let [width, height] = area.get_surface_size(); let [width, height] = area.get_surface_size();
let [boxWidth, boxHeight] = [width, height]; let [boxWidth, boxHeight] = [width, height];
@ -265,8 +258,6 @@ BoxPointer.prototype = {
}, },
setPosition: function(sourceActor, gap, alignment) { setPosition: function(sourceActor, gap, alignment) {
let primary = global.get_primary_monitor();
// We need to show it now to force an allocation, // We need to show it now to force an allocation,
// so that we can query the correct size. // so that we can query the correct size.
this.actor.show(); this.actor.show();
@ -277,6 +268,12 @@ BoxPointer.prototype = {
let [minWidth, minHeight, natWidth, natHeight] = this.actor.get_preferred_size(); let [minWidth, minHeight, natWidth, natHeight] = this.actor.get_preferred_size();
// We also want to keep it onscreen, and separated from the
// edge by the same distance as the main part of the box is
// separated from its sourceActor
let primary = global.get_primary_monitor();
let arrowRise = this.actor.get_theme_node().get_length('-arrow-rise');
let resX, resY; let resX, resY;
switch (this._arrowSide) { switch (this._arrowSide) {
@ -311,7 +308,7 @@ BoxPointer.prototype = {
break; break;
} }
resX = Math.min(resX, primary.x + primary.width - natWidth); resX = Math.min(resX, primary.x + primary.width - natWidth - arrowRise - gap);
resX = Math.max(resX, primary.x); resX = Math.max(resX, primary.x);
this.setArrowOrigin((sourceX - resX) + Math.floor(sourceWidth / 2)); this.setArrowOrigin((sourceX - resX) + Math.floor(sourceWidth / 2));
@ -331,7 +328,7 @@ BoxPointer.prototype = {
break; break;
} }
resY = Math.min(resY, primary.y + primary.height - natHeight); resY = Math.min(resY, primary.y + primary.height - natHeight - arrowRise - gap);
resY = Math.max(resY, primary.y); resY = Math.max(resY, primary.y);
this.setArrowOrigin((sourceY - resY) + Math.floor(sourceHeight / 2)); this.setArrowOrigin((sourceY - resY) + Math.floor(sourceHeight / 2));

View File

@ -233,7 +233,7 @@ Chrome.prototype = {
}, },
_windowsRestacked: function() { _windowsRestacked: function() {
let windows = global.get_windows(); let windows = global.get_window_actors();
let primary = global.get_primary_monitor(); let primary = global.get_primary_monitor();
// The chrome layer should be visible unless there is a window // The chrome layer should be visible unless there is a window

View File

@ -86,6 +86,9 @@ _Draggable.prototype = {
Lang.bind(this, this._onButtonPress)); Lang.bind(this, this._onButtonPress));
this.actor.connect('destroy', Lang.bind(this, function() { this.actor.connect('destroy', Lang.bind(this, function() {
this._actorDestroyed = true;
if (this._dragInProgress)
this._cancelDrag(global.get_current_time());
this.disconnectAll(); this.disconnectAll();
})); }));
this._onEventId = null; this._onEventId = null;
@ -417,6 +420,8 @@ _Draggable.prototype = {
targX, targX,
targY, targY,
event.get_time())) { event.get_time())) {
if (this._actorDestroyed)
return true;
// If it accepted the drop without taking the actor, // If it accepted the drop without taking the actor,
// handle it ourselves. // handle it ourselves.
if (this._dragActor.get_parent() == this._dragActor.get_stage()) { if (this._dragActor.get_parent() == this._dragActor.get_stage()) {
@ -458,6 +463,12 @@ _Draggable.prototype = {
this._dragInProgress = false; this._dragInProgress = false;
let [snapBackX, snapBackY] = this._getRestoreLocation(); let [snapBackX, snapBackY] = this._getRestoreLocation();
if (this._actorDestroyed) {
global.unset_cursor();
this.emit('drag-end', eventTime, false);
return;
}
this._animationInProgress = true; this._animationInProgress = true;
// No target, so snap back // No target, so snap back
Tweener.addTween(this._dragActor, Tweener.addTween(this._dragActor,

View File

@ -113,18 +113,14 @@ BaseIcon.prototype = {
}, },
_onStyleChanged: function() { _onStyleChanged: function() {
let success, len;
let node = this.actor.get_theme_node(); let node = this.actor.get_theme_node();
this._spacing = node.get_length('spacing');
[success, len] = node.get_length('spacing', false);
if (success)
this._spacing = spacing;
if (this._setSizeManually) if (this._setSizeManually)
return; return;
[success, len] = node.get_length('icon-size', false); let len = node.get_length('icon-size');
if (success) if (len > 0)
this._setIconSize(len); this._setIconSize(len);
} }
}; };
@ -269,12 +265,8 @@ IconGrid.prototype = {
_onStyleChanged: function() { _onStyleChanged: function() {
let themeNode = this.actor.get_theme_node(); let themeNode = this.actor.get_theme_node();
let [success, len] = themeNode.get_length('spacing', false); this._spacing = themeNode.get_length('spacing');
if (success) this._item_size = themeNode.get_length('-shell-grid-item-size');
this._spacing = len;
[success, len] = themeNode.get_length('-shell-grid-item-size', false);
if (success)
this._item_size = len;
this._grid.queue_relayout(); this._grid.queue_relayout();
}, },

View File

@ -220,7 +220,7 @@ WindowList.prototype = {
_updateWindowList: function() { _updateWindowList: function() {
this.actor.get_children().forEach(function (actor) { actor.destroy(); }); this.actor.get_children().forEach(function (actor) { actor.destroy(); });
let windows = global.get_windows(); let windows = global.get_window_actors();
let tracker = Shell.WindowTracker.get_default(); let tracker = Shell.WindowTracker.get_default();
for (let i = 0; i < windows.length; i++) { for (let i = 0; i < windows.length; i++) {
let metaWindow = windows[i].metaWindow; let metaWindow = windows[i].metaWindow;

View File

@ -253,11 +253,11 @@ function _relayout() {
// metacity-clutter currently uses the same prefs as plain metacity, // metacity-clutter currently uses the same prefs as plain metacity,
// which probably means we'll be starting out with multiple workspaces; // which probably means we'll be starting out with multiple workspaces;
// remove any unused ones. (We do this from an idle handler, because // remove any unused ones. (We do this from an idle handler, because
// global.get_windows() still returns NULL at the point when start() // global.get_window_actors() still returns NULL at the point when start()
// is called.) // is called.)
function _removeUnusedWorkspaces() { function _removeUnusedWorkspaces() {
let windows = global.get_windows(); let windows = global.get_window_actors();
let maxWorkspace = 0; let maxWorkspace = 0;
for (let i = 0; i < windows.length; i++) { for (let i = 0; i < windows.length; i++) {
let win = windows[i]; let win = windows[i];
@ -292,13 +292,30 @@ function _removeUnusedWorkspaces() {
function _globalKeyPressHandler(actor, event) { function _globalKeyPressHandler(actor, event) {
if (modalCount == 0) if (modalCount == 0)
return false; return false;
if (event.type() != Clutter.EventType.KEY_RELEASE)
return false;
let type = event.type(); let symbol = event.get_key_symbol();
let keyCode = event.get_key_code();
let modifierState = Shell.get_event_state(event);
// Check the overview key first, this isn't a Meta.KeyBindingAction yet
if (symbol == Clutter.Super_L || symbol == Clutter.Super_R) {
// The super key is the default for triggering the overview, and should
// get us out of the overview when we are already in it.
if (overview.visible)
overview.hide();
if (type == Clutter.EventType.KEY_PRESS) { return true;
let symbol = event.get_key_symbol(); }
if (symbol == Clutter.Print) {
// We want to be able to take screenshots of the shell at all times // Whitelist some of the Metacity actions
let display = global.screen.get_display();
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
// This relies on the fact that Clutter.ModifierType is the same as Gdk.ModifierType
let action = display.get_keybinding_action(keyCode, modifierState);
switch (action) {
case Meta.KeyBindingAction.COMMAND_SCREENSHOT:
let gconf = GConf.Client.get_default(); let gconf = GConf.Client.get_default();
let command = gconf.get_string('/apps/metacity/keybinding_commands/command_screenshot'); let command = gconf.get_string('/apps/metacity/keybinding_commands/command_screenshot');
if (command != null && command != '') { if (command != null && command != '') {
@ -306,41 +323,17 @@ function _globalKeyPressHandler(actor, event) {
let p = new Shell.Process({'args' : args}); let p = new Shell.Process({'args' : args});
p.run(); p.run();
} }
return true; return true;
} case Meta.KeyBindingAction.WORKSPACE_LEFT:
} else if (type == Clutter.EventType.KEY_RELEASE) { wm.actionMoveWorkspaceLeft();
let symbol = event.get_key_symbol(); return true;
let keyCode = event.get_key_code(); case Meta.KeyBindingAction.WORKSPACE_RIGHT:
let modifierState = Shell.get_event_state(event); wm.actionMoveWorkspaceRight();
// Check the overview key first, this isn't a Meta.KeyBindingAction yet return true;
if (symbol == Clutter.Super_L || symbol == Clutter.Super_R) { case Meta.KeyBindingAction.PANEL_RUN_DIALOG:
// The super key is the default for triggering the overview, and should case Meta.KeyBindingAction.COMMAND_2:
// get us out of the overview when we are already in it. getRunDialog().open();
if (overview.visible)
overview.hide();
return true; return true;
}
// Whitelist some of the Metacity actions
let display = global.screen.get_display();
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
// This relies on the fact that Clutter.ModifierType is the same as Gdk.ModifierType
let action = display.get_keybinding_action(symbol, keyCode, modifierState);
switch (action) {
case Meta.KeyBindingAction.WORKSPACE_LEFT:
wm.actionMoveWorkspaceLeft();
return true;
case Meta.KeyBindingAction.WORKSPACE_RIGHT:
wm.actionMoveWorkspaceRight();
return true;
case Meta.KeyBindingAction.PANEL_RUN_DIALOG:
case Meta.KeyBindingAction.COMMAND_2:
getRunDialog().open();
return true;
}
} }
return false; return false;

View File

@ -360,8 +360,7 @@ Notification.prototype = {
}, },
_styleChanged: function() { _styleChanged: function() {
let [hasSpacing, spacing] = this.actor.get_theme_node().get_length('spacing-columns', false); this._spacing = this.actor.get_theme_node().get_length('spacing-columns');
this._spacing = hasSpacing ? spacing : 0;
}, },
_bannerBoxGetPreferredWidth: function(actor, forHeight, alloc) { _bannerBoxGetPreferredWidth: function(actor, forHeight, alloc) {

View File

@ -372,7 +372,7 @@ NotificationDaemon.prototype = {
_onTrayIconAdded: function(o, icon) { _onTrayIconAdded: function(o, icon) {
let source = this._sources[icon.pid]; let source = this._sources[icon.pid];
if (!source) if (!source)
source = this._newSource(icon.title, icon.pid); source = this._newSource(icon.title || icon.wm_class || _("Unknown"), icon.pid);
source.setTrayIcon(icon); source.setTrayIcon(icon);
}, },

View File

@ -16,6 +16,8 @@ const Tweener = imports.ui.tweener;
const Gettext = imports.gettext.domain('gnome-shell'); const Gettext = imports.gettext.domain('gnome-shell');
const _ = Gettext.gettext; const _ = Gettext.gettext;
const SLIDER_SCROLL_STEP = 0.05; /* Slider scrolling step in % */
function Switch() { function Switch() {
this._init.apply(this, arguments); this._init.apply(this, arguments);
} }
@ -54,13 +56,19 @@ PopupBaseMenuItem.prototype = {
params = Params.parse (params, { reactive: true, params = Params.parse (params, { reactive: true,
activate: true, activate: true,
hover: true }); hover: true });
this.actor = new St.Bin({ style_class: 'popup-menu-item', this.actor = new Shell.GenericContainer({ style_class: 'popup-menu-item',
reactive: params.reactive, reactive: params.reactive,
track_hover: params.reactive, track_hover: params.reactive });
x_fill: true, this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
y_fill: true, this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
x_align: St.Align.START }); this.actor.connect('allocate', Lang.bind(this, this._allocate));
this.actor.connect('style-changed', Lang.bind(this, this._onStyleChanged));
this.actor._delegate = this; this.actor._delegate = this;
this._children = [];
this._dot = null;
this._columnWidths = null;
this._spacing = 0;
this.active = false; this.active = false;
if (params.reactive && params.activate) { if (params.reactive && params.activate) {
@ -72,6 +80,12 @@ PopupBaseMenuItem.prototype = {
this.actor.connect('notify::hover', Lang.bind(this, this._hoverChanged)); this.actor.connect('notify::hover', Lang.bind(this, this._hoverChanged));
}, },
_onStyleChanged: function (actor) {
let themeNode = actor.get_theme_node();
let [found, spacing] = themeNode.get_length('spacing', false);
this._spacing = found ? spacing : 0;
},
_hoverChanged: function (actor) { _hoverChanged: function (actor) {
this.setActive(actor.hover); this.setActive(actor.hover);
}, },
@ -105,6 +119,159 @@ PopupBaseMenuItem.prototype = {
// true if non descendant content includes @actor // true if non descendant content includes @actor
contains: function(actor) { contains: function(actor) {
return false; return false;
},
// adds an actor to the menu item; @column defaults to the next
// open column, @span defaults to 1. If @span is -1, the actor
// will span the width of the menu item. Children are not
// allowed to overlap each other.
addActor: function(child, column, span) {
if (column == null) {
if (this._children.length) {
let lastChild = this._children[this._children.length - 1];
column = lastChild.column + lastChild.span;
} else
column = 0;
span = 1;
} else if (span == null)
span = 1;
this._children.push({ actor: child,
column: column,
span: span });
this.actor.connect('destroy', Lang.bind(this, function () { this.removeActor(child); }));
this.actor.add_actor(child);
},
removeActor: 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;
}
}
},
setShowDot: function(show) {
if (show) {
if (this._dot)
return;
this._dot = new St.DrawingArea({ style_class: 'popup-menu-item-dot' });
this._dot.connect('repaint', Lang.bind(this, this._onRepaintDot));
this.actor.add_actor(this._dot);
} else {
if (!this._dot)
return;
this._dot.destroy();
this._dot = null;
}
},
_onRepaintDot: function(area) {
let cr = area.get_context();
let [width, height] = area.get_surface_size();
let color = new Clutter.Color();
area.get_theme_node().get_foreground_color(color);
cr.setSourceRGBA (
color.red / 255,
color.green / 255,
color.blue / 255,
color.alpha / 255);
cr.arc(width / 2, height / 2, width / 3, 0, 2 * Math.PI);
cr.fill();
},
getColumnWidths: function() {
let widths = [];
for (let i = 0, col = 0; i < this._children.length; i++) {
let child = this._children[i];
let [min, natural] = child.actor.get_preferred_width(-1);
widths[col++] = natural;
if (child.span > 1) {
for (let j = 1; j < child.span; j++)
widths[col++] = 0;
}
}
return widths;
},
setColumnWidths: function(widths) {
this._columnWidths = widths;
},
_getPreferredWidth: function(actor, forHeight, alloc) {
let width = 0;
if (this._columnWidths) {
for (let i = 0; i < this._columnWidths.length; i++) {
if (i > 0)
width += this._spacing;
width += this._columnWidths[i];
}
} else {
for (let i = 0; i < this._children.length; i++) {
let child = this._children[i];
if (i > 0)
width += this._spacing;
let [min, natural] = child.actor.get_preferred_width(forHeight);
width += natural;
}
}
alloc.min_size = alloc.natural_size = width;
},
_getPreferredHeight: function(actor, forWidth, alloc) {
let height = 0;
for (let i = 0; i < this._children.length; i++) {
let child = this._children[i];
let [min, natural] = child.actor.get_preferred_height(-1);
if (natural > height)
height = natural;
}
alloc.min_size = alloc.natural_size = height;
},
_allocate: function(actor, box, flags) {
let height = box.y2 - box.y1;
if (this._dot) {
let dotBox = new Clutter.ActorBox();
let dotWidth = Math.round(box.x1 / 2);
dotBox.x1 = Math.round(box.x1 / 4);
dotBox.x2 = dotBox.x1 + dotWidth;
dotBox.y1 = Math.round(box.y1 + (height - dotWidth) / 2);
dotBox.y2 = dotBox.y1 + dotWidth;
this._dot.allocate(dotBox, flags);
}
let x = box.x1;
for (let i = 0, col = 0; i < this._children.length; i++) {
let child = this._children[i];
let childBox = new Clutter.ActorBox();
childBox.x1 = x;
if (this._columnWidths) {
if (child.span == -1)
childBox.x2 = box.x2;
else {
childBox.x2 = x;
for (let j = 0; j < child.span; j++)
childBox.x2 += this._columnWidths[col++];
}
} else {
let [min, natural] = child.actor.get_preferred_width(-1);
childBox.x2 = x + natural;
}
let [min, natural] = child.actor.get_preferred_height(-1);
childBox.y1 = Math.round(box.y1 + (height - natural) / 2);
childBox.y2 = childBox.y1 + natural;
child.actor.allocate(childBox, flags);
x = childBox.x2 + this._spacing;
}
} }
}; };
Signals.addSignalMethods(PopupBaseMenuItem.prototype); Signals.addSignalMethods(PopupBaseMenuItem.prototype);
@ -120,7 +287,7 @@ PopupMenuItem.prototype = {
PopupBaseMenuItem.prototype._init.call(this); PopupBaseMenuItem.prototype._init.call(this);
this.label = new St.Label({ text: text }); this.label = new St.Label({ text: text });
this.actor.set_child(this.label); this.addActor(this.label);
} }
}; };
@ -135,7 +302,7 @@ PopupSeparatorMenuItem.prototype = {
PopupBaseMenuItem.prototype._init.call(this, { reactive: false }); PopupBaseMenuItem.prototype._init.call(this, { reactive: false });
this._drawingArea = new St.DrawingArea({ style_class: 'popup-separator-menu-item' }); this._drawingArea = new St.DrawingArea({ style_class: 'popup-separator-menu-item' });
this.actor.set_child(this._drawingArea); this.addActor(this._drawingArea, 0, -1);
this._drawingArea.connect('repaint', Lang.bind(this, this._onRepaint)); this._drawingArea.connect('repaint', Lang.bind(this, this._onRepaint));
}, },
@ -143,13 +310,12 @@ PopupSeparatorMenuItem.prototype = {
let cr = area.get_context(); let cr = area.get_context();
let themeNode = area.get_theme_node(); let themeNode = area.get_theme_node();
let [width, height] = area.get_surface_size(); let [width, height] = area.get_surface_size();
let found, margin, gradientHeight; let margin = themeNode.get_length('-margin-horizontal');
[found, margin] = themeNode.get_length('-margin-horizontal', false); let gradientHeight = themeNode.get_length('-gradient-height');
[found, gradientHeight] = themeNode.get_length('-gradient-height', false);
let startColor = new Clutter.Color(); let startColor = new Clutter.Color();
themeNode.get_color('-gradient-start', false, startColor); themeNode.get_color('-gradient-start', startColor);
let endColor = new Clutter.Color(); let endColor = new Clutter.Color();
themeNode.get_color('-gradient-end', false, endColor); themeNode.get_color('-gradient-end', endColor);
let gradientWidth = (width - margin * 2); let gradientWidth = (width - margin * 2);
let gradientOffset = (height - gradientHeight) / 2; let gradientOffset = (height - gradientHeight) / 2;
@ -179,9 +345,10 @@ PopupSliderMenuItem.prototype = {
this._value = Math.max(Math.min(value, 1), 0); this._value = Math.max(Math.min(value, 1), 0);
this._slider = new St.DrawingArea({ style_class: 'popup-slider-menu-item', reactive: true }); this._slider = new St.DrawingArea({ style_class: 'popup-slider-menu-item', reactive: true });
this.actor.set_child(this._slider); this.addActor(this._slider, 0, -1);
this._slider.connect('repaint', Lang.bind(this, this._sliderRepaint)); this._slider.connect('repaint', Lang.bind(this, this._sliderRepaint));
this._slider.connect('button-press-event', Lang.bind(this, this._startDragging)); this._slider.connect('button-press-event', Lang.bind(this, this._startDragging));
this._slider.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
this._releaseId = this._motionId = 0; this._releaseId = this._motionId = 0;
this._dragging = false; this._dragging = false;
@ -200,20 +367,17 @@ PopupSliderMenuItem.prototype = {
let themeNode = area.get_theme_node(); let themeNode = area.get_theme_node();
let [width, height] = area.get_surface_size(); let [width, height] = area.get_surface_size();
let found, handleRadius; let handleRadius = themeNode.get_length('-slider-handle-radius');
[found, handleRadius] = themeNode.get_length('-slider-handle-radius', false);
let sliderWidth = width - 2 * handleRadius; let sliderWidth = width - 2 * handleRadius;
let sliderHeight; let sliderHeight = themeNode.get_length('-slider-height');
[found, sliderHeight] = themeNode.get_length('-slider-height', false);
let sliderBorderWidth; let sliderBorderWidth = themeNode.get_length('-slider-border-width');
[found, sliderBorderWidth] = themeNode.get_length('-slider-border-width', false);
let sliderBorderColor = new Clutter.Color(); let sliderBorderColor = new Clutter.Color();
themeNode.get_color('-slider-border-color', false, sliderBorderColor); themeNode.get_color('-slider-border-color', sliderBorderColor);
let sliderColor = new Clutter.Color(); let sliderColor = new Clutter.Color();
themeNode.get_color('-slider-background-color', false, sliderColor); themeNode.get_color('-slider-background-color', sliderColor);
cr.setSourceRGBA ( cr.setSourceRGBA (
sliderColor.red / 255, sliderColor.red / 255,
@ -274,6 +438,20 @@ PopupSliderMenuItem.prototype = {
return true; return true;
}, },
_onScrollEvent: function (actor, event) {
let direction = event.get_scroll_direction();
if (direction == Clutter.ScrollDirection.DOWN) {
this._value = Math.max(0, this._value - SLIDER_SCROLL_STEP);
}
else if (direction == Clutter.ScrollDirection.UP) {
this._value = Math.min(1, this._value + SLIDER_SCROLL_STEP);
}
this._slider.queue_repaint();
this.emit('value-changed', this._value);
},
_motionEvent: function(actor, event) { _motionEvent: function(actor, event) {
let absX, absY; let absX, absY;
[absX, absY] = event.get_coords(); [absX, absY] = event.get_coords();
@ -288,8 +466,7 @@ PopupSliderMenuItem.prototype = {
relY = absY - sliderY; relY = absY - sliderY;
let width = this._slider.width; let width = this._slider.width;
let found, handleRadius; let handleRadius = this._slider.get_theme_node().get_length('-slider-handle-radius');
[found, handleRadius] = this._slider.get_theme_node().get_length('-slider-handle-radius', false);
let newvalue; let newvalue;
if (relX < handleRadius) if (relX < handleRadius)
@ -331,14 +508,11 @@ PopupSwitchMenuItem.prototype = {
_init: function(text, active) { _init: function(text, active) {
PopupBaseMenuItem.prototype._init.call(this); PopupBaseMenuItem.prototype._init.call(this);
this.active = !!active;
this.label = new St.Label({ text: text }); this.label = new St.Label({ text: text });
this._switch = new Switch(this.active); this._switch = new Switch(active);
this._box = new St.BoxLayout({ style_class: 'popup-switch-menu-item' }); this.addActor(this.label);
this._box.add(this.label, { expand: true, y_fill: false }); this.addActor(this._switch.actor);
this._box.add(this._switch.actor, { y_fill: false });
this.actor.set_child(this._box);
this.connect('activate', Lang.bind(this,function(from) { this.connect('activate', Lang.bind(this,function(from) {
this.toggle(); this.toggle();
@ -360,64 +534,32 @@ PopupSwitchMenuItem.prototype = {
} }
function PopupImageMenuItem(text, iconName, alwaysShowImage) { function PopupImageMenuItem(text, iconName) {
this._init(text, iconName, alwaysShowImage); this._init(text, iconName);
} }
// We need to instantiate a GtkImageMenuItem so it
// hooks up its properties on the GtkSettings
var _gtkImageMenuItemCreated = false;
PopupImageMenuItem.prototype = { PopupImageMenuItem.prototype = {
__proto__: PopupBaseMenuItem.prototype, __proto__: PopupBaseMenuItem.prototype,
_init: function (text, iconName, alwaysShowImage) { _init: function (text, iconName) {
PopupBaseMenuItem.prototype._init.call(this); PopupBaseMenuItem.prototype._init.call(this);
if (!_gtkImageMenuItemCreated) {
let menuItem = new Gtk.ImageMenuItem();
menuItem.destroy();
_gtkImageMenuItemCreated = true;
}
this._alwaysShowImage = alwaysShowImage;
this._iconName = iconName;
this._size = 16; this._size = 16;
let box = new St.BoxLayout({ style_class: 'popup-image-menu-item' });
this.actor.set_child(box);
this._imageBin = new St.Bin({ width: this._size, height: this._size });
box.add(this._imageBin, { y_fill: false });
this.label = new St.Label({ text: text }); this.label = new St.Label({ text: text });
box.add(this.label, { expand: true }); this.addActor(this.label);
this._imageBin = new St.Bin({ width: this._size, height: this._size });
this.addActor(this._imageBin);
if (!alwaysShowImage) { this.setIcon(iconName);
let settings = Gtk.Settings.get_default();
settings.connect('notify::gtk-menu-images', Lang.bind(this, this._onMenuImagesChanged));
}
this._onMenuImagesChanged();
}, },
_onMenuImagesChanged: function() {
let show;
if (this._alwaysShowImage) {
show = true;
} else {
let settings = Gtk.Settings.get_default();
show = settings.gtk_menu_images;
}
if (!show) {
this._imageBin.hide();
} else {
let img = St.TextureCache.get_default().load_icon_name(this._iconName, St.IconType.SYMBOLIC, this._size);
this._imageBin.set_child(img);
this._imageBin.show();
}
},
setIcon: function(name) { setIcon: function(name) {
this._iconName = name; if (this._imageBin.child)
this._onMenuImagesChanged(); this._imageBin.child.destroy();
let img = St.TextureCache.get_default().load_icon_name(name, St.IconType.SYMBOLIC, this._size);
this._imageBin.set_child(img);
} }
}; };
@ -460,15 +602,51 @@ PopupMenu.prototype = {
x_align: St.Align.START }); x_align: St.Align.START });
this.actor = this._boxPointer.actor; this.actor = this._boxPointer.actor;
this.actor.style_class = 'popup-menu-boxpointer'; this.actor.style_class = 'popup-menu-boxpointer';
this._boxWrapper = new Shell.GenericContainer();
this._boxWrapper.connect('get-preferred-width', Lang.bind(this, this._boxGetPreferredWidth));
this._boxWrapper.connect('get-preferred-height', Lang.bind(this, this._boxGetPreferredHeight));
this._boxWrapper.connect('allocate', Lang.bind(this, this._boxAllocate));
this._boxPointer.bin.set_child(this._boxWrapper);
this._box = new St.BoxLayout({ style_class: 'popup-menu-content', this._box = new St.BoxLayout({ style_class: 'popup-menu-content',
vertical: true }); vertical: true });
this._boxPointer.bin.set_child(this._box); this._boxWrapper.add_actor(this._box);
this.actor.add_style_class_name('popup-menu'); this.actor.add_style_class_name('popup-menu');
this.isOpen = false; this.isOpen = false;
this._activeMenuItem = null; this._activeMenuItem = null;
}, },
_boxGetPreferredWidth: function (actor, forHeight, alloc) {
// Update the menuitem column widths
let columnWidths = [];
let items = this._box.get_children();
for (let i = 0; i < items.length; i++) {
if (items[i]._delegate instanceof PopupBaseMenuItem) {
let itemColumnWidths = items[i]._delegate.getColumnWidths();
for (let j = 0; j < itemColumnWidths.length; j++) {
if (j >= columnWidths.length || itemColumnWidths[j] > columnWidths[j])
columnWidths[j] = itemColumnWidths[j];
}
}
}
for (let i = 0; i < items.length; i++) {
if (items[i]._delegate instanceof PopupBaseMenuItem)
items[i]._delegate.setColumnWidths(columnWidths);
}
// Now they will request the right sizes
[alloc.min_size, alloc.natural_size] = this._box.get_preferred_width(forHeight);
},
_boxGetPreferredHeight: function (actor, forWidth, alloc) {
[alloc.min_size, alloc.natural_size] = this._box.get_preferred_height(forWidth);
},
_boxAllocate: function (actor, box, flags) {
this._box.allocate(box, flags);
},
addAction: function(title, callback) { addAction: function(title, callback) {
var menuItem = new PopupMenuItem(title); var menuItem = new PopupMenuItem(title);
this.addMenuItem(menuItem); this.addMenuItem(menuItem);
@ -670,10 +848,8 @@ PopupSubMenuMenuItem.prototype = {
this.actor.connect('enter-event', Lang.bind(this, this._mouseEnter)); this.actor.connect('enter-event', Lang.bind(this, this._mouseEnter));
this.label = new St.Label({ text: text }); this.label = new St.Label({ text: text });
this._container = new St.BoxLayout(); this.addActor(this.label);
this._container.add(this.label, { fill: true, expand: true }); this.addActor(new St.Label({ text: '>' }));
this._container.add(new St.Label({ text: '>' }));
this.actor.set_child(this._container);
this.menu = new PopupMenu(this.actor, St.Align.MIDDLE, St.Side.LEFT, 0, true); this.menu = new PopupMenu(this.actor, St.Align.MIDDLE, St.Side.LEFT, 0, true);
Main.chrome.addActor(this.menu.actor, { visibleInOverview: true, Main.chrome.addActor(this.menu.actor, { visibleInOverview: true,

View File

@ -1,5 +1,6 @@
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */ /* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
const Clutter = imports.gi.Clutter;
const DBus = imports.dbus; const DBus = imports.dbus;
const Lang = imports.lang; const Lang = imports.lang;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
@ -15,6 +16,7 @@ const Gettext = imports.gettext.domain('gnome-shell');
const _ = Gettext.gettext; const _ = Gettext.gettext;
const VOLUME_MAX = 65536.0; /* PA_VOLUME_NORM */ const VOLUME_MAX = 65536.0; /* PA_VOLUME_NORM */
const VOLUME_ADJUSTMENT_STEP = 0.05; /* Volume adjustment step in % */
function Indicator() { function Indicator() {
this._init.apply(this, arguments); this._init.apply(this, arguments);
@ -60,13 +62,28 @@ Indicator.prototype = {
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this.menu.addAction(_("Sound Preferences"), function() { this.menu.addAction(_("Sound Preferences"), function() {
let p = new Shell.Process({ args: ['gnome-control-center', 'volume'] }); let p = new Shell.Process({ args: ['gnome-control-center', 'sound'] });
p.run(); p.run();
}); });
this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
this._control.open(); this._control.open();
}, },
_onScrollEvent: function(actor, event) {
let direction = event.get_scroll_direction();
let currentVolume = this._output.volume;
if (direction == Clutter.ScrollDirection.DOWN) {
this._output.volume = Math.max(0, currentVolume - VOLUME_MAX * VOLUME_ADJUSTMENT_STEP);
this._output.push_volume();
}
else if (direction == Clutter.ScrollDirection.UP) {
this._output.volume = Math.min(VOLUME_MAX, currentVolume + VOLUME_MAX * VOLUME_ADJUSTMENT_STEP);
this._output.push_volume();
}
},
_onControlReady: function() { _onControlReady: function() {
this._readOutput(); this._readOutput();
this._readInput(); this._readInput();
@ -85,7 +102,6 @@ Indicator.prototype = {
this._outputVolumeId = this._output.connect('notify::volume', Lang.bind(this, this._volumeChanged, '_output')); this._outputVolumeId = this._output.connect('notify::volume', Lang.bind(this, this._volumeChanged, '_output'));
this._mutedChanged (null, null, '_output'); this._mutedChanged (null, null, '_output');
this._volumeChanged (null, null, '_output'); this._volumeChanged (null, null, '_output');
this.setIcon(this._volumeToIcon(this._output.volume));
} else { } else {
this._outputSwitch.label.text = _("Output: Muted"); this._outputSwitch.label.text = _("Output: Muted");
this._outputSwitch.setToggleState(false); this._outputSwitch.setToggleState(false);
@ -117,9 +133,9 @@ Indicator.prototype = {
// only show input widgets if any application is recording audio // only show input widgets if any application is recording audio
let showInput = false; let showInput = false;
let recordingApps = this._control.get_source_outputs(); let recordingApps = this._control.get_source_outputs();
if (this._source && recordingApps) { if (this._input && recordingApps) {
for (let i = 0; i < recordingApp.length; i++) { for (let i = 0; i < recordingApps.length; i++) {
let outputStream = recordingApp[i]; let outputStream = recordingApps[i];
let id = outputStream.get_application_id(); let id = outputStream.get_application_id();
// but skip gnome-volume-control and pavucontrol // but skip gnome-volume-control and pavucontrol
// (that appear as recording because they show the input level) // (that appear as recording because they show the input level)
@ -191,7 +207,7 @@ Indicator.prototype = {
_volumeChanged: function(object, param_spec, property) { _volumeChanged: function(object, param_spec, property) {
this[property+'Slider'].setValue(this[property].volume / VOLUME_MAX); this[property+'Slider'].setValue(this[property].volume / VOLUME_MAX);
this._updateLabel(property); this._updateLabel(property);
if (property == '_output') if (property == '_output' && !this._output.is_muted)
this.setIcon(this._volumeToIcon(this._output.volume)); this.setIcon(this._volumeToIcon(this._output.volume));
}, },

View File

@ -36,7 +36,7 @@ StatusIconDispatcher.prototype = {
}, },
_onTrayIconAdded: function(o, icon) { _onTrayIconAdded: function(o, icon) {
let wmClass = icon.wm_class.toLowerCase(); let wmClass = (icon.wm_class || 'unknown').toLowerCase();
let role = STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass]; let role = STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass];
if (role) if (role)
this.emit('status-icon-added', icon, role); this.emit('status-icon-added', icon, role);
@ -45,7 +45,7 @@ StatusIconDispatcher.prototype = {
}, },
_onTrayIconRemoved: function(o, icon) { _onTrayIconRemoved: function(o, icon) {
let wmClass = icon.wm_class.toLowerCase(); let wmClass = (icon.wm_class || 'unknown').toLowerCase();
let role = STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass]; let role = STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass];
if (role) if (role)
this.emit('status-icon-removed', icon); this.emit('status-icon-removed', icon);

View File

@ -35,6 +35,7 @@ StatusMenuButton.prototype = {
this._user = this._gdm.get_user(GLib.get_user_name()); this._user = this._gdm.get_user(GLib.get_user_name());
this._presence = new GnomeSession.Presence(); this._presence = new GnomeSession.Presence();
this._presenceItems = {};
this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
@ -89,6 +90,9 @@ StatusMenuButton.prototype = {
this._iconBox.child = this._invisibleIcon; this._iconBox.child = this._invisibleIcon;
else else
this._iconBox.child = this._idleIcon; this._iconBox.child = this._idleIcon;
for (let itemStatus in this._presenceItems)
this._presenceItems[itemStatus].setShowDot(itemStatus == status);
}, },
_createSubMenu: function() { _createSubMenu: function() {
@ -97,43 +101,57 @@ StatusMenuButton.prototype = {
item = new PopupMenu.PopupImageMenuItem(_("Available"), 'user-available', true); item = new PopupMenu.PopupImageMenuItem(_("Available"), 'user-available', true);
item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.AVAILABLE)); item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.AVAILABLE));
this.menu.addMenuItem(item); this.menu.addMenuItem(item);
this._presenceItems[GnomeSession.PresenceStatus.AVAILABLE] = item;
item = new PopupMenu.PopupImageMenuItem(_("Busy"), 'user-busy', true); item = new PopupMenu.PopupImageMenuItem(_("Busy"), 'user-busy', true);
item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.BUSY)); item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.BUSY));
this.menu.addMenuItem(item); this.menu.addMenuItem(item);
this._presenceItems[GnomeSession.PresenceStatus.BUSY] = item;
item = new PopupMenu.PopupImageMenuItem(_("Invisible"), 'user-invisible', true); item = new PopupMenu.PopupImageMenuItem(_("Invisible"), 'user-invisible', true);
item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.INVISIBLE)); item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.INVISIBLE));
this.menu.addMenuItem(item); this.menu.addMenuItem(item);
this._presenceItems[GnomeSession.PresenceStatus.INVISIBLE] = item;
item = new PopupMenu.PopupSeparatorMenuItem(); item = new PopupMenu.PopupSeparatorMenuItem();
this.menu.addMenuItem(item); this.menu.addMenuItem(item);
item = new PopupMenu.PopupImageMenuItem(_("Account Information..."), 'user-info'); item = new PopupMenu.PopupMenuItem(_("My Account..."));
item.connect('activate', Lang.bind(this, this._onAccountInformationActivate)); item.connect('activate', Lang.bind(this, this._onMyAccountActivate));
this.menu.addMenuItem(item); this.menu.addMenuItem(item);
item = new PopupMenu.PopupImageMenuItem(_("System Settings..."), 'preferences-desktop'); item = new PopupMenu.PopupMenuItem(_("System Preferences..."));
item.connect('activate', Lang.bind(this, this._onPreferencesActivate)); item.connect('activate', Lang.bind(this, this._onPreferencesActivate));
this.menu.addMenuItem(item); this.menu.addMenuItem(item);
item = new PopupMenu.PopupSeparatorMenuItem(); item = new PopupMenu.PopupSeparatorMenuItem();
this.menu.addMenuItem(item); this.menu.addMenuItem(item);
item = new PopupMenu.PopupImageMenuItem(_("Lock Screen"), 'system-lock-screen'); item = new PopupMenu.PopupMenuItem(_("Lock Screen"));
item.connect('activate', Lang.bind(this, this._onLockScreenActivate)); item.connect('activate', Lang.bind(this, this._onLockScreenActivate));
this.menu.addMenuItem(item); this.menu.addMenuItem(item);
item = new PopupMenu.PopupImageMenuItem(_("Switch User"), 'system-users'); item = new PopupMenu.PopupMenuItem(_("Switch User"));
item.connect('activate', Lang.bind(this, this._onLoginScreenActivate)); item.connect('activate', Lang.bind(this, this._onLoginScreenActivate));
this.menu.addMenuItem(item); this.menu.addMenuItem(item);
this._loginScreenItem = item; this._loginScreenItem = item;
item = new PopupMenu.PopupImageMenuItem(_("Log Out..."), 'system-log-out'); item = new PopupMenu.PopupMenuItem(_("Log Out..."));
item.connect('activate', Lang.bind(this, this._onQuitSessionActivate)); item.connect('activate', Lang.bind(this, this._onQuitSessionActivate));
this.menu.addMenuItem(item); this.menu.addMenuItem(item);
item = new PopupMenu.PopupImageMenuItem(_("Shut Down..."), 'system-shutdown'); item = new PopupMenu.PopupSeparatorMenuItem();
this.menu.addMenuItem(item);
item = new PopupMenu.PopupMenuItem(_("Suspend"));
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)); item.connect('activate', Lang.bind(this, this._onShutDownActivate));
this.menu.addMenuItem(item); this.menu.addMenuItem(item);
}, },
@ -142,7 +160,7 @@ StatusMenuButton.prototype = {
this._presence.setStatus(status); this._presence.setStatus(status);
}, },
_onAccountInformationActivate: function() { _onMyAccountActivate: function() {
Main.overview.hide(); Main.overview.hide();
this._spawn(['gnome-about-me']); this._spawn(['gnome-about-me']);
}, },

View File

@ -415,7 +415,7 @@ WindowManager.prototype = {
return; return;
} }
let windows = global.get_windows(); let windows = global.get_window_actors();
/* @direction is the direction that the "camera" moves, so the /* @direction is the direction that the "camera" moves, so the
* screen contents have to move one screen's worth in the * screen contents have to move one screen's worth in the

View File

@ -553,18 +553,10 @@ WindowOverlay.prototype = {
_onStyleChanged: function() { _onStyleChanged: function() {
let titleNode = this.title.get_theme_node(); let titleNode = this.title.get_theme_node();
this.title._spacing = titleNode.get_length('-shell-caption-spacing');
let [success, len] = titleNode.get_length('-shell-caption-spacing',
false);
if (success)
this.title._spacing = len;
let closeNode = this.closeButton.get_theme_node(); let closeNode = this.closeButton.get_theme_node();
this.closeButton._overlap = closeNode.get_length('-shell-close-overlap');
[success, len] = closeNode.get_length('-shell-close-overlap',
false);
if (success)
this.closeButton._overlap = len;
this._parentActor.queue_relayout(); this._parentActor.queue_relayout();
} }
@ -610,7 +602,7 @@ Workspace.prototype = {
this.actor.height = global.screen_height; this.actor.height = global.screen_height;
this.scale = 1.0; this.scale = 1.0;
let windows = global.get_windows().filter(this._isMyWindow, this); let windows = global.get_window_actors().filter(this._isMyWindow, this);
// Find the desktop window // Find the desktop window
for (let i = 0; i < windows.length; i++) { for (let i = 0; i < windows.length; i++) {

View File

@ -33,8 +33,7 @@ WorkspaceSwitcherPopup.prototype = {
this._list = new Shell.GenericContainer({ style_class: 'workspace-switcher' }); this._list = new Shell.GenericContainer({ style_class: 'workspace-switcher' });
this._itemSpacing = 0; this._itemSpacing = 0;
this._list.connect('style-changed', Lang.bind(this, function() { this._list.connect('style-changed', Lang.bind(this, function() {
let [found, spacing] = this._list.get_theme_node().get_length('spacing', false); this._itemSpacing = this._list.get_theme_node().get_length('spacing');
this._itemSpacing = (found) ? spacing : 0;
})); }));
this._list.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth)); this._list.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));

View File

@ -43,8 +43,7 @@ GenericWorkspacesView.prototype = {
this.actor.connect('style-changed', Lang.bind(this, this.actor.connect('style-changed', Lang.bind(this,
function() { function() {
let node = this.actor.get_theme_node(); let node = this.actor.get_theme_node();
let [a, spacing] = node.get_length('spacing', false); this._spacing = node.get_length('spacing');
this._spacing = spacing;
if (Main.overview.animationInProgress) if (Main.overview.animationInProgress)
this._computeWorkspacePositions(); this._computeWorkspacePositions();
else else
@ -191,7 +190,7 @@ GenericWorkspacesView.prototype = {
}, },
_onRestacked: function() { _onRestacked: function() {
let stack = global.get_windows(); let stack = global.get_window_actors();
let stackIndices = {}; let stackIndices = {};
for (let i = 0; i < stack.length; i++) { for (let i = 0; i < stack.length; i++) {
@ -609,7 +608,7 @@ WorkspaceIndicator.prototype = {
this._indicatorsPanel.add_actor(actor); this._indicatorsPanel.add_actor(actor);
let [a, spacing] = actor.get_theme_node().get_length('border-spacing', false); let spacing = actor.get_theme_node().get_length('border-spacing');
actor.x = spacing * i + actor.width * i; actor.x = spacing * i + actor.width * i;
}, },

View File

@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: gnome-shell.master\n" "Project-Id-Version: gnome-shell.master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-"
"shell&component=general\n" "shell&component=general\n"
"POT-Creation-Date: 2010-10-18 08:59+0000\n" "POT-Creation-Date: 2010-10-25 21:45+0000\n"
"PO-Revision-Date: 2010-10-18 11:12+0200\n" "PO-Revision-Date: 2010-10-26 10:43+0200\n"
"Last-Translator: Jorge González <jorgegonz@svn.gnome.org>\n" "Last-Translator: Jorge González <jorgegonz@svn.gnome.org>\n"
"Language-Team: Español <gnome-es-list@gnome.org>\n" "Language-Team: Español <gnome-es-list@gnome.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -503,58 +503,58 @@ msgid "Undo"
msgstr "Deshacer" msgstr "Deshacer"
#. TODO - _quit() doesn't really work on apps in state STARTING yet #. TODO - _quit() doesn't really work on apps in state STARTING yet
#: ../js/ui/panel.js:468 #: ../js/ui/panel.js:469
#, c-format #, c-format
msgid "Quit %s" msgid "Quit %s"
msgstr "Salir de %s" msgstr "Salir de %s"
#: ../js/ui/panel.js:493 #: ../js/ui/panel.js:494
msgid "Preferences" msgid "Preferences"
msgstr "Preferencias" msgstr "Preferencias"
#. Translators: This is the time format with date used #. Translators: This is the time format with date used
#. in 24-hour mode. #. in 24-hour mode.
#: ../js/ui/panel.js:579 #: ../js/ui/panel.js:580
msgid "%a %b %e, %R:%S" msgid "%a %b %e, %R:%S"
msgstr "%a %e de %b, %R:%S" msgstr "%a %e de %b, %R:%S"
#: ../js/ui/panel.js:580 #: ../js/ui/panel.js:581
msgid "%a %b %e, %R" msgid "%a %b %e, %R"
msgstr "%a %e de %b, %R" msgstr "%a %e de %b, %R"
#. Translators: This is the time format without date used #. Translators: This is the time format without date used
#. in 24-hour mode. #. in 24-hour mode.
#: ../js/ui/panel.js:584 #: ../js/ui/panel.js:585
msgid "%a %R:%S" msgid "%a %R:%S"
msgstr "%a %R:%S" msgstr "%a %R:%S"
#: ../js/ui/panel.js:585 #: ../js/ui/panel.js:586
msgid "%a %R" msgid "%a %R"
msgstr "%a %R" msgstr "%a %R"
#. Translators: This is a time format with date used #. Translators: This is a time format with date used
#. for AM/PM. #. for AM/PM.
#: ../js/ui/panel.js:592 #: ../js/ui/panel.js:593
msgid "%a %b %e, %l:%M:%S %p" msgid "%a %b %e, %l:%M:%S %p"
msgstr "%a %e de %b, %H:%M:%S" msgstr "%a %e de %b, %H:%M:%S"
#: ../js/ui/panel.js:593 #: ../js/ui/panel.js:594
msgid "%a %b %e, %l:%M %p" msgid "%a %b %e, %l:%M %p"
msgstr "%a %e de %b, %H:%M" msgstr "%a %e de %b, %H:%M"
#. Translators: This is a time format without date used #. Translators: This is a time format without date used
#. for AM/PM. #. for AM/PM.
#: ../js/ui/panel.js:597 #: ../js/ui/panel.js:598
msgid "%a %l:%M:%S %p" msgid "%a %l:%M:%S %p"
msgstr "%a %H:%M:%S" msgstr "%a %H:%M:%S"
#: ../js/ui/panel.js:598 #: ../js/ui/panel.js:599
msgid "%a %l:%M %p" msgid "%a %l:%M %p"
msgstr "%a %H:%M" msgstr "%a %H:%M"
#. Button on the left side of the panel. #. 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". #. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview".
#: ../js/ui/panel.js:743 #: ../js/ui/panel.js:744
msgid "Activities" msgid "Activities"
msgstr "Actividades" msgstr "Actividades"
@ -589,39 +589,48 @@ msgstr "Introduzca un comando:"
msgid "Execution of '%s' failed:" msgid "Execution of '%s' failed:"
msgstr "Falló la ejecución de «%s»:" msgstr "Falló la ejecución de «%s»:"
#: ../js/ui/statusMenu.js:97 #: ../js/ui/statusMenu.js:101
msgid "Available" msgid "Available"
msgstr "Disponible" msgstr "Disponible"
#: ../js/ui/statusMenu.js:101 #: ../js/ui/statusMenu.js:106
msgid "Busy" msgid "Busy"
msgstr "Ocupado" msgstr "Ocupado"
#: ../js/ui/statusMenu.js:105 #: ../js/ui/statusMenu.js:111
msgid "Invisible" msgid "Invisible"
msgstr "Invisible" msgstr "Invisible"
#: ../js/ui/statusMenu.js:112 #: ../js/ui/statusMenu.js:119
msgid "Account Information..." msgid "My Account..."
msgstr "Información de la cuenta…" msgstr "Mi cuenta…"
#: ../js/ui/statusMenu.js:116
msgid "System Settings..."
msgstr "Ajustes del sistema…"
#: ../js/ui/statusMenu.js:123 #: ../js/ui/statusMenu.js:123
#| msgid "Preferences"
msgid "System Preferences..."
msgstr "Preferencias del sistema…"
#: ../js/ui/statusMenu.js:130
msgid "Lock Screen" msgid "Lock Screen"
msgstr "Bloquear la pantalla" msgstr "Bloquear la pantalla"
#: ../js/ui/statusMenu.js:127 #: ../js/ui/statusMenu.js:134
msgid "Switch User" msgid "Switch User"
msgstr "Cambiar de usuario" msgstr "Cambiar de usuario"
#: ../js/ui/statusMenu.js:132 #: ../js/ui/statusMenu.js:139
msgid "Log Out..." msgid "Log Out..."
msgstr "Salir…" msgstr "Salir…"
#: ../js/ui/statusMenu.js:136 #: ../js/ui/statusMenu.js:146
msgid "Suspend"
msgstr "Suspender"
#: ../js/ui/statusMenu.js:150
msgid "Restart..."
msgstr "Reiniciar…"
#: ../js/ui/statusMenu.js:154
msgid "Shut Down..." msgid "Shut Down..."
msgstr "Apagar…" msgstr "Apagar…"
@ -679,43 +688,43 @@ msgstr "%s finalizó su lanzamiento"
msgid "'%s' is ready" msgid "'%s' is ready"
msgstr "«%s» está preparado" msgstr "«%s» está preparado"
#: ../js/ui/workspacesView.js:230 #: ../js/ui/workspacesView.js:229
msgid "" msgid ""
"Can't add a new workspace because maximum workspaces limit has been reached." "Can't add a new workspace because maximum workspaces limit has been reached."
msgstr "" msgstr ""
"No se puede añadir un área de trabajo nueva porque se ha llegado al límite " "No se puede añadir un área de trabajo nueva porque se ha llegado al límite "
"de áreas de trabajo." "de áreas de trabajo."
#: ../js/ui/workspacesView.js:247 #: ../js/ui/workspacesView.js:246
msgid "Can't remove the first workspace." msgid "Can't remove the first workspace."
msgstr "No se puede quitar el primer área de trabajo." msgstr "No se puede quitar el primer área de trabajo."
#: ../src/shell-global.c:1196 #: ../src/shell-global.c:1204
msgid "Less than a minute ago" msgid "Less than a minute ago"
msgstr "Hace menos de un minuto" msgstr "Hace menos de un minuto"
#: ../src/shell-global.c:1200 #: ../src/shell-global.c:1208
#, c-format #, c-format
msgid "%d minute ago" msgid "%d minute ago"
msgid_plural "%d minutes ago" msgid_plural "%d minutes ago"
msgstr[0] "Hace %d minuto" msgstr[0] "Hace %d minuto"
msgstr[1] "Hace %d minutos" msgstr[1] "Hace %d minutos"
#: ../src/shell-global.c:1205 #: ../src/shell-global.c:1213
#, c-format #, c-format
msgid "%d hour ago" msgid "%d hour ago"
msgid_plural "%d hours ago" msgid_plural "%d hours ago"
msgstr[0] "Hace %d hora" msgstr[0] "Hace %d hora"
msgstr[1] "Hace %d horas" msgstr[1] "Hace %d horas"
#: ../src/shell-global.c:1210 #: ../src/shell-global.c:1218
#, c-format #, c-format
msgid "%d day ago" msgid "%d day ago"
msgid_plural "%d days ago" msgid_plural "%d days ago"
msgstr[0] "Hace %d día" msgstr[0] "Hace %d día"
msgstr[1] "Hace %d días" msgstr[1] "Hace %d días"
#: ../src/shell-global.c:1215 #: ../src/shell-global.c:1223
#, c-format #, c-format
msgid "%d week ago" msgid "%d week ago"
msgid_plural "%d weeks ago" msgid_plural "%d weeks ago"
@ -746,6 +755,12 @@ msgstr "Buscar"
msgid "%1$s: %2$s" msgid "%1$s: %2$s"
msgstr "%1$s: %2$s" msgstr "%1$s: %2$s"
#~ msgid "Account Information..."
#~ msgstr "Información de la cuenta…"
#~ msgid "System Settings..."
#~ msgstr "Ajustes del sistema…"
#~ msgid "ON" #~ msgid "ON"
#~ msgstr "ENCENDIDO" #~ msgstr "ENCENDIDO"

181
po/gl.po
View File

@ -10,8 +10,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gnome-shell master\n" "Project-Id-Version: gnome-shell master\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-10-07 13:04+0200\n" "POT-Creation-Date: 2010-10-26 16:28+0200\n"
"PO-Revision-Date: 2010-10-07 13:20+0200\n" "PO-Revision-Date: 2010-10-26 16:36+0200\n"
"Last-Translator: Fran Diéguez <frandieguez@ubuntu.com>\n" "Last-Translator: Fran Diéguez <frandieguez@ubuntu.com>\n"
"Language-Team: Galician <gnome-gl-list@gnome.org>\n" "Language-Team: Galician <gnome-gl-list@gnome.org>\n"
"Language: gl\n" "Language: gl\n"
@ -43,7 +43,7 @@ msgid ""
"dialog." "dialog."
msgstr "" msgstr ""
"Permite o acceso ás ferramentas de depuración e monitorización internas " "Permite o acceso ás ferramentas de depuración e monitorización internas "
"usando o diálogo Alt-F2" "usando o diálogo Alt-F2."
#: ../data/org.gnome.shell.gschema.xml.in.h:2 #: ../data/org.gnome.shell.gschema.xml.in.h:2
msgid "Custom format of the clock" msgid "Custom format of the clock"
@ -84,7 +84,7 @@ msgid ""
"If true and format is either \"12-hour\" or \"24-hour\", display date in the " "If true and format is either \"12-hour\" or \"24-hour\", display date in the "
"clock, in addition to time." "clock, in addition to time."
msgstr "" msgstr ""
"Se é verdadeiro e o formato é \"12-hour\" ou \"24-hour\" móstrase a data no " "Se é verdadeiro e o formato é «12-hour» ou «24-hour» móstrase a data no "
"reloxo, ademais da hora." "reloxo, ademais da hora."
#: ../data/org.gnome.shell.gschema.xml.in.h:10 #: ../data/org.gnome.shell.gschema.xml.in.h:10
@ -92,8 +92,8 @@ msgid ""
"If true and format is either \"12-hour\" or \"24-hour\", display seconds in " "If true and format is either \"12-hour\" or \"24-hour\", display seconds in "
"time." "time."
msgstr "" msgstr ""
"Se é verdadeiro e o formato é \"12-hour\" ou \"24-hour\" móstranse os " "Se é verdadeiro e o formato é «12-hour» ou «24-hour» móstranse os segundos "
"segundos na hora." "na hora."
#: ../data/org.gnome.shell.gschema.xml.in.h:11 #: ../data/org.gnome.shell.gschema.xml.in.h:11
msgid "If true, display the ISO week date in the calendar." msgid "If true, display the ISO week date in the calendar."
@ -118,10 +118,15 @@ msgid ""
"to an empty value, the default pipeline will be used. This is currently " "to an empty value, the default pipeline will be used. This is currently "
"'videorate ! theoraenc ! oggmux' and records to Ogg Theora." "'videorate ! theoraenc ! oggmux' and records to Ogg Theora."
msgstr "" msgstr ""
"Estabelece a tubería do GStreamer usada para codificar as gravacións. Segue " "Estabelece a tubería GStreamer usada para codificar gravacións. Segue a "
"a sintaxe usada por gst-launch. A tubería debe ter un desprazamento de " "sintaxe usada para gst-launch. A tubería debería ter un sumideiro («sink») "
"sumideiro non conectado cando o vídeo gravado estea gravado. Normalmente " "de ensamblaxe/desensamblaxe onde o vídeo que se está gravando grávase. "
"terá un ......." "Xeralmente terá unha orixe de ensamblado/desensamblado; a saída dese punto "
"escribirase no ficheiro de saída. Porén, a tubería tamén pode tomar parte na "
"súa propia saída; isto pódese usar para enviar a saída a un servidor "
"«icecast» a través de shout2send ou similar. Cando non está estabelecido ou "
"está a un valor baleiro, usarase a tubería predeterminada. Actualmente é "
"«videorate ! theoraenc ! oggmux» e grava en Ogg Theora."
#: ../data/org.gnome.shell.gschema.xml.in.h:15 #: ../data/org.gnome.shell.gschema.xml.in.h:15
msgid "Show date in clock" msgid "Show date in clock"
@ -207,12 +212,12 @@ msgid ""
"the show_date and show_seconds keys are ignored." "the show_date and show_seconds keys are ignored."
msgstr "" msgstr ""
"Esta chave especifica o formato de hora usado polo reloxo do panel. Os " "Esta chave especifica o formato de hora usado polo reloxo do panel. Os "
"posíbeis valores son \"12-hour\", \"24-hour\", \"unix\"e \"custom\". Se está " "posíbeis valores son «12-hour», «24-hour», «unix» e «custom». Se está "
"estabelecido a \"unix\", o reloxo mostrará a hora en segundos desde Epoch, p." "estabelecido a «unix», o reloxo mostrará a hora en segundos desde Epoch, p."
"ex. 01-01-1970. Se está estabelecido a \"custom\", o reloxo mostrará a hora " "ex. 01-01-1970. Se está estabelecido a «custom», o reloxo mostrará a hora "
"segundo o formato especificado na chave custom_format. Teña en conta que se " "segundo o formato especificado na chave custom_format. Teña en conta que se "
"está estabelecido a \"unix\" ou \"custom\", as chaves show_date e " "está estabelecido a «unix» ou «custom», as chaves show_date e show_seconds "
"show_seconds ignoraranse." "ignoraranse."
#: ../data/org.gnome.shell.gschema.xml.in.h:26 #: ../data/org.gnome.shell.gschema.xml.in.h:26
msgid "Uuids of extensions to disable" msgid "Uuids of extensions to disable"
@ -220,7 +225,7 @@ msgstr "Os Uuid das extensións a desactivar"
#: ../data/org.gnome.shell.gschema.xml.in.h:27 #: ../data/org.gnome.shell.gschema.xml.in.h:27
msgid "Whether to collect stats about applications usage" msgid "Whether to collect stats about applications usage"
msgstr "Indica se recoller estatísticas sobre o uso dos aplicativos ou non." msgstr "Indica se recoller estatísticas sobre o uso dos aplicativos"
#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:1 #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:1
msgid "Clip the crosshairs at the center" msgid "Clip the crosshairs at the center"
@ -250,6 +255,15 @@ msgid ""
"push: when the magnified mouse intersects a boundary of the zoom region, the " "push: when the magnified mouse intersects a boundary of the zoom region, the "
"contents are scrolled into view." "contents are scrolled into view."
msgstr "" msgstr ""
"Determina a posición da imaxe magnificada do rato dentro da vista "
"magnificada e como reacciona ao movemento do rato do sistema. Os valores son "
"«none» (ningún): sen seguimento do rato; «centered» (centrado): a imaxe do "
"rato móstrase no centro da rexión ampliada (que tamén representa o punto "
"baixo o rato do sistema) e o contido magnificado deslízase segundo se move o "
"rato do sistema; «proporcional»: a posición do rato magnificado na rexión de "
"ampliación é proporcionalmente a mesma que a posición do rato do sistema na "
"pantalla; «push» (empurrar): cando o rato magnificado cruza un límite da "
"rexión de ampliación, o contido deslízase na vista."
#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:5 #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:5
msgid "" msgid ""
@ -265,11 +279,13 @@ msgid ""
"are clipped such that the ends of the horizontal and vertical lines surround " "are clipped such that the ends of the horizontal and vertical lines surround "
"the mouse image." "the mouse image."
msgstr "" msgstr ""
"Determina se as cruces cruzan o «sprite» magnificado do rato ou fíxanse de "
"tal forma que os finais das liñas horizontais e verticais rodean a imaxe do "
"rato."
#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:7 #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:7
#, fuzzy
msgid "Enable lens mode" msgid "Enable lens mode"
msgstr "Activado" msgstr "Activar o modo lente"
#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:8 #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:8
msgid "" msgid ""
@ -277,7 +293,7 @@ msgid ""
"sprite." "sprite."
msgstr "" msgstr ""
"Activa/desactiva a visualización do punto de mira centrada no mapa de bits " "Activa/desactiva a visualización do punto de mira centrada no mapa de bits "
"de magnificación do rato" "de magnificación do rato."
#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:9 #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:9
msgid "" msgid ""
@ -285,6 +301,9 @@ msgid ""
"of the screen, the magnified contents continue to scroll such that the " "of the screen, the magnified contents continue to scroll such that the "
"screen edge moves into the magnified view." "screen edge moves into the magnified view."
msgstr "" msgstr ""
"Para o seguimento do centro do rato, cando o punteiro do sistema está preto "
"do bordo da pantalla, o contido magnificado continúa desprazándose de tal "
"forma que o bordo da pantalla móvese dentro da vista magnificada."
#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:10 #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:10
msgid "Length of the crosshairs" msgid "Length of the crosshairs"
@ -442,7 +461,7 @@ msgstr "Non hai resultados que coincidan."
#. network locations, etc. #. network locations, etc.
#: ../js/ui/dash.js:797 ../js/ui/placeDisplay.js:554 #: ../js/ui/dash.js:797 ../js/ui/placeDisplay.js:554
msgid "PLACES & DEVICES" msgid "PLACES & DEVICES"
msgstr "LUGARES e DISPOSITIVOS" msgstr "LUGARES E DISPOSITIVOS"
#. **** Documents **** #. **** Documents ****
#: ../js/ui/dash.js:804 ../js/ui/docDisplay.js:494 #: ../js/ui/dash.js:804 ../js/ui/docDisplay.js:494
@ -482,58 +501,58 @@ msgid "Undo"
msgstr "Desfacer" msgstr "Desfacer"
#. TODO - _quit() doesn't really work on apps in state STARTING yet #. TODO - _quit() doesn't really work on apps in state STARTING yet
#: ../js/ui/panel.js:468 #: ../js/ui/panel.js:469
#, c-format #, c-format
msgid "Quit %s" msgid "Quit %s"
msgstr "Saír de %s" msgstr "Saír de %s"
#: ../js/ui/panel.js:493 #: ../js/ui/panel.js:494
msgid "Preferences" msgid "Preferences"
msgstr "Preferencias" msgstr "Preferencias"
#. Translators: This is the time format with date used #. Translators: This is the time format with date used
#. in 24-hour mode. #. in 24-hour mode.
#: ../js/ui/panel.js:579 #: ../js/ui/panel.js:580
msgid "%a %b %e, %R:%S" msgid "%a %b %e, %R:%S"
msgstr "%a %e de %b, %R:%S" msgstr "%a %e de %b, %R:%S"
#: ../js/ui/panel.js:580 #: ../js/ui/panel.js:581
msgid "%a %b %e, %R" msgid "%a %b %e, %R"
msgstr "%a %e de %b, %R" msgstr "%a %e de %b, %R"
#. Translators: This is the time format without date used #. Translators: This is the time format without date used
#. in 24-hour mode. #. in 24-hour mode.
#: ../js/ui/panel.js:584 #: ../js/ui/panel.js:585
msgid "%a %R:%S" msgid "%a %R:%S"
msgstr "%a %R:%S" msgstr "%a %R:%S"
#: ../js/ui/panel.js:585 #: ../js/ui/panel.js:586
msgid "%a %R" msgid "%a %R"
msgstr "%a %R" msgstr "%a %R"
#. Translators: This is a time format with date used #. Translators: This is a time format with date used
#. for AM/PM. #. for AM/PM.
#: ../js/ui/panel.js:592 #: ../js/ui/panel.js:593
msgid "%a %b %e, %l:%M:%S %p" msgid "%a %b %e, %l:%M:%S %p"
msgstr "%a %e de %b, %H:%M:%S" msgstr "%a %e de %b, %H:%M:%S"
#: ../js/ui/panel.js:593 #: ../js/ui/panel.js:594
msgid "%a %b %e, %l:%M %p" msgid "%a %b %e, %l:%M %p"
msgstr "%a %e de %b, %H:%M" msgstr "%a %e de %b, %H:%M"
#. Translators: This is a time format without date used #. Translators: This is a time format without date used
#. for AM/PM. #. for AM/PM.
#: ../js/ui/panel.js:597 #: ../js/ui/panel.js:598
msgid "%a %l:%M:%S %p" msgid "%a %l:%M:%S %p"
msgstr "%a %H:%M:%S" msgstr "%a %H:%M:%S"
#: ../js/ui/panel.js:598 #: ../js/ui/panel.js:599
msgid "%a %l:%M %p" msgid "%a %l:%M %p"
msgstr "%a %l:%M %p" msgstr "%a %l:%M %p"
#. Button on the left side of the panel. #. 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". #. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview".
#: ../js/ui/panel.js:743 #: ../js/ui/panel.js:744
msgid "Activities" msgid "Activities"
msgstr "Actividades" msgstr "Actividades"
@ -566,44 +585,96 @@ msgstr "Insira unha orde:"
#: ../js/ui/runDialog.js:378 #: ../js/ui/runDialog.js:378
#, c-format #, c-format
msgid "Execution of '%s' failed:" msgid "Execution of '%s' failed:"
msgstr "Produciuse un fallo na execución de %s" msgstr "Produciuse un fallo na execución de «%s»:"
#: ../js/ui/statusMenu.js:91 #: ../js/ui/statusMenu.js:101
msgid "Available" msgid "Available"
msgstr "Dispoñíbel" msgstr "Dispoñíbel"
#: ../js/ui/statusMenu.js:95 #: ../js/ui/statusMenu.js:106
msgid "Busy" msgid "Busy"
msgstr "Ocupado" msgstr "Ocupado"
#: ../js/ui/statusMenu.js:99 #: ../js/ui/statusMenu.js:111
msgid "Invisible" msgid "Invisible"
msgstr "Invisíbel" msgstr "Invisíbel"
#: ../js/ui/statusMenu.js:106 #: ../js/ui/statusMenu.js:119
msgid "Account Information..." msgid "My Account..."
msgstr "Información da conta..." msgstr "A miña conta..."
#: ../js/ui/statusMenu.js:110 #: ../js/ui/statusMenu.js:123
msgid "System Settings..." msgid "System Preferences..."
msgstr "Configuracións do sistema..." msgstr "Preferencias do sistema..."
#: ../js/ui/statusMenu.js:117 #: ../js/ui/statusMenu.js:130
msgid "Lock Screen" msgid "Lock Screen"
msgstr "Bloquear pantalla" msgstr "Bloquear pantalla"
#: ../js/ui/statusMenu.js:121 #: ../js/ui/statusMenu.js:134
msgid "Switch User" msgid "Switch User"
msgstr "Cambiar de usuario" msgstr "Cambiar de usuario"
#: ../js/ui/statusMenu.js:126 #: ../js/ui/statusMenu.js:139
msgid "Log Out..." msgid "Log Out..."
msgstr "Saír da sesión..." msgstr "Saír da sesión..."
#: ../js/ui/statusMenu.js:130 #: ../js/ui/statusMenu.js:146
msgid "Suspend"
msgstr "Suspender"
#: ../js/ui/statusMenu.js:150
msgid "Restart..."
msgstr "Reiniciar..."
#: ../js/ui/statusMenu.js:154
msgid "Shut Down..." msgid "Shut Down..."
msgstr "Apagar..." msgstr "Apagar..."
#: ../js/ui/status/accessibility.js:88
msgid "Screen Reader"
msgstr "Lector de pantalla"
#: ../js/ui/status/accessibility.js:91
msgid "Screen Keyboard"
msgstr "Teclado en pantalla"
#: ../js/ui/status/accessibility.js:94
msgid "Visual Alerts"
msgstr "Alertas visuais"
#: ../js/ui/status/accessibility.js:97
msgid "Sticky Keys"
msgstr "Teclas persistentes"
#: ../js/ui/status/accessibility.js:100
msgid "Slow Keys"
msgstr "Teclas lentas"
#: ../js/ui/status/accessibility.js:103
msgid "Bounce Keys"
msgstr "Rebote das teclas"
#: ../js/ui/status/accessibility.js:106
msgid "Mouse Keys"
msgstr "Teclas do Rato"
#: ../js/ui/status/accessibility.js:110
msgid "Universal Access Settings"
msgstr "Configuracións de acceso universal"
#: ../js/ui/status/accessibility.js:163
msgid "High Contrast"
msgstr "Alto contraste"
#: ../js/ui/status/accessibility.js:202
msgid "Large Text"
msgstr "Texto máis grande"
#: ../js/ui/status/accessibility.js:223
msgid "Zoom"
msgstr "Ampliación"
#: ../js/ui/windowAttentionHandler.js:43 #: ../js/ui/windowAttentionHandler.js:43
#, c-format #, c-format
msgid "%s has finished starting" msgid "%s has finished starting"
@ -614,43 +685,43 @@ msgstr "%s rematou de iniarse"
msgid "'%s' is ready" msgid "'%s' is ready"
msgstr "«%s» está preparado" msgstr "«%s» está preparado"
#: ../js/ui/workspacesView.js:230 #: ../js/ui/workspacesView.js:229
msgid "" msgid ""
"Can't add a new workspace because maximum workspaces limit has been reached." "Can't add a new workspace because maximum workspaces limit has been reached."
msgstr "" msgstr ""
"Non é posíbel engadir unha área de traballo nova porque chegouse ao límite " "Non é posíbel engadir unha área de traballo nova porque chegouse ao límite "
"de áreas de traballo." "de áreas de traballo."
#: ../js/ui/workspacesView.js:247 #: ../js/ui/workspacesView.js:246
msgid "Can't remove the first workspace." msgid "Can't remove the first workspace."
msgstr "Non é posíbel quitar a primeira área de traballo." msgstr "Non é posíbel quitar a primeira área de traballo."
#: ../src/shell-global.c:1196 #: ../src/shell-global.c:1204
msgid "Less than a minute ago" msgid "Less than a minute ago"
msgstr "Hai menos dun minuto" msgstr "Hai menos dun minuto"
#: ../src/shell-global.c:1200 #: ../src/shell-global.c:1208
#, c-format #, c-format
msgid "%d minute ago" msgid "%d minute ago"
msgid_plural "%d minutes ago" msgid_plural "%d minutes ago"
msgstr[0] "hai %d minuto" msgstr[0] "hai %d minuto"
msgstr[1] "hai %d minutos" msgstr[1] "hai %d minutos"
#: ../src/shell-global.c:1205 #: ../src/shell-global.c:1213
#, c-format #, c-format
msgid "%d hour ago" msgid "%d hour ago"
msgid_plural "%d hours ago" msgid_plural "%d hours ago"
msgstr[0] "hai %d hora" msgstr[0] "hai %d hora"
msgstr[1] "hai %d horas" msgstr[1] "hai %d horas"
#: ../src/shell-global.c:1210 #: ../src/shell-global.c:1218
#, c-format #, c-format
msgid "%d day ago" msgid "%d day ago"
msgid_plural "%d days ago" msgid_plural "%d days ago"
msgstr[0] "hai %d día" msgstr[0] "hai %d día"
msgstr[1] "hai %d días" msgstr[1] "hai %d días"
#: ../src/shell-global.c:1215 #: ../src/shell-global.c:1223
#, c-format #, c-format
msgid "%d week ago" msgid "%d week ago"
msgid_plural "%d weeks ago" msgid_plural "%d weeks ago"
@ -681,6 +752,12 @@ msgstr "Buscar"
msgid "%1$s: %2$s" msgid "%1$s: %2$s"
msgstr "%1$s: %2$s" msgstr "%1$s: %2$s"
#~ msgid "Account Information..."
#~ msgstr "Información da conta..."
#~ msgid "System Settings..."
#~ msgstr "Configuracións do sistema..."
#~ msgid "ON" #~ msgid "ON"
#~ msgstr "⚫" #~ msgstr "⚫"

124
po/he.po
View File

@ -8,8 +8,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gnome-shell master\n" "Project-Id-Version: gnome-shell master\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-10-06 02:19+0200\n" "POT-Creation-Date: 2010-10-26 08:20+0200\n"
"PO-Revision-Date: 2010-10-06 02:28+0200\n" "PO-Revision-Date: 2010-10-26 08:20+0200\n"
"Last-Translator: Yaron Shahrabani <sh.yaron@gmail.com>\n" "Last-Translator: Yaron Shahrabani <sh.yaron@gmail.com>\n"
"Language-Team: Hebrew <he@li.org>\n" "Language-Team: Hebrew <he@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -494,58 +494,58 @@ msgid "Undo"
msgstr "ביטול" msgstr "ביטול"
#. TODO - _quit() doesn't really work on apps in state STARTING yet #. TODO - _quit() doesn't really work on apps in state STARTING yet
#: ../js/ui/panel.js:461 #: ../js/ui/panel.js:469
#, c-format #, c-format
msgid "Quit %s" msgid "Quit %s"
msgstr "יציאה מ־%s" msgstr "יציאה מ־%s"
#: ../js/ui/panel.js:486 #: ../js/ui/panel.js:494
msgid "Preferences" msgid "Preferences"
msgstr "העדפות" msgstr "העדפות"
#. Translators: This is the time format with date used #. Translators: This is the time format with date used
#. in 24-hour mode. #. in 24-hour mode.
#: ../js/ui/panel.js:572 #: ../js/ui/panel.js:580
msgid "%a %b %e, %R:%S" msgid "%a %b %e, %R:%S"
msgstr "%a %b %e, %R:%S" msgstr "%a %b %e, %R:%S"
#: ../js/ui/panel.js:573 #: ../js/ui/panel.js:581
msgid "%a %b %e, %R" msgid "%a %b %e, %R"
msgstr "%a %b %e, %R" msgstr "%a %b %e, %R"
#. Translators: This is the time format without date used #. Translators: This is the time format without date used
#. in 24-hour mode. #. in 24-hour mode.
#: ../js/ui/panel.js:577 #: ../js/ui/panel.js:585
msgid "%a %R:%S" msgid "%a %R:%S"
msgstr "%a %R:%S" msgstr "%a %R:%S"
#: ../js/ui/panel.js:578 #: ../js/ui/panel.js:586
msgid "%a %R" msgid "%a %R"
msgstr "%a %R" msgstr "%a %R"
#. Translators: This is a time format with date used #. Translators: This is a time format with date used
#. for AM/PM. #. for AM/PM.
#: ../js/ui/panel.js:585 #: ../js/ui/panel.js:593
msgid "%a %b %e, %l:%M:%S %p" msgid "%a %b %e, %l:%M:%S %p"
msgstr "%a %b %e, %l:%M:%S %p" msgstr "%a %b %e, %l:%M:%S %p"
#: ../js/ui/panel.js:586 #: ../js/ui/panel.js:594
msgid "%a %b %e, %l:%M %p" msgid "%a %b %e, %l:%M %p"
msgstr "%a %b %e, %l:%M %p" msgstr "%a %b %e, %l:%M %p"
#. Translators: This is a time format without date used #. Translators: This is a time format without date used
#. for AM/PM. #. for AM/PM.
#: ../js/ui/panel.js:590 #: ../js/ui/panel.js:598
msgid "%a %l:%M:%S %p" msgid "%a %l:%M:%S %p"
msgstr "%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" msgid "%a %l:%M %p"
msgstr "%a %l:%M %p" msgstr "%a %l:%M %p"
#. Button on the left side of the panel. #. 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". #. 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" msgid "Activities"
msgstr "פעילויות" msgstr "פעילויות"
@ -580,42 +580,94 @@ msgstr "נא להזין פקודה:"
msgid "Execution of '%s' failed:" msgid "Execution of '%s' failed:"
msgstr "ההרצה של '%s' נכשלה:" msgstr "ההרצה של '%s' נכשלה:"
#: ../js/ui/statusMenu.js:91 #: ../js/ui/statusMenu.js:101
msgid "Available" msgid "Available"
msgstr "זמין" msgstr "זמין"
#: ../js/ui/statusMenu.js:95 #: ../js/ui/statusMenu.js:106
msgid "Busy" msgid "Busy"
msgstr "עסוק" msgstr "עסוק"
#: ../js/ui/statusMenu.js:99 #: ../js/ui/statusMenu.js:111
msgid "Invisible" msgid "Invisible"
msgstr "בלתי נראה" msgstr "בלתי נראה"
#: ../js/ui/statusMenu.js:106 #: ../js/ui/statusMenu.js:119
msgid "Account Information..." msgid "My Account..."
msgstr "פרטי המשתמש..." msgstr "החשבון שלי..."
#: ../js/ui/statusMenu.js:110 #: ../js/ui/statusMenu.js:123
msgid "System Settings..." msgid "System Preferences..."
msgstr "הגדרות מערכת..." msgstr "העדפות המערכת..."
#: ../js/ui/statusMenu.js:117 #: ../js/ui/statusMenu.js:130
msgid "Lock Screen" msgid "Lock Screen"
msgstr "נעילת המסך" msgstr "נעילת המסך"
#: ../js/ui/statusMenu.js:121 #: ../js/ui/statusMenu.js:134
msgid "Switch User" msgid "Switch User"
msgstr "החלפת משתמש" msgstr "החלפת משתמש"
#: ../js/ui/statusMenu.js:126 #: ../js/ui/statusMenu.js:139
msgid "Log Out..." msgid "Log Out..."
msgstr "ניתוק..." 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..." msgid "Shut Down..."
msgstr "כיבוי..." 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 #: ../js/ui/windowAttentionHandler.js:43
#, c-format #, c-format
msgid "%s has finished starting" msgid "%s has finished starting"
@ -626,20 +678,20 @@ msgstr "%s סיים את תהליך ההתחלה"
msgid "'%s' is ready" msgid "'%s' is ready"
msgstr "'%s' מוכן" msgstr "'%s' מוכן"
#: ../js/ui/workspacesView.js:230 #: ../js/ui/workspacesView.js:229
msgid "" msgid ""
"Can't add a new workspace because maximum workspaces limit has been reached." "Can't add a new workspace because maximum workspaces limit has been reached."
msgstr "לא ניתן להוסיף מרחבי עבודה כיוון שהם ממלאים את המכסה המרבית." msgstr "לא ניתן להוסיף מרחבי עבודה כיוון שהם ממלאים את המכסה המרבית."
#: ../js/ui/workspacesView.js:247 #: ../js/ui/workspacesView.js:246
msgid "Can't remove the first workspace." msgid "Can't remove the first workspace."
msgstr "לא ניתן להסיר את מרחב העבודה הראשון." msgstr "לא ניתן להסיר את מרחב העבודה הראשון."
#: ../src/shell-global.c:1196 #: ../src/shell-global.c:1204
msgid "Less than a minute ago" msgid "Less than a minute ago"
msgstr "לפני פחות מדקה" msgstr "לפני פחות מדקה"
#: ../src/shell-global.c:1200 #: ../src/shell-global.c:1208
#, c-format #, c-format
msgid "%d minute ago" msgid "%d minute ago"
msgid_plural "%d minutes ago" msgid_plural "%d minutes ago"
@ -647,7 +699,7 @@ msgstr[0] "לפני דקה"
msgstr[1] "לפני %d דקות" msgstr[1] "לפני %d דקות"
msgstr[2] "לפני 2 דקות" msgstr[2] "לפני 2 דקות"
#: ../src/shell-global.c:1205 #: ../src/shell-global.c:1213
#, c-format #, c-format
msgid "%d hour ago" msgid "%d hour ago"
msgid_plural "%d hours ago" msgid_plural "%d hours ago"
@ -655,7 +707,7 @@ msgstr[0] "לפני שעה"
msgstr[1] "לפני %d שעות" msgstr[1] "לפני %d שעות"
msgstr[2] "לפני שעתיים" msgstr[2] "לפני שעתיים"
#: ../src/shell-global.c:1210 #: ../src/shell-global.c:1218
#, c-format #, c-format
msgid "%d day ago" msgid "%d day ago"
msgid_plural "%d days ago" msgid_plural "%d days ago"
@ -663,7 +715,7 @@ msgstr[0] "לפני יום"
msgstr[1] "לפני %d ימים" msgstr[1] "לפני %d ימים"
msgstr[2] "לפני יומיים" msgstr[2] "לפני יומיים"
#: ../src/shell-global.c:1215 #: ../src/shell-global.c:1223
#, c-format #, c-format
msgid "%d week ago" msgid "%d week ago"
msgid_plural "%d weeks ago" msgid_plural "%d weeks ago"
@ -695,6 +747,12 @@ msgstr "חיפוש"
msgid "%1$s: %2$s" msgid "%1$s: %2$s"
msgstr "%1$s: %2$s" msgstr "%1$s: %2$s"
#~ msgid "Account Information..."
#~ msgstr "פרטי המשתמש..."
#~ msgid "System Settings..."
#~ msgstr "הגדרות מערכת..."
#~ msgid "ON" #~ msgid "ON"
#~ msgstr "1" #~ msgstr "1"

View File

@ -25,8 +25,7 @@
#include "config.h" #include "config.h"
#define MUTTER_BUILDING_PLUGIN 1 #include <meta-plugin.h>
#include <mutter-plugin.h>
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
@ -57,38 +56,40 @@
static void gnome_shell_plugin_dispose (GObject *object); static void gnome_shell_plugin_dispose (GObject *object);
static void gnome_shell_plugin_finalize (GObject *object); static void gnome_shell_plugin_finalize (GObject *object);
static void gnome_shell_plugin_start (MutterPlugin *plugin); static void gnome_shell_plugin_start (MetaPlugin *plugin);
static void gnome_shell_plugin_minimize (MutterPlugin *plugin, static void gnome_shell_plugin_minimize (MetaPlugin *plugin,
MutterWindow *actor); MetaWindowActor *actor);
static void gnome_shell_plugin_maximize (MutterPlugin *plugin, static void gnome_shell_plugin_maximize (MetaPlugin *plugin,
MutterWindow *actor, MetaWindowActor *actor,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint height); gint height);
static void gnome_shell_plugin_unmaximize (MutterPlugin *plugin, static void gnome_shell_plugin_unmaximize (MetaPlugin *plugin,
MutterWindow *actor, MetaWindowActor *actor,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint height); gint height);
static void gnome_shell_plugin_map (MutterPlugin *plugin, static void gnome_shell_plugin_map (MetaPlugin *plugin,
MutterWindow *actor); MetaWindowActor *actor);
static void gnome_shell_plugin_destroy (MutterPlugin *plugin, static void gnome_shell_plugin_destroy (MetaPlugin *plugin,
MutterWindow *actor); MetaWindowActor *actor);
static void gnome_shell_plugin_switch_workspace (MutterPlugin *plugin, static void gnome_shell_plugin_switch_workspace (MetaPlugin *plugin,
gint from, gint from,
gint to, gint to,
MetaMotionDirection direction); MetaMotionDirection direction);
static void gnome_shell_plugin_kill_window_effects (MutterPlugin *plugin, static void gnome_shell_plugin_kill_window_effects (MetaPlugin *plugin,
MutterWindow *actor); MetaWindowActor *actor);
static void gnome_shell_plugin_kill_switch_workspace (MutterPlugin *plugin); static void gnome_shell_plugin_kill_switch_workspace (MetaPlugin *plugin);
static gboolean gnome_shell_plugin_xevent_filter (MetaPlugin *plugin,
XEvent *event);
static const MetaPluginInfo *gnome_shell_plugin_plugin_info (MetaPlugin *plugin);
static gboolean gnome_shell_plugin_xevent_filter (MutterPlugin *plugin,
XEvent *event);
static const MutterPluginInfo *gnome_shell_plugin_plugin_info (MutterPlugin *plugin);
#define GNOME_TYPE_SHELL_PLUGIN (gnome_shell_plugin_get_type ()) #define GNOME_TYPE_SHELL_PLUGIN (gnome_shell_plugin_get_type ())
#define GNOME_SHELL_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_SHELL_PLUGIN, GnomeShellPlugin)) #define GNOME_SHELL_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_SHELL_PLUGIN, GnomeShellPlugin))
@ -102,7 +103,7 @@ typedef struct _GnomeShellPluginClass GnomeShellPluginClass;
struct _GnomeShellPlugin struct _GnomeShellPlugin
{ {
MutterPlugin parent; MetaPlugin parent;
GjsContext *gjs_context; GjsContext *gjs_context;
Atom panel_action; Atom panel_action;
@ -116,20 +117,20 @@ struct _GnomeShellPlugin
struct _GnomeShellPluginClass struct _GnomeShellPluginClass
{ {
MutterPluginClass parent_class; MetaPluginClass parent_class;
}; };
/* /*
* Create the plugin struct; function pointers initialized in * Create the plugin struct; function pointers initialized in
* g_module_check_init(). * g_module_check_init().
*/ */
MUTTER_PLUGIN_DECLARE(GnomeShellPlugin, gnome_shell_plugin); META_PLUGIN_DECLARE(GnomeShellPlugin, gnome_shell_plugin);
static void static void
gnome_shell_plugin_class_init (GnomeShellPluginClass *klass) gnome_shell_plugin_class_init (GnomeShellPluginClass *klass)
{ {
GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
MutterPluginClass *plugin_class = MUTTER_PLUGIN_CLASS (klass); MetaPluginClass *plugin_class = META_PLUGIN_CLASS (klass);
gobject_class->dispose = gnome_shell_plugin_dispose; gobject_class->dispose = gnome_shell_plugin_dispose;
gobject_class->finalize = gnome_shell_plugin_finalize; gobject_class->finalize = gnome_shell_plugin_finalize;
@ -306,7 +307,7 @@ gvc_muted_debug_log_handler (const char *log_domain,
} }
static void static void
gnome_shell_plugin_start (MutterPlugin *plugin) gnome_shell_plugin_start (MetaPlugin *plugin)
{ {
GnomeShellPlugin *shell_plugin = GNOME_SHELL_PLUGIN (plugin); GnomeShellPlugin *shell_plugin = GNOME_SHELL_PLUGIN (plugin);
MetaScreen *screen; MetaScreen *screen;
@ -336,7 +337,7 @@ gnome_shell_plugin_start (MutterPlugin *plugin)
NULL); NULL);
update_font_options (settings); update_font_options (settings);
screen = mutter_plugin_get_screen (plugin); screen = meta_plugin_get_screen (plugin);
display = meta_screen_get_display (screen); display = meta_screen_get_display (screen);
xdisplay = meta_display_get_xdisplay (display); xdisplay = meta_display_get_xdisplay (display);
@ -371,7 +372,7 @@ gnome_shell_plugin_start (MutterPlugin *plugin)
/* Initialize the global object here. */ /* Initialize the global object here. */
global = shell_global_get (); global = shell_global_get ();
_shell_global_set_plugin (global, MUTTER_PLUGIN(shell_plugin)); _shell_global_set_plugin (global, META_PLUGIN(shell_plugin));
_shell_global_set_gjs_context (global, shell_plugin->gjs_context); _shell_global_set_gjs_context (global, shell_plugin->gjs_context);
add_statistics (shell_plugin); add_statistics (shell_plugin);
@ -427,8 +428,8 @@ get_shell_wm (void)
} }
static void static void
gnome_shell_plugin_minimize (MutterPlugin *plugin, gnome_shell_plugin_minimize (MetaPlugin *plugin,
MutterWindow *actor) MetaWindowActor *actor)
{ {
_shell_wm_minimize (get_shell_wm (), _shell_wm_minimize (get_shell_wm (),
actor); actor);
@ -436,70 +437,70 @@ gnome_shell_plugin_minimize (MutterPlugin *plugin,
} }
static void static void
gnome_shell_plugin_maximize (MutterPlugin *plugin, gnome_shell_plugin_maximize (MetaPlugin *plugin,
MutterWindow *actor, MetaWindowActor *actor,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint height) gint height)
{ {
_shell_wm_maximize (get_shell_wm (), _shell_wm_maximize (get_shell_wm (),
actor, x, y, width, height); actor, x, y, width, height);
} }
static void static void
gnome_shell_plugin_unmaximize (MutterPlugin *plugin, gnome_shell_plugin_unmaximize (MetaPlugin *plugin,
MutterWindow *actor, MetaWindowActor *actor,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint height) gint height)
{ {
_shell_wm_unmaximize (get_shell_wm (), _shell_wm_unmaximize (get_shell_wm (),
actor, x, y, width, height); actor, x, y, width, height);
} }
static void static void
gnome_shell_plugin_map (MutterPlugin *plugin, gnome_shell_plugin_map (MetaPlugin *plugin,
MutterWindow *actor) MetaWindowActor *actor)
{ {
_shell_wm_map (get_shell_wm (), _shell_wm_map (get_shell_wm (),
actor); actor);
} }
static void static void
gnome_shell_plugin_destroy (MutterPlugin *plugin, gnome_shell_plugin_destroy (MetaPlugin *plugin,
MutterWindow *actor) MetaWindowActor *actor)
{ {
_shell_wm_destroy (get_shell_wm (), _shell_wm_destroy (get_shell_wm (),
actor); actor);
} }
static void static void
gnome_shell_plugin_switch_workspace (MutterPlugin *plugin, gnome_shell_plugin_switch_workspace (MetaPlugin *plugin,
gint from, gint from,
gint to, gint to,
MetaMotionDirection direction) MetaMotionDirection direction)
{ {
_shell_wm_switch_workspace (get_shell_wm(), from, to, direction); _shell_wm_switch_workspace (get_shell_wm(), from, to, direction);
} }
static void static void
gnome_shell_plugin_kill_window_effects (MutterPlugin *plugin, gnome_shell_plugin_kill_window_effects (MetaPlugin *plugin,
MutterWindow *actor) MetaWindowActor *actor)
{ {
_shell_wm_kill_window_effects (get_shell_wm(), actor); _shell_wm_kill_window_effects (get_shell_wm(), actor);
} }
static void static void
gnome_shell_plugin_kill_switch_workspace (MutterPlugin *plugin) gnome_shell_plugin_kill_switch_workspace (MetaPlugin *plugin)
{ {
_shell_wm_kill_switch_workspace (get_shell_wm()); _shell_wm_kill_switch_workspace (get_shell_wm());
} }
static gboolean static gboolean
gnome_shell_plugin_xevent_filter (MutterPlugin *plugin, gnome_shell_plugin_xevent_filter (MetaPlugin *plugin,
XEvent *xev) XEvent *xev)
{ {
#ifdef GLX_INTEL_swap_event #ifdef GLX_INTEL_swap_event
GnomeShellPlugin *shell_plugin = GNOME_SHELL_PLUGIN (plugin); GnomeShellPlugin *shell_plugin = GNOME_SHELL_PLUGIN (plugin);
@ -539,9 +540,9 @@ gnome_shell_plugin_xevent_filter (MutterPlugin *plugin,
} }
static const static const
MutterPluginInfo *gnome_shell_plugin_plugin_info (MutterPlugin *plugin) MetaPluginInfo *gnome_shell_plugin_plugin_info (MetaPlugin *plugin)
{ {
static const MutterPluginInfo info = { static const MetaPluginInfo info = {
.name = "GNOME Shell", .name = "GNOME Shell",
.version = "0.1", .version = "0.1",
.author = "Various", .author = "Various",

View File

@ -7,7 +7,7 @@
#include <gjs/gjs.h> #include <gjs/gjs.h>
void _shell_global_set_plugin (ShellGlobal *global, void _shell_global_set_plugin (ShellGlobal *global,
MutterPlugin *plugin); MetaPlugin *plugin);
void _shell_global_set_gjs_context (ShellGlobal *global, void _shell_global_set_gjs_context (ShellGlobal *global,
GjsContext *context); GjsContext *context);

View File

@ -23,7 +23,7 @@
#include <gio/gio.h> #include <gio/gio.h>
#include <math.h> #include <math.h>
#include <X11/extensions/Xfixes.h> #include <X11/extensions/Xfixes.h>
#include <gjs/gjs.h> #include <gjs/gjs-module.h>
#include <canberra.h> #include <canberra.h>
#include <libical/ical.h> #include <libical/ical.h>
#ifdef HAVE_SYS_RESOURCE_H #ifdef HAVE_SYS_RESOURCE_H
@ -53,7 +53,7 @@ struct _ShellGlobal {
XserverRegion input_region; XserverRegion input_region;
GjsContext *js_context; GjsContext *js_context;
MutterPlugin *plugin; MetaPlugin *plugin;
ShellWM *wm; ShellWM *wm;
GSettings *settings; GSettings *settings;
const char *datadir; const char *datadir;
@ -125,7 +125,7 @@ shell_global_get_property(GObject *object,
switch (prop_id) switch (prop_id)
{ {
case PROP_OVERLAY_GROUP: case PROP_OVERLAY_GROUP:
g_value_set_object (value, mutter_plugin_get_overlay_group (global->plugin)); g_value_set_object (value, meta_plugin_get_overlay_group (global->plugin));
break; break;
case PROP_SCREEN: case PROP_SCREEN:
g_value_set_object (value, shell_global_get_screen (global)); g_value_set_object (value, shell_global_get_screen (global));
@ -137,7 +137,7 @@ shell_global_get_property(GObject *object,
{ {
int width, height; int width, height;
mutter_plugin_query_screen_size (global->plugin, &width, &height); meta_plugin_query_screen_size (global->plugin, &width, &height);
g_value_set_int (value, width); g_value_set_int (value, width);
} }
break; break;
@ -145,18 +145,18 @@ shell_global_get_property(GObject *object,
{ {
int width, height; int width, height;
mutter_plugin_query_screen_size (global->plugin, &width, &height); meta_plugin_query_screen_size (global->plugin, &width, &height);
g_value_set_int (value, height); g_value_set_int (value, height);
} }
break; break;
case PROP_STAGE: case PROP_STAGE:
g_value_set_object (value, mutter_plugin_get_stage (global->plugin)); g_value_set_object (value, meta_plugin_get_stage (global->plugin));
break; break;
case PROP_STAGE_INPUT_MODE: case PROP_STAGE_INPUT_MODE:
g_value_set_enum (value, global->input_mode); g_value_set_enum (value, global->input_mode);
break; break;
case PROP_WINDOW_GROUP: case PROP_WINDOW_GROUP:
g_value_set_object (value, mutter_plugin_get_window_group (global->plugin)); g_value_set_object (value, meta_plugin_get_window_group (global->plugin));
break; break;
case PROP_WINDOW_MANAGER: case PROP_WINDOW_MANAGER:
g_value_set_object (value, global->wm); g_value_set_object (value, global->wm);
@ -392,9 +392,9 @@ shell_global_focus_stage (ShellGlobal *global)
ClutterActor *stage; ClutterActor *stage;
Window xstage; Window xstage;
stage = mutter_plugin_get_stage (global->plugin); stage = meta_plugin_get_stage (global->plugin);
xstage = clutter_x11_get_stage_window (CLUTTER_STAGE (stage)); xstage = clutter_x11_get_stage_window (CLUTTER_STAGE (stage));
xdpy = mutter_plugin_get_xdisplay (global->plugin); xdpy = meta_plugin_get_xdisplay (global->plugin);
XSetInputFocus (xdpy, xstage, RevertToPointerRoot, XSetInputFocus (xdpy, xstage, RevertToPointerRoot,
shell_global_get_current_time (global)); shell_global_get_current_time (global));
} }
@ -431,11 +431,11 @@ shell_global_set_stage_input_mode (ShellGlobal *global,
g_return_if_fail (SHELL_IS_GLOBAL (global)); g_return_if_fail (SHELL_IS_GLOBAL (global));
if (mode == SHELL_STAGE_INPUT_MODE_NONREACTIVE || global->gtk_grab_active) if (mode == SHELL_STAGE_INPUT_MODE_NONREACTIVE || global->gtk_grab_active)
mutter_plugin_set_stage_reactive (global->plugin, FALSE); meta_plugin_set_stage_reactive (global->plugin, FALSE);
else if (mode == SHELL_STAGE_INPUT_MODE_FULLSCREEN || !global->input_region) else if (mode == SHELL_STAGE_INPUT_MODE_FULLSCREEN || !global->input_region)
mutter_plugin_set_stage_reactive (global->plugin, TRUE); meta_plugin_set_stage_reactive (global->plugin, TRUE);
else else
mutter_plugin_set_stage_input_region (global->plugin, global->input_region); meta_plugin_set_stage_input_region (global->plugin, global->input_region);
if (mode == SHELL_STAGE_INPUT_MODE_FOCUSED) if (mode == SHELL_STAGE_INPUT_MODE_FOCUSED)
shell_global_focus_stage (global); shell_global_focus_stage (global);
@ -515,7 +515,7 @@ shell_global_set_cursor (ShellGlobal *global,
} }
if (!global->stage_window) if (!global->stage_window)
{ {
ClutterStage *stage = CLUTTER_STAGE (mutter_plugin_get_stage (global->plugin)); ClutterStage *stage = CLUTTER_STAGE (meta_plugin_get_stage (global->plugin));
global->stage_window = gdk_window_foreign_new (clutter_x11_get_stage_window (stage)); global->stage_window = gdk_window_foreign_new (clutter_x11_get_stage_window (stage));
} }
@ -554,7 +554,7 @@ void
shell_global_set_stage_input_region (ShellGlobal *global, shell_global_set_stage_input_region (ShellGlobal *global,
GSList *rectangles) GSList *rectangles)
{ {
MetaScreen *screen = mutter_plugin_get_screen (global->plugin); MetaScreen *screen = meta_plugin_get_screen (global->plugin);
MetaDisplay *display = meta_screen_get_display (screen); MetaDisplay *display = meta_screen_get_display (screen);
Display *xdpy = meta_display_get_xdisplay (display); Display *xdpy = meta_display_get_xdisplay (display);
MetaRectangle *rect; MetaRectangle *rect;
@ -595,7 +595,7 @@ shell_global_set_stage_input_region (ShellGlobal *global,
MetaScreen * MetaScreen *
shell_global_get_screen (ShellGlobal *global) shell_global_get_screen (ShellGlobal *global)
{ {
return mutter_plugin_get_screen (global->plugin); return meta_plugin_get_screen (global->plugin);
} }
/** /**
@ -612,18 +612,18 @@ shell_global_get_gdk_screen (ShellGlobal *global)
} }
/** /**
* shell_global_get_windows: * shell_global_get_window_actors:
* *
* Gets the list of MutterWindows for the plugin's screen * Gets the list of #MetaWindowActor for the plugin's screen
* *
* Return value: (element-type Meta.MutterWindow) (transfer none): the list of windows * Return value: (element-type Meta.WindowActor) (transfer none): the list of windows
*/ */
GList * GList *
shell_global_get_windows (ShellGlobal *global) shell_global_get_window_actors (ShellGlobal *global)
{ {
g_return_val_if_fail (SHELL_IS_GLOBAL (global), NULL); g_return_val_if_fail (SHELL_IS_GLOBAL (global), NULL);
return mutter_plugin_get_windows (global->plugin); return meta_plugin_get_window_actors (global->plugin);
} }
static gboolean static gboolean
@ -632,7 +632,7 @@ update_screen_size (gpointer data)
int width, height; int width, height;
ShellGlobal *global = SHELL_GLOBAL (data); ShellGlobal *global = SHELL_GLOBAL (data);
mutter_plugin_query_screen_size (global->plugin, &width, &height); meta_plugin_query_screen_size (global->plugin, &width, &height);
if (global->last_change_screen_width == width && global->last_change_screen_height == height) if (global->last_change_screen_width == width && global->last_change_screen_height == height)
return FALSE; return FALSE;
@ -695,8 +695,8 @@ global_stage_after_paint (ClutterStage *stage,
} }
void void
_shell_global_set_plugin (ShellGlobal *global, _shell_global_set_plugin (ShellGlobal *global,
MutterPlugin *plugin) MetaPlugin *plugin)
{ {
ClutterActor *stage; ClutterActor *stage;
MetaScreen *screen; MetaScreen *screen;
@ -708,7 +708,7 @@ _shell_global_set_plugin (ShellGlobal *global,
global->plugin = plugin; global->plugin = plugin;
global->wm = shell_wm_new (plugin); global->wm = shell_wm_new (plugin);
stage = mutter_plugin_get_stage (plugin); stage = meta_plugin_get_stage (plugin);
g_signal_connect (stage, "notify::width", g_signal_connect (stage, "notify::width",
G_CALLBACK (global_stage_notify_width), global); G_CALLBACK (global_stage_notify_width), global);
@ -730,7 +730,7 @@ _shell_global_set_plugin (ShellGlobal *global,
"End of stage page repaint", "End of stage page repaint",
""); "");
screen = mutter_plugin_get_screen (global->plugin); screen = meta_plugin_get_screen (global->plugin);
display = meta_screen_get_display (screen); display = meta_screen_get_display (screen);
g_signal_connect (display, "notify::focus-window", g_signal_connect (display, "notify::focus-window",
G_CALLBACK (focus_window_changed), global); G_CALLBACK (focus_window_changed), global);
@ -763,10 +763,10 @@ gboolean
shell_global_begin_modal (ShellGlobal *global, shell_global_begin_modal (ShellGlobal *global,
guint32 timestamp) guint32 timestamp)
{ {
ClutterStage *stage = CLUTTER_STAGE (mutter_plugin_get_stage (global->plugin)); ClutterStage *stage = CLUTTER_STAGE (meta_plugin_get_stage (global->plugin));
Window stagewin = clutter_x11_get_stage_window (stage); Window stagewin = clutter_x11_get_stage_window (stage);
return mutter_plugin_begin_modal (global->plugin, stagewin, None, 0, timestamp); return meta_plugin_begin_modal (global->plugin, stagewin, None, 0, timestamp);
} }
/** /**
@ -779,7 +779,7 @@ void
shell_global_end_modal (ShellGlobal *global, shell_global_end_modal (ShellGlobal *global,
guint32 timestamp) guint32 timestamp)
{ {
mutter_plugin_end_modal (global->plugin, timestamp); meta_plugin_end_modal (global->plugin, timestamp);
} }
/** /**
@ -800,7 +800,7 @@ shell_global_end_modal (ShellGlobal *global,
gboolean gboolean
shell_global_display_is_grabbed (ShellGlobal *global) shell_global_display_is_grabbed (ShellGlobal *global)
{ {
MetaScreen *screen = mutter_plugin_get_screen (global->plugin); MetaScreen *screen = meta_plugin_get_screen (global->plugin);
MetaDisplay *display = meta_screen_get_display (screen); MetaDisplay *display = meta_screen_get_display (screen);
return meta_display_get_grab_op (display) != META_GRAB_OP_NONE; return meta_display_get_grab_op (display) != META_GRAB_OP_NONE;
@ -1274,7 +1274,7 @@ shell_global_create_root_pixmap_actor (ShellGlobal *global)
/* Initialize to the stage color, since that's what will be seen /* Initialize to the stage color, since that's what will be seen
* in the main view if there's no actual background window. * in the main view if there's no actual background window.
*/ */
stage = mutter_plugin_get_stage (global->plugin); stage = meta_plugin_get_stage (global->plugin);
clutter_stage_get_color (CLUTTER_STAGE (stage), &stage_color); clutter_stage_get_color (CLUTTER_STAGE (stage), &stage_color);
clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (global->root_pixmap), clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (global->root_pixmap),
/* ClutterColor has the same layout /* ClutterColor has the same layout

View File

@ -2,7 +2,7 @@
#ifndef __SHELL_GLOBAL_H__ #ifndef __SHELL_GLOBAL_H__
#define __SHELL_GLOBAL_H__ #define __SHELL_GLOBAL_H__
#include "mutter-plugin.h" #include "meta-plugin.h"
#include <clutter/clutter.h> #include <clutter/clutter.h>
#include <glib-object.h> #include <glib-object.h>
#include <gdk-pixbuf/gdk-pixbuf.h> #include <gdk-pixbuf/gdk-pixbuf.h>
@ -70,7 +70,7 @@ void shell_global_set_stage_input_mode (ShellGlobal *global,
void shell_global_set_stage_input_region (ShellGlobal *global, void shell_global_set_stage_input_region (ShellGlobal *global,
GSList *rectangles); GSList *rectangles);
GList *shell_global_get_windows (ShellGlobal *global); GList *shell_global_get_window_actors (ShellGlobal *global);
gboolean shell_global_begin_modal (ShellGlobal *global, gboolean shell_global_begin_modal (ShellGlobal *global,
guint32 timestamp); guint32 timestamp);

View File

@ -60,11 +60,13 @@ free_tray_icon (gpointer data)
{ {
ShellTrayManagerChild *child = data; ShellTrayManagerChild *child = data;
gtk_widget_hide (child->window);
gtk_widget_destroy (child->window); gtk_widget_destroy (child->window);
g_signal_handlers_disconnect_matched (child->actor, G_SIGNAL_MATCH_DATA, if (child->actor)
0, 0, NULL, NULL, child); {
g_object_unref (child->actor); g_signal_handlers_disconnect_matched (child->actor, G_SIGNAL_MATCH_DATA,
0, 0, NULL, NULL, child);
g_object_unref (child->actor);
}
g_slice_free (ShellTrayManagerChild, child); g_slice_free (ShellTrayManagerChild, child);
} }
@ -314,8 +316,14 @@ na_tray_icon_removed (NaTrayManager *na_manager, GtkWidget *socket,
child = g_hash_table_lookup (manager->priv->icons, socket); child = g_hash_table_lookup (manager->priv->icons, socket);
g_return_if_fail (child != NULL); g_return_if_fail (child != NULL);
g_signal_emit (manager, if (child->actor != NULL)
shell_tray_manager_signals[TRAY_ICON_REMOVED], 0, {
child->actor); /* Only emit signal if a corresponding tray-icon-added signal was emitted,
that is, if embedding did not fail and we got a plug-added
*/
g_signal_emit (manager,
shell_tray_manager_signals[TRAY_ICON_REMOVED], 0,
child->actor);
}
g_hash_table_remove (manager->priv->icons, socket); g_hash_table_remove (manager->priv->icons, socket);
} }

View File

@ -8,32 +8,32 @@ G_BEGIN_DECLS
/* These forward along the different effects from GnomeShellPlugin */ /* These forward along the different effects from GnomeShellPlugin */
void _shell_wm_minimize (ShellWM *wm, void _shell_wm_minimize (ShellWM *wm,
MutterWindow *actor); MetaWindowActor *actor);
void _shell_wm_maximize (ShellWM *wm, void _shell_wm_maximize (ShellWM *wm,
MutterWindow *actor, MetaWindowActor *actor,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint height); gint height);
void _shell_wm_unmaximize (ShellWM *wm, void _shell_wm_unmaximize (ShellWM *wm,
MutterWindow *actor, MetaWindowActor *actor,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint height); gint height);
void _shell_wm_map (ShellWM *wm, void _shell_wm_map (ShellWM *wm,
MutterWindow *actor); MetaWindowActor *actor);
void _shell_wm_destroy (ShellWM *wm, void _shell_wm_destroy (ShellWM *wm,
MutterWindow *actor); MetaWindowActor *actor);
void _shell_wm_switch_workspace (ShellWM *wm, void _shell_wm_switch_workspace (ShellWM *wm,
gint from, gint from,
gint to, gint to,
MetaMotionDirection direction); MetaMotionDirection direction);
void _shell_wm_kill_window_effects (ShellWM *wm, void _shell_wm_kill_window_effects (ShellWM *wm,
MutterWindow *actor); MetaWindowActor *actor);
void _shell_wm_kill_switch_workspace (ShellWM *wm); void _shell_wm_kill_switch_workspace (ShellWM *wm);
G_END_DECLS G_END_DECLS

View File

@ -13,7 +13,7 @@
struct _ShellWM { struct _ShellWM {
GObject parent; GObject parent;
MutterPlugin *plugin; MetaPlugin *plugin;
}; };
/* Signals */ /* Signals */
@ -63,7 +63,7 @@ shell_wm_class_init (ShellWMClass *klass)
NULL, NULL, NULL, NULL,
g_cclosure_marshal_VOID__OBJECT, g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
MUTTER_TYPE_COMP_WINDOW); META_TYPE_WINDOW_ACTOR);
shell_wm_signals[MAXIMIZE] = shell_wm_signals[MAXIMIZE] =
g_signal_new ("maximize", g_signal_new ("maximize",
G_TYPE_FROM_CLASS (klass), G_TYPE_FROM_CLASS (klass),
@ -72,7 +72,7 @@ shell_wm_class_init (ShellWMClass *klass)
NULL, NULL, NULL, NULL,
_shell_marshal_VOID__OBJECT_INT_INT_INT_INT, _shell_marshal_VOID__OBJECT_INT_INT_INT_INT,
G_TYPE_NONE, 5, G_TYPE_NONE, 5,
MUTTER_TYPE_COMP_WINDOW, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); META_TYPE_WINDOW_ACTOR, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
shell_wm_signals[UNMAXIMIZE] = shell_wm_signals[UNMAXIMIZE] =
g_signal_new ("unmaximize", g_signal_new ("unmaximize",
G_TYPE_FROM_CLASS (klass), G_TYPE_FROM_CLASS (klass),
@ -81,7 +81,7 @@ shell_wm_class_init (ShellWMClass *klass)
NULL, NULL, NULL, NULL,
_shell_marshal_VOID__OBJECT_INT_INT_INT_INT, _shell_marshal_VOID__OBJECT_INT_INT_INT_INT,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
MUTTER_TYPE_COMP_WINDOW, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); META_TYPE_WINDOW_ACTOR, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
shell_wm_signals[MAP] = shell_wm_signals[MAP] =
g_signal_new ("map", g_signal_new ("map",
G_TYPE_FROM_CLASS (klass), G_TYPE_FROM_CLASS (klass),
@ -90,7 +90,7 @@ shell_wm_class_init (ShellWMClass *klass)
NULL, NULL, NULL, NULL,
g_cclosure_marshal_VOID__OBJECT, g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
MUTTER_TYPE_COMP_WINDOW); META_TYPE_WINDOW_ACTOR);
shell_wm_signals[DESTROY] = shell_wm_signals[DESTROY] =
g_signal_new ("destroy", g_signal_new ("destroy",
G_TYPE_FROM_CLASS (klass), G_TYPE_FROM_CLASS (klass),
@ -99,7 +99,7 @@ shell_wm_class_init (ShellWMClass *klass)
NULL, NULL, NULL, NULL,
g_cclosure_marshal_VOID__OBJECT, g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
MUTTER_TYPE_COMP_WINDOW); META_TYPE_WINDOW_ACTOR);
shell_wm_signals[SWITCH_WORKSPACE] = shell_wm_signals[SWITCH_WORKSPACE] =
g_signal_new ("switch-workspace", g_signal_new ("switch-workspace",
G_TYPE_FROM_CLASS (klass), G_TYPE_FROM_CLASS (klass),
@ -125,7 +125,7 @@ shell_wm_class_init (ShellWMClass *klass)
NULL, NULL, NULL, NULL,
g_cclosure_marshal_VOID__OBJECT, g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
MUTTER_TYPE_COMP_WINDOW); META_TYPE_WINDOW_ACTOR);
/** /**
* ShellWM::keybinding: * ShellWM::keybinding:
@ -174,77 +174,77 @@ _shell_wm_switch_workspace (ShellWM *wm,
void void
shell_wm_completed_switch_workspace (ShellWM *wm) shell_wm_completed_switch_workspace (ShellWM *wm)
{ {
mutter_plugin_switch_workspace_completed (wm->plugin); meta_plugin_switch_workspace_completed (wm->plugin);
} }
/** /**
* shell_wm_completed_minimize * shell_wm_completed_minimize
* @wm: the ShellWM * @wm: the ShellWM
* @actor: the MutterWindow actor * @actor: the MetaWindowActor actor
* *
* The plugin must call this when it has completed a window minimize effect. * The plugin must call this when it has completed a window minimize effect.
**/ **/
void void
shell_wm_completed_minimize (ShellWM *wm, shell_wm_completed_minimize (ShellWM *wm,
MutterWindow *actor) MetaWindowActor *actor)
{ {
mutter_plugin_minimize_completed (wm->plugin, actor); meta_plugin_minimize_completed (wm->plugin, actor);
} }
/** /**
* shell_wm_completed_maximize * shell_wm_completed_maximize
* @wm: the ShellWM * @wm: the ShellWM
* @actor: the MutterWindow actor * @actor: the MetaWindowActor actor
* *
* The plugin must call this when it has completed a window maximize effect. * The plugin must call this when it has completed a window maximize effect.
**/ **/
void void
shell_wm_completed_maximize (ShellWM *wm, shell_wm_completed_maximize (ShellWM *wm,
MutterWindow *actor) MetaWindowActor *actor)
{ {
mutter_plugin_maximize_completed (wm->plugin, actor); meta_plugin_maximize_completed (wm->plugin, actor);
} }
/** /**
* shell_wm_completed_unmaximize * shell_wm_completed_unmaximize
* @wm: the ShellWM * @wm: the ShellWM
* @actor: the MutterWindow actor * @actor: the MetaWindowActor actor
* *
* The plugin must call this when it has completed a window unmaximize effect. * The plugin must call this when it has completed a window unmaximize effect.
**/ **/
void void
shell_wm_completed_unmaximize (ShellWM *wm, shell_wm_completed_unmaximize (ShellWM *wm,
MutterWindow *actor) MetaWindowActor *actor)
{ {
mutter_plugin_unmaximize_completed (wm->plugin, actor); meta_plugin_unmaximize_completed (wm->plugin, actor);
} }
/** /**
* shell_wm_completed_map * shell_wm_completed_map
* @wm: the ShellWM * @wm: the ShellWM
* @actor: the MutterWindow actor * @actor: the MetaWindowActor actor
* *
* The plugin must call this when it has completed a window map effect. * The plugin must call this when it has completed a window map effect.
**/ **/
void void
shell_wm_completed_map (ShellWM *wm, shell_wm_completed_map (ShellWM *wm,
MutterWindow *actor) MetaWindowActor *actor)
{ {
mutter_plugin_map_completed (wm->plugin, actor); meta_plugin_map_completed (wm->plugin, actor);
} }
/** /**
* shell_wm_completed_destroy * shell_wm_completed_destroy
* @wm: the ShellWM * @wm: the ShellWM
* @actor: the MutterWindow actor * @actor: the MetaWindowActor actor
* *
* The plugin must call this when it has completed a window destroy effect. * The plugin must call this when it has completed a window destroy effect.
**/ **/
void void
shell_wm_completed_destroy (ShellWM *wm, shell_wm_completed_destroy (ShellWM *wm,
MutterWindow *actor) MetaWindowActor *actor)
{ {
mutter_plugin_destroy_completed (wm->plugin, actor); meta_plugin_destroy_completed (wm->plugin, actor);
} }
void void
@ -254,66 +254,66 @@ _shell_wm_kill_switch_workspace (ShellWM *wm)
} }
void void
_shell_wm_kill_window_effects (ShellWM *wm, _shell_wm_kill_window_effects (ShellWM *wm,
MutterWindow *actor) MetaWindowActor *actor)
{ {
g_signal_emit (wm, shell_wm_signals[KILL_WINDOW_EFFECTS], 0, actor); g_signal_emit (wm, shell_wm_signals[KILL_WINDOW_EFFECTS], 0, actor);
} }
void void
_shell_wm_minimize (ShellWM *wm, _shell_wm_minimize (ShellWM *wm,
MutterWindow *actor) MetaWindowActor *actor)
{ {
g_signal_emit (wm, shell_wm_signals[MINIMIZE], 0, actor); g_signal_emit (wm, shell_wm_signals[MINIMIZE], 0, actor);
} }
void void
_shell_wm_maximize (ShellWM *wm, _shell_wm_maximize (ShellWM *wm,
MutterWindow *actor, MetaWindowActor *actor,
int target_x, int target_x,
int target_y, int target_y,
int target_width, int target_width,
int target_height) int target_height)
{ {
g_signal_emit (wm, shell_wm_signals[MAXIMIZE], 0, actor, target_x, target_y, target_width, target_height); g_signal_emit (wm, shell_wm_signals[MAXIMIZE], 0, actor, target_x, target_y, target_width, target_height);
} }
void void
_shell_wm_unmaximize (ShellWM *wm, _shell_wm_unmaximize (ShellWM *wm,
MutterWindow *actor, MetaWindowActor *actor,
int target_x, int target_x,
int target_y, int target_y,
int target_width, int target_width,
int target_height) int target_height)
{ {
g_signal_emit (wm, shell_wm_signals[UNMAXIMIZE], 0, actor, target_x, target_y, target_width, target_height); g_signal_emit (wm, shell_wm_signals[UNMAXIMIZE], 0, actor, target_x, target_y, target_width, target_height);
} }
void void
_shell_wm_map (ShellWM *wm, _shell_wm_map (ShellWM *wm,
MutterWindow *actor) MetaWindowActor *actor)
{ {
g_signal_emit (wm, shell_wm_signals[MAP], 0, actor); g_signal_emit (wm, shell_wm_signals[MAP], 0, actor);
} }
void void
_shell_wm_destroy (ShellWM *wm, _shell_wm_destroy (ShellWM *wm,
MutterWindow *actor) MetaWindowActor *actor)
{ {
g_signal_emit (wm, shell_wm_signals[DESTROY], 0, actor); g_signal_emit (wm, shell_wm_signals[DESTROY], 0, actor);
} }
/** /**
* shell_wm_new: * shell_wm_new:
* @plugin: the #MutterPlugin * @plugin: the #MetaPlugin
* *
* Creates a new window management interface by hooking into @plugin. * Creates a new window management interface by hooking into @plugin.
* *
* Return value: the new window-management interface * Return value: the new window-management interface
**/ **/
ShellWM * ShellWM *
shell_wm_new (MutterPlugin *plugin) shell_wm_new (MetaPlugin *plugin)
{ {
ShellWM *wm; ShellWM *wm;
@ -342,7 +342,7 @@ shell_wm_key_handler (MetaDisplay *display,
/** /**
* shell_wm_takeover_keybinding: * shell_wm_takeover_keybinding:
* @wm: the #ShellWM * @wm: the #ShellWM
* @binding_name: a mutter keybinding name * @binding_name: a meta keybinding name
* *
* Tells mutter to forward keypresses for @binding_name to the shell * Tells mutter to forward keypresses for @binding_name to the shell
* rather than processing them internally. This will cause a * rather than processing them internally. This will cause a

View File

@ -3,7 +3,7 @@
#define __SHELL_WM_H__ #define __SHELL_WM_H__
#include <glib-object.h> #include <glib-object.h>
#include <mutter-plugin.h> #include <meta-plugin.h>
G_BEGIN_DECLS G_BEGIN_DECLS
@ -25,19 +25,19 @@ struct _ShellWMClass
GType shell_wm_get_type (void) G_GNUC_CONST; GType shell_wm_get_type (void) G_GNUC_CONST;
ShellWM *shell_wm_new (MutterPlugin *plugin); ShellWM *shell_wm_new (MetaPlugin *plugin);
void shell_wm_completed_minimize (ShellWM *wm, void shell_wm_completed_minimize (ShellWM *wm,
MutterWindow *actor); MetaWindowActor *actor);
void shell_wm_completed_maximize (ShellWM *wm, void shell_wm_completed_maximize (ShellWM *wm,
MutterWindow *actor); MetaWindowActor *actor);
void shell_wm_completed_unmaximize (ShellWM *wm, void shell_wm_completed_unmaximize (ShellWM *wm,
MutterWindow *actor); MetaWindowActor *actor);
void shell_wm_completed_map (ShellWM *wm, void shell_wm_completed_map (ShellWM *wm,
MutterWindow *actor); MetaWindowActor *actor);
void shell_wm_completed_destroy (ShellWM *wm, void shell_wm_completed_destroy (ShellWM *wm,
MutterWindow *actor); MetaWindowActor *actor);
void shell_wm_completed_switch_workspace (ShellWM *wm); void shell_wm_completed_switch_workspace (ShellWM *wm);
/* Keybinding stuff */ /* Keybinding stuff */
void shell_wm_takeover_keybinding (ShellWM *wm, void shell_wm_takeover_keybinding (ShellWM *wm,

View File

@ -1018,9 +1018,9 @@ st_box_layout_style_changed (StWidget *self)
StBoxLayoutPrivate *priv = ST_BOX_LAYOUT (self)->priv; StBoxLayoutPrivate *priv = ST_BOX_LAYOUT (self)->priv;
StThemeNode *theme_node = st_widget_get_theme_node (self); StThemeNode *theme_node = st_widget_get_theme_node (self);
int old_spacing = priv->spacing; int old_spacing = priv->spacing;
double spacing = 0; double spacing;
st_theme_node_get_length (theme_node, "spacing", FALSE, &spacing); spacing = st_theme_node_get_length (theme_node, "spacing");
priv->spacing = (int)(spacing + 0.5); priv->spacing = (int)(spacing + 0.5);
if (priv->spacing != old_spacing) if (priv->spacing != old_spacing)
clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); clutter_actor_queue_relayout (CLUTTER_ACTOR (self));

View File

@ -109,7 +109,7 @@ st_button_style_changed (StWidget *widget)
ST_WIDGET_CLASS (st_button_parent_class)->style_changed (widget); ST_WIDGET_CLASS (st_button_parent_class)->style_changed (widget);
spacing = 6; spacing = 6;
st_theme_node_get_length (theme_node, "border-spacing", FALSE, &spacing); st_theme_node_lookup_length (theme_node, "border-spacing", FALSE, &spacing);
priv->spacing = (int)(0.5 + spacing); priv->spacing = (int)(0.5 + spacing);
/* update the label styling */ /* update the label styling */

View File

@ -202,13 +202,13 @@ st_entry_style_changed (StWidget *self)
st_theme_node_get_foreground_color (theme_node, &color); st_theme_node_get_foreground_color (theme_node, &color);
clutter_text_set_color (CLUTTER_TEXT (priv->entry), &color); clutter_text_set_color (CLUTTER_TEXT (priv->entry), &color);
if (st_theme_node_get_length (theme_node, "caret-size", FALSE, &size)) if (st_theme_node_lookup_length (theme_node, "caret-size", FALSE, &size))
clutter_text_set_cursor_size (CLUTTER_TEXT (priv->entry), (int)(.5 + size)); clutter_text_set_cursor_size (CLUTTER_TEXT (priv->entry), (int)(.5 + size));
if (st_theme_node_get_color (theme_node, "caret-color", FALSE, &color)) if (st_theme_node_lookup_color (theme_node, "caret-color", FALSE, &color))
clutter_text_set_cursor_color (CLUTTER_TEXT (priv->entry), &color); clutter_text_set_cursor_color (CLUTTER_TEXT (priv->entry), &color);
if (st_theme_node_get_color (theme_node, "selection-background-color", FALSE, &color)) if (st_theme_node_lookup_color (theme_node, "selection-background-color", FALSE, &color))
clutter_text_set_selection_color (CLUTTER_TEXT (priv->entry), &color); clutter_text_set_selection_color (CLUTTER_TEXT (priv->entry), &color);
font = st_theme_node_get_font (theme_node); font = st_theme_node_get_font (theme_node);

View File

@ -369,9 +369,9 @@ st_overflow_box_style_changed (StWidget *self)
StOverflowBoxPrivate *priv = ST_OVERFLOW_BOX (self)->priv; StOverflowBoxPrivate *priv = ST_OVERFLOW_BOX (self)->priv;
StThemeNode *theme_node = st_widget_get_theme_node (self); StThemeNode *theme_node = st_widget_get_theme_node (self);
int old_spacing = priv->spacing; int old_spacing = priv->spacing;
double spacing = 0; double spacing;
st_theme_node_get_length (theme_node, "spacing", FALSE, &spacing); spacing = st_theme_node_get_length (theme_node, "spacing");
priv->spacing = (int)(spacing + 0.5); priv->spacing = (int)(spacing + 0.5);
if (priv->spacing != old_spacing) if (priv->spacing != old_spacing)
clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); clutter_actor_queue_relayout (CLUTTER_ACTOR (self));

View File

@ -410,9 +410,9 @@ scroll_bar_allocate_children (StScrollBar *bar,
increment = page_size / (upper - lower); increment = page_size / (upper - lower);
min_size = 32.; min_size = 32.;
st_theme_node_get_length (theme_node, "min-size", FALSE, &min_size); st_theme_node_lookup_length (theme_node, "min-size", FALSE, &min_size);
max_size = G_MAXINT16; max_size = G_MAXINT16;
st_theme_node_get_length (theme_node, "max-size", FALSE, &max_size); st_theme_node_lookup_length (theme_node, "max-size", FALSE, &max_size);
if (upper - lower - page_size <= 0) if (upper - lower - page_size <= 0)
position = 0; position = 0;

View File

@ -988,11 +988,11 @@ st_table_style_changed (StWidget *self)
StThemeNode *theme_node = st_widget_get_theme_node (self); StThemeNode *theme_node = st_widget_get_theme_node (self);
int old_row_spacing = priv->row_spacing; int old_row_spacing = priv->row_spacing;
int old_col_spacing = priv->col_spacing; int old_col_spacing = priv->col_spacing;
double row_spacing = 0., col_spacing = 0.; double row_spacing, col_spacing;
st_theme_node_get_length (theme_node, "spacing-rows", FALSE, &row_spacing); row_spacing = st_theme_node_get_length (theme_node, "spacing-rows");
priv->row_spacing = (int)(row_spacing + 0.5); priv->row_spacing = (int)(row_spacing + 0.5);
st_theme_node_get_length (theme_node, "spacing-columns", FALSE, &col_spacing); col_spacing = st_theme_node_get_length (theme_node, "spacing-columns");
priv->col_spacing = (int)(col_spacing + 0.5); priv->col_spacing = (int)(col_spacing + 0.5);
if (priv->row_spacing != old_row_spacing || if (priv->row_spacing != old_row_spacing ||

View File

@ -490,7 +490,7 @@ get_color_from_term (StThemeNode *node,
} }
/** /**
* st_theme_node_get_color: * st_theme_node_lookup_color:
* @node: a #StThemeNode * @node: a #StThemeNode
* @property_name: The name of the color property * @property_name: The name of the color property
* @inherit: if %TRUE, if a value is not found for the property on the * @inherit: if %TRUE, if a value is not found for the property on the
@ -507,14 +507,16 @@ get_color_from_term (StThemeNode *node,
* should be used instead. They are cached, so more efficient, and have * should be used instead. They are cached, so more efficient, and have
* handling for shortcut properties and other details of CSS. * handling for shortcut properties and other details of CSS.
* *
* See also st_theme_node_get_color(), which provides a simpler API.
*
* Return value: %TRUE if the property was found in the properties for this * Return value: %TRUE if the property was found in the properties for this
* theme node (or in the properties of parent nodes when inheriting.) * theme node (or in the properties of parent nodes when inheriting.)
*/ */
gboolean gboolean
st_theme_node_get_color (StThemeNode *node, st_theme_node_lookup_color (StThemeNode *node,
const char *property_name, const char *property_name,
gboolean inherit, gboolean inherit,
ClutterColor *color) ClutterColor *color)
{ {
int i; int i;
@ -535,18 +537,51 @@ st_theme_node_get_color (StThemeNode *node,
else if (result == VALUE_INHERIT) else if (result == VALUE_INHERIT)
{ {
if (node->parent_node) if (node->parent_node)
return st_theme_node_get_color (node->parent_node, property_name, inherit, color); return st_theme_node_lookup_color (node->parent_node, property_name, inherit, color);
else else
break; break;
} }
} }
} }
if (inherit && node->parent_node)
return st_theme_node_lookup_color (node->parent_node, property_name, inherit, color);
return FALSE; return FALSE;
} }
/** /**
* st_theme_node_get_double: * st_theme_node_get_color:
* @node: a #StThemeNode
* @property_name: The name of the color property
* @color: location to store the color that was determined.
*
* Generically looks up a property containing a single color value. When
* specific getters (like st_theme_node_get_background_color()) exist, they
* should be used instead. They are cached, so more efficient, and have
* handling for shortcut properties and other details of CSS.
*
* If @property_name is not found, a warning will be logged and a
* default color returned.
*
* See also st_theme_node_lookup_color(), which provides more options,
* and lets you handle the case where the theme does not specify the
* indicated color.
*/
void
st_theme_node_get_color (StThemeNode *node,
const char *property_name,
ClutterColor *color)
{
if (!st_theme_node_lookup_color (node, property_name, FALSE, color))
{
g_warning ("Did not find color property '%s'", property_name);
memset (color, 0, sizeof (ClutterColor));
}
}
/**
* st_theme_node_lookup_double:
* @node: a #StThemeNode * @node: a #StThemeNode
* @property_name: The name of the numeric property * @property_name: The name of the numeric property
* @inherit: if %TRUE, if a value is not found for the property on the * @inherit: if %TRUE, if a value is not found for the property on the
@ -561,14 +596,16 @@ st_theme_node_get_color (StThemeNode *node,
* Generically looks up a property containing a single numeric value * Generically looks up a property containing a single numeric value
* without units. * without units.
* *
* See also st_theme_node_get_double(), which provides a simpler API.
*
* Return value: %TRUE if the property was found in the properties for this * Return value: %TRUE if the property was found in the properties for this
* theme node (or in the properties of parent nodes when inheriting.) * theme node (or in the properties of parent nodes when inheriting.)
*/ */
gboolean gboolean
st_theme_node_get_double (StThemeNode *node, st_theme_node_lookup_double (StThemeNode *node,
const char *property_name, const char *property_name,
gboolean inherit, gboolean inherit,
double *value) double *value)
{ {
gboolean result = FALSE; gboolean result = FALSE;
int i; int i;
@ -593,11 +630,41 @@ st_theme_node_get_double (StThemeNode *node,
} }
if (!result && inherit && node->parent_node) if (!result && inherit && node->parent_node)
result = st_theme_node_get_double (node->parent_node, property_name, inherit, value); result = st_theme_node_lookup_double (node->parent_node, property_name, inherit, value);
return result; return result;
} }
/**
* st_theme_node_get_double:
* @node: a #StThemeNode
* @property_name: The name of the numeric property
*
* Generically looks up a property containing a single numeric value
* without units.
*
* See also st_theme_node_lookup_double(), which provides more options,
* and lets you handle the case where the theme does not specify the
* indicated value.
*
* Return value: the value found. If @property_name is not
* found, a warning will be logged and 0 will be returned.
*/
gdouble
st_theme_node_get_double (StThemeNode *node,
const char *property_name)
{
gdouble value;
if (st_theme_node_lookup_double (node, property_name, FALSE, &value))
return value;
else
{
g_warning ("Did not find double property '%s'", property_name);
return 0.0;
}
}
static const PangoFontDescription * static const PangoFontDescription *
get_parent_font (StThemeNode *node) get_parent_font (StThemeNode *node)
{ {
@ -799,7 +866,7 @@ get_length_internal (StThemeNode *node,
} }
/** /**
* st_theme_node_get_length: * st_theme_node_lookup_length:
* @node: a #StThemeNode * @node: a #StThemeNode
* @property_name: The name of the length property * @property_name: The name of the length property
* @inherit: if %TRUE, if a value is not found for the property on the * @inherit: if %TRUE, if a value is not found for the property on the
@ -817,14 +884,16 @@ get_length_internal (StThemeNode *node,
* should be used instead. They are cached, so more efficient, and have * should be used instead. They are cached, so more efficient, and have
* handling for shortcut properties and other details of CSS. * handling for shortcut properties and other details of CSS.
* *
* See also st_theme_node_get_length(), which provides a simpler API.
*
* Return value: %TRUE if the property was found in the properties for this * Return value: %TRUE if the property was found in the properties for this
* theme node (or in the properties of parent nodes when inheriting.) * theme node (or in the properties of parent nodes when inheriting.)
*/ */
gboolean gboolean
st_theme_node_get_length (StThemeNode *node, st_theme_node_lookup_length (StThemeNode *node,
const char *property_name, const char *property_name,
gboolean inherit, gboolean inherit,
gdouble *length) gdouble *length)
{ {
GetFromTermResult result = get_length_internal (node, property_name, NULL, length); GetFromTermResult result = get_length_internal (node, property_name, NULL, length);
if (result == VALUE_FOUND) if (result == VALUE_FOUND)
@ -833,12 +902,42 @@ st_theme_node_get_length (StThemeNode *node,
inherit = TRUE; inherit = TRUE;
if (inherit && node->parent_node && if (inherit && node->parent_node &&
st_theme_node_get_length (node->parent_node, property_name, inherit, length)) st_theme_node_lookup_length (node->parent_node, property_name, inherit, length))
return TRUE; return TRUE;
else else
return FALSE; return FALSE;
} }
/**
* st_theme_node_get_length:
* @node: a #StThemeNode
* @property_name: The name of the length property
*
* Generically looks up a property containing a single length value. When
* specific getters (like st_theme_node_get_border_width()) exist, they
* should be used instead. They are cached, so more efficient, and have
* handling for shortcut properties and other details of CSS.
*
* Unlike st_theme_node_get_color() and st_theme_node_get_double(),
* this does not print a warning if the property is not found; it just
* returns 0.
*
* See also st_theme_node_lookup_length(), which provides more options.
*
* Return value: the length, in pixels, or 0 if the property was not found.
*/
gdouble
st_theme_node_get_length (StThemeNode *node,
const char *property_name)
{
gdouble length;
if (st_theme_node_lookup_length (node, property_name, FALSE, &length))
return length;
else
return 0.0;
}
static void static void
do_border_radius_term (StThemeNode *node, do_border_radius_term (StThemeNode *node,
CRTerm *term, CRTerm *term,
@ -1727,7 +1826,7 @@ st_theme_node_get_transition_duration (StThemeNode *node)
if (node->transition_duration > -1) if (node->transition_duration > -1)
return st_slow_down_factor * node->transition_duration; return st_slow_down_factor * node->transition_duration;
st_theme_node_get_double (node, "transition-duration", FALSE, &value); st_theme_node_lookup_double (node, "transition-duration", FALSE, &value);
node->transition_duration = (int)value; node->transition_duration = (int)value;

View File

@ -99,20 +99,27 @@ const char *st_theme_node_get_pseudo_class (StThemeNode *node);
* details of the actual CSS rules, which can be complicated, especially * details of the actual CSS rules, which can be complicated, especially
* for fonts * for fonts
*/ */
gboolean st_theme_node_get_color (StThemeNode *node, gboolean st_theme_node_lookup_color (StThemeNode *node,
const char *property_name, const char *property_name,
gboolean inherit, gboolean inherit,
ClutterColor *color); ClutterColor *color);
gboolean st_theme_node_lookup_double (StThemeNode *node,
const char *property_name,
gboolean inherit,
double *value);
gboolean st_theme_node_lookup_length (StThemeNode *node,
const char *property_name,
gboolean inherit,
gdouble *length);
gboolean st_theme_node_get_double (StThemeNode *node, /* Easier-to-use variants of the above, for application-level use */
const char *property_name, void st_theme_node_get_color (StThemeNode *node,
gboolean inherit, const char *property_name,
double *value); ClutterColor *color);
gdouble st_theme_node_get_double (StThemeNode *node,
gboolean st_theme_node_get_length (StThemeNode *node, const char *property_name);
const char *property_name, gdouble st_theme_node_get_length (StThemeNode *node,
gboolean inherit, const char *property_name);
gdouble *length);
/* Specific getters for particular properties: cached /* Specific getters for particular properties: cached
*/ */

View File

@ -594,7 +594,7 @@ st_widget_leave (ClutterActor *actor,
if (priv->track_hover) if (priv->track_hover)
{ {
if (!clutter_actor_contains (actor, event->related)) if (!event->related || !clutter_actor_contains (actor, event->related))
st_widget_set_hover (ST_WIDGET (actor), FALSE); st_widget_set_hover (ST_WIDGET (actor), FALSE);
} }

View File

@ -300,8 +300,8 @@ na_tray_manager_handle_dock_request (NaTrayManager *manager,
if (!gtk_socket_get_plug_window (GTK_SOCKET (child))) if (!gtk_socket_get_plug_window (GTK_SOCKET (child)))
{ {
/* Embedding failed, we won't get a plug-removed signal */ /* Embedding failed, we won't get a plug-removed signal */
/* This signal destroys the socket */
g_signal_emit (manager, manager_signals[TRAY_ICON_REMOVED], 0, child); g_signal_emit (manager, manager_signals[TRAY_ICON_REMOVED], 0, child);
gtk_widget_destroy (child);
return; return;
} }

View File

@ -131,6 +131,7 @@
<branch repo="git.gnome.org" module="gconf"/> <branch repo="git.gnome.org" module="gconf"/>
<dependencies> <dependencies>
<dep package="glib"/> <dep package="glib"/>
<dep package="gtk3"/>
</dependencies> </dependencies>
</autotools> </autotools>