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
gtk+-3.0 >= $GTK_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
libgnome-menu $recorder_modules gconf-2.0
gdk-x11-3.0

View File

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

View File

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

View File

@ -102,9 +102,7 @@ AltTabPopup.prototype = {
childBox.x1 = Math.max(primary.x + leftPadding, childBox.x1 - offset - hPadding);
}
let [found, spacing] = this.actor.get_theme_node().get_length('spacing', false);
if (!found)
spacing = 0;
let spacing = this.actor.get_theme_node().get_length('spacing');
childBox.x2 = childBox.x1 + childNaturalWidth;
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.spacing = 0;
this._list.connect('style-changed', Lang.bind(this, function() {
let [found, spacing] = this._list.get_theme_node().get_length('spacing', false);
this._list.spacing = (found) ? spacing : 0;
this._list.spacing = this._list.get_theme_node().get_length('spacing');
}));
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();
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 [found, spacing] = this._items[0].child.get_theme_node().get_length('spacing', false);
if (!found)
spacing = 0;
let spacing = this._items[0].child.get_theme_node().get_length('spacing');
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;

View File

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

View File

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

View File

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

View File

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

View File

@ -220,7 +220,7 @@ WindowList.prototype = {
_updateWindowList: function() {
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();
for (let i = 0; i < windows.length; i++) {
let metaWindow = windows[i].metaWindow;

View File

@ -253,11 +253,11 @@ function _relayout() {
// metacity-clutter currently uses the same prefs as plain metacity,
// which probably means we'll be starting out with multiple workspaces;
// 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.)
function _removeUnusedWorkspaces() {
let windows = global.get_windows();
let windows = global.get_window_actors();
let maxWorkspace = 0;
for (let i = 0; i < windows.length; i++) {
let win = windows[i];
@ -292,24 +292,9 @@ function _removeUnusedWorkspaces() {
function _globalKeyPressHandler(actor, event) {
if (modalCount == 0)
return false;
if (event.type() != Clutter.EventType.KEY_RELEASE)
return false;
let type = event.type();
if (type == Clutter.EventType.KEY_PRESS) {
let symbol = event.get_key_symbol();
if (symbol == Clutter.Print) {
// We want to be able to take screenshots of the shell at all times
let gconf = GConf.Client.get_default();
let command = gconf.get_string('/apps/metacity/keybinding_commands/command_screenshot');
if (command != null && command != '') {
let [ok, len, args] = GLib.shell_parse_argv(command);
let p = new Shell.Process({'args' : args});
p.run();
}
return true;
}
} else if (type == Clutter.EventType.KEY_RELEASE) {
let symbol = event.get_key_symbol();
let keyCode = event.get_key_code();
let modifierState = Shell.get_event_state(event);
@ -328,8 +313,17 @@ function _globalKeyPressHandler(actor, event) {
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);
let action = display.get_keybinding_action(keyCode, modifierState);
switch (action) {
case Meta.KeyBindingAction.COMMAND_SCREENSHOT:
let gconf = GConf.Client.get_default();
let command = gconf.get_string('/apps/metacity/keybinding_commands/command_screenshot');
if (command != null && command != '') {
let [ok, len, args] = GLib.shell_parse_argv(command);
let p = new Shell.Process({'args' : args});
p.run();
}
return true;
case Meta.KeyBindingAction.WORKSPACE_LEFT:
wm.actionMoveWorkspaceLeft();
return true;
@ -341,7 +335,6 @@ function _globalKeyPressHandler(actor, event) {
getRunDialog().open();
return true;
}
}
return false;
}

View File

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

View File

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

View File

@ -16,6 +16,8 @@ const Tweener = imports.ui.tweener;
const Gettext = imports.gettext.domain('gnome-shell');
const _ = Gettext.gettext;
const SLIDER_SCROLL_STEP = 0.05; /* Slider scrolling step in % */
function Switch() {
this._init.apply(this, arguments);
}
@ -54,13 +56,19 @@ PopupBaseMenuItem.prototype = {
params = Params.parse (params, { reactive: true,
activate: 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,
track_hover: params.reactive,
x_fill: true,
y_fill: true,
x_align: St.Align.START });
track_hover: params.reactive });
this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
this.actor.connect('allocate', Lang.bind(this, this._allocate));
this.actor.connect('style-changed', Lang.bind(this, this._onStyleChanged));
this.actor._delegate = this;
this._children = [];
this._dot = null;
this._columnWidths = null;
this._spacing = 0;
this.active = false;
if (params.reactive && params.activate) {
@ -72,6 +80,12 @@ PopupBaseMenuItem.prototype = {
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) {
this.setActive(actor.hover);
},
@ -105,6 +119,159 @@ PopupBaseMenuItem.prototype = {
// true if non descendant content includes @actor
contains: function(actor) {
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);
@ -120,7 +287,7 @@ PopupMenuItem.prototype = {
PopupBaseMenuItem.prototype._init.call(this);
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 });
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));
},
@ -143,13 +310,12 @@ PopupSeparatorMenuItem.prototype = {
let cr = area.get_context();
let themeNode = area.get_theme_node();
let [width, height] = area.get_surface_size();
let found, margin, gradientHeight;
[found, margin] = themeNode.get_length('-margin-horizontal', false);
[found, gradientHeight] = themeNode.get_length('-gradient-height', false);
let margin = themeNode.get_length('-margin-horizontal');
let gradientHeight = themeNode.get_length('-gradient-height');
let startColor = new Clutter.Color();
themeNode.get_color('-gradient-start', false, startColor);
themeNode.get_color('-gradient-start', startColor);
let endColor = new Clutter.Color();
themeNode.get_color('-gradient-end', false, endColor);
themeNode.get_color('-gradient-end', endColor);
let gradientWidth = (width - margin * 2);
let gradientOffset = (height - gradientHeight) / 2;
@ -179,9 +345,10 @@ PopupSliderMenuItem.prototype = {
this._value = Math.max(Math.min(value, 1), 0);
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('button-press-event', Lang.bind(this, this._startDragging));
this._slider.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
this._releaseId = this._motionId = 0;
this._dragging = false;
@ -200,20 +367,17 @@ PopupSliderMenuItem.prototype = {
let themeNode = area.get_theme_node();
let [width, height] = area.get_surface_size();
let found, handleRadius;
[found, handleRadius] = themeNode.get_length('-slider-handle-radius', false);
let handleRadius = themeNode.get_length('-slider-handle-radius');
let sliderWidth = width - 2 * handleRadius;
let sliderHeight;
[found, sliderHeight] = themeNode.get_length('-slider-height', false);
let sliderHeight = themeNode.get_length('-slider-height');
let sliderBorderWidth;
[found, sliderBorderWidth] = themeNode.get_length('-slider-border-width', false);
let sliderBorderWidth = themeNode.get_length('-slider-border-width');
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();
themeNode.get_color('-slider-background-color', false, sliderColor);
themeNode.get_color('-slider-background-color', sliderColor);
cr.setSourceRGBA (
sliderColor.red / 255,
@ -274,6 +438,20 @@ PopupSliderMenuItem.prototype = {
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) {
let absX, absY;
[absX, absY] = event.get_coords();
@ -288,8 +466,7 @@ PopupSliderMenuItem.prototype = {
relY = absY - sliderY;
let width = this._slider.width;
let found, handleRadius;
[found, handleRadius] = this._slider.get_theme_node().get_length('-slider-handle-radius', false);
let handleRadius = this._slider.get_theme_node().get_length('-slider-handle-radius');
let newvalue;
if (relX < handleRadius)
@ -331,14 +508,11 @@ PopupSwitchMenuItem.prototype = {
_init: function(text, active) {
PopupBaseMenuItem.prototype._init.call(this);
this.active = !!active;
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._box.add(this.label, { expand: true, y_fill: false });
this._box.add(this._switch.actor, { y_fill: false });
this.actor.set_child(this._box);
this.addActor(this.label);
this.addActor(this._switch.actor);
this.connect('activate', Lang.bind(this,function(from) {
this.toggle();
@ -360,64 +534,32 @@ PopupSwitchMenuItem.prototype = {
}
function PopupImageMenuItem(text, iconName, alwaysShowImage) {
this._init(text, iconName, alwaysShowImage);
function PopupImageMenuItem(text, iconName) {
this._init(text, iconName);
}
// We need to instantiate a GtkImageMenuItem so it
// hooks up its properties on the GtkSettings
var _gtkImageMenuItemCreated = false;
PopupImageMenuItem.prototype = {
__proto__: PopupBaseMenuItem.prototype,
_init: function (text, iconName, alwaysShowImage) {
_init: function (text, iconName) {
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;
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 });
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) {
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();
}
this.setIcon(iconName);
},
setIcon: function(name) {
this._iconName = name;
this._onMenuImagesChanged();
if (this._imageBin.child)
this._imageBin.child.destroy();
let img = St.TextureCache.get_default().load_icon_name(name, St.IconType.SYMBOLIC, this._size);
this._imageBin.set_child(img);
}
};
@ -460,15 +602,51 @@ PopupMenu.prototype = {
x_align: St.Align.START });
this.actor = this._boxPointer.actor;
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',
vertical: true });
this._boxPointer.bin.set_child(this._box);
this._boxWrapper.add_actor(this._box);
this.actor.add_style_class_name('popup-menu');
this.isOpen = false;
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) {
var menuItem = new PopupMenuItem(title);
this.addMenuItem(menuItem);
@ -670,10 +848,8 @@ PopupSubMenuMenuItem.prototype = {
this.actor.connect('enter-event', Lang.bind(this, this._mouseEnter));
this.label = new St.Label({ text: text });
this._container = new St.BoxLayout();
this._container.add(this.label, { fill: true, expand: true });
this._container.add(new St.Label({ text: '>' }));
this.actor.set_child(this._container);
this.addActor(this.label);
this.addActor(new St.Label({ text: '>' }));
this.menu = new PopupMenu(this.actor, St.Align.MIDDLE, St.Side.LEFT, 0, 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 -*- */
const Clutter = imports.gi.Clutter;
const DBus = imports.dbus;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
@ -15,6 +16,7 @@ const Gettext = imports.gettext.domain('gnome-shell');
const _ = Gettext.gettext;
const VOLUME_MAX = 65536.0; /* PA_VOLUME_NORM */
const VOLUME_ADJUSTMENT_STEP = 0.05; /* Volume adjustment step in % */
function Indicator() {
this._init.apply(this, arguments);
@ -60,13 +62,28 @@ Indicator.prototype = {
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
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();
});
this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
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() {
this._readOutput();
this._readInput();
@ -85,7 +102,6 @@ Indicator.prototype = {
this._outputVolumeId = this._output.connect('notify::volume', Lang.bind(this, this._volumeChanged, '_output'));
this._mutedChanged (null, null, '_output');
this._volumeChanged (null, null, '_output');
this.setIcon(this._volumeToIcon(this._output.volume));
} else {
this._outputSwitch.label.text = _("Output: Muted");
this._outputSwitch.setToggleState(false);
@ -117,9 +133,9 @@ Indicator.prototype = {
// only show input widgets if any application is recording audio
let showInput = false;
let recordingApps = this._control.get_source_outputs();
if (this._source && recordingApps) {
for (let i = 0; i < recordingApp.length; i++) {
let outputStream = recordingApp[i];
if (this._input && recordingApps) {
for (let i = 0; i < recordingApps.length; i++) {
let outputStream = recordingApps[i];
let id = outputStream.get_application_id();
// but skip gnome-volume-control and pavucontrol
// (that appear as recording because they show the input level)
@ -191,7 +207,7 @@ Indicator.prototype = {
_volumeChanged: function(object, param_spec, property) {
this[property+'Slider'].setValue(this[property].volume / VOLUME_MAX);
this._updateLabel(property);
if (property == '_output')
if (property == '_output' && !this._output.is_muted)
this.setIcon(this._volumeToIcon(this._output.volume));
},

View File

@ -36,7 +36,7 @@ StatusIconDispatcher.prototype = {
},
_onTrayIconAdded: function(o, icon) {
let wmClass = icon.wm_class.toLowerCase();
let wmClass = (icon.wm_class || 'unknown').toLowerCase();
let role = STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass];
if (role)
this.emit('status-icon-added', icon, role);
@ -45,7 +45,7 @@ StatusIconDispatcher.prototype = {
},
_onTrayIconRemoved: function(o, icon) {
let wmClass = icon.wm_class.toLowerCase();
let wmClass = (icon.wm_class || 'unknown').toLowerCase();
let role = STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass];
if (role)
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._presence = new GnomeSession.Presence();
this._presenceItems = {};
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
@ -89,6 +90,9 @@ StatusMenuButton.prototype = {
this._iconBox.child = this._invisibleIcon;
else
this._iconBox.child = this._idleIcon;
for (let itemStatus in this._presenceItems)
this._presenceItems[itemStatus].setShowDot(itemStatus == status);
},
_createSubMenu: function() {
@ -97,43 +101,57 @@ StatusMenuButton.prototype = {
item = new PopupMenu.PopupImageMenuItem(_("Available"), 'user-available', true);
item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.AVAILABLE));
this.menu.addMenuItem(item);
this._presenceItems[GnomeSession.PresenceStatus.AVAILABLE] = item;
item = new PopupMenu.PopupImageMenuItem(_("Busy"), 'user-busy', true);
item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.BUSY));
this.menu.addMenuItem(item);
this._presenceItems[GnomeSession.PresenceStatus.BUSY] = item;
item = new PopupMenu.PopupImageMenuItem(_("Invisible"), 'user-invisible', true);
item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.INVISIBLE));
this.menu.addMenuItem(item);
this._presenceItems[GnomeSession.PresenceStatus.INVISIBLE] = item;
item = new PopupMenu.PopupSeparatorMenuItem();
this.menu.addMenuItem(item);
item = new PopupMenu.PopupImageMenuItem(_("Account Information..."), 'user-info');
item.connect('activate', Lang.bind(this, this._onAccountInformationActivate));
item = new PopupMenu.PopupMenuItem(_("My Account..."));
item.connect('activate', Lang.bind(this, this._onMyAccountActivate));
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));
this.menu.addMenuItem(item);
item = new PopupMenu.PopupSeparatorMenuItem();
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));
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));
this.menu.addMenuItem(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));
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));
this.menu.addMenuItem(item);
},
@ -142,7 +160,7 @@ StatusMenuButton.prototype = {
this._presence.setStatus(status);
},
_onAccountInformationActivate: function() {
_onMyAccountActivate: function() {
Main.overview.hide();
this._spawn(['gnome-about-me']);
},

View File

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

View File

@ -553,18 +553,10 @@ WindowOverlay.prototype = {
_onStyleChanged: function() {
let titleNode = this.title.get_theme_node();
let [success, len] = titleNode.get_length('-shell-caption-spacing',
false);
if (success)
this.title._spacing = len;
this.title._spacing = titleNode.get_length('-shell-caption-spacing');
let closeNode = this.closeButton.get_theme_node();
[success, len] = closeNode.get_length('-shell-close-overlap',
false);
if (success)
this.closeButton._overlap = len;
this.closeButton._overlap = closeNode.get_length('-shell-close-overlap');
this._parentActor.queue_relayout();
}
@ -610,7 +602,7 @@ Workspace.prototype = {
this.actor.height = global.screen_height;
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
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._itemSpacing = 0;
this._list.connect('style-changed', Lang.bind(this, function() {
let [found, spacing] = this._list.get_theme_node().get_length('spacing', false);
this._itemSpacing = (found) ? spacing : 0;
this._itemSpacing = this._list.get_theme_node().get_length('spacing');
}));
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,
function() {
let node = this.actor.get_theme_node();
let [a, spacing] = node.get_length('spacing', false);
this._spacing = spacing;
this._spacing = node.get_length('spacing');
if (Main.overview.animationInProgress)
this._computeWorkspacePositions();
else
@ -191,7 +190,7 @@ GenericWorkspacesView.prototype = {
},
_onRestacked: function() {
let stack = global.get_windows();
let stack = global.get_window_actors();
let stackIndices = {};
for (let i = 0; i < stack.length; i++) {
@ -609,7 +608,7 @@ WorkspaceIndicator.prototype = {
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;
},

View File

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

181
po/gl.po
View File

@ -10,8 +10,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gnome-shell master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-10-07 13:04+0200\n"
"PO-Revision-Date: 2010-10-07 13:20+0200\n"
"POT-Creation-Date: 2010-10-26 16:28+0200\n"
"PO-Revision-Date: 2010-10-26 16:36+0200\n"
"Last-Translator: Fran Diéguez <frandieguez@ubuntu.com>\n"
"Language-Team: Galician <gnome-gl-list@gnome.org>\n"
"Language: gl\n"
@ -43,7 +43,7 @@ msgid ""
"dialog."
msgstr ""
"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
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 "
"clock, in addition to time."
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."
#: ../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 "
"time."
msgstr ""
"Se é verdadeiro e o formato é \"12-hour\" ou \"24-hour\" móstranse os "
"segundos na hora."
"Se é verdadeiro e o formato é «12-hour» ou «24-hour» móstranse os segundos "
"na hora."
#: ../data/org.gnome.shell.gschema.xml.in.h:11
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 "
"'videorate ! theoraenc ! oggmux' and records to Ogg Theora."
msgstr ""
"Estabelece a tubería do GStreamer usada para codificar as gravacións. Segue "
"a sintaxe usada por gst-launch. A tubería debe ter un desprazamento de "
"sumideiro non conectado cando o vídeo gravado estea gravado. Normalmente "
"terá un ......."
"Estabelece a tubería GStreamer usada para codificar gravacións. Segue a "
"sintaxe usada para gst-launch. A tubería debería ter un sumideiro («sink») "
"de ensamblaxe/desensamblaxe onde o vídeo que se está gravando grávase. "
"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
msgid "Show date in clock"
@ -207,12 +212,12 @@ msgid ""
"the show_date and show_seconds keys are ignored."
msgstr ""
"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á "
"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 "
"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."
"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 "
"está estabelecido a \"unix\" ou \"custom\", as chaves show_date e "
"show_seconds ignoraranse."
"está estabelecido a «unix» ou «custom», as chaves show_date e show_seconds "
"ignoraranse."
#: ../data/org.gnome.shell.gschema.xml.in.h:26
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
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
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 "
"contents are scrolled into view."
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
msgid ""
@ -265,11 +279,13 @@ msgid ""
"are clipped such that the ends of the horizontal and vertical lines surround "
"the mouse image."
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
#, fuzzy
msgid "Enable lens mode"
msgstr "Activado"
msgstr "Activar o modo lente"
#: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:8
msgid ""
@ -277,7 +293,7 @@ msgid ""
"sprite."
msgstr ""
"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
msgid ""
@ -285,6 +301,9 @@ msgid ""
"of the screen, the magnified contents continue to scroll such that the "
"screen edge moves into the magnified view."
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
msgid "Length of the crosshairs"
@ -442,7 +461,7 @@ msgstr "Non hai resultados que coincidan."
#. network locations, etc.
#: ../js/ui/dash.js:797 ../js/ui/placeDisplay.js:554
msgid "PLACES & DEVICES"
msgstr "LUGARES e DISPOSITIVOS"
msgstr "LUGARES E DISPOSITIVOS"
#. **** Documents ****
#: ../js/ui/dash.js:804 ../js/ui/docDisplay.js:494
@ -482,58 +501,58 @@ msgid "Undo"
msgstr "Desfacer"
#. TODO - _quit() doesn't really work on apps in state STARTING yet
#: ../js/ui/panel.js:468
#: ../js/ui/panel.js:469
#, c-format
msgid "Quit %s"
msgstr "Saír de %s"
#: ../js/ui/panel.js:493
#: ../js/ui/panel.js:494
msgid "Preferences"
msgstr "Preferencias"
#. Translators: This is the time format with date used
#. in 24-hour mode.
#: ../js/ui/panel.js:579
#: ../js/ui/panel.js:580
msgid "%a %b %e, %R:%S"
msgstr "%a %e de %b, %R:%S"
#: ../js/ui/panel.js:580
#: ../js/ui/panel.js:581
msgid "%a %b %e, %R"
msgstr "%a %e de %b, %R"
#. Translators: This is the time format without date used
#. in 24-hour mode.
#: ../js/ui/panel.js:584
#: ../js/ui/panel.js:585
msgid "%a %R:%S"
msgstr "%a %R:%S"
#: ../js/ui/panel.js:585
#: ../js/ui/panel.js:586
msgid "%a %R"
msgstr "%a %R"
#. Translators: This is a time format with date used
#. for AM/PM.
#: ../js/ui/panel.js:592
#: ../js/ui/panel.js:593
msgid "%a %b %e, %l:%M:%S %p"
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"
msgstr "%a %e de %b, %H:%M"
#. Translators: This is a time format without date used
#. for AM/PM.
#: ../js/ui/panel.js:597
#: ../js/ui/panel.js:598
msgid "%a %l:%M:%S %p"
msgstr "%a %H:%M:%S"
#: ../js/ui/panel.js:598
#: ../js/ui/panel.js:599
msgid "%a %l:%M %p"
msgstr "%a %l:%M %p"
#. Button on the left side of the panel.
#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview".
#: ../js/ui/panel.js:743
#: ../js/ui/panel.js:744
msgid "Activities"
msgstr "Actividades"
@ -566,44 +585,96 @@ msgstr "Insira unha orde:"
#: ../js/ui/runDialog.js:378
#, c-format
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"
msgstr "Dispoñíbel"
#: ../js/ui/statusMenu.js:95
#: ../js/ui/statusMenu.js:106
msgid "Busy"
msgstr "Ocupado"
#: ../js/ui/statusMenu.js:99
#: ../js/ui/statusMenu.js:111
msgid "Invisible"
msgstr "Invisíbel"
#: ../js/ui/statusMenu.js:106
msgid "Account Information..."
msgstr "Información da conta..."
#: ../js/ui/statusMenu.js:119
msgid "My Account..."
msgstr "A miña conta..."
#: ../js/ui/statusMenu.js:110
msgid "System Settings..."
msgstr "Configuracións do sistema..."
#: ../js/ui/statusMenu.js:123
msgid "System Preferences..."
msgstr "Preferencias do sistema..."
#: ../js/ui/statusMenu.js:117
#: ../js/ui/statusMenu.js:130
msgid "Lock Screen"
msgstr "Bloquear pantalla"
#: ../js/ui/statusMenu.js:121
#: ../js/ui/statusMenu.js:134
msgid "Switch User"
msgstr "Cambiar de usuario"
#: ../js/ui/statusMenu.js:126
#: ../js/ui/statusMenu.js:139
msgid "Log Out..."
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..."
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
#, c-format
msgid "%s has finished starting"
@ -614,43 +685,43 @@ msgstr "%s rematou de iniarse"
msgid "'%s' is ready"
msgstr "«%s» está preparado"
#: ../js/ui/workspacesView.js:230
#: ../js/ui/workspacesView.js:229
msgid ""
"Can't add a new workspace because maximum workspaces limit has been reached."
msgstr ""
"Non é posíbel engadir unha área de traballo nova porque chegouse ao límite "
"de áreas de traballo."
#: ../js/ui/workspacesView.js:247
#: ../js/ui/workspacesView.js:246
msgid "Can't remove the first workspace."
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"
msgstr "Hai menos dun minuto"
#: ../src/shell-global.c:1200
#: ../src/shell-global.c:1208
#, c-format
msgid "%d minute ago"
msgid_plural "%d minutes ago"
msgstr[0] "hai %d minuto"
msgstr[1] "hai %d minutos"
#: ../src/shell-global.c:1205
#: ../src/shell-global.c:1213
#, c-format
msgid "%d hour ago"
msgid_plural "%d hours ago"
msgstr[0] "hai %d hora"
msgstr[1] "hai %d horas"
#: ../src/shell-global.c:1210
#: ../src/shell-global.c:1218
#, c-format
msgid "%d day ago"
msgid_plural "%d days ago"
msgstr[0] "hai %d día"
msgstr[1] "hai %d días"
#: ../src/shell-global.c:1215
#: ../src/shell-global.c:1223
#, c-format
msgid "%d week ago"
msgid_plural "%d weeks ago"
@ -681,6 +752,12 @@ msgstr "Buscar"
msgid "%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"
#~ msgstr "⚫"

124
po/he.po
View File

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

View File

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

View File

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

View File

@ -23,7 +23,7 @@
#include <gio/gio.h>
#include <math.h>
#include <X11/extensions/Xfixes.h>
#include <gjs/gjs.h>
#include <gjs/gjs-module.h>
#include <canberra.h>
#include <libical/ical.h>
#ifdef HAVE_SYS_RESOURCE_H
@ -53,7 +53,7 @@ struct _ShellGlobal {
XserverRegion input_region;
GjsContext *js_context;
MutterPlugin *plugin;
MetaPlugin *plugin;
ShellWM *wm;
GSettings *settings;
const char *datadir;
@ -125,7 +125,7 @@ shell_global_get_property(GObject *object,
switch (prop_id)
{
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;
case PROP_SCREEN:
g_value_set_object (value, shell_global_get_screen (global));
@ -137,7 +137,7 @@ shell_global_get_property(GObject *object,
{
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);
}
break;
@ -145,18 +145,18 @@ shell_global_get_property(GObject *object,
{
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);
}
break;
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;
case PROP_STAGE_INPUT_MODE:
g_value_set_enum (value, global->input_mode);
break;
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;
case PROP_WINDOW_MANAGER:
g_value_set_object (value, global->wm);
@ -392,9 +392,9 @@ shell_global_focus_stage (ShellGlobal *global)
ClutterActor *stage;
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));
xdpy = mutter_plugin_get_xdisplay (global->plugin);
xdpy = meta_plugin_get_xdisplay (global->plugin);
XSetInputFocus (xdpy, xstage, RevertToPointerRoot,
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));
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)
mutter_plugin_set_stage_reactive (global->plugin, TRUE);
meta_plugin_set_stage_reactive (global->plugin, TRUE);
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)
shell_global_focus_stage (global);
@ -515,7 +515,7 @@ shell_global_set_cursor (ShellGlobal *global,
}
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));
}
@ -554,7 +554,7 @@ void
shell_global_set_stage_input_region (ShellGlobal *global,
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);
Display *xdpy = meta_display_get_xdisplay (display);
MetaRectangle *rect;
@ -595,7 +595,7 @@ shell_global_set_stage_input_region (ShellGlobal *global,
MetaScreen *
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 *
shell_global_get_windows (ShellGlobal *global)
shell_global_get_window_actors (ShellGlobal *global)
{
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
@ -632,7 +632,7 @@ update_screen_size (gpointer data)
int width, height;
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)
return FALSE;
@ -696,7 +696,7 @@ global_stage_after_paint (ClutterStage *stage,
void
_shell_global_set_plugin (ShellGlobal *global,
MutterPlugin *plugin)
MetaPlugin *plugin)
{
ClutterActor *stage;
MetaScreen *screen;
@ -708,7 +708,7 @@ _shell_global_set_plugin (ShellGlobal *global,
global->plugin = 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_CALLBACK (global_stage_notify_width), global);
@ -730,7 +730,7 @@ _shell_global_set_plugin (ShellGlobal *global,
"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);
g_signal_connect (display, "notify::focus-window",
G_CALLBACK (focus_window_changed), global);
@ -763,10 +763,10 @@ gboolean
shell_global_begin_modal (ShellGlobal *global,
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);
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,
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
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);
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
* 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_texture_set_from_rgb_data (CLUTTER_TEXTURE (global->root_pixmap),
/* ClutterColor has the same layout

View File

@ -2,7 +2,7 @@
#ifndef __SHELL_GLOBAL_H__
#define __SHELL_GLOBAL_H__
#include "mutter-plugin.h"
#include "meta-plugin.h"
#include <clutter/clutter.h>
#include <glib-object.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,
GSList *rectangles);
GList *shell_global_get_windows (ShellGlobal *global);
GList *shell_global_get_window_actors (ShellGlobal *global);
gboolean shell_global_begin_modal (ShellGlobal *global,
guint32 timestamp);

View File

@ -60,11 +60,13 @@ free_tray_icon (gpointer data)
{
ShellTrayManagerChild *child = data;
gtk_widget_hide (child->window);
gtk_widget_destroy (child->window);
if (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);
}
@ -314,8 +316,14 @@ na_tray_icon_removed (NaTrayManager *na_manager, GtkWidget *socket,
child = g_hash_table_lookup (manager->priv->icons, socket);
g_return_if_fail (child != NULL);
if (child->actor != NULL)
{
/* 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);
}

View File

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

View File

@ -13,7 +13,7 @@
struct _ShellWM {
GObject parent;
MutterPlugin *plugin;
MetaPlugin *plugin;
};
/* Signals */
@ -63,7 +63,7 @@ shell_wm_class_init (ShellWMClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
MUTTER_TYPE_COMP_WINDOW);
META_TYPE_WINDOW_ACTOR);
shell_wm_signals[MAXIMIZE] =
g_signal_new ("maximize",
G_TYPE_FROM_CLASS (klass),
@ -72,7 +72,7 @@ shell_wm_class_init (ShellWMClass *klass)
NULL, NULL,
_shell_marshal_VOID__OBJECT_INT_INT_INT_INT,
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] =
g_signal_new ("unmaximize",
G_TYPE_FROM_CLASS (klass),
@ -81,7 +81,7 @@ shell_wm_class_init (ShellWMClass *klass)
NULL, NULL,
_shell_marshal_VOID__OBJECT_INT_INT_INT_INT,
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] =
g_signal_new ("map",
G_TYPE_FROM_CLASS (klass),
@ -90,7 +90,7 @@ shell_wm_class_init (ShellWMClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
MUTTER_TYPE_COMP_WINDOW);
META_TYPE_WINDOW_ACTOR);
shell_wm_signals[DESTROY] =
g_signal_new ("destroy",
G_TYPE_FROM_CLASS (klass),
@ -99,7 +99,7 @@ shell_wm_class_init (ShellWMClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
MUTTER_TYPE_COMP_WINDOW);
META_TYPE_WINDOW_ACTOR);
shell_wm_signals[SWITCH_WORKSPACE] =
g_signal_new ("switch-workspace",
G_TYPE_FROM_CLASS (klass),
@ -125,7 +125,7 @@ shell_wm_class_init (ShellWMClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
MUTTER_TYPE_COMP_WINDOW);
META_TYPE_WINDOW_ACTOR);
/**
* ShellWM::keybinding:
@ -174,77 +174,77 @@ _shell_wm_switch_workspace (ShellWM *wm,
void
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
* @wm: the ShellWM
* @actor: the MutterWindow actor
* @actor: the MetaWindowActor actor
*
* The plugin must call this when it has completed a window minimize effect.
**/
void
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
* @wm: the ShellWM
* @actor: the MutterWindow actor
* @actor: the MetaWindowActor actor
*
* The plugin must call this when it has completed a window maximize effect.
**/
void
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
* @wm: the ShellWM
* @actor: the MutterWindow actor
* @actor: the MetaWindowActor actor
*
* The plugin must call this when it has completed a window unmaximize effect.
**/
void
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
* @wm: the ShellWM
* @actor: the MutterWindow actor
* @actor: the MetaWindowActor actor
*
* The plugin must call this when it has completed a window map effect.
**/
void
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
* @wm: the ShellWM
* @actor: the MutterWindow actor
* @actor: the MetaWindowActor actor
*
* The plugin must call this when it has completed a window destroy effect.
**/
void
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
@ -255,7 +255,7 @@ _shell_wm_kill_switch_workspace (ShellWM *wm)
void
_shell_wm_kill_window_effects (ShellWM *wm,
MutterWindow *actor)
MetaWindowActor *actor)
{
g_signal_emit (wm, shell_wm_signals[KILL_WINDOW_EFFECTS], 0, actor);
}
@ -263,14 +263,14 @@ _shell_wm_kill_window_effects (ShellWM *wm,
void
_shell_wm_minimize (ShellWM *wm,
MutterWindow *actor)
MetaWindowActor *actor)
{
g_signal_emit (wm, shell_wm_signals[MINIMIZE], 0, actor);
}
void
_shell_wm_maximize (ShellWM *wm,
MutterWindow *actor,
MetaWindowActor *actor,
int target_x,
int target_y,
int target_width,
@ -281,7 +281,7 @@ _shell_wm_maximize (ShellWM *wm,
void
_shell_wm_unmaximize (ShellWM *wm,
MutterWindow *actor,
MetaWindowActor *actor,
int target_x,
int target_y,
int target_width,
@ -292,28 +292,28 @@ _shell_wm_unmaximize (ShellWM *wm,
void
_shell_wm_map (ShellWM *wm,
MutterWindow *actor)
MetaWindowActor *actor)
{
g_signal_emit (wm, shell_wm_signals[MAP], 0, actor);
}
void
_shell_wm_destroy (ShellWM *wm,
MutterWindow *actor)
MetaWindowActor *actor)
{
g_signal_emit (wm, shell_wm_signals[DESTROY], 0, actor);
}
/**
* shell_wm_new:
* @plugin: the #MutterPlugin
* @plugin: the #MetaPlugin
*
* Creates a new window management interface by hooking into @plugin.
*
* Return value: the new window-management interface
**/
ShellWM *
shell_wm_new (MutterPlugin *plugin)
shell_wm_new (MetaPlugin *plugin)
{
ShellWM *wm;
@ -342,7 +342,7 @@ shell_wm_key_handler (MetaDisplay *display,
/**
* shell_wm_takeover_keybinding:
* @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
* rather than processing them internally. This will cause a

View File

@ -3,7 +3,7 @@
#define __SHELL_WM_H__
#include <glib-object.h>
#include <mutter-plugin.h>
#include <meta-plugin.h>
G_BEGIN_DECLS
@ -25,18 +25,18 @@ struct _ShellWMClass
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,
MutterWindow *actor);
MetaWindowActor *actor);
void shell_wm_completed_maximize (ShellWM *wm,
MutterWindow *actor);
MetaWindowActor *actor);
void shell_wm_completed_unmaximize (ShellWM *wm,
MutterWindow *actor);
MetaWindowActor *actor);
void shell_wm_completed_map (ShellWM *wm,
MutterWindow *actor);
MetaWindowActor *actor);
void shell_wm_completed_destroy (ShellWM *wm,
MutterWindow *actor);
MetaWindowActor *actor);
void shell_wm_completed_switch_workspace (ShellWM *wm);
/* Keybinding stuff */

View File

@ -1018,9 +1018,9 @@ st_box_layout_style_changed (StWidget *self)
StBoxLayoutPrivate *priv = ST_BOX_LAYOUT (self)->priv;
StThemeNode *theme_node = st_widget_get_theme_node (self);
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);
if (priv->spacing != old_spacing)
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);
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);
/* 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);
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));
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);
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);
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;
StThemeNode *theme_node = st_widget_get_theme_node (self);
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);
if (priv->spacing != old_spacing)
clutter_actor_queue_relayout (CLUTTER_ACTOR (self));

View File

@ -410,9 +410,9 @@ scroll_bar_allocate_children (StScrollBar *bar,
increment = page_size / (upper - lower);
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;
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)
position = 0;

View File

@ -988,11 +988,11 @@ st_table_style_changed (StWidget *self)
StThemeNode *theme_node = st_widget_get_theme_node (self);
int old_row_spacing = priv->row_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);
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);
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
* @property_name: The name of the color property
* @inherit: if %TRUE, if a value is not found for the property on the
@ -507,11 +507,13 @@ get_color_from_term (StThemeNode *node,
* should be used instead. They are cached, so more efficient, and have
* 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
* theme node (or in the properties of parent nodes when inheriting.)
*/
gboolean
st_theme_node_get_color (StThemeNode *node,
st_theme_node_lookup_color (StThemeNode *node,
const char *property_name,
gboolean inherit,
ClutterColor *color)
@ -535,18 +537,51 @@ st_theme_node_get_color (StThemeNode *node,
else if (result == VALUE_INHERIT)
{
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
break;
}
}
}
if (inherit && node->parent_node)
return st_theme_node_lookup_color (node->parent_node, property_name, inherit, color);
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
* @property_name: The name of the numeric property
* @inherit: if %TRUE, if a value is not found for the property on the
@ -561,11 +596,13 @@ st_theme_node_get_color (StThemeNode *node,
* Generically looks up a property containing a single numeric value
* 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
* theme node (or in the properties of parent nodes when inheriting.)
*/
gboolean
st_theme_node_get_double (StThemeNode *node,
st_theme_node_lookup_double (StThemeNode *node,
const char *property_name,
gboolean inherit,
double *value)
@ -593,11 +630,41 @@ st_theme_node_get_double (StThemeNode *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;
}
/**
* 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 *
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
* @property_name: The name of the length property
* @inherit: if %TRUE, if a value is not found for the property on the
@ -817,11 +884,13 @@ get_length_internal (StThemeNode *node,
* should be used instead. They are cached, so more efficient, and have
* 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
* theme node (or in the properties of parent nodes when inheriting.)
*/
gboolean
st_theme_node_get_length (StThemeNode *node,
st_theme_node_lookup_length (StThemeNode *node,
const char *property_name,
gboolean inherit,
gdouble *length)
@ -833,12 +902,42 @@ st_theme_node_get_length (StThemeNode *node,
inherit = TRUE;
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;
else
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
do_border_radius_term (StThemeNode *node,
CRTerm *term,
@ -1727,7 +1826,7 @@ st_theme_node_get_transition_duration (StThemeNode *node)
if (node->transition_duration > -1)
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;

View File

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

View File

@ -594,7 +594,7 @@ st_widget_leave (ClutterActor *actor,
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);
}

View File

@ -300,8 +300,8 @@ na_tray_manager_handle_dock_request (NaTrayManager *manager,
if (!gtk_socket_get_plug_window (GTK_SOCKET (child)))
{
/* 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);
gtk_widget_destroy (child);
return;
}

View File

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