Compare commits

..

46 Commits

Author SHA1 Message Date
Carlos Garcia Campos
a8c769e0ff browser-plugin: The NPObject returned by NPP_GetValue should be retained
The Mozilla documentation says: "And as always when working with
reference counted NPObjects, the caller is responsible for calling
NPN_ReleaseObject on the NPObject to drop the reference."

Browsers assume that the plugin does the right thing and always call
NPN_ReleaseObject. At some point the object is released and deallocated
and both the plugin and browser still have references to the object
thinking that it's still alive. That's why the crash is sometimes in the
plugin when it tries to use the np object, and sometimes in the browser.

https://bugzilla.gnome.org/post_bug.cgi
2016-10-29 14:57:30 -04:00
gogo
efd8b2d3a6 Add Croatian translation 2016-10-09 19:26:44 +00:00
Piotr Drąg
2b8d16e685 Updated Polish translation 2016-07-12 21:25:13 +02:00
Florian Müllner
598cf48973 Bump version to 3.18.5
Update NEWS.
2016-04-21 12:04:11 +02:00
Florian Müllner
ce811ec063 st: Don't assert when corner texture creation fails 2016-04-20 19:32:32 +02:00
Florian Müllner
535fb0e2a0 Do not skip CoglError parameters
While CoglError is a define to GError, it doesn't follow the convention
of ignoring errors when NULL is passed, but rather treats the error as
fatal :-(
That's clearly unwanted for a compositor, so make sure to always pass
an error parameter where a runtime error is possible

https://bugzilla.gnome.org/show_bug.cgi?id=765061
2016-04-20 19:32:32 +02:00
Florian Müllner
281101d942 st: Do not try to unref NULL CoglObjects
https://bugzilla.gnome.org/show_bug.cgi?id=765061
2016-04-20 19:32:31 +02:00
Aaron Plattner
045e1f01af st: Fix offscreen leak if cogl_framebuffer_allocate fails
If cogl_framebuffer_allocate fails in _st_create_shadow_pipeline_from_actor, the
CoglOffscreen* that was allocated earlier in the function is leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=735705

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2016-04-03 11:56:39 +02:00
Marek Černocký
db252a65f8 Updated Czech translation 2016-03-30 08:29:07 +02:00
Christophe Fergeau
358ee88e1c NetworkAgent: Fix double-unref in get_secrets_keyring_cb()
In get_secrets_keyring_cb, we own a ref on the 'attributes' hash table
from secret_item_get_attributes), and a ref on the 'secret' object (from
secret_item_get_secret(), but in the SHELL_KEYRING_SK_TAG case, we unref
these once before breaking out of the loop, and the second time after
breaking out of the loop.

https://bugzilla.gnome.org/show_bug.cgi?id=759708

Note: This is needed to avoid crashes with libsecret 0.18.4 -- Michael
2016-03-21 17:56:15 -05:00
Florian Müllner
cdc9652f5b telepathyClient: Acknowledge messages before closing
While a channel has pending messages, it will pop up again when
dismissed. That is clearly not what users expect, so clear them
out first before closing a channel.

https://bugzilla.gnome.org/show_bug.cgi?id=747991
2016-03-16 17:45:52 -05:00
Matej Urbančič
fcfa752fbd Updated Slovenian translation 2016-03-05 20:44:53 +01:00
Florian Müllner
4651b7adcc Bump version to 3.18.4
Update NEWS.
2016-02-22 16:45:15 +01:00
Lubomir Rintel
4562a431ad NetworkAgent: correctly identify the VPN secret requests
The non-interactive requests for 'vpn' settings are forwarded to the UI because
it is able to talk to the auth helpers. However, the VPN requests are identified
by the connection type instead of setting type. That is incorrect and the UI
is not prepared to handle such requests; tries to construct a dialog and fails
miserably:

  Gjs-Message: JS LOG: Invalid connection type: vpn

  (gnome-shell:13133): Gjs-WARNING **: JS ERROR: Error: No property 'text' in property list (or its value was undefined)
  NetworkSecretDialog<._init@resource:///org/gnome/shell/ui/components/networkAgent.js:60
  wrapper@resource:///org/gnome/gjs/modules/lang.js:169
  _Base.prototype._construct@resource:///org/gnome/gjs/modules/lang.js:110
  Class.prototype._construct/newClass@resource:///org/gnome/gjs/modules/lang.js:204
  NetworkAgent<._handleRequest@resource:///org/gnome/shell/ui/components/networkAgent.js:724
  wrapper@resource:///org/gnome/gjs/modules/lang.js:169
  NetworkAgent<._newRequest@resource:///org/gnome/shell/ui/components/networkAgent.js:715
  wrapper@resource:///org/gnome/gjs/modules/lang.js:169

https://bugzilla.gnome.org/show_bug.cgi?id=760999
2016-01-27 13:42:05 +01:00
Michael Catanzaro
f5d9d188a7 authPrompt: Do not allow bypassing disabled Sign In button
The Next and Sign In buttons are disabled when the username/password
field is empty. However, the user can still bypass this button by
pressing the enter key, leading to some odd glitches with the log in
for 'Not Listed?' users.

This is easy to fix by simply not progressing to the next screen when
the button is disabled.

https://bugzilla.gnome.org/show_bug.cgi?id=746180
2016-01-07 17:19:24 -06:00
Andika Triwidada
cca01e3f02 Updated Indonesian translation 2016-01-02 12:12:44 +00:00
Daniel Korostil
1874f3605d Updated Ukrainian translation 2015-12-05 17:00:22 +02:00
Michael Catanzaro
3001f3376c loginDialog: Reconsider user for user list when user changes
Generally a user-changed operation will be uninteresting, but if the
user is currently in the user list and the account changes to locked, we
want to remove it from the list, or if the user is not in the list and
the account changed to unlocked, we want to add it to the list. This
fixes the case where a new user account created in gnome-control-center
does not appear in the user list. The password mode is set in the new
account immediately after it is created, but the operations are not
atomic, so the login dialog considers the new user account when it is
still locked and rejects it from being displayed, then immediately
afterwards the account is unlocked. This commit causes the login dialog
to show the account when this occurs.

The containsUser() check here is not strictly necessary, but reduces
spurious calls to addUser() and removeUser(), since there's no easy way
to check if the locked status of the account has changed (as it's much
easier to connect to one signal on the UserManager than to
notify::locked on each User object).

https://bugzilla.gnome.org/show_bug.cgi?id=758568
2015-12-02 18:25:25 +01:00
Florian Müllner
491e511a96 altTab: Fix window-switcher on HiDPI displays
We need to take the scale factor into account to avoid tiny window
previews on HiDPI.

https://bugzilla.gnome.org/show_bug.cgi?id=758676
2015-12-02 10:35:52 +01:00
Michael Catanzaro
293bc98394 loginDialog: Fix TypeError when user is deleted
LoginDialog has a private _user, but UserListItem has a public user.
Easy to get wrong since _user would be the right thing to type in 90% of
this file.
2015-11-23 17:48:18 -06:00
Kristjan SCHMIDT
2ed3482d54 Updated Esperanto translation 2015-11-23 00:40:00 +01:00
Florian Müllner
4e4414a84d Bump version to 3.18.3
Update NEWS.
2015-11-17 22:25:33 +01:00
Carlos Garcia Campos
934a08f28f browser-plugin: Do not create a new object every time NPPVpluginScriptableNPObject is requested
Merge PluginData and PluginObject structs into a single one and create
the scriptable object associated to the plugin instance in NPP_New. Then,
when NPPVpluginScriptableNPObject is requested we just return the
scriptable object associated to the given instance. This caused the
crashes in NPN_InvokeDefault with WebKit, since we had multiple
scriptable objects for the same instance, but only one of those objects
had the onchange listener installed. Firefox seems to cache the
scriptable object for the instance and therefore NPPVpluginScriptableNPObject
is requested only once.

https://bugzilla.gnome.org/show_bug.cgi?id=737932
2015-11-17 13:18:05 -06:00
Carlos Garcia Campos
732ea2a91e browser-plugin: Set windowless mode and don't claim to need XEmbed
NPAPI plugins are windowed by default, so we need to set
NPPVpluginWindowBool value to FALSE on startup. This way the browser
will not create a GtkSocket for a GtkPlug that we are not going to
create. It doesn't make sense to claim that we need XEmbed either.

https://bugzilla.gnome.org/show_bug.cgi?id=757940
2015-11-17 11:35:53 -06:00
Michael Catanzaro
aae6a3cbbd Revert "browser-plugin: Set windowless mode and don't claim to need XEmbed"
This reverts commit a52c91e9e5.

https://bugzilla.gnome.org/show_bug.cgi?id=758035
2015-11-16 10:57:56 -06:00
Florian Müllner
f67a6589bd Bump version to 3.18.2
Update NEWS.
2015-11-12 13:08:29 +01:00
Carlos Garcia Campos
88c1fa8a3e browser-plugin: Set windowless mode and don't claim to need XEmbed
NPAPI plugins are windowed by default, so we need to set
NPPVpluginWindowBool value to FALSE on startup. This way the browser
will not create a GtkSocket for a GtkPlug that we are not going to
create. It doesn't make sense to claim that we need XEmbed either.

https://bugzilla.gnome.org/show_bug.cgi?id=757940
2015-11-12 12:12:29 +01:00
Florian Müllner
012443bffa st: Fix Gaussian kernel calculation
The result of subtracting unsigned operands is unsigned, which throws
off our calculation in case it should be negative.

This partly reverts 18b6f13395.

https://bugzilla.gnome.org/show_bug.cgi?id=757779
2015-11-12 01:03:01 +01:00
Anthony Fok
61b14c7f04 Updated Chinese (Taiwan) translation 2015-11-11 00:36:06 +00:00
Aron Xu
13dff7d5eb Stable backport for zh_CN translation from master 2015-11-11 00:21:32 +08:00
Carlos Garcia Campos
55087d03e4 browser-plugin: link with -Wl,-z,nodelete
This ensures that the module will not be unloaded, since GObject types
registered statically can't be reloaded. This should fix crashes with
browsers that correctly unload the plugins.

https://bugzilla.gnome.org/show_bug.cgi?id=737932
2015-11-10 15:25:40 +01:00
Owen W. Taylor
e7528bf2fa st_theme_node_prerender_shadow: guard against failure to allocate a texture
If we are trying to render a shadow at a size that is very large in one
direction, but small in the other direction (so that we don't 9-slice
the texture), then allocating the backing texture for the offscreen
buffer may fail due to texture-size limits. Don't crash in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=757150
2015-10-27 15:54:00 -04:00
Daniel Șerbănescu
9e64a1e3d6 Updated Romanian translation 2015-10-24 17:02:18 +00:00
Rui Matos
007ac93cd6 ActivitiesButton: fix overview being toggled while still animating
Adds the missing checks for whether we should toggle the overview, on
button and key release.

https://bugzilla.gnome.org/show_bug.cgi?id=756925
2015-10-23 13:44:49 +02:00
Owen W. Taylor
d8336efddc Defend against failure of cairo_pattern_get_surface()
There are quite a few crashes in retrace.fedoraproject.org that are a result of
of cairo_pattern_get_surface() failing, then a subsequent call to
cairo_image_surface_get_width() crashing because no surface was returned to the
out parameter. Knowing what causes these is hard - my best guess is widgets getting
allocated at ridiculous sizes - but avoiding the crash makes sense in any case.

See https://bugzilla.redhat.com/show_bug.cgi?id=1206754

https://bugzilla.gnome.org/show_bug.cgi?id=756983
2015-10-22 15:15:54 -04:00
Ray Strode
a83f822512 animation: do spinner animation with low priority
It's very unexpected that a spinner animation would
preempt idles from running.

This commit runs the spinner animation with a low
priority to ensure it doesn't take over the main
loop.

https://bugzilla.gnome.org/show_bug.cgi?id=754814
2015-10-21 08:54:55 -04:00
Ray Strode
f64d64035a animation: Run every 16ms not ever 14ms
Right now the spinner animation updates every 14ms.
60 frames per second would be one frame per 16.667ms,
so we're waking up more frequently than we need to.

This commit changes the wakeup to happen after 16ms.

https://bugzilla.gnome.org/show_bug.cgi?id=754814
2015-10-21 08:54:31 -04:00
Ray Strode
5583f881df gdm: don't emit start-session-when-ready from idle function
There's no point in delaying the emission.  We should do it
right away.

https://bugzilla.gnome.org/show_bug.cgi?id=754814
2015-10-21 08:54:24 -04:00
Balázs Meskó
10e4382a7d Updated Hungarian translation 2015-10-21 06:08:43 +00:00
Sveinn í Felli
9f0ee0dc9f Updated Icelandic translation 2015-10-20 14:25:09 +00:00
Owen W. Taylor
2f82f783f2 Fix text-scaling-factor under wayland.
The text-scaling-factor GSetting was not being properly propagated
to clutter and the Pango font map; under X this is done by Clutter,
which listens to XSETTINGS directly.

https://bugzilla.gnome.org/show_bug.cgi?id=756447
2015-10-20 09:37:57 -04:00
Rui Matos
4d066e3916 windowMenu: Ensure the source actor isn't sized 0x0
If the source actor is sized 0x0, the grabHelper will close the menu
on button release if the menu ends up flipped because in that case the
release event happens when the pointer is neither over the source
actor (since it's 0x0) or over the menu actor. A zero sized source
actor works for the non-flipped menu case because the menu's actor
itself ends up underneath the pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=756605
2015-10-20 15:11:31 +02:00
Khaled Hosny
342fbd16d3 Add RLM as appropriate 2015-10-18 17:23:22 +04:00
Cosimo Cecchi
8ae0c69ccf windowManager: fix fullscreen clone being left around
If we get another effect on the same actor, we should make sure to
remove the clone through the "overwrite" methods provided by Tweener, or
there will be a race that might end up with a stray clone being left
around.

https://bugzilla.gnome.org/show_bug.cgi?id=756714
2015-10-16 14:11:10 -07:00
Kjartan Maraas
bed660bdf4 Fix some issues reported by Bjørn Lie in bug 740906. 2015-10-16 18:12:28 +02:00
Florian Müllner
ab2ca17b76 windowManager: Fix fullscreen animations on dualscreen
The translation should describe the difference between the fullscreened
and unfullscreened position of the window - however we are currently
assuming a fullscreen position of (0, 0) instead of the monitor's origin,
which causes glitches on dualscreen setups.

https://bugzilla.gnome.org/show_bug.cgi?id=756697
2015-10-16 15:52:07 +02:00
121 changed files with 6822 additions and 3504 deletions

56
NEWS
View File

@@ -1,18 +1,54 @@
3.19.1 3.18.5
====== ======
* Respect text-scaling factor under wayland [Owen; #756447] * Fix deleting chat notifications in calendar [Florian; #747991]
* Show the Bluetooth submenu when there were setup devices [Bastien; #723848] * Fix recount issue in network agent component [Christophe; #759708]
* Misc. bug fixes [Florian, Cosimo, Rui, Ray, Owen, Jakub, Bastien; * Plug a memory leak [Aaron; #735705]
#756697, #756714, #756605, #754814, #738942, #756983, #756925, * Do not assert on non-fatal runtime errors [Florian; #765061]
#757011, #673235, #757150]
Contributors: Contributors:
Cosimo Cecchi, Rui Matos, Florian Müllner, Bastien Nocera, Jakub Steiner, Christophe Fergeau, Florian Müllner, Aaron Plattner
Ray Strode, Owen W. Taylor
Translations: Translations:
Kjartan Maraas [nb], Khaled Hosny [ar], Balázs Meskó [hu], Matej Urbančič [sl], Marek Černocký [cs]
Daniel Șerbănescu [ro], Marek Černocký [cs]
3.18.4
======
* Fix thumbnail scaling in window switcher on HiDPI [Florian; #758676]
* loginDialog: Update user list on user changes [Michael; #758568]
* gdm: Do not allow bypassing disabled Sign In button [Michael; #746180]
* Correctly identify VPN secret requests [Lubomir; #760999]
Contributors:
Michael Catanzaro, Florian Müllner, Lubomir Rintel
Translations:
Kristjan SCHMIDT [eo], Daniel Korostil [uk], Andika Triwidada [id]
3.18.3
======
* Fix browser plugin crash in Firefox [Carlos; #737932, #757940]
Contributors:
Carlos Garcia Campos
3.18.2
======
* Fix fullscreen animation glitches [Florian, Cosimo; #756697, #756714]
* Fix window menu being closed immediately in top orientation [Rui; #756605]
* Respect text-scaling factor under wayland [Owen; #756447]
* Fix login screen getting stuck after authentification [Ray; #754814]
* Fix overview being toggled while still animating [Rui; #756925]
* Improve robustness of browser plugin [Carlos; #737932, #757940]
* Misc. bug fixes [Owen, Florian; #756983, #757150, #757779]
Contributors:
Cosimo Cecchi, Carlos Garcia Campos, Rui Matos, Florian Müllner, Ray Strode,
Owen W. Taylor
Translations:
Kjartan Maraas [nb], Khaled Hosny [ar], Sveinn í Felli [is],
Balázs Meskó [hu], Daniel Șerbănescu [ro], Aron Xu [zh_CN],
Anthony Fok [zh_TW]
3.18.1 3.18.1
====== ======

View File

@@ -3,7 +3,10 @@ mozillalibdir = $(BROWSER_PLUGIN_DIR)
mozillalib_LTLIBRARIES = libgnome-shell-browser-plugin.la mozillalib_LTLIBRARIES = libgnome-shell-browser-plugin.la
libgnome_shell_browser_plugin_la_LDFLAGS = -module -avoid-version -no-undefined # Browsers can unload and reload the module while browsing, which is not supported by GObject.
# We pass -Wl,-z,nodelete to the linker to ensure the module is never unloaded.
# https://bugzilla.gnome.org/show_bug.cgi?id=737932
libgnome_shell_browser_plugin_la_LDFLAGS = -module -avoid-version -no-undefined -Wl,-z,nodelete
libgnome_shell_browser_plugin_la_LIBADD = \ libgnome_shell_browser_plugin_la_LIBADD = \
$(BROWSER_PLUGIN_LIBS) $(BROWSER_PLUGIN_LIBS)

View File

@@ -43,10 +43,6 @@
#define EXTENSION_DISABLE_VERSION_CHECK_KEY "disable-extension-version-validation" #define EXTENSION_DISABLE_VERSION_CHECK_KEY "disable-extension-version-validation"
typedef struct {
GDBusProxy *proxy;
} PluginData;
static NPNetscapeFuncs funcs; static NPNetscapeFuncs funcs;
static inline gchar * static inline gchar *
@@ -145,121 +141,6 @@ check_origin_and_protocol (NPP instance)
return ret; return ret;
} }
/* =============== public entry points =================== */
NPError
NP_Initialize(NPNetscapeFuncs *pfuncs, NPPluginFuncs *plugin)
{
/* global initialization routine, called once when plugin
is loaded */
g_debug ("plugin loaded");
memcpy (&funcs, pfuncs, sizeof (funcs));
plugin->size = sizeof(NPPluginFuncs);
plugin->newp = NPP_New;
plugin->destroy = NPP_Destroy;
plugin->getvalue = NPP_GetValue;
plugin->setwindow = NPP_SetWindow;
return NPERR_NO_ERROR;
}
NPError
NP_Shutdown(void)
{
return NPERR_NO_ERROR;
}
const char*
NP_GetMIMEDescription(void)
{
return PLUGIN_MIME_STRING;
}
NPError
NP_GetValue(void *instance,
NPPVariable variable,
void *value)
{
switch (variable) {
case NPPVpluginNameString:
*(char**)value = PLUGIN_NAME;
break;
case NPPVpluginDescriptionString:
*(char**)value = PLUGIN_DESCRIPTION;
break;
default:
;
}
return NPERR_NO_ERROR;
}
NPError
NPP_New(NPMIMEType mimetype,
NPP instance,
uint16_t mode,
int16_t argc,
char **argn,
char **argv,
NPSavedData *saved)
{
/* instance initialization function */
PluginData *data;
GError *error = NULL;
g_debug ("plugin created");
if (!check_origin_and_protocol (instance))
return NPERR_GENERIC_ERROR;
data = g_slice_new (PluginData);
instance->pdata = data;
data->proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE,
NULL, /* interface info */
"org.gnome.Shell",
"/org/gnome/Shell",
"org.gnome.Shell.Extensions",
NULL, /* GCancellable */
&error);
if (!data->proxy)
{
/* ignore error if the shell is not running, otherwise warn */
if (error->domain != G_DBUS_ERROR ||
error->code != G_DBUS_ERROR_NAME_HAS_NO_OWNER)
{
g_warning ("Failed to set up Shell proxy: %s", error->message);
}
g_clear_error (&error);
return NPERR_GENERIC_ERROR;
}
g_debug ("plugin created successfully");
return NPERR_NO_ERROR;
}
NPError
NPP_Destroy(NPP instance,
NPSavedData **saved)
{
/* instance finalization function */
PluginData *data = instance->pdata;
g_debug ("plugin destroyed");
g_object_unref (data->proxy);
g_slice_free (PluginData, data);
return NPERR_NO_ERROR;
}
/* =================== scripting interface =================== */ /* =================== scripting interface =================== */
typedef struct { typedef struct {
@@ -344,24 +225,10 @@ static NPObject *
plugin_object_allocate (NPP instance, plugin_object_allocate (NPP instance,
NPClass *klass) NPClass *klass)
{ {
PluginData *data = instance->pdata; PluginObject *obj = (PluginObject *) funcs.memalloc (sizeof (PluginObject));
PluginObject *obj = g_slice_new0 (PluginObject);
memset (obj, 0, sizeof (PluginObject));
obj->instance = instance; obj->instance = instance;
obj->proxy = g_object_ref (data->proxy);
obj->settings = g_settings_new (SHELL_SCHEMA);
obj->signal_id = g_signal_connect (obj->proxy, "g-signal",
G_CALLBACK (on_shell_signal), obj);
obj->watch_name_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
"org.gnome.Shell",
G_BUS_NAME_WATCHER_FLAGS_NONE,
on_shell_appeared,
NULL,
obj,
NULL);
g_debug ("plugin object created");
return (NPObject*) obj; return (NPObject*) obj;
} }
@@ -369,20 +236,7 @@ plugin_object_allocate (NPP instance,
static void static void
plugin_object_deallocate (NPObject *npobj) plugin_object_deallocate (NPObject *npobj)
{ {
PluginObject *obj = (PluginObject*)npobj; funcs.memfree (npobj);
g_signal_handler_disconnect (obj->proxy, obj->signal_id);
g_object_unref (obj->proxy);
if (obj->listener)
funcs.releaseobject (obj->listener);
if (obj->watch_name_id)
g_bus_unwatch_name (obj->watch_name_id);
g_debug ("plugin object destroyed");
g_slice_free (PluginObject, obj);
} }
static inline gboolean static inline gboolean
@@ -1033,6 +887,149 @@ init_methods_and_properties (void)
onextension_changed_id = funcs.getstringidentifier ("onchange"); onextension_changed_id = funcs.getstringidentifier ("onchange");
} }
/* =============== public entry points =================== */
NPError
NP_Initialize(NPNetscapeFuncs *pfuncs, NPPluginFuncs *plugin)
{
/* global initialization routine, called once when plugin
is loaded */
g_debug ("plugin loaded");
memcpy (&funcs, pfuncs, sizeof (funcs));
plugin->size = sizeof(NPPluginFuncs);
plugin->newp = NPP_New;
plugin->destroy = NPP_Destroy;
plugin->getvalue = NPP_GetValue;
plugin->setwindow = NPP_SetWindow;
plugin->event = NPP_HandleEvent;
return NPERR_NO_ERROR;
}
NPError
NP_Shutdown(void)
{
return NPERR_NO_ERROR;
}
const char*
NP_GetMIMEDescription(void)
{
return PLUGIN_MIME_STRING;
}
NPError
NP_GetValue(void *instance,
NPPVariable variable,
void *value)
{
switch (variable) {
case NPPVpluginNameString:
*(char**)value = PLUGIN_NAME;
break;
case NPPVpluginDescriptionString:
*(char**)value = PLUGIN_DESCRIPTION;
break;
default:
;
}
return NPERR_NO_ERROR;
}
NPError
NPP_New(NPMIMEType mimetype,
NPP instance,
uint16_t mode,
int16_t argc,
char **argn,
char **argv,
NPSavedData *saved)
{
/* instance initialization function */
PluginObject *obj;
GError *error = NULL;
g_debug ("plugin created");
if (!check_origin_and_protocol (instance))
return NPERR_GENERIC_ERROR;
/* set windowless mode */
funcs.setvalue(instance, NPPVpluginWindowBool, NULL);
g_debug ("creating scriptable object");
init_methods_and_properties ();
obj = (PluginObject *) funcs.createobject (instance, &plugin_class);
instance->pdata = obj;
obj->proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE,
NULL, /* interface info */
"org.gnome.Shell",
"/org/gnome/Shell",
"org.gnome.Shell.Extensions",
NULL, /* GCancellable */
&error);
if (!obj->proxy)
{
/* ignore error if the shell is not running, otherwise warn */
if (!g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_NAME_HAS_NO_OWNER))
{
g_warning ("Failed to set up Shell proxy: %s", error->message);
}
g_clear_error (&error);
return NPERR_GENERIC_ERROR;
}
obj->settings = g_settings_new (SHELL_SCHEMA);
obj->signal_id = g_signal_connect (obj->proxy, "g-signal",
G_CALLBACK (on_shell_signal), obj);
obj->watch_name_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
"org.gnome.Shell",
G_BUS_NAME_WATCHER_FLAGS_NONE,
on_shell_appeared,
NULL,
obj,
NULL);
g_debug ("plugin created successfully");
return NPERR_NO_ERROR;
}
NPError
NPP_Destroy(NPP instance,
NPSavedData **saved)
{
/* instance finalization function */
PluginObject *obj = (PluginObject *) instance->pdata;
if (!obj)
return NPERR_INVALID_INSTANCE_ERROR;
g_debug ("plugin destroyed");
g_signal_handler_disconnect (obj->proxy, obj->signal_id);
g_object_unref (obj->proxy);
if (obj->listener)
funcs.releaseobject (obj->listener);
if (obj->restart_listener)
funcs.releaseobject (obj->restart_listener);
if (obj->watch_name_id)
g_bus_unwatch_name (obj->watch_name_id);
funcs.releaseobject((NPObject *)obj);
return NPERR_NO_ERROR;
}
NPError NPError
NPP_GetValue(NPP instance, NPP_GetValue(NPP instance,
NPPVariable variable, NPPVariable variable,
@@ -1043,13 +1040,11 @@ NPP_GetValue(NPP instance,
switch (variable) { switch (variable) {
case NPPVpluginScriptableNPObject: case NPPVpluginScriptableNPObject:
g_debug ("creating scriptable object"); g_debug ("creating scriptable object");
init_methods_and_properties (); if (!instance->pdata)
return NPERR_INVALID_INSTANCE_ERROR;
*(NPObject**)value = funcs.createobject (instance, &plugin_class); funcs.retainobject (instance->pdata);
break; *(NPObject**)value = instance->pdata;
case NPPVpluginNeedsXEmbed:
*(bool *)value = TRUE;
break; break;
default: default:
@@ -1067,3 +1062,11 @@ NPP_SetWindow(NPP instance,
{ {
return NPERR_NO_ERROR; return NPERR_NO_ERROR;
} }
int16_t
NPP_HandleEvent(NPP instance,
void *event)
{
/* Ignore the event */
return FALSE;
}

View File

@@ -1,5 +1,5 @@
AC_PREREQ(2.63) AC_PREREQ(2.63)
AC_INIT([gnome-shell],[3.19.1],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell],[gnome-shell]) AC_INIT([gnome-shell],[3.18.5],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell],[gnome-shell])
AX_IS_RELEASE([git-directory]) AX_IS_RELEASE([git-directory])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
@@ -77,7 +77,7 @@ AC_MSG_RESULT($enable_systemd)
CLUTTER_MIN_VERSION=1.21.5 CLUTTER_MIN_VERSION=1.21.5
GOBJECT_INTROSPECTION_MIN_VERSION=1.45.4 GOBJECT_INTROSPECTION_MIN_VERSION=1.45.4
GJS_MIN_VERSION=1.39.0 GJS_MIN_VERSION=1.39.0
MUTTER_MIN_VERSION=3.19.1 MUTTER_MIN_VERSION=3.18.1
GTK_MIN_VERSION=3.15.0 GTK_MIN_VERSION=3.15.0
GIO_MIN_VERSION=2.45.3 GIO_MIN_VERSION=2.45.3
LIBECAL_MIN_VERSION=3.5.3 LIBECAL_MIN_VERSION=3.5.3
@@ -117,7 +117,7 @@ PKG_CHECK_MODULES(GNOME_SHELL_JS, gio-2.0 gjs-internals-1.0 >= $GJS_MIN_VERSION)
PKG_CHECK_MODULES(ST, clutter-1.0 gtk+-3.0 libcroco-0.6 >= 0.6.8 x11) PKG_CHECK_MODULES(ST, clutter-1.0 gtk+-3.0 libcroco-0.6 >= 0.6.8 x11)
PKG_CHECK_MODULES(SHELL_PERF_HELPER, gtk+-3.0 gio-2.0) PKG_CHECK_MODULES(SHELL_PERF_HELPER, gtk+-3.0 gio-2.0)
PKG_CHECK_MODULES(SHELL_HOTPLUG_SNIFFER, gio-2.0 gdk-pixbuf-2.0) PKG_CHECK_MODULES(SHELL_HOTPLUG_SNIFFER, gio-2.0 gdk-pixbuf-2.0)
PKG_CHECK_MODULES(TRAY, clutter-1.0 gtk+-3.0) PKG_CHECK_MODULES(TRAY, gtk+-3.0)
PKG_CHECK_MODULES(GVC, libpulse >= $PULSE_MIN_VERS libpulse-mainloop-glib gobject-2.0) PKG_CHECK_MODULES(GVC, libpulse >= $PULSE_MIN_VERS libpulse-mainloop-glib gobject-2.0)
PKG_CHECK_MODULES(DESKTOP_SCHEMAS, gsettings-desktop-schemas >= 3.13.1) PKG_CHECK_MODULES(DESKTOP_SCHEMAS, gsettings-desktop-schemas >= 3.13.1)

View File

@@ -72,16 +72,6 @@
This key sets the default state of the checkbox. This key sets the default state of the checkbox.
</_description> </_description>
</key> </key>
<key name="had-bluetooth-devices-setup" type="b">
<default>false</default>
<_summary>Whether the default Bluetooth adapter had set up devices associated to it</_summary>
<_description>
The shell will only show a Bluetooth menu item if a Bluetooth
adapter is powered, or if there were devices set up associated
with the default adapter. This will be reset if the default
adapter is ever seen not to have devices associated to it.
</_description>
</key>
<child name="calendar" schema="org.gnome.shell.calendar"/> <child name="calendar" schema="org.gnome.shell.calendar"/>
<child name="keybindings" schema="org.gnome.shell.keybindings"/> <child name="keybindings" schema="org.gnome.shell.keybindings"/>
<child name="keyboard" schema="org.gnome.shell.keyboard"/> <child name="keyboard" schema="org.gnome.shell.keyboard"/>

View File

@@ -41,9 +41,9 @@ stage {
icon-shadow: 0 1px black; icon-shadow: 0 1px black;
box-shadow: inset 0px 0px 0px 1px #215d9c; } box-shadow: inset 0px 0px 0px 1px #215d9c; }
.button:insensitive { .button:insensitive {
color: gray; color: #7f7f7f;
border-color: rgba(0, 0, 0, 0.7); border-color: rgba(0, 0, 0, 0.7);
background-color: rgba(62, 67, 69, 0.7); background-color: rgba(62, 67, 68, 0.7);
box-shadow: none; box-shadow: none;
text-shadow: none; text-shadow: none;
icon-shadow: none; } icon-shadow: none; }
@@ -65,9 +65,9 @@ stage {
icon-shadow: 0 1px black; icon-shadow: 0 1px black;
padding: 12px; } padding: 12px; }
.modal-dialog-linked-button:insensitive { .modal-dialog-linked-button:insensitive {
color: gray; color: #7f7f7f;
border-color: rgba(0, 0, 0, 0.7); border-color: rgba(0, 0, 0, 0.7);
background-color: rgba(62, 67, 69, 0.7); background-color: rgba(62, 67, 68, 0.7);
box-shadow: none; box-shadow: none;
text-shadow: none; text-shadow: none;
icon-shadow: none; } icon-shadow: none; }
@@ -107,8 +107,8 @@ StEntry {
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
border-color: rgba(166, 166, 166, 0.5); } border-color: rgba(166, 166, 166, 0.5); }
StEntry:insensitive { StEntry:insensitive {
color: gray; color: #7f7f7f;
border-color: #0e0e0e; border-color: #0d0d0d;
box-shadow: none; } box-shadow: none; }
StEntry StIcon.capslock-warning { StEntry StIcon.capslock-warning {
icon-size: 16px; icon-size: 16px;
@@ -142,7 +142,7 @@ StScrollBar {
.slider { .slider {
height: 1em; height: 1em;
-slider-height: 0.3em; -slider-height: 0.3em;
-slider-background-color: #0e0e0e; -slider-background-color: #0d0d0d;
-slider-border-color: black; -slider-border-color: black;
-slider-active-background-color: #215d9c; -slider-active-background-color: #215d9c;
-slider-active-border-color: #184472; -slider-active-border-color: #184472;
@@ -735,7 +735,7 @@ StScrollBar {
border-left-width: 1px; } border-left-width: 1px; }
.calendar-nonwork-day { .calendar-nonwork-day {
color: gray; } color: #7f7f7f; }
.calendar-today { .calendar-today {
font-weight: bold; font-weight: bold;
@@ -960,14 +960,10 @@ StScrollBar {
.search-entry { .search-entry {
width: 320px; width: 320px;
padding: 7px 9px; padding: 7px 9px;
border-radius: 6px; border-radius: 6px; }
border-color: #747467;
color: #eeeeec;
background-color: #2e3436; }
.search-entry:focus { .search-entry:focus {
padding: 6px 8px; padding: 6px 8px;
border-width: 2px; border-width: 2px; }
border-color: #215d9c; }
.search-entry .search-entry-icon { .search-entry .search-entry-icon {
icon-size: 1em; icon-size: 1em;
padding: 0 4px; padding: 0 4px;
@@ -1495,9 +1491,9 @@ StScrollBar {
text-shadow: none; text-shadow: none;
icon-shadow: none; } icon-shadow: none; }
.login-dialog .modal-dialog-button:default:insensitive { .login-dialog .modal-dialog-button:default:insensitive {
color: gray; color: #7f7f7f;
border-color: rgba(0, 0, 0, 0.7); border-color: rgba(0, 0, 0, 0.7);
background-color: rgba(62, 67, 69, 0.7); background-color: rgba(62, 67, 68, 0.7);
box-shadow: none; box-shadow: none;
text-shadow: none; text-shadow: none;
icon-shadow: none; } icon-shadow: none; }

View File

@@ -41,9 +41,9 @@ stage {
icon-shadow: 0 1px black; icon-shadow: 0 1px black;
box-shadow: inset 0px 0px 0px 1px #215d9c; } box-shadow: inset 0px 0px 0px 1px #215d9c; }
.button:insensitive { .button:insensitive {
color: #949796; color: #939695;
border-color: rgba(0, 0, 0, 0.7); border-color: rgba(0, 0, 0, 0.7);
background-color: rgba(66, 72, 73, 0.7); background-color: rgba(66, 71, 73, 0.7);
box-shadow: none; box-shadow: none;
text-shadow: none; text-shadow: none;
icon-shadow: none; } icon-shadow: none; }
@@ -65,9 +65,9 @@ stage {
icon-shadow: 0 1px black; icon-shadow: 0 1px black;
padding: 12px; } padding: 12px; }
.modal-dialog-linked-button:insensitive { .modal-dialog-linked-button:insensitive {
color: #949796; color: #939695;
border-color: rgba(0, 0, 0, 0.7); border-color: rgba(0, 0, 0, 0.7);
background-color: rgba(66, 72, 73, 0.7); background-color: rgba(66, 71, 73, 0.7);
box-shadow: none; box-shadow: none;
text-shadow: none; text-shadow: none;
icon-shadow: none; } icon-shadow: none; }
@@ -107,8 +107,8 @@ StEntry {
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
border-color: rgba(154, 154, 142, 0.5); } border-color: rgba(154, 154, 142, 0.5); }
StEntry:insensitive { StEntry:insensitive {
color: #949796; color: #939695;
border-color: #333636; border-color: #323636;
box-shadow: none; } box-shadow: none; }
StEntry StIcon.capslock-warning { StEntry StIcon.capslock-warning {
icon-size: 16px; icon-size: 16px;
@@ -131,10 +131,10 @@ StScrollBar {
background-color: transparent; } background-color: transparent; }
StScrollBar StButton#vhandle, StScrollBar StButton#hhandle { StScrollBar StButton#vhandle, StScrollBar StButton#hhandle {
border-radius: 8px; border-radius: 8px;
background-color: #a6a8a7; background-color: #a5a8a6;
margin: 3px; } margin: 3px; }
StScrollBar StButton#vhandle:hover, StScrollBar StButton#hhandle:hover { StScrollBar StButton#vhandle:hover, StScrollBar StButton#hhandle:hover {
background-color: #cacbc9; } background-color: #c9cbc9; }
StScrollBar StButton#vhandle:active, StScrollBar StButton#hhandle:active { StScrollBar StButton#vhandle:active, StScrollBar StButton#hhandle:active {
background-color: #215d9c; } background-color: #215d9c; }
@@ -142,7 +142,7 @@ StScrollBar {
.slider { .slider {
height: 1em; height: 1em;
-slider-height: 0.3em; -slider-height: 0.3em;
-slider-background-color: #333636; -slider-background-color: #323636;
-slider-border-color: #1c1f1f; -slider-border-color: #1c1f1f;
-slider-active-background-color: #215d9c; -slider-active-background-color: #215d9c;
-slider-active-border-color: #184472; -slider-active-border-color: #184472;
@@ -735,7 +735,7 @@ StScrollBar {
border-left-width: 1px; } border-left-width: 1px; }
.calendar-nonwork-day { .calendar-nonwork-day {
color: #949796; } color: #939695; }
.calendar-today { .calendar-today {
font-weight: bold; font-weight: bold;
@@ -960,14 +960,10 @@ StScrollBar {
.search-entry { .search-entry {
width: 320px; width: 320px;
padding: 7px 9px; padding: 7px 9px;
border-radius: 6px; border-radius: 6px; }
border-color: #747467;
color: #eeeeec;
background-color: #2e3436; }
.search-entry:focus { .search-entry:focus {
padding: 6px 8px; padding: 6px 8px;
border-width: 2px; border-width: 2px; }
border-color: #215d9c; }
.search-entry .search-entry-icon { .search-entry .search-entry-icon {
icon-size: 1em; icon-size: 1em;
padding: 0 4px; padding: 0 4px;
@@ -1495,9 +1491,9 @@ StScrollBar {
text-shadow: none; text-shadow: none;
icon-shadow: none; } icon-shadow: none; }
.login-dialog .modal-dialog-button:default:insensitive { .login-dialog .modal-dialog-button:default:insensitive {
color: #949796; color: #939695;
border-color: rgba(0, 0, 0, 0.7); border-color: rgba(0, 0, 0, 0.7);
background-color: rgba(66, 72, 73, 0.7); background-color: rgba(66, 71, 73, 0.7);
box-shadow: none; box-shadow: none;
text-shadow: none; text-shadow: none;
icon-shadow: none; } icon-shadow: none; }

View File

@@ -189,6 +189,7 @@ const AuthPrompt = new Lang.Class({
this._updateNextButtonSensitivity(this._entry.text.length > 0); this._updateNextButtonSensitivity(this._entry.text.length > 0);
})); }));
this._entry.clutter_text.connect('activate', Lang.bind(this, function() { this._entry.clutter_text.connect('activate', Lang.bind(this, function() {
if (this.nextButton.reactive)
this.emit('next'); this.emit('next');
})); }));
}, },

View File

@@ -96,7 +96,7 @@ const UserListItem = new Lang.Class({
}, },
_onDestroy: function() { _onDestroy: function() {
this._user.disconnect(this._userChangedId); this.user.disconnect(this._userChangedId);
}, },
_onClicked: function() { _onClicked: function() {
@@ -212,6 +212,10 @@ const UserList = new Lang.Class({
return item; return item;
}, },
containsUser: function(user) {
return this._items[user.get_user_name()] != null;
},
addUser: function(user) { addUser: function(user) {
if (!user.is_loaded) if (!user.is_loaded)
return; return;
@@ -1126,6 +1130,10 @@ const LoginDialog = new Lang.Class({
this._userManager.disconnect(this._userRemovedId); this._userManager.disconnect(this._userRemovedId);
this._userRemovedId = 0; this._userRemovedId = 0;
} }
if (this._userChangedId) {
this._userManager.disconnect(this._userChangedId);
this._userChangedId = 0;
}
this._textureCache.disconnect(this._updateLogoTextureId); this._textureCache.disconnect(this._updateLogoTextureId);
Main.layoutManager.disconnect(this._startupCompleteId); Main.layoutManager.disconnect(this._startupCompleteId);
if (this._settings) { if (this._settings) {
@@ -1172,6 +1180,14 @@ const LoginDialog = new Lang.Class({
this._userList.removeUser(user); this._userList.removeUser(user);
})); }));
this._userChangedId = this._userManager.connect('user-changed',
Lang.bind(this, function(userManager, user) {
if (this._userList.containsUser(user) && user.locked)
this._userList.removeUser(user);
else if (!this._userList.containsUser(user) && !user.locked)
this._userList.addUser(user);
}));
return GLib.SOURCE_REMOVE; return GLib.SOURCE_REMOVE;
}, },

View File

@@ -685,15 +685,17 @@ const WindowIcon = new Lang.Class({
this._icon.destroy_all_children(); this._icon.destroy_all_children();
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
switch (mode) { switch (mode) {
case AppIconMode.THUMBNAIL_ONLY: case AppIconMode.THUMBNAIL_ONLY:
size = WINDOW_PREVIEW_SIZE; size = WINDOW_PREVIEW_SIZE;
this._icon.add_actor(_createWindowClone(mutterWindow, WINDOW_PREVIEW_SIZE)); this._icon.add_actor(_createWindowClone(mutterWindow, size * scaleFactor));
break; break;
case AppIconMode.BOTH: case AppIconMode.BOTH:
size = WINDOW_PREVIEW_SIZE; size = WINDOW_PREVIEW_SIZE;
this._icon.add_actor(_createWindowClone(mutterWindow, WINDOW_PREVIEW_SIZE)); this._icon.add_actor(_createWindowClone(mutterWindow, size * scaleFactor));
if (this.app) if (this.app)
this._icon.add_actor(this._createAppIcon(this.app, this._icon.add_actor(this._createAppIcon(this.app,
@@ -705,7 +707,7 @@ const WindowIcon = new Lang.Class({
this._icon.add_actor(this._createAppIcon(this.app, size)); this._icon.add_actor(this._createAppIcon(this.app, size));
} }
this._icon.set_size(size, size); this._icon.set_size(size * scaleFactor, size * scaleFactor);
}, },
_createAppIcon: function(app, size) { _createAppIcon: function(app, size) {

View File

@@ -725,7 +725,7 @@ const Calendar = new Lang.Class({
// nRows here means 6 weeks + one header + one navbar // nRows here means 6 weeks + one header + one navbar
let nRows = 8; let nRows = 8;
while (row < 8) { while (row < 8) {
let button = new St.Button({ label: iter.toLocaleFormat(C_("date day number format", "%d")), let button = new St.Button({ label: iter.getDate().toString(),
can_focus: true }); can_focus: true });
let rtl = button.get_text_direction() == Clutter.TextDirection.RTL; let rtl = button.get_text_direction() == Clutter.TextDirection.RTL;

View File

@@ -469,6 +469,7 @@ const ChatSource = new Lang.Class({
destroy: function(reason) { destroy: function(reason) {
if (this._client.is_handling_channel(this._channel)) { if (this._client.is_handling_channel(this._channel)) {
this._ackMessages();
// The chat box has been destroyed so it can't // The chat box has been destroyed so it can't
// handle the channel any more. // handle the channel any more.
this._channel.close_async(function(channel, result) { this._channel.close_async(function(channel, result) {

View File

@@ -78,7 +78,6 @@ let _startDate;
let _defaultCssStylesheet = null; let _defaultCssStylesheet = null;
let _cssStylesheet = null; let _cssStylesheet = null;
let _a11ySettings = null; let _a11ySettings = null;
let _themeResource = null;
function _sessionUpdated() { function _sessionUpdated() {
if (sessionMode.isPrimary) if (sessionMode.isPrimary)
@@ -138,7 +137,9 @@ function _initializeUI() {
Shell.WindowTracker.get_default(); Shell.WindowTracker.get_default();
Shell.AppUsage.get_default(); Shell.AppUsage.get_default();
reloadThemeResource(); let resource = Gio.Resource.load(global.datadir + '/gnome-shell-theme.gresource');
resource._register();
_loadDefaultStylesheet(); _loadDefaultStylesheet();
// Setup the stage hierarchy early // Setup the stage hierarchy early
@@ -289,14 +290,6 @@ function setThemeStylesheet(cssStylesheet) {
_cssStylesheet = cssStylesheet ? Gio.File.new_for_path(cssStylesheet) : null; _cssStylesheet = cssStylesheet ? Gio.File.new_for_path(cssStylesheet) : null;
} }
function reloadThemeResource() {
if (_themeResource)
_themeResource._unregister();
_themeResource = Gio.Resource.load(global.datadir + '/gnome-shell-theme.gresource');
_themeResource._register();
}
/** /**
* loadTheme: * loadTheme:
* *

View File

@@ -61,7 +61,6 @@ const RunDialog = new Lang.Class({
// rt is short for "reload theme" // rt is short for "reload theme"
'rt': Lang.bind(this, function() { 'rt': Lang.bind(this, function() {
Main.reloadThemeResource();
Main.loadTheme(); Main.loadTheme();
}) })
}; };

View File

@@ -23,8 +23,6 @@ const RfkillManagerInterface = '<node> \
const RfkillManagerProxy = Gio.DBusProxy.makeProxyWrapper(RfkillManagerInterface); const RfkillManagerProxy = Gio.DBusProxy.makeProxyWrapper(RfkillManagerInterface);
const HAD_BLUETOOTH_DEVICES_SETUP = 'had-bluetooth-devices-setup';
const Indicator = new Lang.Class({ const Indicator = new Lang.Class({
Name: 'BTIndicator', Name: 'BTIndicator',
Extends: PanelMenu.SystemIndicator, Extends: PanelMenu.SystemIndicator,
@@ -34,7 +32,6 @@ const Indicator = new Lang.Class({
this._indicator = this._addIndicator(); this._indicator = this._addIndicator();
this._indicator.icon_name = 'bluetooth-active-symbolic'; this._indicator.icon_name = 'bluetooth-active-symbolic';
this._hadSetupDevices = global.settings.get_boolean(HAD_BLUETOOTH_DEVICES_SETUP);
this._proxy = new RfkillManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH, this._proxy = new RfkillManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH,
Lang.bind(this, function(proxy, error) { Lang.bind(this, function(proxy, error) {
@@ -47,15 +44,13 @@ const Indicator = new Lang.Class({
})); }));
this._proxy.connect('g-properties-changed', Lang.bind(this, this._sync)); this._proxy.connect('g-properties-changed', Lang.bind(this, this._sync));
this._item = new PopupMenu.PopupSubMenuMenuItem(_("Bluetooth"), true); // The Bluetooth menu only appears when Bluetooth is in use,
// so just statically build it with a "Turn Off" menu item.
this._item = new PopupMenu.PopupSubMenuMenuItem('', true);
this._item.icon.icon_name = 'bluetooth-active-symbolic'; this._item.icon.icon_name = 'bluetooth-active-symbolic';
this._item.menu.addAction(_("Turn Off"), Lang.bind(this, function() {
this._toggleItem = new PopupMenu.PopupMenuItem(''); this._proxy.BluetoothAirplaneMode = true;
this._toggleItem.connect('activate', Lang.bind(this, function() {
this._proxy.BluetoothAirplaneMode = !this._proxy.BluetoothAirplaneMode;
})); }));
this._item.menu.addMenuItem(this._toggleItem);
this._item.menu.addSettingsAction(_("Bluetooth Settings"), 'gnome-bluetooth-panel.desktop'); this._item.menu.addSettingsAction(_("Bluetooth Settings"), 'gnome-bluetooth-panel.desktop');
this.menu.addMenuItem(this._item); this.menu.addMenuItem(this._item);
@@ -73,75 +68,42 @@ const Indicator = new Lang.Class({
while (ret) { while (ret) {
let isDefault = this._model.get_value(iter, let isDefault = this._model.get_value(iter,
GnomeBluetooth.Column.DEFAULT); GnomeBluetooth.Column.DEFAULT);
let isPowered = this._model.get_value(iter, if (isDefault)
GnomeBluetooth.Column.POWERED);
if (isDefault && isPowered)
return iter; return iter;
ret = this._model.iter_next(iter); ret = this._model.iter_next(iter);
} }
return null; return null;
}, },
// nDevices is the number of devices setup for the current default _getNConnectedDevices: function() {
// adapter if one exists and is powered. If unpowered or unavailable,
// nDevice is "1" if it had setup devices associated to it the last
// time it was seen, and "-1" if not.
//
// nConnectedDevices is the number of devices connected to the default
// adapter if one exists and is powered, or -1 if it's not available.
_getNDevices: function() {
let adapter = this._getDefaultAdapter(); let adapter = this._getDefaultAdapter();
if (!adapter) if (!adapter)
return [ this._hadSetupDevices ? 1 : -1, -1 ]; return 0;
let nConnectedDevices = 0;
let nDevices = 0; let nDevices = 0;
let [ret, iter] = this._model.iter_children(adapter); let [ret, iter] = this._model.iter_children(adapter);
while (ret) { while (ret) {
let isConnected = this._model.get_value(iter, let isConnected = this._model.get_value(iter,
GnomeBluetooth.Column.CONNECTED); GnomeBluetooth.Column.CONNECTED);
if (isConnected) if (isConnected)
nConnectedDevices++;
let isPaired = this._model.get_value(iter,
GnomeBluetooth.Column.PAIRED);
let isTrusted = this._model.get_value(iter,
GnomeBluetooth.Column.TRUSTED);
if (isPaired || isTrusted)
nDevices++; nDevices++;
ret = this._model.iter_next(iter); ret = this._model.iter_next(iter);
} }
return nDevices;
if (this._hadSetupDevices != (nDevices > 0)) {
this._hadSetupDevices = !this._hadSetupDevices;
global.settings.set_boolean(HAD_BLUETOOTH_DEVICES_SETUP, this._hadSetupDevices);
}
return [ nDevices, nConnectedDevices];
}, },
_sync: function() { _sync: function() {
let [ nDevices, nConnectedDevices ] = this._getNDevices(); let nDevices = this._getNConnectedDevices();
let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter; let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
this.menu.setSensitive(sensitive); this.menu.setSensitive(sensitive);
this._indicator.visible = nConnectedDevices > 0; this._indicator.visible = nDevices > 0;
// Remember if there were setup devices and show the menu
// if we've seen setup devices and we're not hard blocked
if (nDevices > 0)
this._item.actor.visible = !this._proxy.BluetoothHardwareAirplaneMode;
else
this._item.actor.visible = this._proxy.BluetoothHasAirplaneMode && !this._proxy.BluetoothAirplaneMode; this._item.actor.visible = this._proxy.BluetoothHasAirplaneMode && !this._proxy.BluetoothAirplaneMode;
if (nConnectedDevices > 0) if (nDevices > 0)
/* Translators: this is the number of connected bluetooth devices */ /* Translators: this is the number of connected bluetooth devices */
this._item.label.text = ngettext("%d Connected", "%d Connected", nConnectedDevices).format(nConnectedDevices); this._item.label.text = ngettext("%d Connected", "%d Connected", nDevices).format(nDevices);
else if (nConnectedDevices == -1)
this._item.label.text = _("Off");
else else
this._item.label.text = _("Not In Use"); this._item.label.text = _("Not In Use");
this._toggleItem.label.text = this._proxy.BluetoothAirplaneMode ? _("Turn On") : _("Turn Off");
}, },
}); });

View File

@@ -28,6 +28,7 @@ gl
gu gu
he he
hi hi
hr
hu hu
ia ia
id id

View File

@@ -12,8 +12,8 @@ msgstr ""
"Project-Id-Version: gnome-shell\n" "Project-Id-Version: gnome-shell\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-"
"shell&keywords=I18N+L10N&component=general\n" "shell&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2015-10-27 22:11+0000\n" "POT-Creation-Date: 2015-10-05 08:41+0000\n"
"PO-Revision-Date: 2015-10-28 10:56+0100\n" "PO-Revision-Date: 2015-10-04 11:42-0400\n"
"Last-Translator: Marek Černocký <marek@manet.cz>\n" "Last-Translator: Marek Černocký <marek@manet.cz>\n"
"Language-Team: Czech <gnome-cs-list@gnome.org>\n" "Language-Team: Czech <gnome-cs-list@gnome.org>\n"
"Language: cs\n" "Language: cs\n"
@@ -21,7 +21,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
"X-Generator: Gtranslator 2.91.7\n" "X-Generator: Virtaal 0.7.1\n"
"X-Project-Style: gnome\n" "X-Project-Style: gnome\n"
#: ../data/50-gnome-shell-system.xml.in.h:1 #: ../data/50-gnome-shell-system.xml.in.h:1
@@ -357,7 +357,7 @@ msgstr "(např. uživatel nebo %s)"
msgid "Username: " msgid "Username: "
msgstr "Uživatelské jméno: " msgstr "Uživatelské jméno: "
#: ../js/gdm/loginDialog.js:1180 #: ../js/gdm/loginDialog.js:1184
msgid "Login Window" msgid "Login Window"
msgstr "Přihlašovací okno" msgstr "Přihlašovací okno"
@@ -575,12 +575,6 @@ msgstr "Předchozí měsíc"
msgid "Next month" msgid "Next month"
msgstr "Následující měsíc" msgstr "Následující měsíc"
#: ../js/ui/calendar.js:728
#, javascript-format
msgctxt "date day number format"
msgid "%d"
msgstr "%e"
#: ../js/ui/calendar.js:783 #: ../js/ui/calendar.js:783
msgid "Week %V" msgid "Week %V"
msgstr "Týden %V" msgstr "Týden %V"
@@ -631,7 +625,7 @@ msgstr "Externí svazek připojen"
msgid "External drive disconnected" msgid "External drive disconnected"
msgstr "Externí svazek odpojen" msgstr "Externí svazek odpojen"
#: ../js/ui/components/autorunManager.js:351 #: ../js/ui/components/autorunManager.js:354
#, javascript-format #, javascript-format
msgid "Open with %s" msgid "Open with %s"
msgstr "Otevřít s %s" msgstr "Otevřít s %s"
@@ -1029,22 +1023,22 @@ msgstr "Přehled"
msgid "Type to search…" msgid "Type to search…"
msgstr "Vyhledávejte psaním…" msgstr "Vyhledávejte psaním…"
#: ../js/ui/panel.js:358 #: ../js/ui/panel.js:352
msgid "Quit" msgid "Quit"
msgstr "Ukončit" msgstr "Ukončit"
#. Translators: If there is no suitable word for "Activities" #. Translators: If there is no suitable word for "Activities"
#. in your language, you can use the word for "Overview". #. in your language, you can use the word for "Overview".
#: ../js/ui/panel.js:414 #: ../js/ui/panel.js:404
msgid "Activities" msgid "Activities"
msgstr "Činnosti" msgstr "Činnosti"
#: ../js/ui/panel.js:695 #: ../js/ui/panel.js:650
msgctxt "System menu in the top bar" msgctxt "System menu in the top bar"
msgid "System" msgid "System"
msgstr "Systém" msgstr "Systém"
#: ../js/ui/panel.js:807 #: ../js/ui/panel.js:754
msgid "Top Bar" msgid "Top Bar"
msgstr "Horní lišta" msgstr "Horní lišta"
@@ -1057,15 +1051,15 @@ msgstr "Horní lišta"
msgid "toggle-switch-us" msgid "toggle-switch-us"
msgstr "toggle-switch-intl" msgstr "toggle-switch-intl"
#: ../js/ui/runDialog.js:71 #: ../js/ui/runDialog.js:70
msgid "Enter a Command" msgid "Enter a Command"
msgstr "Zadejte příkaz:" msgstr "Zadejte příkaz:"
#: ../js/ui/runDialog.js:111 ../js/ui/windowMenu.js:162 #: ../js/ui/runDialog.js:110 ../js/ui/windowMenu.js:162
msgid "Close" msgid "Close"
msgstr "Zavřít" msgstr "Zavřít"
#: ../js/ui/runDialog.js:282 #: ../js/ui/runDialog.js:281
msgid "Restarting…" msgid "Restarting…"
msgstr "Restartuje se…" msgstr "Restartuje se…"
@@ -1228,7 +1222,7 @@ msgstr "Zjišťování polohy je povoleno"
#: ../js/ui/status/location.js:72 ../js/ui/status/location.js:178 #: ../js/ui/status/location.js:72 ../js/ui/status/location.js:178
msgid "Disable" msgid "Disable"
msgstr "Zakázáno" msgstr "Zakázat"
#: ../js/ui/status/location.js:73 #: ../js/ui/status/location.js:73
msgid "Privacy Settings" msgid "Privacy Settings"
@@ -1244,7 +1238,7 @@ msgstr "Zjišťování polohy je zakázáno"
#: ../js/ui/status/location.js:181 #: ../js/ui/status/location.js:181
msgid "Enable" msgid "Enable"
msgstr "Povoleno" msgstr "Povolit"
#: ../js/ui/status/network.js:101 #: ../js/ui/status/network.js:101
msgid "<unknown>" msgid "<unknown>"
@@ -1662,24 +1656,24 @@ msgstr "Použít pro přihlašovací obrazovku zadaný režim, např. „gdm“.
msgid "List possible modes" msgid "List possible modes"
msgstr "Vypsat možné režimy" msgstr "Vypsat možné režimy"
#: ../src/shell-app.c:246 #: ../src/shell-app.c:239
msgctxt "program" msgctxt "program"
msgid "Unknown" msgid "Unknown"
msgstr "Neznámé" msgstr "Neznámé"
#: ../src/shell-app.c:487 #: ../src/shell-app.c:480
#, c-format #, c-format
msgid "Failed to launch “%s”" msgid "Failed to launch “%s”"
msgstr "Nelze spustit „%s“" msgstr "Nelze spustit „%s“"
#: ../src/shell-keyring-prompt.c:730 #: ../src/shell-keyring-prompt.c:742
msgid "Passwords do not match." msgid "Passwords do not match."
msgstr "Hesla si neodpovídají." msgstr "Hesla si neodpovídají."
#: ../src/shell-keyring-prompt.c:738 #: ../src/shell-keyring-prompt.c:750
msgid "Password cannot be blank" msgid "Password cannot be blank"
msgstr "Heslo nemůže být prázdné." msgstr "Heslo nemůže být prázdné."
#: ../src/shell-polkit-authentication-agent.c:353 #: ../src/shell-polkit-authentication-agent.c:346
msgid "Authentication dialog was dismissed by the user" msgid "Authentication dialog was dismissed by the user"
msgstr "Dialogové okno ověření bylo uživatelem zrušeno" msgstr "Dialogové okno ověření bylo uživatelem zrušeno"

1591
po/eo.po

File diff suppressed because it is too large Load Diff

1775
po/hr.po Normal file

File diff suppressed because it is too large Load Diff

210
po/id.po
View File

@@ -7,11 +7,11 @@
# Wibiharto <wibinem@yahoo.com>, 2011. # Wibiharto <wibinem@yahoo.com>, 2011.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gnome-shell master\n" "Project-Id-Version: gnome-shell gnome-3-18\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-"
"shell&keywords=I18N+L10N&component=general\n" "shell&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2015-09-19 08:21+0000\n" "POT-Creation-Date: 2016-01-02 10:15+0000\n"
"PO-Revision-Date: 2015-09-19 19:34+0700\n" "PO-Revision-Date: 2016-01-02 19:12+0700\n"
"Last-Translator: Andika Triwidada <andika@gmail.com>\n" "Last-Translator: Andika Triwidada <andika@gmail.com>\n"
"Language-Team: Indonesian <gnome-l10n-id@googlegroups.com>\n" "Language-Team: Indonesian <gnome-l10n-id@googlegroups.com>\n"
"Language: id\n" "Language: id\n"
@@ -20,7 +20,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
"X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SourceCharset: UTF-8\n"
"X-Generator: Poedit 1.6.10\n" "X-Generator: Poedit 1.8.4\n"
#: ../data/50-gnome-shell-system.xml.in.h:1 #: ../data/50-gnome-shell-system.xml.in.h:1
msgid "System" msgid "System"
@@ -336,25 +336,33 @@ msgctxt "button"
msgid "Sign In" msgid "Sign In"
msgstr "Masuk" msgstr "Masuk"
#: ../js/gdm/loginDialog.js:281 #: ../js/gdm/loginDialog.js:285
msgid "Choose Session" msgid "Choose Session"
msgstr "Pilih Sesi" msgstr "Pilih Sesi"
#: ../js/gdm/loginDialog.js:431 #. translators: this message is shown below the user list on the
#. login screen. It can be activated to reveal an entry for
#. manually entering the username.
#: ../js/gdm/loginDialog.js:435
msgid "Not listed?" msgid "Not listed?"
msgstr "Tak masuk daftar?" msgstr "Tak masuk daftar?"
#: ../js/gdm/loginDialog.js:850 #. Translators: this message is shown below the username entry field
#. to clue the user in on how to login to the local network realm
#: ../js/gdm/loginDialog.js:854
#, javascript-format #, javascript-format
msgid "(e.g., user or %s)" msgid "(e.g., user or %s)"
msgstr "(cth., pengguna dari %s)" msgstr "(cth., pengguna dari %s)"
#: ../js/gdm/loginDialog.js:855 ../js/ui/components/networkAgent.js:271 #. TTLS and PEAP are actually much more complicated, but this complication
#. is not visible here since we only care about phase2 authentication
#. (and don't even care of which one)
#: ../js/gdm/loginDialog.js:859 ../js/ui/components/networkAgent.js:271
#: ../js/ui/components/networkAgent.js:289 #: ../js/ui/components/networkAgent.js:289
msgid "Username: " msgid "Username: "
msgstr "Nama pengguna: " msgstr "Nama pengguna: "
#: ../js/gdm/loginDialog.js:1184 #: ../js/gdm/loginDialog.js:1196
msgid "Login Window" msgid "Login Window"
msgstr "Jendela Log Masuk" msgstr "Jendela Log Masuk"
@@ -362,6 +370,11 @@ msgstr "Jendela Log Masuk"
msgid "Authentication error" msgid "Authentication error"
msgstr "Galat otentikasi" msgstr "Galat otentikasi"
#. We don't show fingerprint messages directly since it's
#. not the main auth service. Instead we use the messages
#. as a cue to display our own message.
#. Translators: this message is shown below the password entry field
#. to indicate the user can swipe their finger instead
#: ../js/gdm/util.js:473 #: ../js/gdm/util.js:473
msgid "(or swipe finger)" msgid "(or swipe finger)"
msgstr "(atau gesekkan jari)" msgstr "(atau gesekkan jari)"
@@ -370,6 +383,8 @@ msgstr "(atau gesekkan jari)"
msgid "Command not found" msgid "Command not found"
msgstr "Perintah tidak ditemukan" msgstr "Perintah tidak ditemukan"
#. Replace "Error invoking GLib.shell_parse_argv: " with
#. something nicer
#: ../js/misc/util.js:152 #: ../js/misc/util.js:152
msgid "Could not parse command:" msgid "Could not parse command:"
msgstr "Tak dapat mengurai perintah:" msgstr "Tak dapat mengurai perintah:"
@@ -379,70 +394,78 @@ msgstr "Tak dapat mengurai perintah:"
msgid "Execution of “%s” failed:" msgid "Execution of “%s” failed:"
msgstr "Eksekusi \"%s\" gagal:" msgstr "Eksekusi \"%s\" gagal:"
#. Translators: Time in 24h format */ #. Translators: Time in 24h format
#: ../js/misc/util.js:191 #: ../js/misc/util.js:191
msgid "%H%M" msgid "%H%M"
msgstr "%H%M" msgstr "%H%M"
#. Translators: this is the word "Yesterday" followed by a #. Translators: this is the word "Yesterday" followed by a
#. time string in 24h format. i.e. "Yesterday, 14:30" */ #. time string in 24h format. i.e. "Yesterday, 14:30"
#: ../js/misc/util.js:197 #: ../js/misc/util.js:197
#, no-c-format
msgid "Yesterday, %H%M" msgid "Yesterday, %H%M"
msgstr "Kemarin, %H:%M" msgstr "Kemarin, %H:%M"
#. Translators: this is the week day name followed by a time #. Translators: this is the week day name followed by a time
#. string in 24h format. i.e. "Monday, 14:30" */ #. string in 24h format. i.e. "Monday, 14:30"
#: ../js/misc/util.js:203 #: ../js/misc/util.js:203
#, no-c-format
msgid "%A, %H%M" msgid "%A, %H%M"
msgstr "%A, %H%M" msgstr "%A, %H%M"
#. Translators: this is the month name and day number #. Translators: this is the month name and day number
#. followed by a time string in 24h format. #. followed by a time string in 24h format.
#. i.e. "May 25, 14:30" */ #. i.e. "May 25, 14:30"
#: ../js/misc/util.js:209 #: ../js/misc/util.js:209
#, no-c-format
msgid "%B %d, %H%M" msgid "%B %d, %H%M"
msgstr "%d %B, %H%M" msgstr "%d %B, %H%M"
#. Translators: this is the month name, day number, year #. Translators: this is the month name, day number, year
#. number followed by a time string in 24h format. #. number followed by a time string in 24h format.
#. i.e. "May 25 2012, 14:30" */ #. i.e. "May 25 2012, 14:30"
#: ../js/misc/util.js:215 #: ../js/misc/util.js:215
#, no-c-format
msgid "%B %d %Y, %H%M" msgid "%B %d %Y, %H%M"
msgstr "%d %B %Y, %H%M" msgstr "%d %B %Y, %H%M"
#. Translators: Time in 12h format */ #. Translators: Time in 12h format
#: ../js/misc/util.js:220 #: ../js/misc/util.js:220
msgid "%l%M %p" msgid "%l%M %p"
msgstr "%H%M" msgstr "%H%M"
#. Translators: this is the word "Yesterday" followed by a #. Translators: this is the word "Yesterday" followed by a
#. time string in 12h format. i.e. "Yesterday, 2:30 pm" */ #. time string in 12h format. i.e. "Yesterday, 2:30 pm"
#: ../js/misc/util.js:226 #: ../js/misc/util.js:226
#, no-c-format
msgid "Yesterday, %l%M %p" msgid "Yesterday, %l%M %p"
msgstr "Kemarin, %l%M %p" msgstr "Kemarin, %l%M %p"
#. Translators: this is the week day name followed by a time #. Translators: this is the week day name followed by a time
#. string in 12h format. i.e. "Monday, 2:30 pm" */ #. string in 12h format. i.e. "Monday, 2:30 pm"
#: ../js/misc/util.js:232 #: ../js/misc/util.js:232
#, no-c-format
msgid "%A, %l%M %p" msgid "%A, %l%M %p"
msgstr "%A, %l%M %p" msgstr "%A, %l%M %p"
#. Translators: this is the month name and day number #. Translators: this is the month name and day number
#. followed by a time string in 12h format. #. followed by a time string in 12h format.
#. i.e. "May 25, 2:30 pm" */ #. i.e. "May 25, 2:30 pm"
#: ../js/misc/util.js:238 #: ../js/misc/util.js:238
#, no-c-format
msgid "%B %d, %l%M %p" msgid "%B %d, %l%M %p"
msgstr "%d %B, %l%M %p" msgstr "%d %B, %l%M %p"
#. Translators: this is the month name, day number, year #. Translators: this is the month name, day number, year
#. number followed by a time string in 12h format. #. number followed by a time string in 12h format.
#. i.e. "May 25 2012, 2:30 pm"*/ #. i.e. "May 25 2012, 2:30 pm"
#: ../js/misc/util.js:244 #: ../js/misc/util.js:244
#, no-c-format
msgid "%B %d %Y, %l%M %p" msgid "%B %d %Y, %l%M %p"
msgstr "%d %B %Y, %l%M %p" msgstr "%d %B %Y, %l%M %p"
#. TRANSLATORS: this is the title of the wifi captive portal login #. TRANSLATORS: this is the title of the wifi captive portal login
#. * window, until we know the title of the actual login page */ #. * window, until we know the title of the actual login page
#: ../js/portalHelper/main.js:85 #: ../js/portalHelper/main.js:85
msgid "Web Authentication Redirect" msgid "Web Authentication Redirect"
msgstr "Pengalihan Otentikasi Web" msgstr "Pengalihan Otentikasi Web"
@@ -493,12 +516,11 @@ msgstr "Ubah Latar…"
msgid "Display Settings" msgid "Display Settings"
msgstr "Pengaturan Tampilan" msgstr "Pengaturan Tampilan"
#: ../js/ui/backgroundMenu.js:22 ../js/ui/panel.js:650 #: ../js/ui/backgroundMenu.js:22 ../js/ui/status/system.js:366
#: ../js/ui/status/system.js:366
msgid "Settings" msgid "Settings"
msgstr "Pengaturan" msgstr "Pengaturan"
#. Translators: Enter 0-6 (Sunday-Saturday) for non-work days. Examples: "0" (Sunday) "6" (Saturday) "06" (Sunday and Saturday). */ #. Translators: Enter 0-6 (Sunday-Saturday) for non-work days. Examples: "0" (Sunday) "6" (Saturday) "06" (Sunday and Saturday).
#: ../js/ui/calendar.js:55 #: ../js/ui/calendar.js:55
msgctxt "calendar-no-work" msgctxt "calendar-no-work"
msgid "06" msgid "06"
@@ -508,43 +530,43 @@ msgstr "06"
#. * #. *
#. * NOTE: These grid abbreviations are always shown together #. * NOTE: These grid abbreviations are always shown together
#. * and in order, e.g. "S M T W T F S". #. * and in order, e.g. "S M T W T F S".
#. */ #.
#: ../js/ui/calendar.js:84 #: ../js/ui/calendar.js:84
msgctxt "grid sunday" msgctxt "grid sunday"
msgid "S" msgid "S"
msgstr "M" msgstr "M"
#. Translators: Calendar grid abbreviation for Monday */ #. Translators: Calendar grid abbreviation for Monday
#: ../js/ui/calendar.js:86 #: ../js/ui/calendar.js:86
msgctxt "grid monday" msgctxt "grid monday"
msgid "M" msgid "M"
msgstr "S" msgstr "S"
#. Translators: Calendar grid abbreviation for Tuesday */ #. Translators: Calendar grid abbreviation for Tuesday
#: ../js/ui/calendar.js:88 #: ../js/ui/calendar.js:88
msgctxt "grid tuesday" msgctxt "grid tuesday"
msgid "T" msgid "T"
msgstr "S" msgstr "S"
#. Translators: Calendar grid abbreviation for Wednesday */ #. Translators: Calendar grid abbreviation for Wednesday
#: ../js/ui/calendar.js:90 #: ../js/ui/calendar.js:90
msgctxt "grid wednesday" msgctxt "grid wednesday"
msgid "W" msgid "W"
msgstr "R" msgstr "R"
#. Translators: Calendar grid abbreviation for Thursday */ #. Translators: Calendar grid abbreviation for Thursday
#: ../js/ui/calendar.js:92 #: ../js/ui/calendar.js:92
msgctxt "grid thursday" msgctxt "grid thursday"
msgid "T" msgid "T"
msgstr "K" msgstr "K"
#. Translators: Calendar grid abbreviation for Friday */ #. Translators: Calendar grid abbreviation for Friday
#: ../js/ui/calendar.js:94 #: ../js/ui/calendar.js:94
msgctxt "grid friday" msgctxt "grid friday"
msgid "F" msgid "F"
msgstr "J" msgstr "J"
#. Translators: Calendar grid abbreviation for Saturday */ #. Translators: Calendar grid abbreviation for Saturday
#: ../js/ui/calendar.js:96 #: ../js/ui/calendar.js:96
msgctxt "grid saturday" msgctxt "grid saturday"
msgid "S" msgid "S"
@@ -564,39 +586,39 @@ msgstr "Minggu %V"
#. Translators: Shown in calendar event list for all day events #. Translators: Shown in calendar event list for all day events
#. * Keep it short, best if you can use less then 10 characters #. * Keep it short, best if you can use less then 10 characters
#. */ #.
#: ../js/ui/calendar.js:1188 #: ../js/ui/calendar.js:1188
msgctxt "event list time" msgctxt "event list time"
msgid "All Day" msgid "All Day"
msgstr "Sepanjang Hari" msgstr "Sepanjang Hari"
#: ../js/ui/calendar.js:1291 #: ../js/ui/calendar.js:1295
msgid "Clear section" msgid "Clear section"
msgstr "Bersihkan seksi" msgstr "Bersihkan seksi"
#: ../js/ui/calendar.js:1518 #: ../js/ui/calendar.js:1522
msgid "Events" msgid "Events"
msgstr "Kejadian" msgstr "Kejadian"
#: ../js/ui/calendar.js:1527 #: ../js/ui/calendar.js:1531
msgctxt "calendar heading" msgctxt "calendar heading"
msgid "%A, %B %d" msgid "%A, %B %d"
msgstr "%A, %d %B" msgstr "%A, %d %B"
#: ../js/ui/calendar.js:1531 #: ../js/ui/calendar.js:1535
msgctxt "calendar heading" msgctxt "calendar heading"
msgid "%A, %B %d, %Y" msgid "%A, %B %d, %Y"
msgstr "%A, %d %B %Y" msgstr "%A, %d %B %Y"
#: ../js/ui/calendar.js:1616 #: ../js/ui/calendar.js:1620
msgid "Notifications" msgid "Notifications"
msgstr "Pemberitahuan" msgstr "Pemberitahuan"
#: ../js/ui/calendar.js:1767 #: ../js/ui/calendar.js:1771
msgid "No Notifications" msgid "No Notifications"
msgstr "Tak Ada Pemberitahuan" msgstr "Tak Ada Pemberitahuan"
#: ../js/ui/calendar.js:1770 #: ../js/ui/calendar.js:1774
msgid "No Events" msgid "No Events"
msgstr "Tak Ada Kejadian" msgstr "Tak Ada Kejadian"
@@ -608,7 +630,7 @@ msgstr "Drive eksternal tersambung"
msgid "External drive disconnected" msgid "External drive disconnected"
msgstr "Drive eksternal terputus" msgstr "Drive eksternal terputus"
#: ../js/ui/components/autorunManager.js:354 #: ../js/ui/components/autorunManager.js:351
#, javascript-format #, javascript-format
msgid "Open with %s" msgid "Open with %s"
msgstr "Buka dengan %s" msgstr "Buka dengan %s"
@@ -626,6 +648,7 @@ msgstr "Ketik lagi:"
msgid "Connect" msgid "Connect"
msgstr "Sambung" msgstr "Sambung"
#. Cisco LEAP
#: ../js/ui/components/networkAgent.js:233 #: ../js/ui/components/networkAgent.js:233
#: ../js/ui/components/networkAgent.js:245 #: ../js/ui/components/networkAgent.js:245
#: ../js/ui/components/networkAgent.js:273 #: ../js/ui/components/networkAgent.js:273
@@ -634,6 +657,7 @@ msgstr "Sambung"
msgid "Password: " msgid "Password: "
msgstr "Sandi: " msgstr "Sandi: "
#. static WEP
#: ../js/ui/components/networkAgent.js:238 #: ../js/ui/components/networkAgent.js:238
msgid "Key: " msgid "Key: "
msgstr "Tombol: " msgstr "Tombol: "
@@ -725,13 +749,13 @@ msgstr "Otentikasi"
#. Translators: "that didn't work" refers to the fact that the #. Translators: "that didn't work" refers to the fact that the
#. * requested authentication was not gained; this can happen #. * requested authentication was not gained; this can happen
#. * because of an authentication error (like invalid password), #. * because of an authentication error (like invalid password),
#. * for instance. */ #. * for instance.
#: ../js/ui/components/polkitAgent.js:301 ../js/ui/shellMountOperation.js:383 #: ../js/ui/components/polkitAgent.js:301 ../js/ui/shellMountOperation.js:383
msgid "Sorry, that didn't work. Please try again." msgid "Sorry, that didn't work. Please try again."
msgstr "Maaf, tidak berhasil. Silakan coba lagi." msgstr "Maaf, tidak berhasil. Silakan coba lagi."
#. Translators: this is the other person changing their old IM name to their new #. Translators: this is the other person changing their old IM name to their new
#. IM name. */ #. IM name.
#: ../js/ui/components/telepathyClient.js:759 #: ../js/ui/components/telepathyClient.js:759
#, javascript-format #, javascript-format
msgid "%s is now known as %s" msgid "%s is now known as %s"
@@ -745,13 +769,15 @@ msgstr "Jendela"
msgid "Show Applications" msgid "Show Applications"
msgstr "Tampilkan Aplikasi" msgstr "Tampilkan Aplikasi"
#. Translators: this is the name of the dock/favorites area on
#. the left of the overview
#: ../js/ui/dash.js:449 #: ../js/ui/dash.js:449
msgid "Dash" msgid "Dash"
msgstr "Dash" msgstr "Dash"
#. Translators: This is the date format to use when the calendar popup is #. Translators: This is the date format to use when the calendar popup is
#. * shown - it is shown just below the time in the shell (e.g. "Tue 9:29 AM"). #. * shown - it is shown just below the time in the shell (e.g. "Tue 9:29 AM").
#. */ #.
#: ../js/ui/dateMenu.js:73 #: ../js/ui/dateMenu.js:73
msgid "%B %e %Y" msgid "%B %e %Y"
msgstr "%e %B %Y" msgstr "%e %B %Y"
@@ -759,7 +785,7 @@ msgstr "%e %B %Y"
#. Translators: This is the accessible name of the date button shown #. Translators: This is the accessible name of the date button shown
#. * below the time in the shell; it should combine the weekday and the #. * below the time in the shell; it should combine the weekday and the
#. * date, e.g. "Tuesday February 17 2015". #. * date, e.g. "Tuesday February 17 2015".
#. */ #.
#: ../js/ui/dateMenu.js:80 #: ../js/ui/dateMenu.js:80
msgid "%A %B %e %Y" msgid "%A %B %e %Y"
msgstr "%A %e %B %Y" msgstr "%A %e %B %Y"
@@ -884,13 +910,13 @@ msgstr "Beberapa aplikasi sedang sibuk atau belum disimpan perubahannya."
msgid "Other users are logged in." msgid "Other users are logged in."
msgstr "Pengguna lain sedang log masuk." msgstr "Pengguna lain sedang log masuk."
#. Translators: Remote here refers to a remote session, like a ssh login */ #. Translators: Remote here refers to a remote session, like a ssh login
#: ../js/ui/endSessionDialog.js:640 #: ../js/ui/endSessionDialog.js:640
#, javascript-format #, javascript-format
msgid "%s (remote)" msgid "%s (remote)"
msgstr "%s (jarak jauh)" msgstr "%s (jarak jauh)"
#. Translators: Console here refers to a tty like a VT console */ #. Translators: Console here refers to a tty like a VT console
#: ../js/ui/endSessionDialog.js:643 #: ../js/ui/endSessionDialog.js:643
#, javascript-format #, javascript-format
msgid "%s (console)" msgid "%s (console)"
@@ -909,7 +935,7 @@ msgstr "Unduh dan pasang \"%s\" dari extensions.gnome.org?"
msgid "Keyboard" msgid "Keyboard"
msgstr "Papan Ketik" msgstr "Papan Ketik"
#. translators: 'Hide' is a verb */ #. translators: 'Hide' is a verb
#: ../js/ui/legacyTray.js:66 #: ../js/ui/legacyTray.js:66
msgid "Hide tray" msgid "Hide tray"
msgstr "Sembunyikan baki" msgstr "Sembunyikan baki"
@@ -922,7 +948,7 @@ msgstr "Ikon Status"
msgid "No extensions installed" msgid "No extensions installed"
msgstr "Tak ada ekstensi terpasang" msgstr "Tak ada ekstensi terpasang"
#. Translators: argument is an extension UUID. */ #. Translators: argument is an extension UUID.
#: ../js/ui/lookingGlass.js:697 #: ../js/ui/lookingGlass.js:697
#, javascript-format #, javascript-format
msgid "%s has not emitted any errors." msgid "%s has not emitted any errors."
@@ -942,7 +968,7 @@ msgstr "Diaktifkan"
#. translators: #. translators:
#. * The device has been disabled #. * The device has been disabled
#: ../js/ui/lookingGlass.js:719 ../src/gvc/gvc-mixer-control.c:1830 #: ../js/ui/lookingGlass.js:719 ../src/gvc/gvc-mixer-control.c:1828
msgid "Disabled" msgid "Disabled"
msgstr "Dinonaktifkan" msgstr "Dinonaktifkan"
@@ -981,26 +1007,36 @@ msgstr "Gambaran"
#. Translators: this is the text displayed #. Translators: this is the text displayed
#. in the search entry when no search is #. in the search entry when no search is
#. active; it should not exceed ~30 #. active; it should not exceed ~30
#. characters. */ #. characters.
#: ../js/ui/overview.js:244 #: ../js/ui/overview.js:244
msgid "Type to search…" msgid "Type to search…"
msgstr "Ketik untuk mencari…" msgstr "Ketik untuk mencari…"
#: ../js/ui/panel.js:352 #: ../js/ui/panel.js:358
msgid "Quit" msgid "Quit"
msgstr "Keluar" msgstr "Keluar"
#. Translators: If there is no suitable word for "Activities" #. Translators: If there is no suitable word for "Activities"
#. in your language, you can use the word for "Overview". */ #. in your language, you can use the word for "Overview".
#: ../js/ui/panel.js:404 #: ../js/ui/panel.js:414
msgid "Activities" msgid "Activities"
msgstr "Aktivitas" msgstr "Aktivitas"
#: ../js/ui/panel.js:754 #: ../js/ui/panel.js:695
msgctxt "System menu in the top bar"
msgid "System"
msgstr "Sistem"
#: ../js/ui/panel.js:807
msgid "Top Bar" msgid "Top Bar"
msgstr "Bar Atas" msgstr "Bar Atas"
# Dirgita: Hayo, enaknya pake I/O atau ON/OFF?^^ # Dirgita: Hayo, enaknya pake I/O atau ON/OFF?^^
#. Translators: this MUST be either "toggle-switch-us"
#. (for toggle switches containing the English words
#. "ON" and "OFF") or "toggle-switch-intl" (for toggle
#. switches containing "◯" and "|"). Other values will
#. simply result in invisible toggle switches.
#: ../js/ui/popupMenu.js:289 #: ../js/ui/popupMenu.js:289
msgid "toggle-switch-us" msgid "toggle-switch-us"
msgstr "toggle-switch-intl" msgstr "toggle-switch-intl"
@@ -1018,7 +1054,7 @@ msgid "Restarting…"
msgstr "Memulai ulang..." msgstr "Memulai ulang..."
#. Translators: This is a time format for a date in #. Translators: This is a time format for a date in
#. long format */ #. long format
#: ../js/ui/screenShield.js:85 #: ../js/ui/screenShield.js:85
msgid "%A, %B %d" msgid "%A, %B %d"
msgstr "%A, %d %B" msgstr "%A, %d %B"
@@ -1043,6 +1079,13 @@ msgstr "Kunci"
msgid "GNOME needs to lock the screen" msgid "GNOME needs to lock the screen"
msgstr "GNOME perlu mengunci layar" msgstr "GNOME perlu mengunci layar"
#. We could not become modal, so we can't activate the
#. screenshield. The user is probably very upset at this
#. point, but any application using global grabs is broken
#. Just tell him to stop using this app
#.
#. XXX: another option is to kick the user into the gdm login
#. screen, where we're not affected by grabs
#: ../js/ui/screenShield.js:805 ../js/ui/screenShield.js:1271 #: ../js/ui/screenShield.js:805 ../js/ui/screenShield.js:1271
msgid "Unable to lock" msgid "Unable to lock"
msgstr "Tak bisa mengunci" msgstr "Tak bisa mengunci"
@@ -1138,7 +1181,7 @@ msgstr "Matikan"
msgid "Bluetooth Settings" msgid "Bluetooth Settings"
msgstr "Pengaturan Bluetooth" msgstr "Pengaturan Bluetooth"
#. Translators: this is the number of connected bluetooth devices */ #. Translators: this is the number of connected bluetooth devices
#: ../js/ui/status/bluetooth.js:105 #: ../js/ui/status/bluetooth.js:105
#, javascript-format #, javascript-format
msgid "%d Connected" msgid "%d Connected"
@@ -1185,13 +1228,13 @@ msgstr "Fungsikan"
msgid "<unknown>" msgid "<unknown>"
msgstr "<tak dikenal>" msgstr "<tak dikenal>"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:451 ../js/ui/status/network.js:1308 #: ../js/ui/status/network.js:451 ../js/ui/status/network.js:1308
#, javascript-format #, javascript-format
msgid "%s Off" msgid "%s Off"
msgstr "%s Mati" msgstr "%s Mati"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:454 #: ../js/ui/status/network.js:454
#, javascript-format #, javascript-format
msgid "%s Connected" msgid "%s Connected"
@@ -1199,45 +1242,45 @@ msgstr "%s Tersambung"
#. Translators: this is for network devices that are physically present but are not #. Translators: this is for network devices that are physically present but are not
#. under NetworkManager's control (and thus cannot be used in the menu); #. under NetworkManager's control (and thus cannot be used in the menu);
#. %s is a network identifier */ #. %s is a network identifier
#: ../js/ui/status/network.js:459 #: ../js/ui/status/network.js:459
#, javascript-format #, javascript-format
msgid "%s Unmanaged" msgid "%s Unmanaged"
msgstr "%s Tak Dikelola" msgstr "%s Tak Dikelola"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:462 #: ../js/ui/status/network.js:462
#, javascript-format #, javascript-format
msgid "%s Disconnecting" msgid "%s Disconnecting"
msgstr "%s Memutus" msgstr "%s Memutus"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:469 ../js/ui/status/network.js:1300 #: ../js/ui/status/network.js:469 ../js/ui/status/network.js:1300
#, javascript-format #, javascript-format
msgid "%s Connecting" msgid "%s Connecting"
msgstr "%s Menyambung" msgstr "%s Menyambung"
#. Translators: this is for network connections that require some kind of key or password; %s is a network identifier */ #. Translators: this is for network connections that require some kind of key or password; %s is a network identifier
#: ../js/ui/status/network.js:472 #: ../js/ui/status/network.js:472
#, javascript-format #, javascript-format
msgid "%s Requires Authentication" msgid "%s Requires Authentication"
msgstr "%s Memerlukan Otentikasi" msgstr "%s Memerlukan Otentikasi"
#. Translators: this is for devices that require some kind of firmware or kernel #. Translators: this is for devices that require some kind of firmware or kernel
#. module, which is missing; %s is a network identifier */ #. module, which is missing; %s is a network identifier
#: ../js/ui/status/network.js:480 #: ../js/ui/status/network.js:480
#, javascript-format #, javascript-format
msgid "Firmware Missing For %s" msgid "Firmware Missing For %s"
msgstr "Firmware Hilang Untuk %s" msgstr "Firmware Hilang Untuk %s"
#. Translators: this is for a network device that cannot be activated (for example it #. Translators: this is for a network device that cannot be activated (for example it
#. is disabled by rfkill, or it has no coverage; %s is a network identifier */ #. is disabled by rfkill, or it has no coverage; %s is a network identifier
#: ../js/ui/status/network.js:484 #: ../js/ui/status/network.js:484
#, javascript-format #, javascript-format
msgid "%s Unavailable" msgid "%s Unavailable"
msgstr "%s Tak tersedia" msgstr "%s Tak tersedia"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:487 #: ../js/ui/status/network.js:487
#, javascript-format #, javascript-format
msgid "%s Connection Failed" msgid "%s Connection Failed"
@@ -1251,14 +1294,14 @@ msgstr "Pengaturan Kabel"
msgid "Mobile Broadband Settings" msgid "Mobile Broadband Settings"
msgstr "Pengaturan Data Seluler" msgstr "Pengaturan Data Seluler"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:588 ../js/ui/status/network.js:1305 #: ../js/ui/status/network.js:588 ../js/ui/status/network.js:1305
#, javascript-format #, javascript-format
msgid "%s Hardware Disabled" msgid "%s Hardware Disabled"
msgstr "%s Perangkat Keras Dinonaktifkan" msgstr "%s Perangkat Keras Dinonaktifkan"
#. Translators: this is for a network device that cannot be activated #. Translators: this is for a network device that cannot be activated
#. because it's disabled by rfkill (airplane mode); %s is a network identifier */ #. because it's disabled by rfkill (airplane mode); %s is a network identifier
#: ../js/ui/status/network.js:592 #: ../js/ui/status/network.js:592
#, javascript-format #, javascript-format
msgid "%s Disabled" msgid "%s Disabled"
@@ -1320,13 +1363,13 @@ msgstr "Pengaturan Wi-Fi"
msgid "Turn On" msgid "Turn On"
msgstr "Nyalakan" msgstr "Nyalakan"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:1296 #: ../js/ui/status/network.js:1296
#, javascript-format #, javascript-format
msgid "%s Hotspot Active" msgid "%s Hotspot Active"
msgstr "%s Hotspot Aktif" msgstr "%s Hotspot Aktif"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:1311 #: ../js/ui/status/network.js:1311
#, javascript-format #, javascript-format
msgid "%s Not Connected" msgid "%s Not Connected"
@@ -1336,7 +1379,7 @@ msgstr "%s Tak Tersambung"
msgid "connecting..." msgid "connecting..."
msgstr "menghubungi..." msgstr "menghubungi..."
#. Translators: this is for network connections that require some kind of key or password */ #. Translators: this is for network connections that require some kind of key or password
#: ../js/ui/status/network.js:1414 #: ../js/ui/status/network.js:1414
msgid "authentication required" msgid "authentication required"
msgstr "diperlukan otentikasi" msgstr "diperlukan otentikasi"
@@ -1377,20 +1420,27 @@ msgstr "Pengaturan Daya"
msgid "Fully Charged" msgid "Fully Charged"
msgstr "Terisi Penuh" msgstr "Terisi Penuh"
#. 0 is reported when UPower does not have enough data
#. to estimate battery life
#: ../js/ui/status/power.js:72 ../js/ui/status/power.js:78 #: ../js/ui/status/power.js:72 ../js/ui/status/power.js:78
msgid "Estimating…" msgid "Estimating…"
msgstr "Memperkirakan…" msgstr "Memperkirakan…"
#. Translators: this is <hours>:<minutes> Remaining (<percentage>)
#: ../js/ui/status/power.js:86 #: ../js/ui/status/power.js:86
#, javascript-format #, javascript-format
msgid "%d%02d Remaining (%d%%)" msgid "%d%02d Remaining (%d%%)"
msgstr "%d:%02d Tersisa (%d%%)" msgstr "%d:%02d Tersisa (%d%%)"
#. Translators: this is <hours>:<minutes> Until Full (<percentage>)
#: ../js/ui/status/power.js:91 #: ../js/ui/status/power.js:91
#, javascript-format #, javascript-format
msgid "%d%02d Until Full (%d%%)" msgid "%d%02d Until Full (%d%%)"
msgstr "%d:%02d Sampai Penuh (%d%%)" msgstr "%d:%02d Sampai Penuh (%d%%)"
#. The menu only appears when airplane mode is on, so just
#. statically build it as if it was on, rather than dynamically
#. changing the menu contents.
#: ../js/ui/status/rfkill.js:88 #: ../js/ui/status/rfkill.js:88
msgid "Airplane Mode On" msgid "Airplane Mode On"
msgstr "Mode Pesawat Terbang Aktif" msgstr "Mode Pesawat Terbang Aktif"
@@ -1458,7 +1508,7 @@ msgstr "Apakah Anda ingin mempertahankan pengaturan tampilan ini?"
#. Translators: this and the following message should be limited in lenght, #. Translators: this and the following message should be limited in lenght,
#. to avoid ellipsizing the labels. #. to avoid ellipsizing the labels.
#. */ #.
#: ../js/ui/windowManager.js:82 #: ../js/ui/windowManager.js:82
msgid "Revert Settings" msgid "Revert Settings"
msgstr "Balikkan Tatanan" msgstr "Balikkan Tatanan"
@@ -1474,7 +1524,7 @@ msgid_plural "Settings changes will revert in %d seconds"
msgstr[0] "Perubahan tatanan akan dikembalikan dalam %d detik" msgstr[0] "Perubahan tatanan akan dikembalikan dalam %d detik"
#. Translators: This represents the size of a window. The first number is #. Translators: This represents the size of a window. The first number is
#. * the width of the window and the second is the height. */ #. * the width of the window and the second is the height.
#: ../js/ui/windowManager.js:658 #: ../js/ui/windowManager.js:658
#, javascript-format #, javascript-format
msgid "%d x %d" msgid "%d x %d"
@@ -1550,7 +1600,7 @@ msgstr "Evolution Kalender"
#. translators: #. translators:
#. * The number of sound outputs on a particular device #. * The number of sound outputs on a particular device
#: ../src/gvc/gvc-mixer-control.c:1837 #: ../src/gvc/gvc-mixer-control.c:1835
#, c-format #, c-format
msgid "%u Output" msgid "%u Output"
msgid_plural "%u Outputs" msgid_plural "%u Outputs"
@@ -1558,38 +1608,38 @@ msgstr[0] "%u Keluaran"
#. translators: #. translators:
#. * The number of sound inputs on a particular device #. * The number of sound inputs on a particular device
#: ../src/gvc/gvc-mixer-control.c:1847 #: ../src/gvc/gvc-mixer-control.c:1845
#, c-format #, c-format
msgid "%u Input" msgid "%u Input"
msgid_plural "%u Inputs" msgid_plural "%u Inputs"
msgstr[0] "%u Masukan" msgstr[0] "%u Masukan"
#: ../src/gvc/gvc-mixer-control.c:2373 #: ../src/gvc/gvc-mixer-control.c:2371
msgid "System Sounds" msgid "System Sounds"
msgstr "Suara Sistem" msgstr "Suara Sistem"
#: ../src/main.c:373 #: ../src/main.c:381
msgid "Print version" msgid "Print version"
msgstr "Versi Cetak" msgstr "Versi Cetak"
#: ../src/main.c:379 #: ../src/main.c:387
msgid "Mode used by GDM for login screen" msgid "Mode used by GDM for login screen"
msgstr "Mode yang dipakai oleh layar log masuk GDM" msgstr "Mode yang dipakai oleh layar log masuk GDM"
#: ../src/main.c:385 #: ../src/main.c:393
msgid "Use a specific mode, e.g. \"gdm\" for login screen" msgid "Use a specific mode, e.g. \"gdm\" for login screen"
msgstr "Menggunakan mode tertentu, mis. \"gdm\" untuk layar masuk" msgstr "Menggunakan mode tertentu, mis. \"gdm\" untuk layar masuk"
#: ../src/main.c:391 #: ../src/main.c:399
msgid "List possible modes" msgid "List possible modes"
msgstr "Menampilkan mode yang mungkin" msgstr "Menampilkan mode yang mungkin"
#: ../src/shell-app.c:239 #: ../src/shell-app.c:246
msgctxt "program" msgctxt "program"
msgid "Unknown" msgid "Unknown"
msgstr "Tak dikenal" msgstr "Tak dikenal"
#: ../src/shell-app.c:480 #: ../src/shell-app.c:487
#, c-format #, c-format
msgid "Failed to launch “%s”" msgid "Failed to launch “%s”"
msgstr "Gagal meluncurkan \"%s\"" msgstr "Gagal meluncurkan \"%s\""

631
po/is.po

File diff suppressed because it is too large Load Diff

View File

@@ -7,10 +7,10 @@
# Torstein Adolf Winterseth <kvikende@fsfe.org>, 2010. # Torstein Adolf Winterseth <kvikende@fsfe.org>, 2010.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gnome-shell 3.18.x\n" "Project-Id-Version: gnome-shell 3.17.x\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-10-16 18:09+0200\n" "POT-Creation-Date: 2015-10-16 18:11+0200\n"
"PO-Revision-Date: 2015-10-16 18:09+0200\n" "PO-Revision-Date: 2015-10-16 18:11+0200\n"
"Last-Translator: Kjartan Maraas <kmaraas@gnome.org>\n" "Last-Translator: Kjartan Maraas <kmaraas@gnome.org>\n"
"Language-Team: Norwegian bokmål <i18n-nb@lister.ping.uio.no>\n" "Language-Team: Norwegian bokmål <i18n-nb@lister.ping.uio.no>\n"
"Language: Norwegian bokmål\n" "Language: Norwegian bokmål\n"
@@ -1648,14 +1648,14 @@ msgstr "Ukjent"
msgid "Failed to launch “%s”" msgid "Failed to launch “%s”"
msgstr "Klarte ikke å starte «%s»" msgstr "Klarte ikke å starte «%s»"
#: ../src/shell-keyring-prompt.c:730 #: ../src/shell-keyring-prompt.c:742
msgid "Passwords do not match." msgid "Passwords do not match."
msgstr "Passordene er ikke like." msgstr "Passordene er ikke like."
#: ../src/shell-keyring-prompt.c:738 #: ../src/shell-keyring-prompt.c:750
msgid "Password cannot be blank" msgid "Password cannot be blank"
msgstr "Passordet kan ikke være tomt" msgstr "Passordet kan ikke være tomt"
#: ../src/shell-polkit-authentication-agent.c:353 #: ../src/shell-polkit-authentication-agent.c:346
msgid "Authentication dialog was dismissed by the user" msgid "Authentication dialog was dismissed by the user"
msgstr "Autentiseringsdialogen ble lukket av brukeren" msgstr "Autentiseringsdialogen ble lukket av brukeren"

View File

@@ -4,16 +4,16 @@
# pomóc w jego rozwijaniu i pielęgnowaniu, napisz do nas: # pomóc w jego rozwijaniu i pielęgnowaniu, napisz do nas:
# gnomepl@aviary.pl # gnomepl@aviary.pl
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Piotr Drąg <piotrdrag@gmail.com>, 2009-2015. # Piotr Drąg <piotrdrag@gmail.com>, 2009-2016.
# Tomasz Dominikowski <dominikowski@gmail.com>, 2009. # Tomasz Dominikowski <dominikowski@gmail.com>, 2009.
# Wojciech Szczęsny <wszczesny@aviary.pl>, 2013. # Wojciech Szczęsny <wszczesny@aviary.pl>, 2013.
# Aviary.pl <gnomepl@aviary.pl>, 2009-2015. # Aviary.pl <gnomepl@aviary.pl>, 2009-2016.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gnome-shell\n" "Project-Id-Version: gnome-shell\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-09-29 00:50+0200\n" "POT-Creation-Date: 2016-07-12 21:23+0200\n"
"PO-Revision-Date: 2015-09-29 00:52+0200\n" "PO-Revision-Date: 2016-07-12 21:24+0200\n"
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n" "Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
"Language-Team: Polish <gnomepl@aviary.pl>\n" "Language-Team: Polish <gnomepl@aviary.pl>\n"
"Language: pl\n" "Language: pl\n"
@@ -330,35 +330,35 @@ msgstr "Rozszerzenia powłoki GNOME"
msgid "Cancel" msgid "Cancel"
msgstr "Anuluj" msgstr "Anuluj"
#: ../js/gdm/authPrompt.js:169 ../js/gdm/authPrompt.js:215 #: ../js/gdm/authPrompt.js:169 ../js/gdm/authPrompt.js:216
#: ../js/gdm/authPrompt.js:447 #: ../js/gdm/authPrompt.js:448
msgid "Next" msgid "Next"
msgstr "Dalej" msgstr "Dalej"
#: ../js/gdm/authPrompt.js:211 ../js/ui/shellMountOperation.js:403 #: ../js/gdm/authPrompt.js:212 ../js/ui/shellMountOperation.js:403
#: ../js/ui/unlockDialog.js:59 #: ../js/ui/unlockDialog.js:59
msgid "Unlock" msgid "Unlock"
msgstr "Odblokuj" msgstr "Odblokuj"
#: ../js/gdm/authPrompt.js:213 #: ../js/gdm/authPrompt.js:214
msgctxt "button" msgctxt "button"
msgid "Sign In" msgid "Sign In"
msgstr "Zaloguj" msgstr "Zaloguj"
#: ../js/gdm/loginDialog.js:281 #: ../js/gdm/loginDialog.js:285
msgid "Choose Session" msgid "Choose Session"
msgstr "Wybór sesji" msgstr "Wybór sesji"
#. translators: this message is shown below the user list on the #. translators: this message is shown below the user list on the
#. login screen. It can be activated to reveal an entry for #. login screen. It can be activated to reveal an entry for
#. manually entering the username. #. manually entering the username.
#: ../js/gdm/loginDialog.js:431 #: ../js/gdm/loginDialog.js:435
msgid "Not listed?" msgid "Not listed?"
msgstr "Inny użytkownik?" msgstr "Inny użytkownik?"
#. Translators: this message is shown below the username entry field #. Translators: this message is shown below the username entry field
#. to clue the user in on how to login to the local network realm #. to clue the user in on how to login to the local network realm
#: ../js/gdm/loginDialog.js:850 #: ../js/gdm/loginDialog.js:854
#, javascript-format #, javascript-format
msgid "(e.g., user or %s)" msgid "(e.g., user or %s)"
msgstr "(np. użytkownik lub %s)" msgstr "(np. użytkownik lub %s)"
@@ -366,12 +366,12 @@ msgstr "(np. użytkownik lub %s)"
#. TTLS and PEAP are actually much more complicated, but this complication #. TTLS and PEAP are actually much more complicated, but this complication
#. is not visible here since we only care about phase2 authentication #. is not visible here since we only care about phase2 authentication
#. (and don't even care of which one) #. (and don't even care of which one)
#: ../js/gdm/loginDialog.js:855 ../js/ui/components/networkAgent.js:271 #: ../js/gdm/loginDialog.js:859 ../js/ui/components/networkAgent.js:271
#: ../js/ui/components/networkAgent.js:289 #: ../js/ui/components/networkAgent.js:289
msgid "Username: " msgid "Username: "
msgstr "Nazwa użytkownika: " msgstr "Nazwa użytkownika: "
#: ../js/gdm/loginDialog.js:1184 #: ../js/gdm/loginDialog.js:1196
msgid "Login Window" msgid "Login Window"
msgstr "Okno logowania" msgstr "Okno logowania"
@@ -639,7 +639,7 @@ msgstr "Podłączono dysk zewnętrzny"
msgid "External drive disconnected" msgid "External drive disconnected"
msgstr "Odłączono dysk zewnętrzny" msgstr "Odłączono dysk zewnętrzny"
#: ../js/ui/components/autorunManager.js:354 #: ../js/ui/components/autorunManager.js:351
#, javascript-format #, javascript-format
msgid "Open with %s" msgid "Open with %s"
msgstr "Otwórz za pomocą „%s”" msgstr "Otwórz za pomocą „%s”"
@@ -765,7 +765,7 @@ msgstr "To nie zadziałało. Proszę spróbować ponownie."
#. Translators: this is the other person changing their old IM name to their new #. Translators: this is the other person changing their old IM name to their new
#. IM name. #. IM name.
#: ../js/ui/components/telepathyClient.js:759 #: ../js/ui/components/telepathyClient.js:760
#, javascript-format #, javascript-format
msgid "%s is now known as %s" msgid "%s is now known as %s"
msgstr "Użytkownik %s jest teraz znany jako %s" msgstr "Użytkownik %s jest teraz znany jako %s"
@@ -990,7 +990,7 @@ msgstr "Włączone"
#. translators: #. translators:
#. * The device has been disabled #. * The device has been disabled
#: ../js/ui/lookingGlass.js:719 ../src/gvc/gvc-mixer-control.c:1828 #: ../js/ui/lookingGlass.js:719 ../src/gvc/gvc-mixer-control.c:1866
msgid "Disabled" msgid "Disabled"
msgstr "Wyłączone" msgstr "Wyłączone"
@@ -1034,22 +1034,22 @@ msgstr "Podgląd"
msgid "Type to search…" msgid "Type to search…"
msgstr "Wyszukiwanie…" msgstr "Wyszukiwanie…"
#: ../js/ui/panel.js:352 #: ../js/ui/panel.js:358
msgid "Quit" msgid "Quit"
msgstr "Zakończ" msgstr "Zakończ"
#. Translators: If there is no suitable word for "Activities" #. Translators: If there is no suitable word for "Activities"
#. in your language, you can use the word for "Overview". #. in your language, you can use the word for "Overview".
#: ../js/ui/panel.js:404 #: ../js/ui/panel.js:414
msgid "Activities" msgid "Activities"
msgstr "Podgląd" msgstr "Podgląd"
#: ../js/ui/panel.js:650 #: ../js/ui/panel.js:695
msgctxt "System menu in the top bar" msgctxt "System menu in the top bar"
msgid "System" msgid "System"
msgstr "Menu systemowe" msgstr "Menu systemowe"
#: ../js/ui/panel.js:754 #: ../js/ui/panel.js:807
msgid "Top Bar" msgid "Top Bar"
msgstr "Górny pasek" msgstr "Górny pasek"
@@ -1064,7 +1064,7 @@ msgstr "toggle-switch-intl"
#: ../js/ui/runDialog.js:70 #: ../js/ui/runDialog.js:70
msgid "Enter a Command" msgid "Enter a Command"
msgstr "Proszę wprowadzić polecenie" msgstr "Proszę wprowadzić polecenie:"
#: ../js/ui/runDialog.js:110 ../js/ui/windowMenu.js:162 #: ../js/ui/runDialog.js:110 ../js/ui/windowMenu.js:162
msgid "Close" msgid "Close"
@@ -1629,7 +1629,7 @@ msgstr "Kalendarz programu Evolution"
#. translators: #. translators:
#. * The number of sound outputs on a particular device #. * The number of sound outputs on a particular device
#: ../src/gvc/gvc-mixer-control.c:1835 #: ../src/gvc/gvc-mixer-control.c:1873
#, c-format #, c-format
msgid "%u Output" msgid "%u Output"
msgid_plural "%u Outputs" msgid_plural "%u Outputs"
@@ -1639,7 +1639,7 @@ msgstr[2] "%u wyjść"
#. translators: #. translators:
#. * The number of sound inputs on a particular device #. * The number of sound inputs on a particular device
#: ../src/gvc/gvc-mixer-control.c:1845 #: ../src/gvc/gvc-mixer-control.c:1883
#, c-format #, c-format
msgid "%u Input" msgid "%u Input"
msgid_plural "%u Inputs" msgid_plural "%u Inputs"
@@ -1647,7 +1647,7 @@ msgstr[0] "%u wejście"
msgstr[1] "%u wejścia" msgstr[1] "%u wejścia"
msgstr[2] "%u wejść" msgstr[2] "%u wejść"
#: ../src/gvc/gvc-mixer-control.c:2371 #: ../src/gvc/gvc-mixer-control.c:2738
msgid "System Sounds" msgid "System Sounds"
msgstr "Dźwięki systemowe" msgstr "Dźwięki systemowe"
@@ -1667,12 +1667,12 @@ msgstr "Używa podanego trybu, np. „gdm” dla ekranu logowania"
msgid "List possible modes" msgid "List possible modes"
msgstr "Wyświetla listę możliwych trybów" msgstr "Wyświetla listę możliwych trybów"
#: ../src/shell-app.c:239 #: ../src/shell-app.c:246
msgctxt "program" msgctxt "program"
msgid "Unknown" msgid "Unknown"
msgstr "Nieznany" msgstr "Nieznany"
#: ../src/shell-app.c:480 #: ../src/shell-app.c:487
#, c-format #, c-format
msgid "Failed to launch “%s”" msgid "Failed to launch “%s”"
msgstr "Uruchomienie „%s” się nie powiodło" msgstr "Uruchomienie „%s” się nie powiodło"
@@ -1688,3 +1688,16 @@ msgstr "Hasło nie może być puste"
#: ../src/shell-polkit-authentication-agent.c:346 #: ../src/shell-polkit-authentication-agent.c:346
msgid "Authentication dialog was dismissed by the user" msgid "Authentication dialog was dismissed by the user"
msgstr "Okno dialogowe uwierzytelnienia zostało odrzucone przez użytkownika" msgstr "Okno dialogowe uwierzytelnienia zostało odrzucone przez użytkownika"
msgctxt "title"
msgid "Restart & Install Upgrade"
msgstr "Ponowne uruchomienie i instalacja aktualizacji"
msgid ""
"%s %s will be installed after restart. Upgrade installation can take a "
"long time: ensure that you have backed up and that the computer is "
"plugged in."
msgstr ""
"System %s %s zostanie zainstalowany po ponownym uruchomieniu. Instalacja "
"aktualizacji może zająć dużo czasu. Proszę się upewnić, że wykonano kopię "
"zapasową danych i podłączono komputer do prądu."

View File

@@ -11,8 +11,8 @@ msgstr ""
"Project-Id-Version: gnome-shell master\n" "Project-Id-Version: gnome-shell master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-"
"shell&keywords=I18N+L10N&component=general\n" "shell&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2015-10-24 21:07+0000\n" "POT-Creation-Date: 2015-10-23 11:47+0000\n"
"PO-Revision-Date: 2015-10-25 10:17+0200\n" "PO-Revision-Date: 2015-10-24 19:01+0200\n"
"Last-Translator: Daniel Șerbănescu <daniel [at] serbanescu [dot] dk>\n" "Last-Translator: Daniel Șerbănescu <daniel [at] serbanescu [dot] dk>\n"
"Language-Team: Gnome Romanian Translation Team\n" "Language-Team: Gnome Romanian Translation Team\n"
"Language: ro\n" "Language: ro\n"
@@ -50,7 +50,7 @@ msgstr "Arată meniul aplicației"
#: ../data/gnome-shell.desktop.in.in.h:1 #: ../data/gnome-shell.desktop.in.in.h:1
msgid "GNOME Shell" msgid "GNOME Shell"
msgstr "Vizualizatorul activităților GNOME" msgstr "GNOME Shell"
#: ../data/gnome-shell.desktop.in.in.h:2 #: ../data/gnome-shell.desktop.in.in.h:2
#: ../data/gnome-shell-wayland.desktop.in.in.h:2 #: ../data/gnome-shell-wayland.desktop.in.in.h:2
@@ -59,15 +59,15 @@ msgstr "Administrare de ferestre și lansare de aplicații"
#: ../data/gnome-shell-extension-prefs.desktop.in.in.h:1 #: ../data/gnome-shell-extension-prefs.desktop.in.in.h:1
msgid "GNOME Shell Extension Preferences" msgid "GNOME Shell Extension Preferences"
msgstr "Preferințele extensiei Vizualizatorul activităților GNOME" msgstr "Preferințele extensiei GNOME Shell"
#: ../data/gnome-shell-extension-prefs.desktop.in.in.h:2 #: ../data/gnome-shell-extension-prefs.desktop.in.in.h:2
msgid "Configure GNOME Shell Extensions" msgid "Configure GNOME Shell Extensions"
msgstr "Configurarea extensiilor pentru Vizualizatorul activităților GNOME" msgstr "Configurarea extensiilor GNOME Shell"
#: ../data/gnome-shell-wayland.desktop.in.in.h:1 #: ../data/gnome-shell-wayland.desktop.in.in.h:1
msgid "GNOME Shell (wayland compositor)" msgid "GNOME Shell (wayland compositor)"
msgstr "Vizualizatorul activităților GNOME (compozitor wayland)" msgstr "GNOME Shell (compozitor wayland)"
#: ../data/org.gnome.shell.gschema.xml.in.in.h:1 #: ../data/org.gnome.shell.gschema.xml.in.in.h:1
msgid "Enable internal tools useful for developers and testers from Alt-F2" msgid "Enable internal tools useful for developers and testers from Alt-F2"
@@ -93,11 +93,10 @@ msgid ""
"list. You can also manipulate this list with the EnableExtension and " "list. You can also manipulate this list with the EnableExtension and "
"DisableExtension D-Bus methods on org.gnome.Shell." "DisableExtension D-Bus methods on org.gnome.Shell."
msgstr "" msgstr ""
"Extensiile pentru Vizualizatorul activităților GNOME au o proprietate uuid; " "Extensiile GNOME Shell au o proprietate uuid; această cheie listează "
"această cheie listează extensiile care ar trebui încărcate. Orice extensie " "extensiile care ar trebui încărcate. Orice extensie care trebuie încărcată "
"care trebuie încărcată trebuie să fie în listă. Puteți de asemenea să " "trebuie să fie în listă. Puteți de asemenea să manipulați această listă cu "
"manipulați această listă cu metodele EnableExtension și DisableExtension pe " "metodele EnableExtension și DisableExtension pe org.gnome.Shell."
"org.gnome.Shell."
#: ../data/org.gnome.shell.gschema.xml.in.in.h:5 #: ../data/org.gnome.shell.gschema.xml.in.in.h:5
msgid "Disables the validation of extension version compatibility" msgid "Disables the validation of extension version compatibility"
@@ -109,10 +108,10 @@ msgid ""
"running version. Enabling this option will disable this check and try to " "running version. Enabling this option will disable this check and try to "
"load all extensions regardless of the versions they claim to support." "load all extensions regardless of the versions they claim to support."
msgstr "" msgstr ""
"Vizualizatorul activităților GNOME va încărca doar extensiile care pretind " "GNOME Shell va încărca doar extensiile care pretind să fie compatibile cu "
"să fie compatibile cu versiunea actuală. Activarea acestei opțiuni va duce " "versiunea actuală. Activarea acestei opțiuni va duce la dezactivarea "
"la dezactivarea verificării și la încercarea de a încărca toate extensiile " "verificării și la încercarea de a încărca toate extensiile fără a ține cont "
"fără a ține cont de versiunile cu care acestea pretind că sunt compatibile." "de versiunile cu care acestea pretind că sunt compatibile."
#: ../data/org.gnome.shell.gschema.xml.in.in.h:7 #: ../data/org.gnome.shell.gschema.xml.in.in.h:7
msgid "List of desktop file IDs for favorite applications" msgid "List of desktop file IDs for favorite applications"
@@ -171,10 +170,10 @@ msgid ""
"'Remember Password' checkbox will be present. This key sets the default " "'Remember Password' checkbox will be present. This key sets the default "
"state of the checkbox." "state of the checkbox."
msgstr "" msgstr ""
"Vizualizatorul activităților va cere o parolă când este montat un dispozitiv " "Shell-ul va cere o parolă când este montat un dispozitiv criptat sau un "
"criptat sau un sistem de fișiere la distanță. Dacă parola poate fi salvată " "sistem de fișiere la distanță. Dacă parola poate fi salvată pentru o "
"pentru o utilizare viitoare, o căsuță intitulată „Reține parola” va fi " "utilizare viitoare, o căsuță intitulată „Reține parola” va fi afișată. "
"afișată. Această tastă determină starea implicită a căsuței." "Această tastă determină starea implicită a căsuței."
#: ../data/org.gnome.shell.gschema.xml.in.in.h:18 #: ../data/org.gnome.shell.gschema.xml.in.in.h:18
msgid "Show the week date in the calendar" msgid "Show the week date in the calendar"
@@ -201,8 +200,8 @@ msgstr ""
msgid "" msgid ""
"Keybinding to open the \"Show Applications\" view of the Activities Overview." "Keybinding to open the \"Show Applications\" view of the Activities Overview."
msgstr "" msgstr ""
"Combinație de taste pentru deschiderea modului de afișare „Arată " "Combinație de taste pentru deschiderea modului de afișare „Arată aplicațiile”"
"aplicațiile” a prezentării generale a activităților." " a prezentării generale a activităților."
#: ../data/org.gnome.shell.gschema.xml.in.in.h:24 #: ../data/org.gnome.shell.gschema.xml.in.in.h:24
msgid "Keybinding to open the overview" msgid "Keybinding to open the overview"
@@ -288,8 +287,8 @@ msgstr "Atașează dialogul modal la fereastra părinte"
msgid "" msgid ""
"This key overrides the key in org.gnome.mutter when running GNOME Shell." "This key overrides the key in org.gnome.mutter when running GNOME Shell."
msgstr "" msgstr ""
"Această cheie suprascrie cheia corespondentă din org.gnome.mutter când " "Această cheie suprascrie cheia corespondentă din org.gnome.mutter când GNOME "
"Vizualizatorul activităților GNOME rulează." "Shell rulează."
#: ../data/org.gnome.shell.gschema.xml.in.in.h:40 #: ../data/org.gnome.shell.gschema.xml.in.in.h:40
msgid "Enable edge tiling when dropping windows on screen edges" msgid "Enable edge tiling when dropping windows on screen edges"
@@ -321,7 +320,7 @@ msgstr "S-a produs o eroare la încărcarea ferestrei cu preferințe pentru %s:"
#: ../js/extensionPrefs/main.js:154 #: ../js/extensionPrefs/main.js:154
msgid "GNOME Shell Extensions" msgid "GNOME Shell Extensions"
msgstr "Extensii pentru vizualizatorul activităților GNOME" msgstr "Extensii GNOME Shell"
#: ../js/gdm/authPrompt.js:147 ../js/ui/components/networkAgent.js:145 #: ../js/gdm/authPrompt.js:147 ../js/ui/components/networkAgent.js:145
#: ../js/ui/components/polkitAgent.js:179 ../js/ui/endSessionDialog.js:452 #: ../js/ui/components/polkitAgent.js:179 ../js/ui/endSessionDialog.js:452
@@ -1058,15 +1057,15 @@ msgstr "Bara de sus"
msgid "toggle-switch-us" msgid "toggle-switch-us"
msgstr "toggle-switch-us" msgstr "toggle-switch-us"
#: ../js/ui/runDialog.js:71 #: ../js/ui/runDialog.js:70
msgid "Enter a Command" msgid "Enter a Command"
msgstr "Introduceți o comandă" msgstr "Introduceți o comandă"
#: ../js/ui/runDialog.js:111 ../js/ui/windowMenu.js:162 #: ../js/ui/runDialog.js:110 ../js/ui/windowMenu.js:162
msgid "Close" msgid "Close"
msgstr "Închide" msgstr "Închide"
#: ../js/ui/runDialog.js:282 #: ../js/ui/runDialog.js:281
msgid "Restarting…" msgid "Restarting…"
msgstr "Se repornește…" msgstr "Se repornește…"
@@ -1673,15 +1672,15 @@ msgstr "Necunoscut"
msgid "Failed to launch “%s”" msgid "Failed to launch “%s”"
msgstr "Nu s-a putut lansa „%s”" msgstr "Nu s-a putut lansa „%s”"
#: ../src/shell-keyring-prompt.c:730 #: ../src/shell-keyring-prompt.c:742
msgid "Passwords do not match." msgid "Passwords do not match."
msgstr "Parolele nu se potrivesc." msgstr "Parolele nu se potrivesc."
#: ../src/shell-keyring-prompt.c:738 #: ../src/shell-keyring-prompt.c:750
msgid "Password cannot be blank" msgid "Password cannot be blank"
msgstr "Parola nu poate fi goală" msgstr "Parola nu poate fi goală"
#: ../src/shell-polkit-authentication-agent.c:353 #: ../src/shell-polkit-authentication-agent.c:346
msgid "Authentication dialog was dismissed by the user" msgid "Authentication dialog was dismissed by the user"
msgstr "Fereastra de autentificare a fost închisă de către utilizator" msgstr "Fereastra de autentificare a fost închisă de către utilizator"

609
po/sl.po

File diff suppressed because it is too large Load Diff

627
po/uk.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +1,18 @@
# Chinese (Taiwan) translation for gnome-shell. # Chinese (Taiwan) translation for gnome-shell.
# Copyright (C) 2010 gnome-shell's COPYRIGHT HOLDER # Copyright (C) 2010 gnome-shell's COPYRIGHT HOLDER
# This file is distributed under the same license as the gnome-shell package. # This file is distributed under the same license as the gnome-shell package.
# Chao-Hsiung Liao <j_h_liau@yahoo.com.tw>, 2010. # Chao-Hsiung Liao <j_h_liau@yahoo.com.tw>, 2010, 2014.
# Wei-Lun Chao <chaoweilun@gmail.com>, 2010. # Wei-Lun Chao <chaoweilun@gmail.com>, 2010.
# Anthony Fok <foka@debian.org>, 2015.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gnome-shell 3.3.90\n" "Project-Id-Version: gnome-shell 3.18\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-"
"shell&keywords=I18N+L10N&component=general\n" "shell&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2015-08-25 13:32+0800\n" "POT-Creation-Date: 2015-10-16 21:11+0000\n"
"PO-Revision-Date: 2015-08-25 13:37+0800\n" "PO-Revision-Date: 2015-10-17 09:30+0800\n"
"Last-Translator: Chao-Hsiung Liao <j_h_liau@yahoo.com.tw>\n" "Last-Translator: Anthony Fok <foka@debian.org>\n"
"Language-Team: Chinese (Taiwan) <zh-l10n@lists.linux.org.tw>\n" "Language-Team: Chinese (Taiwan) <zh-l10n@lists.linux.org.tw>\n"
"Language: zh_TW\n" "Language: zh_TW\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -297,7 +298,7 @@ msgid "Cancel"
msgstr "取消" msgstr "取消"
#: ../js/gdm/authPrompt.js:169 ../js/gdm/authPrompt.js:215 #: ../js/gdm/authPrompt.js:169 ../js/gdm/authPrompt.js:215
#: ../js/gdm/authPrompt.js:435 #: ../js/gdm/authPrompt.js:447
msgid "Next" msgid "Next"
msgstr "下一個" msgstr "下一個"
@@ -315,21 +316,29 @@ msgstr "登入"
msgid "Choose Session" msgid "Choose Session"
msgstr "選擇作業階段" msgstr "選擇作業階段"
#. translators: this message is shown below the user list on the
#. login screen. It can be activated to reveal an entry for
#. manually entering the username.
#: ../js/gdm/loginDialog.js:431 #: ../js/gdm/loginDialog.js:431
msgid "Not listed?" msgid "Not listed?"
msgstr "沒有列出來?" msgstr "沒有列出來?"
#: ../js/gdm/loginDialog.js:847 #. Translators: this message is shown below the username entry field
#. to clue the user in on how to login to the local network realm
#: ../js/gdm/loginDialog.js:850
#, javascript-format #, javascript-format
msgid "(e.g., user or %s)" msgid "(e.g., user or %s)"
msgstr "(例如: user 或 %s)" msgstr "(例如: user 或 %s)"
#: ../js/gdm/loginDialog.js:852 ../js/ui/components/networkAgent.js:271 #. TTLS and PEAP are actually much more complicated, but this complication
#. is not visible here since we only care about phase2 authentication
#. (and don't even care of which one)
#: ../js/gdm/loginDialog.js:855 ../js/ui/components/networkAgent.js:271
#: ../js/ui/components/networkAgent.js:289 #: ../js/ui/components/networkAgent.js:289
msgid "Username: " msgid "Username: "
msgstr "使用者名稱:" msgstr "使用者名稱:"
#: ../js/gdm/loginDialog.js:1181 #: ../js/gdm/loginDialog.js:1184
msgid "Login Window" msgid "Login Window"
msgstr "登入視窗" msgstr "登入視窗"
@@ -337,6 +346,11 @@ msgstr "登入視窗"
msgid "Authentication error" msgid "Authentication error"
msgstr "核對錯誤" msgstr "核對錯誤"
#. We don't show fingerprint messages directly since it's
#. not the main auth service. Instead we use the messages
#. as a cue to display our own message.
#. Translators: this message is shown below the password entry field
#. to indicate the user can swipe their finger instead
#: ../js/gdm/util.js:473 #: ../js/gdm/util.js:473
msgid "(or swipe finger)" msgid "(or swipe finger)"
msgstr "(或是滑過手指)" msgstr "(或是滑過手指)"
@@ -345,6 +359,8 @@ msgstr "(或是滑過手指)"
msgid "Command not found" msgid "Command not found"
msgstr "找不到指令" msgstr "找不到指令"
#. Replace "Error invoking GLib.shell_parse_argv: " with
#. something nicer
#: ../js/misc/util.js:152 #: ../js/misc/util.js:152
msgid "Could not parse command:" msgid "Could not parse command:"
msgstr "無法分析指令:" msgstr "無法分析指令:"
@@ -354,70 +370,78 @@ msgstr "無法分析指令:"
msgid "Execution of “%s” failed:" msgid "Execution of “%s” failed:"
msgstr "執行「%s」失敗" msgstr "執行「%s」失敗"
#. Translators: Time in 24h format */ #. Translators: Time in 24h format
#: ../js/misc/util.js:191 #: ../js/misc/util.js:191
msgid "%H%M" msgid "%H%M"
msgstr "%H%M" msgstr "%H%M"
#. Translators: this is the word "Yesterday" followed by a #. Translators: this is the word "Yesterday" followed by a
#. time string in 24h format. i.e. "Yesterday, 14:30" */ #. time string in 24h format. i.e. "Yesterday, 14:30"
#: ../js/misc/util.js:197 #: ../js/misc/util.js:197
#, no-c-format
msgid "Yesterday, %H%M" msgid "Yesterday, %H%M"
msgstr "昨天 %H:%M" msgstr "昨天 %H:%M"
#. Translators: this is the week day name followed by a time #. Translators: this is the week day name followed by a time
#. string in 24h format. i.e. "Monday, 14:30" */ #. string in 24h format. i.e. "Monday, 14:30"
#: ../js/misc/util.js:203 #: ../js/misc/util.js:203
#, no-c-format
msgid "%A, %H%M" msgid "%A, %H%M"
msgstr "%A %H%M" msgstr "%A %H%M"
#. Translators: this is the month name and day number #. Translators: this is the month name and day number
#. followed by a time string in 24h format. #. followed by a time string in 24h format.
#. i.e. "May 25, 14:30" */ #. i.e. "May 25, 14:30"
#: ../js/misc/util.js:209 #: ../js/misc/util.js:209
#, no-c-format
msgid "%B %d, %H%M" msgid "%B %d, %H%M"
msgstr "%m月%d日 %H%M" msgstr "%m月%d日 %H%M"
#. Translators: this is the month name, day number, year #. Translators: this is the month name, day number, year
#. number followed by a time string in 24h format. #. number followed by a time string in 24h format.
#. i.e. "May 25 2012, 14:30" */ #. i.e. "May 25 2012, 14:30"
#: ../js/misc/util.js:215 #: ../js/misc/util.js:215
#, no-c-format
msgid "%B %d %Y, %H%M" msgid "%B %d %Y, %H%M"
msgstr "%Y年%m月%d日 %H:%M" msgstr "%Y年%m月%d日 %H:%M"
#. Translators: Time in 12h format */ #. Translators: Time in 12h format
#: ../js/misc/util.js:220 #: ../js/misc/util.js:220
msgid "%l%M %p" msgid "%l%M %p"
msgstr "%p %l%M" msgstr "%p %l%M"
#. Translators: this is the word "Yesterday" followed by a #. Translators: this is the word "Yesterday" followed by a
#. time string in 12h format. i.e. "Yesterday, 2:30 pm" */ #. time string in 12h format. i.e. "Yesterday, 2:30 pm"
#: ../js/misc/util.js:226 #: ../js/misc/util.js:226
#, no-c-format
msgid "Yesterday, %l%M %p" msgid "Yesterday, %l%M %p"
msgstr "昨天 %p %l%M" msgstr "昨天 %p %l%M"
#. Translators: this is the week day name followed by a time #. Translators: this is the week day name followed by a time
#. string in 12h format. i.e. "Monday, 2:30 pm" */ #. string in 12h format. i.e. "Monday, 2:30 pm"
#: ../js/misc/util.js:232 #: ../js/misc/util.js:232
#, no-c-format
msgid "%A, %l%M %p" msgid "%A, %l%M %p"
msgstr "%A%p %l%M" msgstr "%A%p %l%M"
#. Translators: this is the month name and day number #. Translators: this is the month name and day number
#. followed by a time string in 12h format. #. followed by a time string in 12h format.
#. i.e. "May 25, 2:30 pm" */ #. i.e. "May 25, 2:30 pm"
#: ../js/misc/util.js:238 #: ../js/misc/util.js:238
#, no-c-format
msgid "%B %d, %l%M %p" msgid "%B %d, %l%M %p"
msgstr "%m月%d日%p %l%M" msgstr "%m月%d日%p %l%M"
#. Translators: this is the month name, day number, year #. Translators: this is the month name, day number, year
#. number followed by a time string in 12h format. #. number followed by a time string in 12h format.
#. i.e. "May 25 2012, 2:30 pm"*/ #. i.e. "May 25 2012, 2:30 pm"
#: ../js/misc/util.js:244 #: ../js/misc/util.js:244
#, no-c-format
msgid "%B %d %Y, %l%M %p" msgid "%B %d %Y, %l%M %p"
msgstr "%Y年%m月%d日%p %l%M" msgstr "%Y年%m月%d日%p %l%M"
#. TRANSLATORS: this is the title of the wifi captive portal login #. TRANSLATORS: this is the title of the wifi captive portal login
#. * window, until we know the title of the actual login page */ #. * window, until we know the title of the actual login page
#: ../js/portalHelper/main.js:85 #: ../js/portalHelper/main.js:85
msgid "Web Authentication Redirect" msgid "Web Authentication Redirect"
msgstr "網頁核對重新導向" msgstr "網頁核對重新導向"
@@ -468,12 +492,11 @@ msgstr "改變背景…"
msgid "Display Settings" msgid "Display Settings"
msgstr "顯示設定值" msgstr "顯示設定值"
#: ../js/ui/backgroundMenu.js:22 ../js/ui/panel.js:650 #: ../js/ui/backgroundMenu.js:22 ../js/ui/status/system.js:366
#: ../js/ui/status/system.js:366
msgid "Settings" msgid "Settings"
msgstr "設定值" msgstr "設定值"
#. Translators: Enter 0-6 (Sunday-Saturday) for non-work days. Examples: "0" (Sunday) "6" (Saturday) "06" (Sunday and Saturday). */ #. Translators: Enter 0-6 (Sunday-Saturday) for non-work days. Examples: "0" (Sunday) "6" (Saturday) "06" (Sunday and Saturday).
#: ../js/ui/calendar.js:55 #: ../js/ui/calendar.js:55
msgctxt "calendar-no-work" msgctxt "calendar-no-work"
msgid "06" msgid "06"
@@ -483,43 +506,43 @@ msgstr "06"
#. * #. *
#. * NOTE: These grid abbreviations are always shown together #. * NOTE: These grid abbreviations are always shown together
#. * and in order, e.g. "S M T W T F S". #. * and in order, e.g. "S M T W T F S".
#. */ #.
#: ../js/ui/calendar.js:84 #: ../js/ui/calendar.js:84
msgctxt "grid sunday" msgctxt "grid sunday"
msgid "S" msgid "S"
msgstr "日" msgstr "日"
#. Translators: Calendar grid abbreviation for Monday */ #. Translators: Calendar grid abbreviation for Monday
#: ../js/ui/calendar.js:86 #: ../js/ui/calendar.js:86
msgctxt "grid monday" msgctxt "grid monday"
msgid "M" msgid "M"
msgstr "一" msgstr "一"
#. Translators: Calendar grid abbreviation for Tuesday */ #. Translators: Calendar grid abbreviation for Tuesday
#: ../js/ui/calendar.js:88 #: ../js/ui/calendar.js:88
msgctxt "grid tuesday" msgctxt "grid tuesday"
msgid "T" msgid "T"
msgstr "二" msgstr "二"
#. Translators: Calendar grid abbreviation for Wednesday */ #. Translators: Calendar grid abbreviation for Wednesday
#: ../js/ui/calendar.js:90 #: ../js/ui/calendar.js:90
msgctxt "grid wednesday" msgctxt "grid wednesday"
msgid "W" msgid "W"
msgstr "三" msgstr "三"
#. Translators: Calendar grid abbreviation for Thursday */ #. Translators: Calendar grid abbreviation for Thursday
#: ../js/ui/calendar.js:92 #: ../js/ui/calendar.js:92
msgctxt "grid thursday" msgctxt "grid thursday"
msgid "T" msgid "T"
msgstr "四" msgstr "四"
#. Translators: Calendar grid abbreviation for Friday */ #. Translators: Calendar grid abbreviation for Friday
#: ../js/ui/calendar.js:94 #: ../js/ui/calendar.js:94
msgctxt "grid friday" msgctxt "grid friday"
msgid "F" msgid "F"
msgstr "五" msgstr "五"
#. Translators: Calendar grid abbreviation for Saturday */ #. Translators: Calendar grid abbreviation for Saturday
#: ../js/ui/calendar.js:96 #: ../js/ui/calendar.js:96
msgctxt "grid saturday" msgctxt "grid saturday"
msgid "S" msgid "S"
@@ -539,39 +562,39 @@ msgstr "%V 週"
#. Translators: Shown in calendar event list for all day events #. Translators: Shown in calendar event list for all day events
#. * Keep it short, best if you can use less then 10 characters #. * Keep it short, best if you can use less then 10 characters
#. */ #.
#: ../js/ui/calendar.js:1188 #: ../js/ui/calendar.js:1188
msgctxt "event list time" msgctxt "event list time"
msgid "All Day" msgid "All Day"
msgstr "整天" msgstr "整天"
#: ../js/ui/calendar.js:1291 #: ../js/ui/calendar.js:1295
msgid "Clear section" msgid "Clear section"
msgstr "清除區段" msgstr "清除區段"
#: ../js/ui/calendar.js:1518 #: ../js/ui/calendar.js:1522
msgid "Events" msgid "Events"
msgstr "行程" msgstr "行程"
#: ../js/ui/calendar.js:1527 #: ../js/ui/calendar.js:1531
msgctxt "calendar heading" msgctxt "calendar heading"
msgid "%A, %B %d" msgid "%A, %B %d"
msgstr "%m月%d日%A" msgstr "%m月%d日%A"
#: ../js/ui/calendar.js:1531 #: ../js/ui/calendar.js:1535
msgctxt "calendar heading" msgctxt "calendar heading"
msgid "%A, %B %d, %Y" msgid "%A, %B %d, %Y"
msgstr "%Y年%m月%d日%A" msgstr "%Y年%m月%d日%A"
#: ../js/ui/calendar.js:1616 #: ../js/ui/calendar.js:1620
msgid "Notifications" msgid "Notifications"
msgstr "通知" msgstr "通知"
#: ../js/ui/calendar.js:1767 #: ../js/ui/calendar.js:1771
msgid "No Notifications" msgid "No Notifications"
msgstr "沒有通知" msgstr "沒有通知"
#: ../js/ui/calendar.js:1770 #: ../js/ui/calendar.js:1774
msgid "No Events" msgid "No Events"
msgstr "沒有行程" msgstr "沒有行程"
@@ -583,7 +606,7 @@ msgstr "外部裝置已連接"
msgid "External drive disconnected" msgid "External drive disconnected"
msgstr "外部裝置已拔除" msgstr "外部裝置已拔除"
#: ../js/ui/components/autorunManager.js:354 #: ../js/ui/components/autorunManager.js:351
#, javascript-format #, javascript-format
msgid "Open with %s" msgid "Open with %s"
msgstr "用 %s 開啟" msgstr "用 %s 開啟"
@@ -601,6 +624,7 @@ msgstr "再輸入一次:"
msgid "Connect" msgid "Connect"
msgstr "連線" msgstr "連線"
#. Cisco LEAP
#: ../js/ui/components/networkAgent.js:233 #: ../js/ui/components/networkAgent.js:233
#: ../js/ui/components/networkAgent.js:245 #: ../js/ui/components/networkAgent.js:245
#: ../js/ui/components/networkAgent.js:273 #: ../js/ui/components/networkAgent.js:273
@@ -609,6 +633,7 @@ msgstr "連線"
msgid "Password: " msgid "Password: "
msgstr "密碼: " msgstr "密碼: "
#. static WEP
#: ../js/ui/components/networkAgent.js:238 #: ../js/ui/components/networkAgent.js:238
msgid "Key: " msgid "Key: "
msgstr "金鑰:" msgstr "金鑰:"
@@ -698,13 +723,13 @@ msgstr "核對"
#. Translators: "that didn't work" refers to the fact that the #. Translators: "that didn't work" refers to the fact that the
#. * requested authentication was not gained; this can happen #. * requested authentication was not gained; this can happen
#. * because of an authentication error (like invalid password), #. * because of an authentication error (like invalid password),
#. * for instance. */ #. * for instance.
#: ../js/ui/components/polkitAgent.js:301 ../js/ui/shellMountOperation.js:383 #: ../js/ui/components/polkitAgent.js:301 ../js/ui/shellMountOperation.js:383
msgid "Sorry, that didn't work. Please try again." msgid "Sorry, that didn't work. Please try again."
msgstr "抱歉,那樣沒有作用。請再試一次。" msgstr "抱歉,那樣沒有作用。請再試一次。"
#. Translators: this is the other person changing their old IM name to their new #. Translators: this is the other person changing their old IM name to their new
#. IM name. */ #. IM name.
#: ../js/ui/components/telepathyClient.js:759 #: ../js/ui/components/telepathyClient.js:759
#, javascript-format #, javascript-format
msgid "%s is now known as %s" msgid "%s is now known as %s"
@@ -718,13 +743,15 @@ msgstr "視窗"
msgid "Show Applications" msgid "Show Applications"
msgstr "顯示應用程式" msgstr "顯示應用程式"
#. Translators: this is the name of the dock/favorites area on
#. the left of the overview
#: ../js/ui/dash.js:449 #: ../js/ui/dash.js:449
msgid "Dash" msgid "Dash"
msgstr "Dash" msgstr "Dash"
#. Translators: This is the date format to use when the calendar popup is #. Translators: This is the date format to use when the calendar popup is
#. * shown - it is shown just below the time in the shell (e.g. "Tue 9:29 AM"). #. * shown - it is shown just below the time in the shell (e.g. "Tue 9:29 AM").
#. */ #.
#: ../js/ui/dateMenu.js:73 #: ../js/ui/dateMenu.js:73
msgid "%B %e %Y" msgid "%B %e %Y"
msgstr "%Y年%m月%e日" msgstr "%Y年%m月%e日"
@@ -732,7 +759,7 @@ msgstr "%Y年%m月%e日"
#. Translators: This is the accessible name of the date button shown #. Translators: This is the accessible name of the date button shown
#. * below the time in the shell; it should combine the weekday and the #. * below the time in the shell; it should combine the weekday and the
#. * date, e.g. "Tuesday February 17 2015". #. * date, e.g. "Tuesday February 17 2015".
#. */ #.
#: ../js/ui/dateMenu.js:80 #: ../js/ui/dateMenu.js:80
msgid "%A %B %e %Y" msgid "%A %B %e %Y"
msgstr "%Y年%m月%e日%A" msgstr "%Y年%m月%e日%A"
@@ -854,13 +881,13 @@ msgstr "部分應用程式忙碌中或有未儲存的工作。"
msgid "Other users are logged in." msgid "Other users are logged in."
msgstr "其他使用者已登入。" msgstr "其他使用者已登入。"
#. Translators: Remote here refers to a remote session, like a ssh login */ #. Translators: Remote here refers to a remote session, like a ssh login
#: ../js/ui/endSessionDialog.js:640 #: ../js/ui/endSessionDialog.js:640
#, javascript-format #, javascript-format
msgid "%s (remote)" msgid "%s (remote)"
msgstr "%s (遠端)" msgstr "%s (遠端)"
#. Translators: Console here refers to a tty like a VT console */ #. Translators: Console here refers to a tty like a VT console
#: ../js/ui/endSessionDialog.js:643 #: ../js/ui/endSessionDialog.js:643
#, javascript-format #, javascript-format
msgid "%s (console)" msgid "%s (console)"
@@ -879,7 +906,7 @@ msgstr "是否從 extensions.gnome.org 下載並安裝「%s」"
msgid "Keyboard" msgid "Keyboard"
msgstr "鍵盤" msgstr "鍵盤"
#. translators: 'Hide' is a verb */ #. translators: 'Hide' is a verb
#: ../js/ui/legacyTray.js:66 #: ../js/ui/legacyTray.js:66
msgid "Hide tray" msgid "Hide tray"
msgstr "隱藏系統匣" msgstr "隱藏系統匣"
@@ -892,7 +919,7 @@ msgstr "狀態圖示"
msgid "No extensions installed" msgid "No extensions installed"
msgstr "沒有安裝擴充功能" msgstr "沒有安裝擴充功能"
#. Translators: argument is an extension UUID. */ #. Translators: argument is an extension UUID.
#: ../js/ui/lookingGlass.js:697 #: ../js/ui/lookingGlass.js:697
#, javascript-format #, javascript-format
msgid "%s has not emitted any errors." msgid "%s has not emitted any errors."
@@ -912,7 +939,7 @@ msgstr "已啟用"
#. translators: #. translators:
#. * The device has been disabled #. * The device has been disabled
#: ../js/ui/lookingGlass.js:719 ../src/gvc/gvc-mixer-control.c:1830 #: ../js/ui/lookingGlass.js:719 ../src/gvc/gvc-mixer-control.c:1828
msgid "Disabled" msgid "Disabled"
msgstr "已停用" msgstr "已停用"
@@ -951,25 +978,37 @@ msgstr "概覽"
#. Translators: this is the text displayed #. Translators: this is the text displayed
#. in the search entry when no search is #. in the search entry when no search is
#. active; it should not exceed ~30 #. active; it should not exceed ~30
#. characters. */ #. characters.
#: ../js/ui/overview.js:244 #: ../js/ui/overview.js:244
msgid "Type to search…" msgid "Type to search…"
msgstr "輸入以搜尋…" msgstr "輸入以搜尋…"
#: ../js/ui/panel.js:352 #: ../js/ui/panel.js:358
msgid "Quit" msgid "Quit"
msgstr "結束" msgstr "結束"
#. Translators: If there is no suitable word for "Activities" #. Translators: If there is no suitable word for "Activities"
#. in your language, you can use the word for "Overview". */ #. in your language, you can use the word for "Overview".
#: ../js/ui/panel.js:404 #: ../js/ui/panel.js:414
msgid "Activities" msgid "Activities"
msgstr "概覽 " msgstr "概覽 "
#: ../js/ui/panel.js:754 #: ../js/ui/panel.js:693
#, fuzzy
#| msgid "System"
msgctxt "System menu in the top bar"
msgid "System"
msgstr "系統"
#: ../js/ui/panel.js:805
msgid "Top Bar" msgid "Top Bar"
msgstr "頂端列" msgstr "頂端列"
#. Translators: this MUST be either "toggle-switch-us"
#. (for toggle switches containing the English words
#. "ON" and "OFF") or "toggle-switch-intl" (for toggle
#. switches containing "◯" and "|"). Other values will
#. simply result in invisible toggle switches.
#: ../js/ui/popupMenu.js:289 #: ../js/ui/popupMenu.js:289
msgid "toggle-switch-us" msgid "toggle-switch-us"
msgstr "toggle-switch-us" msgstr "toggle-switch-us"
@@ -987,7 +1026,7 @@ msgid "Restarting…"
msgstr "重新啟動…" msgstr "重新啟動…"
#. Translators: This is a time format for a date in #. Translators: This is a time format for a date in
#. long format */ #. long format
#: ../js/ui/screenShield.js:85 #: ../js/ui/screenShield.js:85
msgid "%A, %B %d" msgid "%A, %B %d"
msgstr "%m月%d日%A" msgstr "%m月%d日%A"
@@ -1012,6 +1051,13 @@ msgstr "鎖定"
msgid "GNOME needs to lock the screen" msgid "GNOME needs to lock the screen"
msgstr "GNOME 需要鎖定螢幕" msgstr "GNOME 需要鎖定螢幕"
#. We could not become modal, so we can't activate the
#. screenshield. The user is probably very upset at this
#. point, but any application using global grabs is broken
#. Just tell him to stop using this app
#.
#. XXX: another option is to kick the user into the gdm login
#. screen, where we're not affected by grabs
#: ../js/ui/screenShield.js:805 ../js/ui/screenShield.js:1271 #: ../js/ui/screenShield.js:805 ../js/ui/screenShield.js:1271
msgid "Unable to lock" msgid "Unable to lock"
msgstr "無法鎖定" msgstr "無法鎖定"
@@ -1107,7 +1153,7 @@ msgstr "關閉"
msgid "Bluetooth Settings" msgid "Bluetooth Settings"
msgstr "藍牙設定值" msgstr "藍牙設定值"
#. Translators: this is the number of connected bluetooth devices */ #. Translators: this is the number of connected bluetooth devices
#: ../js/ui/status/bluetooth.js:105 #: ../js/ui/status/bluetooth.js:105
#, javascript-format #, javascript-format
msgid "%d Connected" msgid "%d Connected"
@@ -1154,13 +1200,13 @@ msgstr "啟用"
msgid "<unknown>" msgid "<unknown>"
msgstr "<不明>" msgstr "<不明>"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:451 ../js/ui/status/network.js:1308 #: ../js/ui/status/network.js:451 ../js/ui/status/network.js:1308
#, javascript-format #, javascript-format
msgid "%s Off" msgid "%s Off"
msgstr "%s 關閉" msgstr "%s 關閉"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:454 #: ../js/ui/status/network.js:454
#, javascript-format #, javascript-format
msgid "%s Connected" msgid "%s Connected"
@@ -1168,45 +1214,45 @@ msgstr "%s 已連線"
#. Translators: this is for network devices that are physically present but are not #. Translators: this is for network devices that are physically present but are not
#. under NetworkManager's control (and thus cannot be used in the menu); #. under NetworkManager's control (and thus cannot be used in the menu);
#. %s is a network identifier */ #. %s is a network identifier
#: ../js/ui/status/network.js:459 #: ../js/ui/status/network.js:459
#, javascript-format #, javascript-format
msgid "%s Unmanaged" msgid "%s Unmanaged"
msgstr "%s 未受管理" msgstr "%s 未受管理"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:462 #: ../js/ui/status/network.js:462
#, javascript-format #, javascript-format
msgid "%s Disconnecting" msgid "%s Disconnecting"
msgstr "%s 正在斷線" msgstr "%s 正在斷線"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:469 ../js/ui/status/network.js:1300 #: ../js/ui/status/network.js:469 ../js/ui/status/network.js:1300
#, javascript-format #, javascript-format
msgid "%s Connecting" msgid "%s Connecting"
msgstr "正連線到 %s" msgstr "正連線到 %s"
#. Translators: this is for network connections that require some kind of key or password; %s is a network identifier */ #. Translators: this is for network connections that require some kind of key or password; %s is a network identifier
#: ../js/ui/status/network.js:472 #: ../js/ui/status/network.js:472
#, javascript-format #, javascript-format
msgid "%s Requires Authentication" msgid "%s Requires Authentication"
msgstr "%s 需要核對" msgstr "%s 需要核對"
#. Translators: this is for devices that require some kind of firmware or kernel #. Translators: this is for devices that require some kind of firmware or kernel
#. module, which is missing; %s is a network identifier */ #. module, which is missing; %s is a network identifier
#: ../js/ui/status/network.js:480 #: ../js/ui/status/network.js:480
#, javascript-format #, javascript-format
msgid "Firmware Missing For %s" msgid "Firmware Missing For %s"
msgstr "缺少 %s 韌體" msgstr "缺少 %s 韌體"
#. Translators: this is for a network device that cannot be activated (for example it #. Translators: this is for a network device that cannot be activated (for example it
#. is disabled by rfkill, or it has no coverage; %s is a network identifier */ #. is disabled by rfkill, or it has no coverage; %s is a network identifier
#: ../js/ui/status/network.js:484 #: ../js/ui/status/network.js:484
#, javascript-format #, javascript-format
msgid "%s Unavailable" msgid "%s Unavailable"
msgstr "%s 無法使用" msgstr "%s 無法使用"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:487 #: ../js/ui/status/network.js:487
#, javascript-format #, javascript-format
msgid "%s Connection Failed" msgid "%s Connection Failed"
@@ -1220,14 +1266,14 @@ msgstr "有線設定值"
msgid "Mobile Broadband Settings" msgid "Mobile Broadband Settings"
msgstr "行動寬頻設定值" msgstr "行動寬頻設定值"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:588 ../js/ui/status/network.js:1305 #: ../js/ui/status/network.js:588 ../js/ui/status/network.js:1305
#, javascript-format #, javascript-format
msgid "%s Hardware Disabled" msgid "%s Hardware Disabled"
msgstr "%s 硬體已停用" msgstr "%s 硬體已停用"
#. Translators: this is for a network device that cannot be activated #. Translators: this is for a network device that cannot be activated
#. because it's disabled by rfkill (airplane mode); %s is a network identifier */ #. because it's disabled by rfkill (airplane mode); %s is a network identifier
#: ../js/ui/status/network.js:592 #: ../js/ui/status/network.js:592
#, javascript-format #, javascript-format
msgid "%s Disabled" msgid "%s Disabled"
@@ -1289,13 +1335,13 @@ msgstr "Wi-Fi 設定值"
msgid "Turn On" msgid "Turn On"
msgstr "開啟" msgstr "開啟"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:1296 #: ../js/ui/status/network.js:1296
#, javascript-format #, javascript-format
msgid "%s Hotspot Active" msgid "%s Hotspot Active"
msgstr "%s 熱點有效" msgstr "%s 熱點有效"
#. Translators: %s is a network identifier */ #. Translators: %s is a network identifier
#: ../js/ui/status/network.js:1311 #: ../js/ui/status/network.js:1311
#, javascript-format #, javascript-format
msgid "%s Not Connected" msgid "%s Not Connected"
@@ -1305,7 +1351,7 @@ msgstr "%s 未連線"
msgid "connecting..." msgid "connecting..."
msgstr "連線中…" msgstr "連線中…"
#. Translators: this is for network connections that require some kind of key or password */ #. Translators: this is for network connections that require some kind of key or password
#: ../js/ui/status/network.js:1414 #: ../js/ui/status/network.js:1414
msgid "authentication required" msgid "authentication required"
msgstr "要求核對" msgstr "要求核對"
@@ -1346,20 +1392,27 @@ msgstr "電源設定值"
msgid "Fully Charged" msgid "Fully Charged"
msgstr "已完全充飽" msgstr "已完全充飽"
#. 0 is reported when UPower does not have enough data
#. to estimate battery life
#: ../js/ui/status/power.js:72 ../js/ui/status/power.js:78 #: ../js/ui/status/power.js:72 ../js/ui/status/power.js:78
msgid "Estimating…" msgid "Estimating…"
msgstr "評估中…" msgstr "評估中…"
#. Translators: this is <hours>:<minutes> Remaining (<percentage>)
#: ../js/ui/status/power.js:86 #: ../js/ui/status/power.js:86
#, javascript-format #, javascript-format
msgid "%d%02d Remaining (%d%%)" msgid "%d%02d Remaining (%d%%)"
msgstr "剩餘時間 %d%02d (%d%%)" msgstr "剩餘時間 %d%02d (%d%%)"
#. Translators: this is <hours>:<minutes> Until Full (<percentage>)
#: ../js/ui/status/power.js:91 #: ../js/ui/status/power.js:91
#, javascript-format #, javascript-format
msgid "%d%02d Until Full (%d%%)" msgid "%d%02d Until Full (%d%%)"
msgstr "直到充滿還需 %d%02d (%d%%)" msgstr "直到充滿還需 %d%02d (%d%%)"
#. The menu only appears when airplane mode is on, so just
#. statically build it as if it was on, rather than dynamically
#. changing the menu contents.
#: ../js/ui/status/rfkill.js:88 #: ../js/ui/status/rfkill.js:88
msgid "Airplane Mode On" msgid "Airplane Mode On"
msgstr "飛安模式已開啟" msgstr "飛安模式已開啟"
@@ -1427,7 +1480,7 @@ msgstr "您想要保留這些顯示器設定值嗎?"
#. Translators: this and the following message should be limited in lenght, #. Translators: this and the following message should be limited in lenght,
#. to avoid ellipsizing the labels. #. to avoid ellipsizing the labels.
#. */ #.
#: ../js/ui/windowManager.js:82 #: ../js/ui/windowManager.js:82
msgid "Revert Settings" msgid "Revert Settings"
msgstr "還原設定值" msgstr "還原設定值"
@@ -1443,7 +1496,7 @@ msgid_plural "Settings changes will revert in %d seconds"
msgstr[0] "設定值的變更會在 %d 秒內還原" msgstr[0] "設定值的變更會在 %d 秒內還原"
#. Translators: This represents the size of a window. The first number is #. Translators: This represents the size of a window. The first number is
#. * the width of the window and the second is the height. */ #. * the width of the window and the second is the height.
#: ../js/ui/windowManager.js:658 #: ../js/ui/windowManager.js:658
#, javascript-format #, javascript-format
msgid "%d x %d" msgid "%d x %d"
@@ -1499,11 +1552,11 @@ msgstr "將工作區下移"
#: ../js/ui/windowMenu.js:136 #: ../js/ui/windowMenu.js:136
msgid "Move to Monitor Up" msgid "Move to Monitor Up"
msgstr "將工作區上移" msgstr "移至螢幕上端"
#: ../js/ui/windowMenu.js:142 #: ../js/ui/windowMenu.js:142
msgid "Move to Monitor Down" msgid "Move to Monitor Down"
msgstr "將工作區下移" msgstr "移至螢幕下端"
#: ../js/ui/windowMenu.js:148 #: ../js/ui/windowMenu.js:148
msgid "Move to Monitor Left" msgid "Move to Monitor Left"
@@ -1519,7 +1572,7 @@ msgstr "Evolution 行事曆"
#. translators: #. translators:
#. * The number of sound outputs on a particular device #. * The number of sound outputs on a particular device
#: ../src/gvc/gvc-mixer-control.c:1837 #: ../src/gvc/gvc-mixer-control.c:1835
#, c-format #, c-format
msgid "%u Output" msgid "%u Output"
msgid_plural "%u Outputs" msgid_plural "%u Outputs"
@@ -1527,38 +1580,38 @@ msgstr[0] "%u 輸出"
#. translators: #. translators:
#. * The number of sound inputs on a particular device #. * The number of sound inputs on a particular device
#: ../src/gvc/gvc-mixer-control.c:1847 #: ../src/gvc/gvc-mixer-control.c:1845
#, c-format #, c-format
msgid "%u Input" msgid "%u Input"
msgid_plural "%u Inputs" msgid_plural "%u Inputs"
msgstr[0] "%u 輸入" msgstr[0] "%u 輸入"
#: ../src/gvc/gvc-mixer-control.c:2373 #: ../src/gvc/gvc-mixer-control.c:2371
msgid "System Sounds" msgid "System Sounds"
msgstr "系統音效" msgstr "系統音效"
#: ../src/main.c:373 #: ../src/main.c:381
msgid "Print version" msgid "Print version"
msgstr "顯示版本" msgstr "顯示版本"
#: ../src/main.c:379 #: ../src/main.c:387
msgid "Mode used by GDM for login screen" msgid "Mode used by GDM for login screen"
msgstr "GDM 在登入畫面使用的模式" msgstr "GDM 在登入畫面使用的模式"
#: ../src/main.c:385 #: ../src/main.c:393
msgid "Use a specific mode, e.g. \"gdm\" for login screen" msgid "Use a specific mode, e.g. \"gdm\" for login screen"
msgstr "使用指定的模式例如「gdm」為登入畫面" msgstr "使用指定的模式例如「gdm」為登入畫面"
#: ../src/main.c:391 #: ../src/main.c:399
msgid "List possible modes" msgid "List possible modes"
msgstr "列出可能的模式" msgstr "列出可能的模式"
#: ../src/shell-app.c:239 #: ../src/shell-app.c:246
msgctxt "program" msgctxt "program"
msgid "Unknown" msgid "Unknown"
msgstr "不明" msgstr "不明"
#: ../src/shell-app.c:480 #: ../src/shell-app.c:487
#, c-format #, c-format
msgid "Failed to launch “%s”" msgid "Failed to launch “%s”"
msgstr "無法啟動「%s」" msgstr "無法啟動「%s」"

View File

@@ -41,6 +41,8 @@
#define N_(x) x #define N_(x) x
#endif #endif
#define CALENDAR_SOURCES_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CALENDAR_TYPE_SOURCES, CalendarSourcesPrivate))
typedef struct _ClientData ClientData; typedef struct _ClientData ClientData;
typedef struct _CalendarSourceData CalendarSourceData; typedef struct _CalendarSourceData CalendarSourceData;
@@ -64,14 +66,6 @@ struct _CalendarSourceData
guint loaded : 1; guint loaded : 1;
}; };
typedef struct _CalendarSourcesPrivate CalendarSourcesPrivate;
struct _CalendarSources
{
GObject parent;
CalendarSourcesPrivate *priv;
};
struct _CalendarSourcesPrivate struct _CalendarSourcesPrivate
{ {
ESourceRegistry *registry; ESourceRegistry *registry;
@@ -83,8 +77,8 @@ struct _CalendarSourcesPrivate
CalendarSourceData task_sources; CalendarSourceData task_sources;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (CalendarSources, calendar_sources, G_TYPE_OBJECT) static void calendar_sources_class_init (CalendarSourcesClass *klass);
static void calendar_sources_init (CalendarSources *sources);
static void calendar_sources_finalize (GObject *object); static void calendar_sources_finalize (GObject *object);
static void backend_died_cb (EClient *client, CalendarSourceData *source_data); static void backend_died_cb (EClient *client, CalendarSourceData *source_data);
@@ -114,6 +108,34 @@ client_data_free (ClientData *data)
g_slice_free (ClientData, data); g_slice_free (ClientData, data);
} }
GType
calendar_sources_get_type (void)
{
static GType sources_type = 0;
if (!sources_type)
{
static const GTypeInfo sources_info =
{
sizeof (CalendarSourcesClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) calendar_sources_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (CalendarSources),
0, /* n_preallocs */
(GInstanceInitFunc) calendar_sources_init,
};
sources_type = g_type_register_static (G_TYPE_OBJECT,
"CalendarSources",
&sources_info, 0);
}
return sources_type;
}
static void static void
calendar_sources_class_init (CalendarSourcesClass *klass) calendar_sources_class_init (CalendarSourcesClass *klass)
{ {
@@ -123,11 +145,14 @@ calendar_sources_class_init (CalendarSourcesClass *klass)
gobject_class->finalize = calendar_sources_finalize; gobject_class->finalize = calendar_sources_finalize;
g_type_class_add_private (klass, sizeof (CalendarSourcesPrivate));
signals [APPOINTMENT_SOURCES_CHANGED] = signals [APPOINTMENT_SOURCES_CHANGED] =
g_signal_new ("appointment-sources-changed", g_signal_new ("appointment-sources-changed",
G_TYPE_FROM_CLASS (gobject_class), G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
0, G_STRUCT_OFFSET (CalendarSourcesClass,
appointment_sources_changed),
NULL, NULL,
NULL, NULL,
NULL, NULL,
@@ -138,7 +163,8 @@ calendar_sources_class_init (CalendarSourcesClass *klass)
g_signal_new ("task-sources-changed", g_signal_new ("task-sources-changed",
G_TYPE_FROM_CLASS (gobject_class), G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
0, G_STRUCT_OFFSET (CalendarSourcesClass,
task_sources_changed),
NULL, NULL,
NULL, NULL,
NULL, NULL,
@@ -153,7 +179,7 @@ calendar_sources_init (CalendarSources *sources)
GDBusConnection *session_bus; GDBusConnection *session_bus;
GVariant *result; GVariant *result;
sources->priv = calendar_sources_get_instance_private (sources); sources->priv = CALENDAR_SOURCES_GET_PRIVATE (sources);
/* WORKAROUND: the hardcoded timeout for e_source_registry_new_sync() /* WORKAROUND: the hardcoded timeout for e_source_registry_new_sync()
(and other library calls that eventually call g_dbus_proxy_new[_sync]()) (and other library calls that eventually call g_dbus_proxy_new[_sync]())

View File

@@ -29,9 +29,32 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define CALENDAR_TYPE_SOURCES (calendar_sources_get_type ()) #define CALENDAR_TYPE_SOURCES (calendar_sources_get_type ())
G_DECLARE_FINAL_TYPE (CalendarSources, calendar_sources, #define CALENDAR_SOURCES(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CALENDAR_TYPE_SOURCES, CalendarSources))
CALENDAR, SOURCES, GObject) #define CALENDAR_SOURCES_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CALENDAR_TYPE_SOURCES, CalendarSourcesClass))
#define CALENDAR_IS_SOURCES(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CALENDAR_TYPE_SOURCES))
#define CALENDAR_IS_SOURCES_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CALENDAR_TYPE_SOURCES))
#define CALENDAR_SOURCES_GET_CLASS(o)(G_TYPE_INSTANCE_GET_CLASS ((o), CALENDAR_TYPE_SOURCES, CalendarSourcesClass))
typedef struct _CalendarSources CalendarSources;
typedef struct _CalendarSourcesClass CalendarSourcesClass;
typedef struct _CalendarSourcesPrivate CalendarSourcesPrivate;
struct _CalendarSources
{
GObject parent;
CalendarSourcesPrivate *priv;
};
struct _CalendarSourcesClass
{
GObjectClass parent_class;
void (* appointment_sources_changed) (CalendarSources *sources);
void (* task_sources_changed) (CalendarSources *sources);
};
GType calendar_sources_get_type (void) G_GNUC_CONST;
CalendarSources *calendar_sources_get (void); CalendarSources *calendar_sources_get (void);
GList *calendar_sources_get_appointment_clients (CalendarSources *sources); GList *calendar_sources_get_appointment_clients (CalendarSources *sources);
GList *calendar_sources_get_task_clients (CalendarSources *sources); GList *calendar_sources_get_task_clients (CalendarSources *sources);

View File

@@ -43,6 +43,8 @@
#define DIRECTORY_LOAD_ITEMS_PER_CALLBACK 100 #define DIRECTORY_LOAD_ITEMS_PER_CALLBACK 100
#define HIGH_SCORE_RATIO 0.10 #define HIGH_SCORE_RATIO 0.10
G_DEFINE_TYPE (ShellMimeSniffer, shell_mime_sniffer, G_TYPE_OBJECT);
enum { enum {
PROP_FILE = 1, PROP_FILE = 1,
NUM_PROPERTIES NUM_PROPERTIES
@@ -70,26 +72,16 @@ typedef struct {
gint total_items; gint total_items;
} DeepCountState; } DeepCountState;
typedef struct _ShellMimeSnifferPrivate ShellMimeSnifferPrivate;
struct _ShellMimeSniffer
{
GObject parent_instance;
ShellMimeSnifferPrivate *priv;
};
struct _ShellMimeSnifferPrivate { struct _ShellMimeSnifferPrivate {
GFile *file; GFile *file;
GCancellable *cancellable; GCancellable *cancellable;
guint watchdog_id; guint watchdog_id;
GTask *task; GSimpleAsyncResult *async_result;
gchar **sniffed_mime;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (ShellMimeSniffer, shell_mime_sniffer, G_TYPE_OBJECT);
static void deep_count_load (DeepCountState *state, static void deep_count_load (DeepCountState *state,
GFile *file); GFile *file);
@@ -187,7 +179,6 @@ prepare_async_result (DeepCountState *state)
GArray *results; GArray *results;
GPtrArray *sniffed_mime; GPtrArray *sniffed_mime;
SniffedResult result; SniffedResult result;
char **mimes;
sniffed_mime = g_ptr_array_new (); sniffed_mime = g_ptr_array_new ();
results = g_array_new (TRUE, TRUE, sizeof (SniffedResult)); results = g_array_new (TRUE, TRUE, sizeof (SniffedResult));
@@ -229,10 +220,10 @@ prepare_async_result (DeepCountState *state)
out: out:
g_ptr_array_add (sniffed_mime, NULL); g_ptr_array_add (sniffed_mime, NULL);
mimes = (gchar **) g_ptr_array_free (sniffed_mime, FALSE); self->priv->sniffed_mime = (gchar **) g_ptr_array_free (sniffed_mime, FALSE);
g_array_free (results, TRUE); g_array_free (results, TRUE);
g_task_return_pointer (self->priv->task, mimes, (GDestroyNotify)g_strfreev); g_simple_async_result_complete_in_idle (self->priv->async_result);
} }
/* adapted from nautilus/libnautilus-private/nautilus-directory-async.c */ /* adapted from nautilus/libnautilus-private/nautilus-directory-async.c */
@@ -425,17 +416,20 @@ query_info_async_ready_cb (GObject *source,
if (error != NULL) if (error != NULL)
{ {
g_task_return_error (self->priv->task, error); g_simple_async_result_take_error (self->priv->async_result,
error);
g_simple_async_result_complete_in_idle (self->priv->async_result);
return; return;
} }
if (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY) if (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY)
{ {
g_task_return_new_error (self->priv->task, g_simple_async_result_set_error (self->priv->async_result,
G_IO_ERROR, G_IO_ERROR,
G_IO_ERROR_NOT_DIRECTORY, G_IO_ERROR_NOT_DIRECTORY,
"Not a directory"); "Not a directory");
g_simple_async_result_complete_in_idle (self->priv->async_result);
return; return;
} }
@@ -481,7 +475,7 @@ shell_mime_sniffer_dispose (GObject *object)
g_clear_object (&self->priv->file); g_clear_object (&self->priv->file);
g_clear_object (&self->priv->cancellable); g_clear_object (&self->priv->cancellable);
g_clear_object (&self->priv->task); g_clear_object (&self->priv->async_result);
if (self->priv->watchdog_id != 0) if (self->priv->watchdog_id != 0)
{ {
@@ -492,6 +486,16 @@ shell_mime_sniffer_dispose (GObject *object)
G_OBJECT_CLASS (shell_mime_sniffer_parent_class)->dispose (object); G_OBJECT_CLASS (shell_mime_sniffer_parent_class)->dispose (object);
} }
static void
shell_mime_sniffer_finalize (GObject *object)
{
ShellMimeSniffer *self = SHELL_MIME_SNIFFER (object);
g_strfreev (self->priv->sniffed_mime);
G_OBJECT_CLASS (shell_mime_sniffer_parent_class)->finalize (object);
}
static void static void
shell_mime_sniffer_get_property (GObject *object, shell_mime_sniffer_get_property (GObject *object,
guint prop_id, guint prop_id,
@@ -535,6 +539,7 @@ shell_mime_sniffer_class_init (ShellMimeSnifferClass *klass)
oclass = G_OBJECT_CLASS (klass); oclass = G_OBJECT_CLASS (klass);
oclass->dispose = shell_mime_sniffer_dispose; oclass->dispose = shell_mime_sniffer_dispose;
oclass->finalize = shell_mime_sniffer_finalize;
oclass->get_property = shell_mime_sniffer_get_property; oclass->get_property = shell_mime_sniffer_get_property;
oclass->set_property = shell_mime_sniffer_set_property; oclass->set_property = shell_mime_sniffer_set_property;
@@ -545,13 +550,17 @@ shell_mime_sniffer_class_init (ShellMimeSnifferClass *klass)
G_TYPE_FILE, G_TYPE_FILE,
G_PARAM_READWRITE); G_PARAM_READWRITE);
g_type_class_add_private (klass, sizeof (ShellMimeSnifferPrivate));
g_object_class_install_properties (oclass, NUM_PROPERTIES, properties); g_object_class_install_properties (oclass, NUM_PROPERTIES, properties);
} }
static void static void
shell_mime_sniffer_init (ShellMimeSniffer *self) shell_mime_sniffer_init (ShellMimeSniffer *self)
{ {
self->priv = shell_mime_sniffer_get_instance_private (self); self->priv =
G_TYPE_INSTANCE_GET_PRIVATE (self,
SHELL_TYPE_MIME_SNIFFER,
ShellMimeSnifferPrivate);
init_mimetypes (); init_mimetypes ();
} }
@@ -569,11 +578,14 @@ shell_mime_sniffer_sniff_async (ShellMimeSniffer *self,
gpointer user_data) gpointer user_data)
{ {
g_assert (self->priv->watchdog_id == 0); g_assert (self->priv->watchdog_id == 0);
g_assert (self->priv->task == NULL); g_assert (self->priv->async_result == NULL);
self->priv->async_result =
g_simple_async_result_new (G_OBJECT (self),
callback, user_data,
shell_mime_sniffer_sniff_finish);
self->priv->cancellable = g_cancellable_new (); self->priv->cancellable = g_cancellable_new ();
self->priv->task = g_task_new (self, self->priv->cancellable,
callback, user_data);
self->priv->watchdog_id = self->priv->watchdog_id =
g_timeout_add (WATCHDOG_TIMEOUT, g_timeout_add (WATCHDOG_TIMEOUT,
@@ -588,5 +600,8 @@ shell_mime_sniffer_sniff_finish (ShellMimeSniffer *self,
GAsyncResult *res, GAsyncResult *res,
GError **error) GError **error)
{ {
return g_task_propagate_pointer (self->priv->task, error); if (g_simple_async_result_propagate_error (self->priv->async_result, error))
return NULL;
return g_strdupv (self->priv->sniffed_mime);
} }

View File

@@ -28,8 +28,29 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define SHELL_TYPE_MIME_SNIFFER (shell_mime_sniffer_get_type ()) #define SHELL_TYPE_MIME_SNIFFER (shell_mime_sniffer_get_type ())
G_DECLARE_FINAL_TYPE (ShellMimeSniffer, shell_mime_sniffer, #define SHELL_MIME_SNIFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_MIME_SNIFFER, ShellMimeSniffer))
SHELL, MIME_SNIFFER, GObject) #define SHELL_IS_MIME_SNIFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_TYPE_MIME_SNIFFER))
#define SHELL_MIME_SNIFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_MIME_SNIFFER, ShellMimeSnifferClass))
#define SHELL_IS_MIME_SNIFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_MIME_SNIFFER))
#define SHELL_MIME_SNIFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_MIME_SNIFFER, ShellMimeSnifferClass))
typedef struct _ShellMimeSniffer ShellMimeSniffer;
typedef struct _ShellMimeSnifferPrivate ShellMimeSnifferPrivate;
typedef struct _ShellMimeSnifferClass ShellMimeSnifferClass;
struct _ShellMimeSniffer
{
GObject parent_instance;
ShellMimeSnifferPrivate *priv;
};
struct _ShellMimeSnifferClass
{
GObjectClass parent_class;
};
GType shell_mime_sniffer_get_type (void) G_GNUC_CONST;
ShellMimeSniffer *shell_mime_sniffer_new (GFile *file); ShellMimeSniffer *shell_mime_sniffer_new (GFile *file);

View File

@@ -37,15 +37,6 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 }; static guint signals[LAST_SIGNAL] = { 0 };
typedef struct _ShellAppSystemPrivate ShellAppSystemPrivate;
struct _ShellAppSystem
{
GObject parent;
ShellAppSystemPrivate *priv;
};
struct _ShellAppSystemPrivate { struct _ShellAppSystemPrivate {
GHashTable *running_apps; GHashTable *running_apps;
GHashTable *id_to_app; GHashTable *id_to_app;
@@ -54,7 +45,7 @@ struct _ShellAppSystemPrivate {
static void shell_app_system_finalize (GObject *object); static void shell_app_system_finalize (GObject *object);
G_DEFINE_TYPE_WITH_PRIVATE (ShellAppSystem, shell_app_system, G_TYPE_OBJECT); G_DEFINE_TYPE(ShellAppSystem, shell_app_system, G_TYPE_OBJECT);
static void shell_app_system_class_init(ShellAppSystemClass *klass) static void shell_app_system_class_init(ShellAppSystemClass *klass)
{ {
@@ -73,9 +64,11 @@ static void shell_app_system_class_init(ShellAppSystemClass *klass)
g_signal_new ("installed-changed", g_signal_new ("installed-changed",
SHELL_TYPE_APP_SYSTEM, SHELL_TYPE_APP_SYSTEM,
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
0, G_STRUCT_OFFSET (ShellAppSystemClass, installed_changed),
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 0); G_TYPE_NONE, 0);
g_type_class_add_private (gobject_class, sizeof (ShellAppSystemPrivate));
} }
static void static void
@@ -154,7 +147,9 @@ shell_app_system_init (ShellAppSystem *self)
ShellAppSystemPrivate *priv; ShellAppSystemPrivate *priv;
GAppInfoMonitor *monitor; GAppInfoMonitor *monitor;
self->priv = priv = shell_app_system_get_instance_private (self); self->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
SHELL_TYPE_APP_SYSTEM,
ShellAppSystemPrivate);
priv->running_apps = g_hash_table_new_full (NULL, NULL, (GDestroyNotify) g_object_unref, NULL); priv->running_apps = g_hash_table_new_full (NULL, NULL, (GDestroyNotify) g_object_unref, NULL);
priv->id_to_app = g_hash_table_new_full (g_str_hash, g_str_equal, priv->id_to_app = g_hash_table_new_full (g_str_hash, g_str_equal,

View File

@@ -9,9 +9,32 @@
#include "shell-app.h" #include "shell-app.h"
#define SHELL_TYPE_APP_SYSTEM (shell_app_system_get_type ()) #define SHELL_TYPE_APP_SYSTEM (shell_app_system_get_type ())
G_DECLARE_FINAL_TYPE (ShellAppSystem, shell_app_system, #define SHELL_APP_SYSTEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_APP_SYSTEM, ShellAppSystem))
SHELL, APP_SYSTEM, GObject) #define SHELL_APP_SYSTEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_APP_SYSTEM, ShellAppSystemClass))
#define SHELL_IS_APP_SYSTEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_TYPE_APP_SYSTEM))
#define SHELL_IS_APP_SYSTEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_APP_SYSTEM))
#define SHELL_APP_SYSTEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_APP_SYSTEM, ShellAppSystemClass))
typedef struct _ShellAppSystem ShellAppSystem;
typedef struct _ShellAppSystemClass ShellAppSystemClass;
typedef struct _ShellAppSystemPrivate ShellAppSystemPrivate;
struct _ShellAppSystem
{
GObject parent;
ShellAppSystemPrivate *priv;
};
struct _ShellAppSystemClass
{
GObjectClass parent_class;
void (*installed_changed)(ShellAppSystem *appsys, gpointer user_data);
void (*favorites_changed)(ShellAppSystem *appsys, gpointer user_data);
};
GType shell_app_system_get_type (void) G_GNUC_CONST;
ShellAppSystem *shell_app_system_get_default (void); ShellAppSystem *shell_app_system_get_default (void);
ShellApp *shell_app_system_lookup_app (ShellAppSystem *system, ShellApp *shell_app_system_lookup_app (ShellAppSystem *system,

View File

@@ -7,9 +7,23 @@
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct _ShellAppUsage ShellAppUsage;
typedef struct _ShellAppUsageClass ShellAppUsageClass;
typedef struct _ShellAppUsagePrivate ShellAppUsagePrivate;
#define SHELL_TYPE_APP_USAGE (shell_app_usage_get_type ()) #define SHELL_TYPE_APP_USAGE (shell_app_usage_get_type ())
G_DECLARE_FINAL_TYPE (ShellAppUsage, shell_app_usage, #define SHELL_APP_USAGE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SHELL_TYPE_APP_USAGE, ShellAppUsage))
SHELL, APP_USAGE, GObject) #define SHELL_APP_USAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_APP_USAGE, ShellAppUsageClass))
#define SHELL_IS_APP_USAGE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SHELL_TYPE_APP_USAGE))
#define SHELL_IS_APP_USAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_APP_USAGE))
#define SHELL_APP_USAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_APP_USAGE, ShellAppUsageClass))
struct _ShellAppUsageClass
{
GObjectClass parent_class;
};
GType shell_app_usage_get_type (void) G_GNUC_CONST;
ShellAppUsage* shell_app_usage_get_default(void); ShellAppUsage* shell_app_usage_get_default(void);

View File

@@ -9,8 +9,23 @@
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct _ShellApp ShellApp;
typedef struct _ShellAppClass ShellAppClass;
typedef struct _ShellAppPrivate ShellAppPrivate;
typedef struct _ShellAppAction ShellAppAction;
#define SHELL_TYPE_APP (shell_app_get_type ()) #define SHELL_TYPE_APP (shell_app_get_type ())
G_DECLARE_FINAL_TYPE (ShellApp, shell_app, SHELL, APP, GObject) #define SHELL_APP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SHELL_TYPE_APP, ShellApp))
#define SHELL_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_APP, ShellAppClass))
#define SHELL_IS_APP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SHELL_TYPE_APP))
#define SHELL_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_APP))
#define SHELL_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_APP, ShellAppClass))
struct _ShellAppClass
{
GObjectClass parent_class;
};
typedef enum { typedef enum {
SHELL_APP_STATE_STOPPED, SHELL_APP_STATE_STOPPED,
@@ -18,6 +33,8 @@ typedef enum {
SHELL_APP_STATE_RUNNING SHELL_APP_STATE_RUNNING
} ShellAppState; } ShellAppState;
GType shell_app_get_type (void) G_GNUC_CONST;
const char *shell_app_get_id (ShellApp *app); const char *shell_app_get_id (ShellApp *app);
GDesktopAppInfo *shell_app_get_app_info (ShellApp *app); GDesktopAppInfo *shell_app_get_app_info (ShellApp *app);

View File

@@ -23,22 +23,18 @@
* - Actor is mapped [actor and all parents visible, actor in stage] * - Actor is mapped [actor and all parents visible, actor in stage]
*/ */
G_DEFINE_TYPE (ShellEmbeddedWindow, shell_embedded_window, GTK_TYPE_WINDOW);
enum { enum {
PROP_0 PROP_0
}; };
typedef struct _ShellEmbeddedWindowPrivate ShellEmbeddedWindowPrivate;
struct _ShellEmbeddedWindowPrivate { struct _ShellEmbeddedWindowPrivate {
ShellGtkEmbed *actor; ShellGtkEmbed *actor;
GdkRectangle position; GdkRectangle position;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (ShellEmbeddedWindow,
shell_embedded_window,
GTK_TYPE_WINDOW);
/* /*
* The normal gtk_window_show() starts all of the complicated asynchronous * The normal gtk_window_show() starts all of the complicated asynchronous
* window resizing code running; we don't want or need any of that. * window resizing code running; we don't want or need any of that.
@@ -51,22 +47,19 @@ static void
shell_embedded_window_show (GtkWidget *widget) shell_embedded_window_show (GtkWidget *widget)
{ {
ShellEmbeddedWindow *window = SHELL_EMBEDDED_WINDOW (widget); ShellEmbeddedWindow *window = SHELL_EMBEDDED_WINDOW (widget);
ShellEmbeddedWindowPrivate *priv;
GtkWidgetClass *widget_class; GtkWidgetClass *widget_class;
priv = shell_embedded_window_get_instance_private (window);
/* Skip GtkWindow, but run the default GtkWidget handling which /* Skip GtkWindow, but run the default GtkWidget handling which
* marks the widget visible */ * marks the widget visible */
widget_class = g_type_class_peek (GTK_TYPE_WIDGET); widget_class = g_type_class_peek (GTK_TYPE_WIDGET);
widget_class->show (widget); widget_class->show (widget);
if (priv->actor) if (window->priv->actor)
{ {
/* Size is 0x0 if the GtkWindow is not shown */ /* Size is 0x0 if the GtkWindow is not shown */
clutter_actor_queue_relayout (CLUTTER_ACTOR (priv->actor)); clutter_actor_queue_relayout (CLUTTER_ACTOR (window->priv->actor));
if (clutter_actor_is_realized (CLUTTER_ACTOR (priv->actor))) if (clutter_actor_is_realized (CLUTTER_ACTOR (window->priv->actor)))
gtk_widget_map (widget); gtk_widget_map (widget);
} }
} }
@@ -75,12 +68,9 @@ static void
shell_embedded_window_hide (GtkWidget *widget) shell_embedded_window_hide (GtkWidget *widget)
{ {
ShellEmbeddedWindow *window = SHELL_EMBEDDED_WINDOW (widget); ShellEmbeddedWindow *window = SHELL_EMBEDDED_WINDOW (widget);
ShellEmbeddedWindowPrivate *priv;
priv = shell_embedded_window_get_instance_private (window); if (window->priv->actor)
clutter_actor_queue_relayout (CLUTTER_ACTOR (window->priv->actor));
if (priv->actor)
clutter_actor_queue_relayout (CLUTTER_ACTOR (priv->actor));
GTK_WIDGET_CLASS (shell_embedded_window_parent_class)->hide (widget); GTK_WIDGET_CLASS (shell_embedded_window_parent_class)->hide (widget);
} }
@@ -100,9 +90,6 @@ static void
shell_embedded_window_check_resize (GtkContainer *container) shell_embedded_window_check_resize (GtkContainer *container)
{ {
ShellEmbeddedWindow *window = SHELL_EMBEDDED_WINDOW (container); ShellEmbeddedWindow *window = SHELL_EMBEDDED_WINDOW (container);
ShellEmbeddedWindowPrivate *priv;
priv = shell_embedded_window_get_instance_private (window);
/* Check resize is called when a resize is queued on something /* Check resize is called when a resize is queued on something
* inside the GtkWindow; we need to make sure that in response * inside the GtkWindow; we need to make sure that in response
@@ -110,8 +97,8 @@ shell_embedded_window_check_resize (GtkContainer *container)
* gtk_widget_size_allocate() are called; we defer to the Clutter * gtk_widget_size_allocate() are called; we defer to the Clutter
* logic and assume it will do the right thing. * logic and assume it will do the right thing.
*/ */
if (priv->actor) if (window->priv->actor)
clutter_actor_queue_relayout (CLUTTER_ACTOR (priv->actor)); clutter_actor_queue_relayout (CLUTTER_ACTOR (window->priv->actor));
} }
static GObject * static GObject *
@@ -147,6 +134,8 @@ shell_embedded_window_class_init (ShellEmbeddedWindowClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass); GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
g_type_class_add_private (klass, sizeof (ShellEmbeddedWindowPrivate));
object_class->constructor = shell_embedded_window_constructor; object_class->constructor = shell_embedded_window_constructor;
widget_class->show = shell_embedded_window_show; widget_class->show = shell_embedded_window_show;
@@ -159,6 +148,8 @@ shell_embedded_window_class_init (ShellEmbeddedWindowClass *klass)
static void static void
shell_embedded_window_init (ShellEmbeddedWindow *window) shell_embedded_window_init (ShellEmbeddedWindow *window)
{ {
window->priv = G_TYPE_INSTANCE_GET_PRIVATE (window, SHELL_TYPE_EMBEDDED_WINDOW,
ShellEmbeddedWindowPrivate);
} }
/* /*
@@ -170,12 +161,9 @@ _shell_embedded_window_set_actor (ShellEmbeddedWindow *window,
ShellGtkEmbed *actor) ShellGtkEmbed *actor)
{ {
ShellEmbeddedWindowPrivate *priv;
g_return_if_fail (SHELL_IS_EMBEDDED_WINDOW (window)); g_return_if_fail (SHELL_IS_EMBEDDED_WINDOW (window));
priv = shell_embedded_window_get_instance_private (window); window->priv->actor = actor;
priv->actor = actor;
if (actor && if (actor &&
clutter_actor_is_mapped (CLUTTER_ACTOR (actor)) && clutter_actor_is_mapped (CLUTTER_ACTOR (actor)) &&
@@ -190,23 +178,20 @@ _shell_embedded_window_allocate (ShellEmbeddedWindow *window,
int width, int width,
int height) int height)
{ {
ShellEmbeddedWindowPrivate *priv;
GtkAllocation allocation; GtkAllocation allocation;
g_return_if_fail (SHELL_IS_EMBEDDED_WINDOW (window)); g_return_if_fail (SHELL_IS_EMBEDDED_WINDOW (window));
priv = shell_embedded_window_get_instance_private (window); if (window->priv->position.x == x &&
window->priv->position.y == y &&
if (priv->position.x == x && window->priv->position.width == width &&
priv->position.y == y && window->priv->position.height == height)
priv->position.width == width &&
priv->position.height == height)
return; return;
priv->position.x = x; window->priv->position.x = x;
priv->position.y = y; window->priv->position.y = y;
priv->position.width = width; window->priv->position.width = width;
priv->position.height = height; window->priv->position.height = height;
if (gtk_widget_get_realized (GTK_WIDGET (window))) if (gtk_widget_get_realized (GTK_WIDGET (window)))
gdk_window_move_resize (gtk_widget_get_window (GTK_WIDGET (window)), gdk_window_move_resize (gtk_widget_get_window (GTK_WIDGET (window)),

View File

@@ -6,14 +6,30 @@
#include <clutter/clutter.h> #include <clutter/clutter.h>
#define SHELL_TYPE_EMBEDDED_WINDOW (shell_embedded_window_get_type ()) #define SHELL_TYPE_EMBEDDED_WINDOW (shell_embedded_window_get_type ())
G_DECLARE_DERIVABLE_TYPE (ShellEmbeddedWindow, shell_embedded_window, #define SHELL_EMBEDDED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_EMBEDDED_WINDOW, ShellEmbeddedWindow))
SHELL, EMBEDDED_WINDOW, GtkWindow) #define SHELL_EMBEDDED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_EMBEDDED_WINDOW, ShellEmbeddedWindowClass))
#define SHELL_IS_EMBEDDED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_TYPE_EMBEDDED_WINDOW))
#define SHELL_IS_EMBEDDED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_EMBEDDED_WINDOW))
#define SHELL_EMBEDDED_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_EMBEDDED_WINDOW, ShellEmbeddedWindowClass))
typedef struct _ShellEmbeddedWindow ShellEmbeddedWindow;
typedef struct _ShellEmbeddedWindowClass ShellEmbeddedWindowClass;
typedef struct _ShellEmbeddedWindowPrivate ShellEmbeddedWindowPrivate;
struct _ShellEmbeddedWindow
{
GtkWindow parent;
ShellEmbeddedWindowPrivate *priv;
};
struct _ShellEmbeddedWindowClass struct _ShellEmbeddedWindowClass
{ {
GtkWindowClass parent_class; GtkWindowClass parent_class;
}; };
GType shell_embedded_window_get_type (void) G_GNUC_CONST;
GtkWidget *shell_embedded_window_new (void); GtkWidget *shell_embedded_window_new (void);
#endif /* __SHELL_EMBEDDED_WINDOW_H__ */ #endif /* __SHELL_EMBEDDED_WINDOW_H__ */

View File

@@ -23,26 +23,16 @@
static void shell_generic_container_iface_init (ClutterContainerIface *iface); static void shell_generic_container_iface_init (ClutterContainerIface *iface);
typedef struct _ShellGenericContainerPrivate ShellGenericContainerPrivate; G_DEFINE_TYPE_WITH_CODE(ShellGenericContainer,
shell_generic_container,
struct _ShellGenericContainer ST_TYPE_WIDGET,
{ G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER,
StWidget parent; shell_generic_container_iface_init));
ShellGenericContainerPrivate *priv;
};
struct _ShellGenericContainerPrivate { struct _ShellGenericContainerPrivate {
GHashTable *skip_paint; GHashTable *skip_paint;
}; };
G_DEFINE_TYPE_WITH_CODE(ShellGenericContainer,
shell_generic_container,
ST_TYPE_WIDGET,
G_ADD_PRIVATE (ShellGenericContainer)
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER,
shell_generic_container_iface_init));
/* Signals */ /* Signals */
enum enum
{ {
@@ -395,6 +385,8 @@ shell_generic_container_class_init (ShellGenericContainerClass *klass)
0, 0,
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 2, CLUTTER_TYPE_ACTOR_BOX, CLUTTER_TYPE_ALLOCATION_FLAGS); G_TYPE_NONE, 2, CLUTTER_TYPE_ACTOR_BOX, CLUTTER_TYPE_ALLOCATION_FLAGS);
g_type_class_add_private (gobject_class, sizeof (ShellGenericContainerPrivate));
} }
static void static void
@@ -415,7 +407,8 @@ shell_generic_container_iface_init (ClutterContainerIface *iface)
static void static void
shell_generic_container_init (ShellGenericContainer *area) shell_generic_container_init (ShellGenericContainer *area)
{ {
area->priv = shell_generic_container_get_instance_private (area); area->priv = G_TYPE_INSTANCE_GET_PRIVATE (area, SHELL_TYPE_GENERIC_CONTAINER,
ShellGenericContainerPrivate);
area->priv->skip_paint = g_hash_table_new (NULL, NULL); area->priv->skip_paint = g_hash_table_new (NULL, NULL);
} }

View File

@@ -5,8 +5,11 @@
#include "st.h" #include "st.h"
#define SHELL_TYPE_GENERIC_CONTAINER (shell_generic_container_get_type ()) #define SHELL_TYPE_GENERIC_CONTAINER (shell_generic_container_get_type ())
G_DECLARE_FINAL_TYPE (ShellGenericContainer, shell_generic_container, #define SHELL_GENERIC_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_GENERIC_CONTAINER, ShellGenericContainer))
SHELL, GENERIC_CONTAINER, StWidget) #define SHELL_GENERIC_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_GENERIC_CONTAINER, ShellGenericContainerClass))
#define SHELL_IS_GENERIC_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_TYPE_GENERIC_CONTAINER))
#define SHELL_IS_GENERIC_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_GENERIC_CONTAINER))
#define SHELL_GENERIC_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_GENERIC_CONTAINER, ShellGenericContainerClass))
typedef struct { typedef struct {
float min_size; float min_size;
@@ -19,6 +22,25 @@ typedef struct {
#define SHELL_TYPE_GENERIC_CONTAINER_ALLOCATION (shell_generic_container_allocation_get_type ()) #define SHELL_TYPE_GENERIC_CONTAINER_ALLOCATION (shell_generic_container_allocation_get_type ())
GType shell_generic_container_allocation_get_type (void); GType shell_generic_container_allocation_get_type (void);
typedef struct _ShellGenericContainer ShellGenericContainer;
typedef struct _ShellGenericContainerClass ShellGenericContainerClass;
typedef struct _ShellGenericContainerPrivate ShellGenericContainerPrivate;
struct _ShellGenericContainer
{
StWidget parent;
ShellGenericContainerPrivate *priv;
};
struct _ShellGenericContainerClass
{
StWidgetClass parent_class;
};
GType shell_generic_container_get_type (void) G_GNUC_CONST;
guint shell_generic_container_get_n_skip_paint (ShellGenericContainer *self); guint shell_generic_container_get_n_skip_paint (ShellGenericContainer *self);
gboolean shell_generic_container_get_skip_paint (ShellGenericContainer *self, gboolean shell_generic_container_get_skip_paint (ShellGenericContainer *self,

View File

@@ -10,8 +10,22 @@
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct _ShellGlobal ShellGlobal;
typedef struct _ShellGlobalClass ShellGlobalClass;
#define SHELL_TYPE_GLOBAL (shell_global_get_type ()) #define SHELL_TYPE_GLOBAL (shell_global_get_type ())
G_DECLARE_FINAL_TYPE (ShellGlobal, shell_global, SHELL, GLOBAL, GObject) #define SHELL_GLOBAL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SHELL_TYPE_GLOBAL, ShellGlobal))
#define SHELL_GLOBAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_GLOBAL, ShellGlobalClass))
#define SHELL_IS_GLOBAL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SHELL_TYPE_GLOBAL))
#define SHELL_IS_GLOBAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_GLOBAL))
#define SHELL_GLOBAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_GLOBAL, ShellGlobalClass))
struct _ShellGlobalClass
{
GObjectClass parent_class;
};
GType shell_global_get_type (void) G_GNUC_CONST;
ShellGlobal *shell_global_get (void); ShellGlobal *shell_global_get (void);

View File

@@ -16,14 +16,13 @@
#include <cogl/cogl.h> #include <cogl/cogl.h>
#include "shell-glsl-quad.h" #include "shell-glsl-quad.h"
typedef struct _ShellGLSLQuadPrivate ShellGLSLQuadPrivate; G_DEFINE_TYPE (ShellGLSLQuad, shell_glsl_quad, CLUTTER_TYPE_ACTOR);
struct _ShellGLSLQuadPrivate struct _ShellGLSLQuadPrivate
{ {
CoglPipeline *pipeline; CoglPipeline *pipeline;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (ShellGLSLQuad, shell_glsl_quad, CLUTTER_TYPE_ACTOR);
static gboolean static gboolean
shell_glsl_quad_get_paint_volume (ClutterActor *actor, shell_glsl_quad_get_paint_volume (ClutterActor *actor,
ClutterPaintVolume *volume) ClutterPaintVolume *volume)
@@ -39,7 +38,7 @@ shell_glsl_quad_paint (ClutterActor *actor)
guint8 paint_opacity; guint8 paint_opacity;
ClutterActorBox box; ClutterActorBox box;
priv = shell_glsl_quad_get_instance_private (self); priv = self->priv;
paint_opacity = clutter_actor_get_paint_opacity (actor); paint_opacity = clutter_actor_get_paint_opacity (actor);
clutter_actor_get_allocation_box (actor, &box); clutter_actor_get_allocation_box (actor, &box);
@@ -107,7 +106,7 @@ shell_glsl_quad_dispose (GObject *gobject)
ShellGLSLQuad *self = SHELL_GLSL_QUAD (gobject); ShellGLSLQuad *self = SHELL_GLSL_QUAD (gobject);
ShellGLSLQuadPrivate *priv; ShellGLSLQuadPrivate *priv;
priv = shell_glsl_quad_get_instance_private (self); priv = self->priv;
g_clear_pointer (&priv->pipeline, cogl_object_unref); g_clear_pointer (&priv->pipeline, cogl_object_unref);
@@ -117,6 +116,7 @@ shell_glsl_quad_dispose (GObject *gobject)
static void static void
shell_glsl_quad_init (ShellGLSLQuad *quad) shell_glsl_quad_init (ShellGLSLQuad *quad)
{ {
quad->priv = G_TYPE_INSTANCE_GET_PRIVATE (quad, SHELL_TYPE_GLSL_QUAD, ShellGLSLQuadPrivate);
} }
static void static void
@@ -124,7 +124,6 @@ shell_glsl_quad_constructed (GObject *object)
{ {
ShellGLSLQuad *self; ShellGLSLQuad *self;
ShellGLSLQuadClass *klass; ShellGLSLQuadClass *klass;
ShellGLSLQuadPrivate *priv;
CoglContext *ctx = CoglContext *ctx =
clutter_backend_get_cogl_context (clutter_get_default_backend ()); clutter_backend_get_cogl_context (clutter_get_default_backend ());
@@ -136,7 +135,6 @@ shell_glsl_quad_constructed (GObject *object)
*/ */
klass = SHELL_GLSL_QUAD_GET_CLASS (object); klass = SHELL_GLSL_QUAD_GET_CLASS (object);
self = SHELL_GLSL_QUAD (object); self = SHELL_GLSL_QUAD (object);
priv = shell_glsl_quad_get_instance_private (self);
if (G_UNLIKELY (klass->base_pipeline == NULL)) if (G_UNLIKELY (klass->base_pipeline == NULL))
{ {
@@ -147,9 +145,9 @@ shell_glsl_quad_constructed (GObject *object)
klass->build_pipeline (self); klass->build_pipeline (self);
} }
priv->pipeline = cogl_pipeline_copy (klass->base_pipeline); self->priv->pipeline = cogl_pipeline_copy (klass->base_pipeline);
cogl_pipeline_set_layer_null_texture (priv->pipeline, 0, COGL_TEXTURE_TYPE_2D); cogl_pipeline_set_layer_null_texture (self->priv->pipeline, 0, COGL_TEXTURE_TYPE_2D);
} }
static void static void
@@ -163,6 +161,8 @@ shell_glsl_quad_class_init (ShellGLSLQuadClass *klass)
actor_class->get_paint_volume = shell_glsl_quad_get_paint_volume; actor_class->get_paint_volume = shell_glsl_quad_get_paint_volume;
actor_class->paint = shell_glsl_quad_paint; actor_class->paint = shell_glsl_quad_paint;
g_type_class_add_private (klass, sizeof (ShellGLSLQuadPrivate));
} }
/** /**
@@ -177,8 +177,7 @@ int
shell_glsl_quad_get_uniform_location (ShellGLSLQuad *quad, shell_glsl_quad_get_uniform_location (ShellGLSLQuad *quad,
const char *name) const char *name)
{ {
ShellGLSLQuadPrivate *priv = shell_glsl_quad_get_instance_private (quad); return cogl_pipeline_get_uniform_location (quad->priv->pipeline, name);
return cogl_pipeline_get_uniform_location (priv->pipeline, name);
} }
/** /**
@@ -196,8 +195,7 @@ shell_glsl_quad_set_uniform_float (ShellGLSLQuad *quad,
int total_count, int total_count,
const float *value) const float *value)
{ {
ShellGLSLQuadPrivate *priv = shell_glsl_quad_get_instance_private (quad); cogl_pipeline_set_uniform_float (quad->priv->pipeline, uniform,
cogl_pipeline_set_uniform_float (priv->pipeline, uniform,
n_components, total_count / n_components, n_components, total_count / n_components,
value); value);
} }

View File

@@ -27,8 +27,22 @@ typedef enum {
} ShellSnippetHook; } ShellSnippetHook;
#define SHELL_TYPE_GLSL_QUAD (shell_glsl_quad_get_type ()) #define SHELL_TYPE_GLSL_QUAD (shell_glsl_quad_get_type ())
G_DECLARE_DERIVABLE_TYPE (ShellGLSLQuad, shell_glsl_quad, #define SHELL_GLSL_QUAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_GLSL_QUAD, ShellGLSLQuad))
SHELL, GLSL_QUAD, ClutterActor) #define SHELL_GLSL_QUAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_GLSL_QUAD, ShellGLSLQuadClass))
#define SHELL_IS_GLSL_QUAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_TYPE_GLSL_QUAD))
#define SHELL_IS_GLSL_QUAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_GLSL_QUAD))
#define SHELL_GLSL_QUAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_GLSL_QUAD, ShellGLSLQuadClass))
typedef struct _ShellGLSLQuad ShellGLSLQuad;
typedef struct _ShellGLSLQuadClass ShellGLSLQuadClass;
typedef struct _ShellGLSLQuadPrivate ShellGLSLQuadPrivate;
struct _ShellGLSLQuad
{
ClutterActor parent;
ShellGLSLQuadPrivate *priv;
};
struct _ShellGLSLQuadClass struct _ShellGLSLQuadClass
{ {
@@ -39,6 +53,8 @@ struct _ShellGLSLQuadClass
void (*build_pipeline) (ShellGLSLQuad *effect); void (*build_pipeline) (ShellGLSLQuad *effect);
}; };
GType shell_glsl_quad_get_type (void) G_GNUC_CONST;
void shell_glsl_quad_add_glsl_snippet (ShellGLSLQuad *quad, void shell_glsl_quad_add_glsl_snippet (ShellGLSLQuad *quad,
ShellSnippetHook hook, ShellSnippetHook hook,
const char *declarations, const char *declarations,

View File

@@ -15,8 +15,6 @@ enum {
PROP_WINDOW PROP_WINDOW
}; };
typedef struct _ShellGtkEmbedPrivate ShellGtkEmbedPrivate;
struct _ShellGtkEmbedPrivate struct _ShellGtkEmbedPrivate
{ {
ShellEmbeddedWindow *window; ShellEmbeddedWindow *window;
@@ -27,7 +25,7 @@ struct _ShellGtkEmbedPrivate
guint window_created_handler; guint window_created_handler;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (ShellGtkEmbed, shell_gtk_embed, CLUTTER_TYPE_CLONE); G_DEFINE_TYPE (ShellGtkEmbed, shell_gtk_embed, CLUTTER_TYPE_CLONE);
static void shell_gtk_embed_set_window (ShellGtkEmbed *embed, static void shell_gtk_embed_set_window (ShellGtkEmbed *embed,
ShellEmbeddedWindow *window); ShellEmbeddedWindow *window);
@@ -42,7 +40,7 @@ shell_gtk_embed_on_window_destroy (GtkWidget *object,
static void static void
shell_gtk_embed_remove_window_actor (ShellGtkEmbed *embed) shell_gtk_embed_remove_window_actor (ShellGtkEmbed *embed)
{ {
ShellGtkEmbedPrivate *priv = shell_gtk_embed_get_instance_private (embed); ShellGtkEmbedPrivate *priv = embed->priv;
if (priv->window_actor) if (priv->window_actor)
{ {
@@ -62,7 +60,7 @@ shell_gtk_embed_window_created_cb (MetaDisplay *display,
MetaWindow *window, MetaWindow *window,
ShellGtkEmbed *embed) ShellGtkEmbed *embed)
{ {
ShellGtkEmbedPrivate *priv = shell_gtk_embed_get_instance_private (embed); ShellGtkEmbedPrivate *priv = embed->priv;
Window xwindow = meta_window_get_xwindow (window); Window xwindow = meta_window_get_xwindow (window);
GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (priv->window)); GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (priv->window));
@@ -121,12 +119,11 @@ static void
shell_gtk_embed_on_window_mapped (GtkWidget *object, shell_gtk_embed_on_window_mapped (GtkWidget *object,
ShellGtkEmbed *embed) ShellGtkEmbed *embed)
{ {
ShellGtkEmbedPrivate *priv = shell_gtk_embed_get_instance_private (embed);
MetaDisplay *display = shell_global_get_display (shell_global_get ()); MetaDisplay *display = shell_global_get_display (shell_global_get ());
/* Listen for new windows so we can detect when Mutter has /* Listen for new windows so we can detect when Mutter has
created a MutterWindow for this window */ created a MutterWindow for this window */
priv->window_created_handler = embed->priv->window_created_handler =
g_signal_connect (display, g_signal_connect (display,
"window-created", "window-created",
G_CALLBACK (shell_gtk_embed_window_created_cb), G_CALLBACK (shell_gtk_embed_window_created_cb),
@@ -137,45 +134,44 @@ static void
shell_gtk_embed_set_window (ShellGtkEmbed *embed, shell_gtk_embed_set_window (ShellGtkEmbed *embed,
ShellEmbeddedWindow *window) ShellEmbeddedWindow *window)
{ {
ShellGtkEmbedPrivate *priv = shell_gtk_embed_get_instance_private (embed);
MetaDisplay *display = shell_global_get_display (shell_global_get ()); MetaDisplay *display = shell_global_get_display (shell_global_get ());
if (priv->window) if (embed->priv->window)
{ {
if (priv->window_created_handler) if (embed->priv->window_created_handler)
{ {
g_signal_handler_disconnect (display, g_signal_handler_disconnect (display,
priv->window_created_handler); embed->priv->window_created_handler);
priv->window_created_handler = 0; embed->priv->window_created_handler = 0;
} }
shell_gtk_embed_remove_window_actor (embed); shell_gtk_embed_remove_window_actor (embed);
_shell_embedded_window_set_actor (priv->window, NULL); _shell_embedded_window_set_actor (embed->priv->window, NULL);
g_object_unref (priv->window); g_object_unref (embed->priv->window);
g_signal_handlers_disconnect_by_func (priv->window, g_signal_handlers_disconnect_by_func (embed->priv->window,
(gpointer)shell_gtk_embed_on_window_destroy, (gpointer)shell_gtk_embed_on_window_destroy,
embed); embed);
g_signal_handlers_disconnect_by_func (priv->window, g_signal_handlers_disconnect_by_func (embed->priv->window,
(gpointer)shell_gtk_embed_on_window_mapped, (gpointer)shell_gtk_embed_on_window_mapped,
embed); embed);
} }
priv->window = window; embed->priv->window = window;
if (priv->window) if (embed->priv->window)
{ {
g_object_ref (priv->window); g_object_ref (embed->priv->window);
_shell_embedded_window_set_actor (priv->window, embed); _shell_embedded_window_set_actor (embed->priv->window, embed);
g_signal_connect (priv->window, "destroy", g_signal_connect (embed->priv->window, "destroy",
G_CALLBACK (shell_gtk_embed_on_window_destroy), embed); G_CALLBACK (shell_gtk_embed_on_window_destroy), embed);
g_signal_connect (priv->window, "map", g_signal_connect (embed->priv->window, "map",
G_CALLBACK (shell_gtk_embed_on_window_mapped), embed); G_CALLBACK (shell_gtk_embed_on_window_mapped), embed);
} }
@@ -209,12 +205,11 @@ shell_gtk_embed_get_property (GObject *object,
GParamSpec *pspec) GParamSpec *pspec)
{ {
ShellGtkEmbed *embed = SHELL_GTK_EMBED (object); ShellGtkEmbed *embed = SHELL_GTK_EMBED (object);
ShellGtkEmbedPrivate *priv = shell_gtk_embed_get_instance_private (embed);
switch (prop_id) switch (prop_id)
{ {
case PROP_WINDOW: case PROP_WINDOW:
g_value_set_object (value, priv->window); g_value_set_object (value, embed->priv->window);
break; break;
default: default:
@@ -230,13 +225,12 @@ shell_gtk_embed_get_preferred_width (ClutterActor *actor,
float *natural_width_p) float *natural_width_p)
{ {
ShellGtkEmbed *embed = SHELL_GTK_EMBED (actor); ShellGtkEmbed *embed = SHELL_GTK_EMBED (actor);
ShellGtkEmbedPrivate *priv = shell_gtk_embed_get_instance_private (embed);
if (priv->window if (embed->priv->window
&& gtk_widget_get_visible (GTK_WIDGET (priv->window))) && gtk_widget_get_visible (GTK_WIDGET (embed->priv->window)))
{ {
GtkRequisition min_req, natural_req; GtkRequisition min_req, natural_req;
gtk_widget_get_preferred_size (GTK_WIDGET (priv->window), &min_req, &natural_req); gtk_widget_get_preferred_size (GTK_WIDGET (embed->priv->window), &min_req, &natural_req);
*min_width_p = min_req.width; *min_width_p = min_req.width;
*natural_width_p = natural_req.width; *natural_width_p = natural_req.width;
@@ -252,13 +246,12 @@ shell_gtk_embed_get_preferred_height (ClutterActor *actor,
float *natural_height_p) float *natural_height_p)
{ {
ShellGtkEmbed *embed = SHELL_GTK_EMBED (actor); ShellGtkEmbed *embed = SHELL_GTK_EMBED (actor);
ShellGtkEmbedPrivate *priv = shell_gtk_embed_get_instance_private (embed);
if (priv->window if (embed->priv->window
&& gtk_widget_get_visible (GTK_WIDGET (priv->window))) && gtk_widget_get_visible (GTK_WIDGET (embed->priv->window)))
{ {
GtkRequisition min_req, natural_req; GtkRequisition min_req, natural_req;
gtk_widget_get_preferred_size (GTK_WIDGET (priv->window), &min_req, &natural_req); gtk_widget_get_preferred_size (GTK_WIDGET (embed->priv->window), &min_req, &natural_req);
*min_height_p = min_req.height; *min_height_p = min_req.height;
*natural_height_p = natural_req.height; *natural_height_p = natural_req.height;
@@ -273,7 +266,6 @@ shell_gtk_embed_allocate (ClutterActor *actor,
ClutterAllocationFlags flags) ClutterAllocationFlags flags)
{ {
ShellGtkEmbed *embed = SHELL_GTK_EMBED (actor); ShellGtkEmbed *embed = SHELL_GTK_EMBED (actor);
ShellGtkEmbedPrivate *priv = shell_gtk_embed_get_instance_private (embed);
float wx = 0.0, wy = 0.0, x, y, ax, ay; float wx = 0.0, wy = 0.0, x, y, ax, ay;
CLUTTER_ACTOR_CLASS (shell_gtk_embed_parent_class)-> CLUTTER_ACTOR_CLASS (shell_gtk_embed_parent_class)->
@@ -293,7 +285,7 @@ shell_gtk_embed_allocate (ClutterActor *actor,
actor = clutter_actor_get_parent (actor); actor = clutter_actor_get_parent (actor);
} }
_shell_embedded_window_allocate (priv->window, _shell_embedded_window_allocate (embed->priv->window,
(int)(0.5 + wx), (int)(0.5 + wy), (int)(0.5 + wx), (int)(0.5 + wy),
box->x2 - box->x1, box->x2 - box->x1,
box->y2 - box->y1); box->y2 - box->y1);
@@ -303,9 +295,8 @@ static void
shell_gtk_embed_map (ClutterActor *actor) shell_gtk_embed_map (ClutterActor *actor)
{ {
ShellGtkEmbed *embed = SHELL_GTK_EMBED (actor); ShellGtkEmbed *embed = SHELL_GTK_EMBED (actor);
ShellGtkEmbedPrivate *priv = shell_gtk_embed_get_instance_private (embed);
_shell_embedded_window_map (priv->window); _shell_embedded_window_map (embed->priv->window);
CLUTTER_ACTOR_CLASS (shell_gtk_embed_parent_class)->map (actor); CLUTTER_ACTOR_CLASS (shell_gtk_embed_parent_class)->map (actor);
} }
@@ -314,9 +305,8 @@ static void
shell_gtk_embed_unmap (ClutterActor *actor) shell_gtk_embed_unmap (ClutterActor *actor)
{ {
ShellGtkEmbed *embed = SHELL_GTK_EMBED (actor); ShellGtkEmbed *embed = SHELL_GTK_EMBED (actor);
ShellGtkEmbedPrivate *priv = shell_gtk_embed_get_instance_private (embed);
_shell_embedded_window_unmap (priv->window); _shell_embedded_window_unmap (embed->priv->window);
CLUTTER_ACTOR_CLASS (shell_gtk_embed_parent_class)->unmap (actor); CLUTTER_ACTOR_CLASS (shell_gtk_embed_parent_class)->unmap (actor);
} }
@@ -337,6 +327,8 @@ shell_gtk_embed_class_init (ShellGtkEmbedClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
g_type_class_add_private (klass, sizeof (ShellGtkEmbedPrivate));
object_class->get_property = shell_gtk_embed_get_property; object_class->get_property = shell_gtk_embed_get_property;
object_class->set_property = shell_gtk_embed_set_property; object_class->set_property = shell_gtk_embed_set_property;
object_class->dispose = shell_gtk_embed_dispose; object_class->dispose = shell_gtk_embed_dispose;
@@ -359,6 +351,8 @@ shell_gtk_embed_class_init (ShellGtkEmbedClass *klass)
static void static void
shell_gtk_embed_init (ShellGtkEmbed *embed) shell_gtk_embed_init (ShellGtkEmbed *embed)
{ {
embed->priv = G_TYPE_INSTANCE_GET_PRIVATE (embed, SHELL_TYPE_GTK_EMBED,
ShellGtkEmbedPrivate);
} }
/* /*

View File

@@ -7,14 +7,29 @@
#include "shell-embedded-window.h" #include "shell-embedded-window.h"
#define SHELL_TYPE_GTK_EMBED (shell_gtk_embed_get_type ()) #define SHELL_TYPE_GTK_EMBED (shell_gtk_embed_get_type ())
G_DECLARE_DERIVABLE_TYPE (ShellGtkEmbed, shell_gtk_embed, #define SHELL_GTK_EMBED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_GTK_EMBED, ShellGtkEmbed))
SHELL, GTK_EMBED, ClutterClone) #define SHELL_GTK_EMBED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_GTK_EMBED, ShellGtkEmbedClass))
#define SHELL_IS_GTK_EMBED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_TYPE_GTK_EMBED))
#define SHELL_IS_GTK_EMBED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_GTK_EMBED))
#define SHELL_GTK_EMBED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_GTK_EMBED, ShellGtkEmbedClass))
typedef struct _ShellGtkEmbed ShellGtkEmbed;
typedef struct _ShellGtkEmbedClass ShellGtkEmbedClass;
typedef struct _ShellGtkEmbedPrivate ShellGtkEmbedPrivate;
struct _ShellGtkEmbed
{
ClutterClone parent;
ShellGtkEmbedPrivate *priv;
};
struct _ShellGtkEmbedClass struct _ShellGtkEmbedClass
{ {
ClutterCloneClass parent_class; ClutterCloneClass parent_class;
}; };
GType shell_gtk_embed_get_type (void) G_GNUC_CONST;
ClutterActor *shell_gtk_embed_new (ShellEmbeddedWindow *window); ClutterActor *shell_gtk_embed_new (ShellEmbeddedWindow *window);
#endif /* __SHELL_GTK_EMBED_H__ */ #endif /* __SHELL_GTK_EMBED_H__ */

View File

@@ -32,6 +32,7 @@
#include <string.h> #include <string.h>
typedef struct _ShellPasswordPromptClass ShellPasswordPromptClass;
typedef struct _ShellPasswordPromptPrivate ShellPasswordPromptPrivate; typedef struct _ShellPasswordPromptPrivate ShellPasswordPromptPrivate;
typedef enum typedef enum
@@ -56,13 +57,19 @@ struct _ShellKeyringPrompt
gchar *continue_label; gchar *continue_label;
gchar *cancel_label; gchar *cancel_label;
GTask *task; GcrPromptReply last_reply;
GSimpleAsyncResult *async_result;
ClutterText *password_actor; ClutterText *password_actor;
ClutterText *confirm_actor; ClutterText *confirm_actor;
PromptingMode mode; PromptingMode mode;
gboolean shown; gboolean shown;
}; };
typedef struct _ShellKeyringPromptClass
{
GObjectClass parent_class;
} ShellKeyringPromptClass;
enum { enum {
PROP_0, PROP_0,
PROP_TITLE, PROP_TITLE,
@@ -281,9 +288,9 @@ shell_keyring_prompt_dispose (GObject *obj)
if (self->shown) if (self->shown)
gcr_prompt_close (GCR_PROMPT (self)); gcr_prompt_close (GCR_PROMPT (self));
if (self->task) if (self->async_result)
shell_keyring_prompt_cancel (self); shell_keyring_prompt_cancel (self);
g_assert (self->task == NULL); g_assert (self->async_result == NULL);
shell_keyring_prompt_set_password_actor (self, NULL); shell_keyring_prompt_set_password_actor (self, NULL);
shell_keyring_prompt_set_confirm_actor (self, NULL); shell_keyring_prompt_set_confirm_actor (self, NULL);
@@ -413,14 +420,14 @@ shell_keyring_prompt_password_async (GcrPrompt *prompt,
ShellKeyringPrompt *self = SHELL_KEYRING_PROMPT (prompt); ShellKeyringPrompt *self = SHELL_KEYRING_PROMPT (prompt);
GObject *obj; GObject *obj;
if (self->task != NULL) { if (self->async_result != NULL) {
g_warning ("this prompt can only show one prompt at a time"); g_warning ("this prompt can only show one prompt at a time");
return; return;
} }
self->mode = PROMPTING_FOR_PASSWORD; self->mode = PROMPTING_FOR_PASSWORD;
self->task = g_task_new (self, NULL, callback, user_data); self->async_result = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
g_task_set_source_tag (self->task, shell_keyring_prompt_password_async); shell_keyring_prompt_password_async);
obj = G_OBJECT (self); obj = G_OBJECT (self);
g_object_notify (obj, "password-visible"); g_object_notify (obj, "password-visible");
@@ -437,11 +444,18 @@ shell_keyring_prompt_password_finish (GcrPrompt *prompt,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
g_return_val_if_fail (g_task_get_source_object (G_TASK (result)) == prompt, NULL); ShellKeyringPrompt *self = SHELL_KEYRING_PROMPT (prompt);
g_return_val_if_fail (g_async_result_is_tagged (result,
g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (prompt),
shell_keyring_prompt_password_async), NULL); shell_keyring_prompt_password_async), NULL);
return g_task_propagate_pointer (G_TASK (result), error); if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error))
return NULL;
if (self->last_reply == GCR_PROMPT_REPLY_CONTINUE)
return clutter_text_get_text (self->password_actor);
return NULL;
} }
static void static void
@@ -453,14 +467,14 @@ shell_keyring_prompt_confirm_async (GcrPrompt *prompt,
ShellKeyringPrompt *self = SHELL_KEYRING_PROMPT (prompt); ShellKeyringPrompt *self = SHELL_KEYRING_PROMPT (prompt);
GObject *obj; GObject *obj;
if (self->task != NULL) { if (self->async_result != NULL) {
g_warning ("this prompt is already prompting"); g_warning ("this prompt is already prompting");
return; return;
} }
self->mode = PROMPTING_FOR_CONFIRM; self->mode = PROMPTING_FOR_CONFIRM;
self->task = g_task_new (self, NULL, callback, user_data); self->async_result = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
g_task_set_source_tag (self->task, shell_keyring_prompt_confirm_async); shell_keyring_prompt_confirm_async);
obj = G_OBJECT (self); obj = G_OBJECT (self);
g_object_notify (obj, "password-visible"); g_object_notify (obj, "password-visible");
@@ -477,16 +491,15 @@ shell_keyring_prompt_confirm_finish (GcrPrompt *prompt,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GTask *task = G_TASK (result); ShellKeyringPrompt *self = SHELL_KEYRING_PROMPT (prompt);
gssize res;
g_return_val_if_fail (g_task_get_source_object (task) == prompt, g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (prompt),
GCR_PROMPT_REPLY_CANCEL);
g_return_val_if_fail (g_async_result_is_tagged (result,
shell_keyring_prompt_confirm_async), GCR_PROMPT_REPLY_CANCEL); shell_keyring_prompt_confirm_async), GCR_PROMPT_REPLY_CANCEL);
res = g_task_propagate_int (task, error); if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error))
return res == -1 ? GCR_PROMPT_REPLY_CANCEL : (GcrPromptReply)res; return GCR_PROMPT_REPLY_CANCEL;
return self->last_reply;
} }
static void static void
@@ -705,20 +718,19 @@ shell_keyring_prompt_set_confirm_actor (ShellKeyringPrompt *self,
gboolean gboolean
shell_keyring_prompt_complete (ShellKeyringPrompt *self) shell_keyring_prompt_complete (ShellKeyringPrompt *self)
{ {
GTask *res; GSimpleAsyncResult *res;
PromptingMode mode;
const gchar *password; const gchar *password;
const gchar *confirm; const gchar *confirm;
const gchar *env; const gchar *env;
g_return_val_if_fail (SHELL_IS_KEYRING_PROMPT (self), FALSE); g_return_val_if_fail (SHELL_IS_KEYRING_PROMPT (self), FALSE);
g_return_val_if_fail (self->mode != PROMPTING_NONE, FALSE); g_return_val_if_fail (self->mode != PROMPTING_NONE, FALSE);
g_return_val_if_fail (self->task != NULL, FALSE); g_return_val_if_fail (self->async_result != NULL, FALSE);
password = clutter_text_get_text (self->password_actor);
if (self->mode == PROMPTING_FOR_PASSWORD) if (self->mode == PROMPTING_FOR_PASSWORD)
{ {
password = clutter_text_get_text (self->password_actor);
/* Is it a new password? */ /* Is it a new password? */
if (self->password_new) if (self->password_new)
{ {
@@ -744,15 +756,13 @@ shell_keyring_prompt_complete (ShellKeyringPrompt *self)
g_object_notify (G_OBJECT (self), "password-strength"); g_object_notify (G_OBJECT (self), "password-strength");
} }
res = self->task; self->last_reply = GCR_PROMPT_REPLY_CONTINUE;
mode = self->mode;
self->task = NULL; res = self->async_result;
self->async_result = NULL;
self->mode = PROMPTING_NONE; self->mode = PROMPTING_NONE;
if (mode == PROMPTING_FOR_CONFIRM) g_simple_async_result_complete (res);
g_task_return_int (res, (gssize)GCR_PROMPT_REPLY_CONTINUE);
else
g_task_return_pointer (res, (gpointer)password, NULL);
g_object_unref (res); g_object_unref (res);
return TRUE; return TRUE;
@@ -767,8 +777,7 @@ shell_keyring_prompt_complete (ShellKeyringPrompt *self)
void void
shell_keyring_prompt_cancel (ShellKeyringPrompt *self) shell_keyring_prompt_cancel (ShellKeyringPrompt *self)
{ {
GTask *res; GSimpleAsyncResult *res;
PromptingMode mode;
g_return_if_fail (SHELL_IS_KEYRING_PROMPT (self)); g_return_if_fail (SHELL_IS_KEYRING_PROMPT (self));
@@ -783,16 +792,13 @@ shell_keyring_prompt_cancel (ShellKeyringPrompt *self)
return; return;
} }
g_return_if_fail (self->task != NULL); g_return_if_fail (self->async_result != NULL);
self->last_reply = GCR_PROMPT_REPLY_CANCEL;
res = self->task; res = self->async_result;
mode = self->mode; self->async_result = NULL;
self->task = NULL;
self->mode = PROMPTING_NONE; self->mode = PROMPTING_NONE;
if (mode == PROMPTING_FOR_CONFIRM) g_simple_async_result_complete_in_idle (res);
g_task_return_int (res, (gssize) GCR_PROMPT_REPLY_CANCEL);
else
g_task_return_pointer (res, NULL, NULL);
g_object_unref (res); g_object_unref (res);
} }

View File

@@ -33,8 +33,10 @@ G_BEGIN_DECLS
typedef struct _ShellKeyringPrompt ShellKeyringPrompt; typedef struct _ShellKeyringPrompt ShellKeyringPrompt;
#define SHELL_TYPE_KEYRING_PROMPT (shell_keyring_prompt_get_type ()) #define SHELL_TYPE_KEYRING_PROMPT (shell_keyring_prompt_get_type ())
G_DECLARE_FINAL_TYPE (ShellKeyringPrompt, shell_keyring_prompt, #define SHELL_KEYRING_PROMPT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_KEYRING_PROMPT, ShellKeyringPrompt))
SHELL, KEYRING_PROMPT, GObject) #define SHELL_IS_KEYRING_PROMPT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_TYPE_KEYRING_PROMPT))
GType shell_keyring_prompt_get_type (void) G_GNUC_CONST;
ShellKeyringPrompt * shell_keyring_prompt_new (void); ShellKeyringPrompt * shell_keyring_prompt_new (void);

View File

@@ -33,6 +33,7 @@
* the GPid array to JS). * the GPid array to JS).
* See https://bugzilla.gnome.org/show_bug.cgi?id=645978 * See https://bugzilla.gnome.org/show_bug.cgi?id=645978
*/ */
G_DEFINE_TYPE (ShellMountOperation, shell_mount_operation, G_TYPE_MOUNT_OPERATION);
enum { enum {
SHOW_PROCESSES_2, SHOW_PROCESSES_2,
@@ -41,27 +42,17 @@ enum {
static guint signals[NUM_SIGNALS] = { 0, }; static guint signals[NUM_SIGNALS] = { 0, };
typedef struct _ShellMountOperationPrivate ShellMountOperationPrivate;
struct _ShellMountOperation
{
GMountOperation parent_instance;
ShellMountOperationPrivate *priv;
};
struct _ShellMountOperationPrivate { struct _ShellMountOperationPrivate {
GArray *pids; GArray *pids;
gchar **choices; gchar **choices;
gchar *message; gchar *message;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (ShellMountOperation, shell_mount_operation, G_TYPE_MOUNT_OPERATION);
static void static void
shell_mount_operation_init (ShellMountOperation *self) shell_mount_operation_init (ShellMountOperation *self)
{ {
self->priv = shell_mount_operation_get_instance_private (self); self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, SHELL_TYPE_MOUNT_OPERATION,
ShellMountOperationPrivate);
} }
static void static void
@@ -144,6 +135,8 @@ shell_mount_operation_class_init (ShellMountOperationClass *klass)
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL, 0, NULL, NULL, NULL,
G_TYPE_NONE, 0); G_TYPE_NONE, 0);
g_type_class_add_private (klass, sizeof (ShellMountOperationPrivate));
} }
GMountOperation * GMountOperation *

View File

@@ -27,9 +27,30 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define SHELL_TYPE_MOUNT_OPERATION (shell_mount_operation_get_type ()) #define SHELL_TYPE_MOUNT_OPERATION (shell_mount_operation_get_type ())
G_DECLARE_FINAL_TYPE (ShellMountOperation, shell_mount_operation, #define SHELL_MOUNT_OPERATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SHELL_TYPE_MOUNT_OPERATION, ShellMountOperation))
SHELL, MOUNT_OPERATION, GMountOperation) #define SHELL_MOUNT_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), SHELL_TYPE_MOUNT_OPERATION, ShellMountOperationClass))
#define SHELL_IS_MOUNT_OPERATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), SHELL_TYPE_MOUNT_OPERATION))
#define SHELL_IS_MOUNT_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), SHELL_TYPE_MOUNT_OPERATION))
#define SHELL_MOUNT_OPERATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), SHELL_TYPE_MOUNT_OPERATION, ShellMountOperationClass))
typedef struct _ShellMountOperation ShellMountOperation;
typedef struct _ShellMountOperationClass ShellMountOperationClass;
typedef struct _ShellMountOperationPrivate ShellMountOperationPrivate;
struct _ShellMountOperation
{
GMountOperation parent_instance;
ShellMountOperationPrivate *priv;
};
struct _ShellMountOperationClass
{
GMountOperationClass parent_class;
};
GType shell_mount_operation_get_type (void);
GMountOperation *shell_mount_operation_new (void); GMountOperation *shell_mount_operation_new (void);
GArray * shell_mount_operation_get_show_processes_pids (ShellMountOperation *self); GArray * shell_mount_operation_get_show_processes_pids (ShellMountOperation *self);

View File

@@ -60,7 +60,7 @@ struct _ShellNetworkAgentPrivate {
GHashTable *requests; GHashTable *requests;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (ShellNetworkAgent, shell_network_agent, NM_TYPE_SECRET_AGENT) G_DEFINE_TYPE (ShellNetworkAgent, shell_network_agent, NM_TYPE_SECRET_AGENT)
static const SecretSchema network_agent_schema = { static const SecretSchema network_agent_schema = {
"org.freedesktop.NetworkManager.Connection", "org.freedesktop.NetworkManager.Connection",
@@ -114,7 +114,8 @@ shell_network_agent_init (ShellNetworkAgent *agent)
{ {
ShellNetworkAgentPrivate *priv; ShellNetworkAgentPrivate *priv;
priv = agent->priv = shell_network_agent_get_instance_private (agent); priv = agent->priv = G_TYPE_INSTANCE_GET_PRIVATE (agent, SHELL_TYPE_NETWORK_AGENT, ShellNetworkAgentPrivate);
priv->requests = g_hash_table_new_full (g_str_hash, g_str_equal, priv->requests = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, shell_agent_request_free); g_free, shell_agent_request_free);
} }
@@ -314,8 +315,6 @@ get_secrets_keyring_cb (GObject *source,
secrets_found = TRUE; secrets_found = TRUE;
g_hash_table_unref (attributes);
secret_value_unref (secret);
break; break;
} }
} }
@@ -365,8 +364,6 @@ shell_network_agent_get_secrets (NMSecretAgent *agent,
{ {
ShellNetworkAgent *self = SHELL_NETWORK_AGENT (agent); ShellNetworkAgent *self = SHELL_NETWORK_AGENT (agent);
ShellAgentRequest *request; ShellAgentRequest *request;
NMSettingConnection *setting_connection;
const char *connection_type;
GHashTable *attributes; GHashTable *attributes;
char *request_id; char *request_id;
@@ -380,9 +377,6 @@ shell_network_agent_get_secrets (NMSecretAgent *agent,
shell_agent_request_cancel (request); shell_agent_request_cancel (request);
} }
setting_connection = nm_connection_get_setting_connection (connection);
connection_type = nm_setting_connection_get_connection_type (setting_connection);
request = g_slice_new (ShellAgentRequest); request = g_slice_new (ShellAgentRequest);
request->self = g_object_ref (self); request->self = g_object_ref (self);
request->cancellable = g_cancellable_new (); request->cancellable = g_cancellable_new ();
@@ -392,7 +386,7 @@ shell_network_agent_get_secrets (NMSecretAgent *agent,
request->flags = flags; request->flags = flags;
request->callback = callback; request->callback = callback;
request->callback_data = callback_data; request->callback_data = callback_data;
request->is_vpn = !strcmp(connection_type, NM_SETTING_VPN_SETTING_NAME); request->is_vpn = !strcmp(setting_name, NM_SETTING_VPN_SETTING_NAME);
request->entries = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, gvalue_destroy_notify); request->entries = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, gvalue_destroy_notify);
if (request->is_vpn) if (request->is_vpn)
@@ -852,4 +846,6 @@ shell_network_agent_class_init (ShellNetworkAgentClass *klass)
G_TYPE_NONE, G_TYPE_NONE,
1, /* n_params */ 1, /* n_params */
G_TYPE_STRING); G_TYPE_STRING);
g_type_class_add_private (klass, sizeof (ShellNetworkAgentPrivate));
} }

View File

@@ -53,6 +53,11 @@ struct _ShellPerfLog
guint enabled : 1; guint enabled : 1;
}; };
struct _ShellPerfLogClass
{
GObjectClass parent_class;
};
struct _ShellPerfEvent struct _ShellPerfEvent
{ {
guint16 id; guint16 id;

View File

@@ -7,8 +7,17 @@
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct _ShellPerfLog ShellPerfLog;
typedef struct _ShellPerfLogClass ShellPerfLogClass;
#define SHELL_TYPE_PERF_LOG (shell_perf_log_get_type ()) #define SHELL_TYPE_PERF_LOG (shell_perf_log_get_type ())
G_DECLARE_FINAL_TYPE (ShellPerfLog, shell_perf_log, SHELL, PERF_LOG, GObject) #define SHELL_PERF_LOG(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SHELL_TYPE_PERF_LOG, ShellPerfLog))
#define SHELL_PERF_LOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_PERF_LOG, ShellPerfLogClass))
#define SHELL_IS_PERF_LOG(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SHELL_TYPE_PERF_LOG))
#define SHELL_IS_PERF_LOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_PERF_LOG))
#define SHELL_PERF_LOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_PERF_LOG, ShellPerfLogClass))
GType shell_perf_log_get_type (void) G_GNUC_CONST;
ShellPerfLog *shell_perf_log_get_default (void); ShellPerfLog *shell_perf_log_get_default (void);

View File

@@ -201,7 +201,7 @@ struct _AuthRequest {
gchar *cookie; gchar *cookie;
GList *identities; GList *identities;
GTask *simple; GSimpleAsyncResult *simple;
}; };
static void static void
@@ -338,29 +338,31 @@ auth_request_complete (AuthRequest *request,
gboolean dismissed) gboolean dismissed)
{ {
ShellPolkitAuthenticationAgent *agent = request->agent; ShellPolkitAuthenticationAgent *agent = request->agent;
gboolean is_current = agent->current_request == request;
print_debug ("COMPLETING %s %s cookie %s", is_current ? "CURRENT" : "SCHEDULED",
request->action_id, request->cookie);
if (!is_current)
agent->scheduled_requests = g_list_remove (agent->scheduled_requests, request);
if (dismissed) if (dismissed)
g_task_return_new_error (request->simple, g_simple_async_result_set_error (request->simple,
POLKIT_ERROR, POLKIT_ERROR,
POLKIT_ERROR_CANCELLED, POLKIT_ERROR_CANCELLED,
_("Authentication dialog was dismissed by the user")); _("Authentication dialog was dismissed by the user"));
else
g_task_return_boolean (request->simple, TRUE);
if (agent->current_request == request)
{
print_debug ("COMPLETING CURRENT %s cookie %s", request->action_id, request->cookie);
g_simple_async_result_complete_in_idle (request->simple);
auth_request_free (request); auth_request_free (request);
if (is_current)
{
agent->current_request = NULL; agent->current_request = NULL;
maybe_process_next_request (agent); maybe_process_next_request (agent);
} }
else
{
print_debug ("COMPLETING SCHEDULED %s cookie %s", request->action_id, request->cookie);
agent->scheduled_requests = g_list_remove (agent->scheduled_requests, request);
g_simple_async_result_complete_in_idle (request->simple);
auth_request_free (request);
}
} }
static void static void
@@ -406,7 +408,10 @@ initiate_authentication (PolkitAgentListener *listener,
request->cookie = g_strdup (cookie); request->cookie = g_strdup (cookie);
request->identities = g_list_copy (identities); request->identities = g_list_copy (identities);
g_list_foreach (request->identities, (GFunc) g_object_ref, NULL); g_list_foreach (request->identities, (GFunc) g_object_ref, NULL);
request->simple = g_task_new (listener, NULL, callback, user_data); request->simple = g_simple_async_result_new (G_OBJECT (listener),
callback,
user_data,
initiate_authentication);
request->cancellable = cancellable; request->cancellable = cancellable;
request->handler_id = g_cancellable_connect (request->cancellable, request->handler_id = g_cancellable_connect (request->cancellable,
G_CALLBACK (on_request_cancelled), G_CALLBACK (on_request_cancelled),
@@ -424,7 +429,11 @@ initiate_authentication_finish (PolkitAgentListener *listener,
GAsyncResult *res, GAsyncResult *res,
GError **error) GError **error)
{ {
return g_task_propagate_boolean (G_TASK (res), error); GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
if (g_simple_async_result_propagate_error (simple, error))
return FALSE;
else
return TRUE;
} }
void void

View File

@@ -33,6 +33,11 @@ typedef enum {
typedef struct _RecorderPipeline RecorderPipeline; typedef struct _RecorderPipeline RecorderPipeline;
struct _ShellRecorderClass
{
GObjectClass parent_class;
};
struct _ShellRecorder { struct _ShellRecorder {
GObject parent; GObject parent;

View File

@@ -16,8 +16,17 @@ G_BEGIN_DECLS
* directory named after the date, but the encoding and output can * directory named after the date, but the encoding and output can
* be configured. * be configured.
*/ */
typedef struct _ShellRecorder ShellRecorder;
typedef struct _ShellRecorderClass ShellRecorderClass;
#define SHELL_TYPE_RECORDER (shell_recorder_get_type ()) #define SHELL_TYPE_RECORDER (shell_recorder_get_type ())
G_DECLARE_FINAL_TYPE (ShellRecorder, shell_recorder, SHELL, RECORDER, GObject) #define SHELL_RECORDER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SHELL_TYPE_RECORDER, ShellRecorder))
#define SHELL_RECORDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_RECORDER, ShellRecorderClass))
#define SHELL_IS_RECORDER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SHELL_TYPE_RECORDER))
#define SHELL_IS_RECORDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_RECORDER))
#define SHELL_RECORDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_RECORDER, ShellRecorderClass))
GType shell_recorder_get_type (void) G_GNUC_CONST;
ShellRecorder *shell_recorder_new (ClutterStage *stage); ShellRecorder *shell_recorder_new (ClutterStage *stage);

View File

@@ -14,7 +14,10 @@
#define A11Y_APPS_SCHEMA "org.gnome.desktop.a11y.applications" #define A11Y_APPS_SCHEMA "org.gnome.desktop.a11y.applications"
#define MAGNIFIER_ACTIVE_KEY "screen-magnifier-enabled" #define MAGNIFIER_ACTIVE_KEY "screen-magnifier-enabled"
typedef struct _ShellScreenshotPrivate ShellScreenshotPrivate; struct _ShellScreenshotClass
{
GObjectClass parent_class;
};
struct _ShellScreenshot struct _ShellScreenshot
{ {
@@ -64,7 +67,7 @@ on_screenshot_written (GObject *source,
if (priv->callback) if (priv->callback)
priv->callback (screenshot, priv->callback (screenshot,
g_task_propagate_boolean (G_TASK (result), NULL), g_simple_async_result_get_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (result)),
&priv->screenshot_area, &priv->screenshot_area,
priv->filename_used); priv->filename_used);
@@ -165,9 +168,8 @@ prepare_write_stream (const gchar *filename,
} }
static void static void
write_screenshot_thread (GTask *result, write_screenshot_thread (GSimpleAsyncResult *result,
gpointer object, GObject *object,
gpointer task_data,
GCancellable *cancellable) GCancellable *cancellable)
{ {
cairo_status_t status; cairo_status_t status;
@@ -203,7 +205,7 @@ write_screenshot_thread (GTask *result,
} }
g_task_return_boolean (result, status == CAIRO_STATUS_SUCCESS); g_simple_async_result_set_op_res_gboolean (result, status == CAIRO_STATUS_SUCCESS);
g_clear_object (&stream); g_clear_object (&stream);
} }
@@ -305,7 +307,7 @@ grab_screenshot (ClutterActor *stage,
MetaScreen *screen; MetaScreen *screen;
MetaCursorTracker *tracker; MetaCursorTracker *tracker;
int width, height; int width, height;
GTask *result; GSimpleAsyncResult *result;
GSettings *settings; GSettings *settings;
ShellScreenshotPrivate *priv = screenshot->priv; ShellScreenshotPrivate *priv = screenshot->priv;
@@ -368,8 +370,8 @@ grab_screenshot (ClutterActor *stage,
g_signal_handlers_disconnect_by_func (stage, (void *)grab_screenshot, (gpointer)screenshot); g_signal_handlers_disconnect_by_func (stage, (void *)grab_screenshot, (gpointer)screenshot);
result = g_task_new (screenshot, NULL, on_screenshot_written, NULL); result = g_simple_async_result_new (G_OBJECT (screenshot), on_screenshot_written, NULL, grab_screenshot);
g_task_run_in_thread (result, write_screenshot_thread); g_simple_async_result_run_in_thread (result, write_screenshot_thread, G_PRIORITY_DEFAULT, NULL);
g_object_unref (result); g_object_unref (result);
} }
@@ -377,7 +379,7 @@ static void
grab_area_screenshot (ClutterActor *stage, grab_area_screenshot (ClutterActor *stage,
ShellScreenshot *screenshot) ShellScreenshot *screenshot)
{ {
GTask *result; GSimpleAsyncResult *result;
ShellScreenshotPrivate *priv = screenshot->priv; ShellScreenshotPrivate *priv = screenshot->priv;
do_grab_screenshot (screenshot, do_grab_screenshot (screenshot,
@@ -387,8 +389,8 @@ grab_area_screenshot (ClutterActor *stage,
priv->screenshot_area.height); priv->screenshot_area.height);
g_signal_handlers_disconnect_by_func (stage, (void *)grab_area_screenshot, (gpointer)screenshot); g_signal_handlers_disconnect_by_func (stage, (void *)grab_area_screenshot, (gpointer)screenshot);
result = g_task_new (screenshot, NULL, on_screenshot_written, NULL); result = g_simple_async_result_new (G_OBJECT (screenshot), on_screenshot_written, NULL, grab_area_screenshot);
g_task_run_in_thread (result, write_screenshot_thread); g_simple_async_result_run_in_thread (result, write_screenshot_thread, G_PRIORITY_DEFAULT, NULL);
g_object_unref (result); g_object_unref (result);
} }
@@ -397,7 +399,7 @@ grab_window_screenshot (ClutterActor *stage,
ShellScreenshot *screenshot) ShellScreenshot *screenshot)
{ {
ShellScreenshotPrivate *priv = screenshot->priv; ShellScreenshotPrivate *priv = screenshot->priv;
GTask *result; GSimpleAsyncResult *result;
GSettings *settings; GSettings *settings;
MetaScreen *screen = shell_global_get_screen (priv->global); MetaScreen *screen = shell_global_get_screen (priv->global);
MetaCursorTracker *tracker; MetaCursorTracker *tracker;
@@ -437,8 +439,8 @@ grab_window_screenshot (ClutterActor *stage,
g_object_unref (settings); g_object_unref (settings);
g_signal_handlers_disconnect_by_func (stage, (void *)grab_window_screenshot, (gpointer)screenshot); g_signal_handlers_disconnect_by_func (stage, (void *)grab_window_screenshot, (gpointer)screenshot);
result = g_task_new (screenshot, NULL, on_screenshot_written, NULL); result = g_simple_async_result_new (G_OBJECT (screenshot), on_screenshot_written, NULL, grab_window_screenshot);
g_task_run_in_thread (result, write_screenshot_thread); g_simple_async_result_run_in_thread (result, write_screenshot_thread, G_PRIORITY_DEFAULT, NULL);
g_object_unref (result); g_object_unref (result);
} }

View File

@@ -10,9 +10,19 @@
* areas or windows and write them out as png files. * areas or windows and write them out as png files.
* *
*/ */
typedef struct _ShellScreenshot ShellScreenshot;
typedef struct _ShellScreenshotPrivate ShellScreenshotPrivate;
typedef struct _ShellScreenshotClass ShellScreenshotClass;
#define SHELL_TYPE_SCREENSHOT (shell_screenshot_get_type ()) #define SHELL_TYPE_SCREENSHOT (shell_screenshot_get_type ())
G_DECLARE_FINAL_TYPE (ShellScreenshot, shell_screenshot, #define SHELL_SCREENSHOT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SHELL_TYPE_SCREENSHOT, ShellScreenshot))
SHELL, SCREENSHOT, GObject) #define SHELL_SCREENSHOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_SCREENSHOT, ShellScreenshotClass))
#define SHELL_IS_SCREENSHOT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SHELL_TYPE_SCREENSHOT))
#define SHELL_IS_SCREENSHOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_SCREENSHOT))
#define SHELL_SCREENSHOT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_SCREENSHOT, ShellScreenshotClass))
GType shell_screenshot_get_type (void) G_GNUC_CONST;
ShellScreenshot *shell_screenshot_new (void); ShellScreenshot *shell_screenshot_new (void);

View File

@@ -30,6 +30,9 @@
#include <string.h> #include <string.h>
typedef struct _ShellSecureTextBuffer ShellSecureTextBuffer;
typedef struct _ShellSecureTextBufferClass ShellSecureTextBufferClass;
struct _ShellSecureTextBuffer { struct _ShellSecureTextBuffer {
ClutterTextBuffer parent; ClutterTextBuffer parent;
gchar *text; gchar *text;
@@ -38,6 +41,10 @@ struct _ShellSecureTextBuffer {
guint text_chars; guint text_chars;
}; };
struct _ShellSecureTextBufferClass {
ClutterTextBufferClass parent_class;
};
/* Initial size of buffer, in bytes */ /* Initial size of buffer, in bytes */
#define MIN_SIZE 16 #define MIN_SIZE 16

View File

@@ -29,8 +29,10 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define SHELL_TYPE_SECURE_TEXT_BUFFER (shell_secure_text_buffer_get_type ()) #define SHELL_TYPE_SECURE_TEXT_BUFFER (shell_secure_text_buffer_get_type ())
G_DECLARE_FINAL_TYPE (ShellSecureTextBuffer, shell_secure_text_buffer, #define SHELL_SECURE_TEXT_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_SECURE_TEXT_BUFFER, ShellSecureTextBuffer))
SHELL, SECURE_TEXT_BUFFER, ClutterTextBuffer) #define SHELL_IS_SECURE_TEXT_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_TYPE_SECURE_TEXT_BUFFER))
GType shell_secure_text_buffer_get_type (void) G_GNUC_CONST;
ClutterTextBuffer * shell_secure_text_buffer_new (void); ClutterTextBuffer * shell_secure_text_buffer_new (void);

View File

@@ -16,12 +16,9 @@
#include "shell-stack.h" #include "shell-stack.h"
struct _ShellStack G_DEFINE_TYPE (ShellStack,
{ shell_stack,
StWidget parent; ST_TYPE_WIDGET);
};
G_DEFINE_TYPE (ShellStack, shell_stack, ST_TYPE_WIDGET);
static void static void
shell_stack_allocate (ClutterActor *self, shell_stack_allocate (ClutterActor *self,

View File

@@ -6,6 +6,29 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#define SHELL_TYPE_STACK (shell_stack_get_type ()) #define SHELL_TYPE_STACK (shell_stack_get_type ())
G_DECLARE_FINAL_TYPE (ShellStack, shell_stack, SHELL, STACK, StWidget) #define SHELL_STACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_STACK, ShellStack))
#define SHELL_STACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_STACK, ShellStackClass))
#define SHELL_IS_STACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_TYPE_STACK))
#define SHELL_IS_STACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_STACK))
#define SHELL_STACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_STACK, ShellStackClass))
typedef struct _ShellStack ShellStack;
typedef struct _ShellStackClass ShellStackClass;
typedef struct _ShellStackPrivate ShellStackPrivate;
struct _ShellStack
{
StWidget parent;
ShellStackPrivate *priv;
};
struct _ShellStackClass
{
StWidgetClass parent_class;
};
GType shell_stack_get_type (void) G_GNUC_CONST;
#endif /* __SHELL_STACK_H__ */ #endif /* __SHELL_STACK_H__ */

View File

@@ -6,6 +6,8 @@
#include <telepathy-glib/telepathy-glib.h> #include <telepathy-glib/telepathy-glib.h>
G_DEFINE_TYPE(ShellTpClient, shell_tp_client, TP_TYPE_BASE_CLIENT)
struct _ShellTpClientPrivate struct _ShellTpClientPrivate
{ {
ShellTpClientObserveChannelsImpl observe_impl; ShellTpClientObserveChannelsImpl observe_impl;
@@ -21,8 +23,6 @@ struct _ShellTpClientPrivate
GDestroyNotify destroy_handle_channels; GDestroyNotify destroy_handle_channels;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (ShellTpClient, shell_tp_client, TP_TYPE_BASE_CLIENT)
/** /**
* ShellTpClientObserveChannelsImpl: * ShellTpClientObserveChannelsImpl:
* @client: a #ShellTpClient instance * @client: a #ShellTpClient instance
@@ -84,7 +84,8 @@ shell_tp_client_init (ShellTpClient *self)
{ {
GHashTable *filter; GHashTable *filter;
self->priv = shell_tp_client_get_instance_private (self); self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, SHELL_TYPE_TP_CLIENT,
ShellTpClientPrivate);
/* We only care about single-user text-based chats */ /* We only care about single-user text-based chats */
filter = tp_asv_new ( filter = tp_asv_new (
@@ -197,6 +198,8 @@ shell_tp_client_class_init (ShellTpClientClass *cls)
GObjectClass *object_class = G_OBJECT_CLASS (cls); GObjectClass *object_class = G_OBJECT_CLASS (cls);
TpBaseClientClass *base_clt_cls = TP_BASE_CLIENT_CLASS (cls); TpBaseClientClass *base_clt_cls = TP_BASE_CLIENT_CLASS (cls);
g_type_class_add_private (cls, sizeof (ShellTpClientPrivate));
object_class->dispose = shell_tp_client_dispose; object_class->dispose = shell_tp_client_dispose;
base_clt_cls->observe_channels = observe_channels; base_clt_cls->observe_channels = observe_channels;

View File

@@ -17,15 +17,6 @@ enum {
PROP_WM_CLASS PROP_WM_CLASS
}; };
typedef struct _ShellTrayIconPrivate ShellTrayIconPrivate;
struct _ShellTrayIcon
{
ShellGtkEmbed parent;
ShellTrayIconPrivate *priv;
};
struct _ShellTrayIconPrivate struct _ShellTrayIconPrivate
{ {
NaTrayChild *socket; NaTrayChild *socket;
@@ -34,7 +25,7 @@ struct _ShellTrayIconPrivate
char *title, *wm_class; char *title, *wm_class;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (ShellTrayIcon, shell_tray_icon, SHELL_TYPE_GTK_EMBED); G_DEFINE_TYPE (ShellTrayIcon, shell_tray_icon, SHELL_TYPE_GTK_EMBED);
static void static void
shell_tray_icon_finalize (GObject *object) shell_tray_icon_finalize (GObject *object)
@@ -126,6 +117,8 @@ shell_tray_icon_class_init (ShellTrayIconClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (ShellTrayIconPrivate));
object_class->get_property = shell_tray_icon_get_property; object_class->get_property = shell_tray_icon_get_property;
object_class->constructed = shell_tray_icon_constructed; object_class->constructed = shell_tray_icon_constructed;
object_class->finalize = shell_tray_icon_finalize; object_class->finalize = shell_tray_icon_finalize;
@@ -156,7 +149,8 @@ shell_tray_icon_class_init (ShellTrayIconClass *klass)
static void static void
shell_tray_icon_init (ShellTrayIcon *icon) shell_tray_icon_init (ShellTrayIcon *icon)
{ {
icon->priv = shell_tray_icon_get_instance_private (icon); icon->priv = G_TYPE_INSTANCE_GET_PRIVATE (icon, SHELL_TYPE_TRAY_ICON,
ShellTrayIconPrivate);
} }
/* /*

View File

@@ -5,9 +5,30 @@
#include "shell-gtk-embed.h" #include "shell-gtk-embed.h"
#define SHELL_TYPE_TRAY_ICON (shell_tray_icon_get_type ()) #define SHELL_TYPE_TRAY_ICON (shell_tray_icon_get_type ())
G_DECLARE_FINAL_TYPE (ShellTrayIcon, shell_tray_icon, #define SHELL_TRAY_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_TRAY_ICON, ShellTrayIcon))
SHELL, TRAY_ICON, ShellGtkEmbed) #define SHELL_TRAY_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_TRAY_ICON, ShellTrayIconClass))
#define SHELL_IS_TRAY_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_TYPE_TRAY_ICON))
#define SHELL_IS_TRAY_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_TRAY_ICON))
#define SHELL_TRAY_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_TRAY_ICON, ShellTrayIconClass))
typedef struct _ShellTrayIcon ShellTrayIcon;
typedef struct _ShellTrayIconClass ShellTrayIconClass;
typedef struct _ShellTrayIconPrivate ShellTrayIconPrivate;
struct _ShellTrayIcon
{
ShellGtkEmbed parent;
ShellTrayIconPrivate *priv;
};
struct _ShellTrayIconClass
{
ShellGtkEmbedClass parent_class;
};
GType shell_tray_icon_get_type (void) G_GNUC_CONST;
ClutterActor *shell_tray_icon_new (ShellEmbeddedWindow *window); ClutterActor *shell_tray_icon_new (ShellEmbeddedWindow *window);
void shell_tray_icon_click (ShellTrayIcon *icon, void shell_tray_icon_click (ShellTrayIcon *icon,

View File

@@ -15,15 +15,6 @@
#include "shell-embedded-window.h" #include "shell-embedded-window.h"
#include "shell-global.h" #include "shell-global.h"
typedef struct _ShellTrayManagerPrivate ShellTrayManagerPrivate;
struct _ShellTrayManager
{
GObject parent_instance;
ShellTrayManagerPrivate *priv;
};
struct _ShellTrayManagerPrivate { struct _ShellTrayManagerPrivate {
NaTrayManager *na_manager; NaTrayManager *na_manager;
ClutterColor bg_color; ClutterColor bg_color;
@@ -52,7 +43,7 @@ enum
LAST_SIGNAL LAST_SIGNAL
}; };
G_DEFINE_TYPE_WITH_PRIVATE (ShellTrayManager, shell_tray_manager, G_TYPE_OBJECT); G_DEFINE_TYPE (ShellTrayManager, shell_tray_manager, G_TYPE_OBJECT);
static guint shell_tray_manager_signals [LAST_SIGNAL] = { 0 }; static guint shell_tray_manager_signals [LAST_SIGNAL] = { 0 };
@@ -123,8 +114,8 @@ shell_tray_manager_get_property(GObject *object,
static void static void
shell_tray_manager_init (ShellTrayManager *manager) shell_tray_manager_init (ShellTrayManager *manager)
{ {
manager->priv = shell_tray_manager_get_instance_private (manager); manager->priv = G_TYPE_INSTANCE_GET_PRIVATE (manager, SHELL_TYPE_TRAY_MANAGER,
ShellTrayManagerPrivate);
manager->priv->na_manager = na_tray_manager_new (); manager->priv->na_manager = na_tray_manager_new ();
manager->priv->icons = g_hash_table_new_full (NULL, NULL, manager->priv->icons = g_hash_table_new_full (NULL, NULL,
@@ -153,6 +144,8 @@ shell_tray_manager_class_init (ShellTrayManagerClass *klass)
{ {
GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (ShellTrayManagerPrivate));
gobject_class->finalize = shell_tray_manager_finalize; gobject_class->finalize = shell_tray_manager_finalize;
gobject_class->set_property = shell_tray_manager_set_property; gobject_class->set_property = shell_tray_manager_set_property;
gobject_class->get_property = shell_tray_manager_get_property; gobject_class->get_property = shell_tray_manager_get_property;
@@ -161,7 +154,7 @@ shell_tray_manager_class_init (ShellTrayManagerClass *klass)
g_signal_new ("tray-icon-added", g_signal_new ("tray-icon-added",
G_TYPE_FROM_CLASS (klass), G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
0, G_STRUCT_OFFSET (ShellTrayManagerClass, tray_icon_added),
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
CLUTTER_TYPE_ACTOR); CLUTTER_TYPE_ACTOR);
@@ -169,7 +162,7 @@ shell_tray_manager_class_init (ShellTrayManagerClass *klass)
g_signal_new ("tray-icon-removed", g_signal_new ("tray-icon-removed",
G_TYPE_FROM_CLASS (klass), G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
0, G_STRUCT_OFFSET (ShellTrayManagerClass, tray_icon_removed),
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
CLUTTER_TYPE_ACTOR); CLUTTER_TYPE_ACTOR);
@@ -200,12 +193,27 @@ shell_tray_manager_style_changed (StWidget *theme_widget,
ShellTrayManager *manager = user_data; ShellTrayManager *manager = user_data;
StThemeNode *theme_node; StThemeNode *theme_node;
StIconColors *icon_colors; StIconColors *icon_colors;
GdkColor foreground, warning, error, success;
theme_node = st_widget_get_theme_node (theme_widget); theme_node = st_widget_get_theme_node (theme_widget);
icon_colors = st_theme_node_get_icon_colors (theme_node); icon_colors = st_theme_node_get_icon_colors (theme_node);
foreground.red = icon_colors->foreground.red * 0x101;
foreground.green = icon_colors->foreground.green * 0x101;
foreground.blue = icon_colors->foreground.blue * 0x101;
warning.red = icon_colors->warning.red * 0x101;
warning.green = icon_colors->warning.green * 0x101;
warning.blue = icon_colors->warning.blue * 0x101;
error.red = icon_colors->error.red * 0x101;
error.green = icon_colors->error.green * 0x101;
error.blue = icon_colors->error.blue * 0x101;
success.red = icon_colors->success.red * 0x101;
success.green = icon_colors->success.green * 0x101;
success.blue = icon_colors->success.blue * 0x101;
na_tray_manager_set_colors (manager->priv->na_manager, na_tray_manager_set_colors (manager->priv->na_manager,
&icon_colors->foreground, &icon_colors->warning, &foreground, &warning,
&icon_colors->error, &icon_colors->success); &error, &success);
} }
void void
@@ -279,6 +287,14 @@ na_tray_icon_added (NaTrayManager *na_manager, GtkWidget *socket,
GtkWidget *win; GtkWidget *win;
ShellTrayManagerChild *child; ShellTrayManagerChild *child;
/* We don't need the NaTrayIcon to be composited on the window we
* put it in: the window is the same size as the tray icon
* and transparent. We can just use the default X handling of
* subwindows as mode of SOURCE (replace the parent with the
* child) and then composite the parent onto the stage.
*/
na_tray_child_set_composited (NA_TRAY_CHILD (socket), FALSE);
win = shell_embedded_window_new (); win = shell_embedded_window_new ();
gtk_container_add (GTK_CONTAINER (win), socket); gtk_container_add (GTK_CONTAINER (win), socket);

View File

@@ -9,8 +9,36 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define SHELL_TYPE_TRAY_MANAGER (shell_tray_manager_get_type ()) #define SHELL_TYPE_TRAY_MANAGER (shell_tray_manager_get_type ())
G_DECLARE_FINAL_TYPE (ShellTrayManager, shell_tray_manager, #define SHELL_TRAY_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_TRAY_MANAGER, ShellTrayManager))
SHELL, TRAY_MANAGER, GObject) #define SHELL_TRAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_TRAY_MANAGER, ShellTrayManagerClass))
#define SHELL_IS_TRAY_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_TYPE_TRAY_MANAGER))
#define SHELL_IS_TRAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_TRAY_MANAGER))
#define SHELL_TRAY_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_TRAY_MANAGER, ShellTrayManagerClass))
typedef struct _ShellTrayManager ShellTrayManager;
typedef struct _ShellTrayManagerPrivate ShellTrayManagerPrivate;
typedef struct _ShellTrayManagerClass ShellTrayManagerClass;
struct _ShellTrayManager
{
GObject parent_instance;
ShellTrayManagerPrivate *priv;
};
struct _ShellTrayManagerClass
{
GObjectClass parent_class;
void (* tray_icon_added) (ShellTrayManager *manager,
ClutterActor *icon,
const char *lowercase_wm_class);
void (* tray_icon_removed) (ShellTrayManager *manager,
ClutterActor *icon);
};
GType shell_tray_manager_get_type (void);
ShellTrayManager *shell_tray_manager_new (void); ShellTrayManager *shell_tray_manager_new (void);
void shell_tray_manager_manage_screen (ShellTrayManager *manager, void shell_tray_manager_manage_screen (ShellTrayManager *manager,

View File

@@ -11,9 +11,23 @@
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct _ShellWindowTracker ShellWindowTracker;
typedef struct _ShellWindowTrackerClass ShellWindowTrackerClass;
typedef struct _ShellWindowTrackerPrivate ShellWindowTrackerPrivate;
#define SHELL_TYPE_WINDOW_TRACKER (shell_window_tracker_get_type ()) #define SHELL_TYPE_WINDOW_TRACKER (shell_window_tracker_get_type ())
G_DECLARE_FINAL_TYPE (ShellWindowTracker, shell_window_tracker, #define SHELL_WINDOW_TRACKER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SHELL_TYPE_WINDOW_TRACKER, ShellWindowTracker))
SHELL, WINDOW_TRACKER, GObject) #define SHELL_WINDOW_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_WINDOW_TRACKER, ShellWindowTrackerClass))
#define SHELL_IS_WINDOW_TRACKER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SHELL_TYPE_WINDOW_TRACKER))
#define SHELL_IS_WINDOW_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_WINDOW_TRACKER))
#define SHELL_WINDOW_TRACKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_WINDOW_TRACKER, ShellWindowTrackerClass))
struct _ShellWindowTrackerClass
{
GObjectClass parent_class;
};
GType shell_window_tracker_get_type (void) G_GNUC_CONST;
ShellWindowTracker* shell_window_tracker_get_default(void); ShellWindowTracker* shell_window_tracker_get_default(void);

View File

@@ -7,8 +7,23 @@
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct _ShellWM ShellWM;
typedef struct _ShellWMClass ShellWMClass;
#define SHELL_TYPE_WM (shell_wm_get_type ()) #define SHELL_TYPE_WM (shell_wm_get_type ())
G_DECLARE_FINAL_TYPE (ShellWM, shell_wm, SHELL, WM, GObject) #define SHELL_WM(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SHELL_TYPE_WM, ShellWM))
#define SHELL_WM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_WM, ShellWMClass))
#define SHELL_IS_WM(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SHELL_TYPE_WM))
#define SHELL_IS_WM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_WM))
#define SHELL_WM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_WM, ShellWMClass))
struct _ShellWMClass
{
GObjectClass parent_class;
};
GType shell_wm_get_type (void) G_GNUC_CONST;
ShellWM *shell_wm_new (MetaPlugin *plugin); ShellWM *shell_wm_new (MetaPlugin *plugin);

View File

@@ -37,7 +37,9 @@
#include "st-adjustment.h" #include "st-adjustment.h"
#include "st-private.h" #include "st-private.h"
typedef struct _StAdjustmentPrivate StAdjustmentPrivate; G_DEFINE_TYPE (StAdjustment, st_adjustment, G_TYPE_OBJECT)
#define ADJUSTMENT_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), ST_TYPE_ADJUSTMENT, StAdjustmentPrivate))
struct _StAdjustmentPrivate struct _StAdjustmentPrivate
{ {
@@ -53,8 +55,6 @@ struct _StAdjustmentPrivate
gdouble page_size; gdouble page_size;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (StAdjustment, st_adjustment, G_TYPE_OBJECT)
enum enum
{ {
PROP_0, PROP_0,
@@ -92,7 +92,6 @@ st_adjustment_constructed (GObject *object)
{ {
GObjectClass *g_class; GObjectClass *g_class;
StAdjustment *self = ST_ADJUSTMENT (object); StAdjustment *self = ST_ADJUSTMENT (object);
StAdjustmentPrivate *priv = st_adjustment_get_instance_private (self);
g_class = G_OBJECT_CLASS (st_adjustment_parent_class); g_class = G_OBJECT_CLASS (st_adjustment_parent_class);
/* The docs say we're suppose to chain up, but would crash without /* The docs say we're suppose to chain up, but would crash without
@@ -103,8 +102,8 @@ st_adjustment_constructed (GObject *object)
g_class->constructed (object); g_class->constructed (object);
} }
priv->is_constructing = FALSE; ST_ADJUSTMENT (self)->priv->is_constructing = FALSE;
st_adjustment_clamp_page (self, priv->lower, priv->upper); st_adjustment_clamp_page (self, self->priv->lower, self->priv->upper);
} }
static void static void
@@ -113,7 +112,7 @@ st_adjustment_get_property (GObject *gobject,
GValue *value, GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
StAdjustmentPrivate *priv = st_adjustment_get_instance_private (ST_ADJUSTMENT (gobject)); StAdjustmentPrivate *priv = ST_ADJUSTMENT (gobject)->priv;
switch (prop_id) switch (prop_id)
{ {
@@ -192,6 +191,8 @@ st_adjustment_class_init (StAdjustmentClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (StAdjustmentPrivate));
object_class->constructed = st_adjustment_constructed; object_class->constructed = st_adjustment_constructed;
object_class->get_property = st_adjustment_get_property; object_class->get_property = st_adjustment_get_property;
object_class->set_property = st_adjustment_set_property; object_class->set_property = st_adjustment_set_property;
@@ -274,8 +275,9 @@ st_adjustment_class_init (StAdjustmentClass *klass)
static void static void
st_adjustment_init (StAdjustment *self) st_adjustment_init (StAdjustment *self)
{ {
StAdjustmentPrivate *priv = st_adjustment_get_instance_private (self); self->priv = ADJUSTMENT_PRIVATE (self);
priv->is_constructing = TRUE;
self->priv->is_constructing = TRUE;
} }
StAdjustment * StAdjustment *
@@ -299,9 +301,13 @@ st_adjustment_new (gdouble value,
gdouble gdouble
st_adjustment_get_value (StAdjustment *adjustment) st_adjustment_get_value (StAdjustment *adjustment)
{ {
StAdjustmentPrivate *priv;
g_return_val_if_fail (ST_IS_ADJUSTMENT (adjustment), 0); g_return_val_if_fail (ST_IS_ADJUSTMENT (adjustment), 0);
return ((StAdjustmentPrivate *)st_adjustment_get_instance_private (adjustment))->value; priv = adjustment->priv;
return priv->value;
} }
void void
@@ -312,7 +318,7 @@ st_adjustment_set_value (StAdjustment *adjustment,
g_return_if_fail (ST_IS_ADJUSTMENT (adjustment)); g_return_if_fail (ST_IS_ADJUSTMENT (adjustment));
priv = st_adjustment_get_instance_private (adjustment); priv = adjustment->priv;
/* Defer clamp until after construction. */ /* Defer clamp until after construction. */
if (!priv->is_constructing) if (!priv->is_constructing)
@@ -340,7 +346,7 @@ st_adjustment_clamp_page (StAdjustment *adjustment,
g_return_if_fail (ST_IS_ADJUSTMENT (adjustment)); g_return_if_fail (ST_IS_ADJUSTMENT (adjustment));
priv = st_adjustment_get_instance_private (adjustment); priv = adjustment->priv;
lower = CLAMP (lower, priv->lower, priv->upper - priv->page_size); lower = CLAMP (lower, priv->lower, priv->upper - priv->page_size);
upper = CLAMP (upper, priv->lower + priv->page_size, priv->upper); upper = CLAMP (upper, priv->lower + priv->page_size, priv->upper);
@@ -367,7 +373,7 @@ static gboolean
st_adjustment_set_lower (StAdjustment *adjustment, st_adjustment_set_lower (StAdjustment *adjustment,
gdouble lower) gdouble lower)
{ {
StAdjustmentPrivate *priv = st_adjustment_get_instance_private (adjustment); StAdjustmentPrivate *priv = adjustment->priv;
if (priv->lower != lower) if (priv->lower != lower)
{ {
@@ -391,7 +397,7 @@ static gboolean
st_adjustment_set_upper (StAdjustment *adjustment, st_adjustment_set_upper (StAdjustment *adjustment,
gdouble upper) gdouble upper)
{ {
StAdjustmentPrivate *priv = st_adjustment_get_instance_private (adjustment); StAdjustmentPrivate *priv = adjustment->priv;
if (priv->upper != upper) if (priv->upper != upper)
{ {
@@ -415,7 +421,7 @@ static gboolean
st_adjustment_set_step_increment (StAdjustment *adjustment, st_adjustment_set_step_increment (StAdjustment *adjustment,
gdouble step) gdouble step)
{ {
StAdjustmentPrivate *priv = st_adjustment_get_instance_private (adjustment); StAdjustmentPrivate *priv = adjustment->priv;
if (priv->step_increment != step) if (priv->step_increment != step)
{ {
@@ -435,7 +441,7 @@ static gboolean
st_adjustment_set_page_increment (StAdjustment *adjustment, st_adjustment_set_page_increment (StAdjustment *adjustment,
gdouble page) gdouble page)
{ {
StAdjustmentPrivate *priv = st_adjustment_get_instance_private (adjustment); StAdjustmentPrivate *priv = adjustment->priv;
if (priv->page_increment != page) if (priv->page_increment != page)
{ {
@@ -455,7 +461,7 @@ static gboolean
st_adjustment_set_page_size (StAdjustment *adjustment, st_adjustment_set_page_size (StAdjustment *adjustment,
gdouble size) gdouble size)
{ {
StAdjustmentPrivate *priv = st_adjustment_get_instance_private (adjustment); StAdjustmentPrivate *priv = adjustment->priv;
if (priv->page_size != size) if (priv->page_size != size)
{ {
@@ -492,7 +498,7 @@ st_adjustment_set_values (StAdjustment *adjustment,
g_return_if_fail (step_increment >= 0 && step_increment <= G_MAXDOUBLE); g_return_if_fail (step_increment >= 0 && step_increment <= G_MAXDOUBLE);
g_return_if_fail (page_increment >= 0 && page_increment <= G_MAXDOUBLE); g_return_if_fail (page_increment >= 0 && page_increment <= G_MAXDOUBLE);
priv = st_adjustment_get_instance_private (adjustment); priv = adjustment->priv;
emit_changed = FALSE; emit_changed = FALSE;
@@ -541,7 +547,7 @@ st_adjustment_get_values (StAdjustment *adjustment,
g_return_if_fail (ST_IS_ADJUSTMENT (adjustment)); g_return_if_fail (ST_IS_ADJUSTMENT (adjustment));
priv = st_adjustment_get_instance_private (adjustment); priv = adjustment->priv;
if (lower) if (lower)
*lower = priv->lower; *lower = priv->lower;
@@ -583,7 +589,7 @@ st_adjustment_adjust_for_scroll_event (StAdjustment *adjustment,
g_return_if_fail (ST_IS_ADJUSTMENT (adjustment)); g_return_if_fail (ST_IS_ADJUSTMENT (adjustment));
priv = st_adjustment_get_instance_private (adjustment); priv = adjustment->priv;
scroll_unit = pow (priv->page_size, 2.0 / 3.0); scroll_unit = pow (priv->page_size, 2.0 / 3.0);

View File

@@ -31,7 +31,30 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define ST_TYPE_ADJUSTMENT (st_adjustment_get_type()) #define ST_TYPE_ADJUSTMENT (st_adjustment_get_type())
G_DECLARE_DERIVABLE_TYPE (StAdjustment, st_adjustment, ST, ADJUSTMENT, GObject) #define ST_ADJUSTMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_ADJUSTMENT, StAdjustment))
#define ST_IS_ADJUSTMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_ADJUSTMENT))
#define ST_ADJUSTMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_ADJUSTMENT, StAdjustmentClass))
#define ST_IS_ADJUSTMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_ADJUSTMENT))
#define ST_ADJUSTMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_ADJUSTMENT, StAdjustmentClass))
typedef struct _StAdjustment StAdjustment;
typedef struct _StAdjustmentPrivate StAdjustmentPrivate;
typedef struct _StAdjustmentClass StAdjustmentClass;
/**
* StAdjustment:
*
* Class for handling an interval between to values. The contents of
* the #StAdjustment are private and should be accessed using the
* public API.
*/
struct _StAdjustment
{
/*< private >*/
GObject parent_instance;
StAdjustmentPrivate *priv;
};
/** /**
* StAdjustmentClass: * StAdjustmentClass:
@@ -48,6 +71,8 @@ struct _StAdjustmentClass
void (* changed) (StAdjustment *adjustment); void (* changed) (StAdjustment *adjustment);
}; };
GType st_adjustment_get_type (void) G_GNUC_CONST;
StAdjustment *st_adjustment_new (gdouble value, StAdjustment *st_adjustment_new (gdouble value,
gdouble lower, gdouble lower,
gdouble upper, gdouble upper,

View File

@@ -38,7 +38,8 @@
#include "st-enum-types.h" #include "st-enum-types.h"
#include "st-private.h" #include "st-private.h"
typedef struct _StBinPrivate StBinPrivate; #define ST_BIN_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ST_TYPE_BIN, StBinPrivate))
struct _StBinPrivate struct _StBinPrivate
{ {
ClutterActor *child; ClutterActor *child;
@@ -64,7 +65,6 @@ enum
static void clutter_container_iface_init (ClutterContainerIface *iface); static void clutter_container_iface_init (ClutterContainerIface *iface);
G_DEFINE_TYPE_WITH_CODE (StBin, st_bin, ST_TYPE_WIDGET, G_DEFINE_TYPE_WITH_CODE (StBin, st_bin, ST_TYPE_WIDGET,
G_ADD_PRIVATE (StBin)
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER, G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER,
clutter_container_iface_init)); clutter_container_iface_init));
@@ -79,11 +79,10 @@ static void
st_bin_remove (ClutterContainer *container, st_bin_remove (ClutterContainer *container,
ClutterActor *actor) ClutterActor *actor)
{ {
StBin *bin = ST_BIN (container); StBinPrivate *priv = ST_BIN (container)->priv;
StBinPrivate *priv = st_bin_get_instance_private (bin);
if (priv->child == actor) if (priv->child == actor)
st_bin_set_child (bin, NULL); st_bin_set_child (ST_BIN (container), NULL);
} }
static void static void
@@ -98,7 +97,7 @@ st_bin_allocate (ClutterActor *self,
const ClutterActorBox *box, const ClutterActorBox *box,
ClutterAllocationFlags flags) ClutterAllocationFlags flags)
{ {
StBinPrivate *priv = st_bin_get_instance_private (ST_BIN (self)); StBinPrivate *priv = ST_BIN (self)->priv;
clutter_actor_set_allocation (self, box, flags); clutter_actor_set_allocation (self, box, flags);
@@ -124,7 +123,7 @@ st_bin_get_preferred_width (ClutterActor *self,
gfloat *min_width_p, gfloat *min_width_p,
gfloat *natural_width_p) gfloat *natural_width_p)
{ {
StBinPrivate *priv = st_bin_get_instance_private (ST_BIN (self)); StBinPrivate *priv = ST_BIN (self)->priv;
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self));
st_theme_node_adjust_for_height (theme_node, &for_height); st_theme_node_adjust_for_height (theme_node, &for_height);
@@ -153,7 +152,7 @@ st_bin_get_preferred_height (ClutterActor *self,
gfloat *min_height_p, gfloat *min_height_p,
gfloat *natural_height_p) gfloat *natural_height_p)
{ {
StBinPrivate *priv = st_bin_get_instance_private (ST_BIN (self)); StBinPrivate *priv = ST_BIN (self)->priv;
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self));
st_theme_node_adjust_for_width (theme_node, &for_width); st_theme_node_adjust_for_width (theme_node, &for_width);
@@ -179,7 +178,7 @@ st_bin_get_preferred_height (ClutterActor *self,
static void static void
st_bin_dispose (GObject *gobject) st_bin_dispose (GObject *gobject)
{ {
StBinPrivate *priv = st_bin_get_instance_private (ST_BIN (gobject)); StBinPrivate *priv = ST_BIN (gobject)->priv;
if (priv->child) if (priv->child)
clutter_actor_destroy (priv->child); clutter_actor_destroy (priv->child);
@@ -191,7 +190,7 @@ st_bin_dispose (GObject *gobject)
static void static void
st_bin_popup_menu (StWidget *widget) st_bin_popup_menu (StWidget *widget)
{ {
StBinPrivate *priv = st_bin_get_instance_private (ST_BIN (widget)); StBinPrivate *priv = ST_BIN (widget)->priv;
if (priv->child && ST_IS_WIDGET (priv->child)) if (priv->child && ST_IS_WIDGET (priv->child))
st_widget_popup_menu (ST_WIDGET (priv->child)); st_widget_popup_menu (ST_WIDGET (priv->child));
@@ -202,7 +201,7 @@ st_bin_navigate_focus (StWidget *widget,
ClutterActor *from, ClutterActor *from,
GtkDirectionType direction) GtkDirectionType direction)
{ {
StBinPrivate *priv = st_bin_get_instance_private (ST_BIN (widget)); StBinPrivate *priv = ST_BIN (widget)->priv;
ClutterActor *bin_actor = CLUTTER_ACTOR (widget); ClutterActor *bin_actor = CLUTTER_ACTOR (widget);
if (st_widget_get_can_focus (widget)) if (st_widget_get_can_focus (widget))
@@ -233,7 +232,6 @@ st_bin_set_property (GObject *gobject,
GParamSpec *pspec) GParamSpec *pspec)
{ {
StBin *bin = ST_BIN (gobject); StBin *bin = ST_BIN (gobject);
StBinPrivate *priv = st_bin_get_instance_private (bin);
switch (prop_id) switch (prop_id)
{ {
@@ -244,24 +242,24 @@ st_bin_set_property (GObject *gobject,
case PROP_X_ALIGN: case PROP_X_ALIGN:
st_bin_set_alignment (bin, st_bin_set_alignment (bin,
g_value_get_enum (value), g_value_get_enum (value),
priv->y_align); bin->priv->y_align);
break; break;
case PROP_Y_ALIGN: case PROP_Y_ALIGN:
st_bin_set_alignment (bin, st_bin_set_alignment (bin,
priv->x_align, bin->priv->x_align,
g_value_get_enum (value)); g_value_get_enum (value));
break; break;
case PROP_X_FILL: case PROP_X_FILL:
st_bin_set_fill (bin, st_bin_set_fill (bin,
g_value_get_boolean (value), g_value_get_boolean (value),
priv->y_fill); bin->priv->y_fill);
break; break;
case PROP_Y_FILL: case PROP_Y_FILL:
st_bin_set_fill (bin, st_bin_set_fill (bin,
priv->x_fill, bin->priv->x_fill,
g_value_get_boolean (value)); g_value_get_boolean (value));
break; break;
@@ -276,7 +274,7 @@ st_bin_get_property (GObject *gobject,
GValue *value, GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
StBinPrivate *priv = st_bin_get_instance_private (ST_BIN (gobject)); StBinPrivate *priv = ST_BIN (gobject)->priv;
switch (prop_id) switch (prop_id)
{ {
@@ -313,6 +311,8 @@ st_bin_class_init (StBinClass *klass)
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass); StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
GParamSpec *pspec; GParamSpec *pspec;
g_type_class_add_private (klass, sizeof (StBinPrivate));
gobject_class->set_property = st_bin_set_property; gobject_class->set_property = st_bin_set_property;
gobject_class->get_property = st_bin_get_property; gobject_class->get_property = st_bin_get_property;
gobject_class->dispose = st_bin_dispose; gobject_class->dispose = st_bin_dispose;
@@ -392,10 +392,10 @@ st_bin_class_init (StBinClass *klass)
static void static void
st_bin_init (StBin *bin) st_bin_init (StBin *bin)
{ {
StBinPrivate *priv = st_bin_get_instance_private (bin); bin->priv = ST_BIN_GET_PRIVATE (bin);
priv->x_align = ST_ALIGN_MIDDLE; bin->priv->x_align = ST_ALIGN_MIDDLE;
priv->y_align = ST_ALIGN_MIDDLE; bin->priv->y_align = ST_ALIGN_MIDDLE;
} }
/** /**
@@ -429,7 +429,7 @@ st_bin_set_child (StBin *bin,
g_return_if_fail (ST_IS_BIN (bin)); g_return_if_fail (ST_IS_BIN (bin));
g_return_if_fail (child == NULL || CLUTTER_IS_ACTOR (child)); g_return_if_fail (child == NULL || CLUTTER_IS_ACTOR (child));
priv = st_bin_get_instance_private (bin); priv = bin->priv;
if (priv->child == child) if (priv->child == child)
return; return;
@@ -463,7 +463,7 @@ st_bin_get_child (StBin *bin)
{ {
g_return_val_if_fail (ST_IS_BIN (bin), NULL); g_return_val_if_fail (ST_IS_BIN (bin), NULL);
return ((StBinPrivate *)st_bin_get_instance_private (bin))->child; return bin->priv->child;
} }
/** /**
@@ -485,7 +485,7 @@ st_bin_set_alignment (StBin *bin,
g_return_if_fail (ST_IS_BIN (bin)); g_return_if_fail (ST_IS_BIN (bin));
priv = st_bin_get_instance_private (bin); priv = bin->priv;
g_object_freeze_notify (G_OBJECT (bin)); g_object_freeze_notify (G_OBJECT (bin));
@@ -527,7 +527,7 @@ st_bin_get_alignment (StBin *bin,
g_return_if_fail (ST_IS_BIN (bin)); g_return_if_fail (ST_IS_BIN (bin));
priv = st_bin_get_instance_private (bin); priv = bin->priv;
if (x_align) if (x_align)
*x_align = priv->x_align; *x_align = priv->x_align;
@@ -555,7 +555,7 @@ st_bin_set_fill (StBin *bin,
g_return_if_fail (ST_IS_BIN (bin)); g_return_if_fail (ST_IS_BIN (bin));
priv = st_bin_get_instance_private (bin); priv = bin->priv;
g_object_freeze_notify (G_OBJECT (bin)); g_object_freeze_notify (G_OBJECT (bin));
@@ -594,15 +594,11 @@ st_bin_get_fill (StBin *bin,
gboolean *x_fill, gboolean *x_fill,
gboolean *y_fill) gboolean *y_fill)
{ {
StBinPrivate *priv;
g_return_if_fail (ST_IS_BIN (bin)); g_return_if_fail (ST_IS_BIN (bin));
priv = st_bin_get_instance_private (bin);
if (x_fill) if (x_fill)
*x_fill = priv->x_fill; *x_fill = bin->priv->x_fill;
if (y_fill) if (y_fill)
*y_fill = priv->y_fill; *y_fill = bin->priv->y_fill;
} }

View File

@@ -30,7 +30,28 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define ST_TYPE_BIN (st_bin_get_type ()) #define ST_TYPE_BIN (st_bin_get_type ())
G_DECLARE_DERIVABLE_TYPE (StBin, st_bin, ST, BIN, StWidget) #define ST_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_BIN, StBin))
#define ST_IS_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_BIN))
#define ST_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_BIN, StBinClass))
#define ST_IS_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_BIN))
#define ST_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_BIN, StBinClass))
typedef struct _StBin StBin;
typedef struct _StBinPrivate StBinPrivate;
typedef struct _StBinClass StBinClass;
/**
* StBin:
*
* The #StBin struct contains only private data
*/
struct _StBin
{
/*< private >*/
StWidget parent_instance;
StBinPrivate *priv;
};
/** /**
* StBinClass: * StBinClass:
@@ -43,6 +64,8 @@ struct _StBinClass
StWidgetClass parent_class; StWidgetClass parent_class;
}; };
GType st_bin_get_type (void) G_GNUC_CONST;
StWidget * st_bin_new (void); StWidget * st_bin_new (void);
void st_bin_set_child (StBin *bin, void st_bin_set_child (StBin *bin,
ClutterActor *child); ClutterActor *child);

View File

@@ -28,9 +28,17 @@ G_BEGIN_DECLS
/* A StBorderImage encapsulates an image with specified unscaled borders on each edge. /* A StBorderImage encapsulates an image with specified unscaled borders on each edge.
*/ */
typedef struct _StBorderImage StBorderImage;
typedef struct _StBorderImageClass StBorderImageClass;
#define ST_TYPE_BORDER_IMAGE (st_border_image_get_type ()) #define ST_TYPE_BORDER_IMAGE (st_border_image_get_type ())
G_DECLARE_FINAL_TYPE (StBorderImage, st_border_image, ST, BORDER_IMAGE, GObject) #define ST_BORDER_IMAGE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), ST_TYPE_BORDER_IMAGE, StBorderImage))
#define ST_BORDER_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_BORDER_IMAGE, StBorderImageClass))
#define ST_IS_BORDER_IMAGE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), ST_TYPE_BORDER_IMAGE))
#define ST_IS_BORDER_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_BORDER_IMAGE))
#define ST_BORDER_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_BORDER_IMAGE, StBorderImageClass))
GType st_border_image_get_type (void) G_GNUC_CONST;
StBorderImage *st_border_image_new (GFile *file, StBorderImage *st_border_image_new (GFile *file,
int border_top, int border_top,

View File

@@ -30,6 +30,9 @@
G_DEFINE_TYPE (StBoxLayoutChild, st_box_layout_child, CLUTTER_TYPE_CHILD_META) G_DEFINE_TYPE (StBoxLayoutChild, st_box_layout_child, CLUTTER_TYPE_CHILD_META)
#define BOX_LAYOUT_CHILD_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), ST_TYPE_BOX_LAYOUT_CHILD, StBoxLayoutChildPrivate))
enum enum
{ {

View File

@@ -27,9 +27,29 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define ST_TYPE_BOX_LAYOUT_CHILD st_box_layout_child_get_type() #define ST_TYPE_BOX_LAYOUT_CHILD st_box_layout_child_get_type()
G_DECLARE_FINAL_TYPE (StBoxLayoutChild, st_box_layout_child, ST, BOX_LAYOUT_CHILD, ClutterChildMeta)
#define ST_BOX_LAYOUT_CHILD(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
ST_TYPE_BOX_LAYOUT_CHILD, StBoxLayoutChild))
#define ST_BOX_LAYOUT_CHILD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), \
ST_TYPE_BOX_LAYOUT_CHILD, StBoxLayoutChildClass))
#define ST_IS_BOX_LAYOUT_CHILD(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
ST_TYPE_BOX_LAYOUT_CHILD))
#define ST_IS_BOX_LAYOUT_CHILD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
ST_TYPE_BOX_LAYOUT_CHILD))
#define ST_BOX_LAYOUT_CHILD_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
ST_TYPE_BOX_LAYOUT_CHILD, StBoxLayoutChildClass))
typedef struct _StBoxLayoutChild StBoxLayoutChild; typedef struct _StBoxLayoutChild StBoxLayoutChild;
typedef struct _StBoxLayoutChildClass StBoxLayoutChildClass;
typedef struct _StBoxLayoutChildPrivate StBoxLayoutChildPrivate; typedef struct _StBoxLayoutChildPrivate StBoxLayoutChildPrivate;
/** /**
@@ -47,6 +67,13 @@ struct _StBoxLayoutChild
gboolean y_fill_set; gboolean y_fill_set;
}; };
struct _StBoxLayoutChildClass
{
ClutterChildMetaClass parent_class;
};
GType st_box_layout_child_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* _ST_BOX_LAYOUT_CHILD_H */ #endif /* _ST_BOX_LAYOUT_CHILD_H */

View File

@@ -59,6 +59,15 @@
static void st_box_container_iface_init (ClutterContainerIface *iface); static void st_box_container_iface_init (ClutterContainerIface *iface);
static void st_box_scrollable_interface_init (StScrollableInterface *iface); static void st_box_scrollable_interface_init (StScrollableInterface *iface);
G_DEFINE_TYPE_WITH_CODE (StBoxLayout, st_box_layout, ST_TYPE_WIDGET,
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER,
st_box_container_iface_init)
G_IMPLEMENT_INTERFACE (ST_TYPE_SCROLLABLE,
st_box_scrollable_interface_init));
#define BOX_LAYOUT_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), ST_TYPE_BOX_LAYOUT, StBoxLayoutPrivate))
enum { enum {
PROP_0, PROP_0,
@@ -75,13 +84,6 @@ struct _StBoxLayoutPrivate
StAdjustment *vadjustment; StAdjustment *vadjustment;
}; };
G_DEFINE_TYPE_WITH_CODE (StBoxLayout, st_box_layout, ST_TYPE_WIDGET,
G_ADD_PRIVATE (StBoxLayout)
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER,
st_box_container_iface_init)
G_IMPLEMENT_INTERFACE (ST_TYPE_SCROLLABLE,
st_box_scrollable_interface_init));
/* /*
* StScrollable Interface Implementation * StScrollable Interface Implementation
*/ */
@@ -586,6 +588,8 @@ st_box_layout_class_init (StBoxLayoutClass *klass)
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass); StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
GParamSpec *pspec; GParamSpec *pspec;
g_type_class_add_private (klass, sizeof (StBoxLayoutPrivate));
object_class->get_property = st_box_layout_get_property; object_class->get_property = st_box_layout_get_property;
object_class->set_property = st_box_layout_set_property; object_class->set_property = st_box_layout_set_property;
object_class->dispose = st_box_layout_dispose; object_class->dispose = st_box_layout_dispose;
@@ -628,7 +632,7 @@ st_box_layout_class_init (StBoxLayoutClass *klass)
static void static void
st_box_layout_init (StBoxLayout *self) st_box_layout_init (StBoxLayout *self)
{ {
self->priv = st_box_layout_get_instance_private (self); self->priv = BOX_LAYOUT_PRIVATE (self);
g_signal_connect (self, "notify::layout-manager", g_signal_connect (self, "notify::layout-manager",
G_CALLBACK (on_layout_manager_notify), NULL); G_CALLBACK (on_layout_manager_notify), NULL);

View File

@@ -30,9 +30,29 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define ST_TYPE_BOX_LAYOUT st_box_layout_get_type() #define ST_TYPE_BOX_LAYOUT st_box_layout_get_type()
G_DECLARE_FINAL_TYPE (StBoxLayout, st_box_layout, ST, BOX_LAYOUT, StWidget)
#define ST_BOX_LAYOUT(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
ST_TYPE_BOX_LAYOUT, StBoxLayout))
#define ST_BOX_LAYOUT_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), \
ST_TYPE_BOX_LAYOUT, StBoxLayoutClass))
#define ST_IS_BOX_LAYOUT(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
ST_TYPE_BOX_LAYOUT))
#define ST_IS_BOX_LAYOUT_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
ST_TYPE_BOX_LAYOUT))
#define ST_BOX_LAYOUT_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
ST_TYPE_BOX_LAYOUT, StBoxLayoutClass))
typedef struct _StBoxLayout StBoxLayout; typedef struct _StBoxLayout StBoxLayout;
typedef struct _StBoxLayoutClass StBoxLayoutClass;
typedef struct _StBoxLayoutPrivate StBoxLayoutPrivate; typedef struct _StBoxLayoutPrivate StBoxLayoutPrivate;
/** /**
@@ -49,6 +69,13 @@ struct _StBoxLayout
StBoxLayoutPrivate *priv; StBoxLayoutPrivate *priv;
}; };
struct _StBoxLayoutClass
{
StWidgetClass parent_class;
};
GType st_box_layout_get_type (void);
StWidget *st_box_layout_new (void); StWidget *st_box_layout_new (void);
void st_box_layout_set_vertical (StBoxLayout *box, void st_box_layout_set_vertical (StBoxLayout *box,

View File

@@ -64,7 +64,8 @@ enum
LAST_SIGNAL LAST_SIGNAL
}; };
typedef struct _StButtonPrivate StButtonPrivate; #define ST_BUTTON_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), ST_TYPE_BUTTON, StButtonPrivate))
struct _StButtonPrivate struct _StButtonPrivate
{ {
@@ -85,7 +86,7 @@ struct _StButtonPrivate
static guint button_signals[LAST_SIGNAL] = { 0, }; static guint button_signals[LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE_WITH_PRIVATE (StButton, st_button, ST_TYPE_BIN); G_DEFINE_TYPE (StButton, st_button, ST_TYPE_BIN);
static GType st_button_accessible_get_type (void) G_GNUC_CONST; static GType st_button_accessible_get_type (void) G_GNUC_CONST;
@@ -107,7 +108,7 @@ static void
st_button_style_changed (StWidget *widget) st_button_style_changed (StWidget *widget)
{ {
StButton *button = ST_BUTTON (widget); StButton *button = ST_BUTTON (widget);
StButtonPrivate *priv = st_button_get_instance_private (button); StButtonPrivate *priv = button->priv;
StButtonClass *button_class = ST_BUTTON_GET_CLASS (button); StButtonClass *button_class = ST_BUTTON_GET_CLASS (button);
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (button)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (button));
double spacing; double spacing;
@@ -134,14 +135,12 @@ st_button_press (StButton *button,
StButtonMask mask, StButtonMask mask,
ClutterEventSequence *sequence) ClutterEventSequence *sequence)
{ {
StButtonPrivate *priv = st_button_get_instance_private (button); if (button->priv->pressed == 0 || sequence)
if (priv->pressed == 0 || sequence)
st_widget_add_style_pseudo_class (ST_WIDGET (button), "active"); st_widget_add_style_pseudo_class (ST_WIDGET (button), "active");
priv->pressed |= mask; button->priv->pressed |= mask;
priv->press_sequence = sequence; button->priv->press_sequence = sequence;
priv->device = device; button->priv->device = device;
} }
static void static void
@@ -151,27 +150,25 @@ st_button_release (StButton *button,
int clicked_button, int clicked_button,
ClutterEventSequence *sequence) ClutterEventSequence *sequence)
{ {
StButtonPrivate *priv = st_button_get_instance_private (button); if ((device && button->priv->device != device) ||
(sequence && button->priv->press_sequence != sequence))
if ((device && priv->device != device) ||
(sequence && priv->press_sequence != sequence))
return; return;
else if (!sequence) else if (!sequence)
{ {
priv->pressed &= ~mask; button->priv->pressed &= ~mask;
if (priv->pressed != 0) if (button->priv->pressed != 0)
return; return;
} }
priv->press_sequence = NULL; button->priv->press_sequence = NULL;
priv->device = NULL; button->priv->device = NULL;
st_widget_remove_style_pseudo_class (ST_WIDGET (button), "active"); st_widget_remove_style_pseudo_class (ST_WIDGET (button), "active");
if (clicked_button || sequence) if (clicked_button || sequence)
{ {
if (priv->is_toggle) if (button->priv->is_toggle)
st_button_set_checked (button, !priv->is_checked); st_button_set_checked (button, !button->priv->is_checked);
g_signal_emit (button, button_signals[CLICKED], 0, clicked_button); g_signal_emit (button, button_signals[CLICKED], 0, clicked_button);
} }
@@ -182,19 +179,18 @@ st_button_button_press (ClutterActor *actor,
ClutterButtonEvent *event) ClutterButtonEvent *event)
{ {
StButton *button = ST_BUTTON (actor); StButton *button = ST_BUTTON (actor);
StButtonPrivate *priv = st_button_get_instance_private (button);
StButtonMask mask = ST_BUTTON_MASK_FROM_BUTTON (event->button); StButtonMask mask = ST_BUTTON_MASK_FROM_BUTTON (event->button);
ClutterInputDevice *device = clutter_event_get_device ((ClutterEvent*) event); ClutterInputDevice *device = clutter_event_get_device ((ClutterEvent*) event);
if (priv->press_sequence) if (button->priv->press_sequence)
return CLUTTER_EVENT_PROPAGATE; return CLUTTER_EVENT_PROPAGATE;
if (priv->button_mask & mask) if (button->priv->button_mask & mask)
{ {
if (priv->grabbed == 0) if (button->priv->grabbed == 0)
clutter_grab_pointer (actor); clutter_grab_pointer (actor);
priv->grabbed |= mask; button->priv->grabbed |= mask;
st_button_press (button, device, mask, NULL); st_button_press (button, device, mask, NULL);
return TRUE; return TRUE;
@@ -208,19 +204,18 @@ st_button_button_release (ClutterActor *actor,
ClutterButtonEvent *event) ClutterButtonEvent *event)
{ {
StButton *button = ST_BUTTON (actor); StButton *button = ST_BUTTON (actor);
StButtonPrivate *priv = st_button_get_instance_private (button);
StButtonMask mask = ST_BUTTON_MASK_FROM_BUTTON (event->button); StButtonMask mask = ST_BUTTON_MASK_FROM_BUTTON (event->button);
ClutterInputDevice *device = clutter_event_get_device ((ClutterEvent*) event); ClutterInputDevice *device = clutter_event_get_device ((ClutterEvent*) event);
if (priv->button_mask & mask) if (button->priv->button_mask & mask)
{ {
gboolean is_click; gboolean is_click;
is_click = priv->grabbed && clutter_actor_contains (actor, event->source); is_click = button->priv->grabbed && clutter_actor_contains (actor, event->source);
st_button_release (button, device, mask, is_click ? event->button : 0, NULL); st_button_release (button, device, mask, is_click ? event->button : 0, NULL);
priv->grabbed &= ~mask; button->priv->grabbed &= ~mask;
if (priv->grabbed == 0) if (button->priv->grabbed == 0)
clutter_ungrab_pointer (); clutter_ungrab_pointer ();
return TRUE; return TRUE;
@@ -234,26 +229,25 @@ st_button_touch_event (ClutterActor *actor,
ClutterTouchEvent *event) ClutterTouchEvent *event)
{ {
StButton *button = ST_BUTTON (actor); StButton *button = ST_BUTTON (actor);
StButtonPrivate *priv = st_button_get_instance_private (button);
StButtonMask mask = ST_BUTTON_MASK_FROM_BUTTON (1); StButtonMask mask = ST_BUTTON_MASK_FROM_BUTTON (1);
ClutterEventSequence *sequence; ClutterEventSequence *sequence;
ClutterInputDevice *device; ClutterInputDevice *device;
if (priv->pressed != 0) if (button->priv->pressed != 0)
return CLUTTER_EVENT_PROPAGATE; return CLUTTER_EVENT_PROPAGATE;
device = clutter_event_get_device ((ClutterEvent*) event); device = clutter_event_get_device ((ClutterEvent*) event);
sequence = clutter_event_get_event_sequence ((ClutterEvent*) event); sequence = clutter_event_get_event_sequence ((ClutterEvent*) event);
if (event->type == CLUTTER_TOUCH_BEGIN && !priv->press_sequence) if (event->type == CLUTTER_TOUCH_BEGIN && !button->priv->press_sequence)
{ {
clutter_input_device_sequence_grab (device, sequence, actor); clutter_input_device_sequence_grab (device, sequence, actor);
st_button_press (button, device, 0, sequence); st_button_press (button, device, 0, sequence);
return CLUTTER_EVENT_STOP; return CLUTTER_EVENT_STOP;
} }
else if (event->type == CLUTTER_TOUCH_END && else if (event->type == CLUTTER_TOUCH_END &&
priv->device == device && button->priv->device == device &&
priv->press_sequence == sequence) button->priv->press_sequence == sequence)
{ {
st_button_release (button, device, mask, 0, sequence); st_button_release (button, device, mask, 0, sequence);
clutter_input_device_sequence_ungrab (device, sequence); clutter_input_device_sequence_ungrab (device, sequence);
@@ -268,9 +262,8 @@ st_button_key_press (ClutterActor *actor,
ClutterKeyEvent *event) ClutterKeyEvent *event)
{ {
StButton *button = ST_BUTTON (actor); StButton *button = ST_BUTTON (actor);
StButtonPrivate *priv = st_button_get_instance_private (button);
if (priv->button_mask & ST_BUTTON_ONE) if (button->priv->button_mask & ST_BUTTON_ONE)
{ {
if (event->keyval == CLUTTER_KEY_space || if (event->keyval == CLUTTER_KEY_space ||
event->keyval == CLUTTER_KEY_Return || event->keyval == CLUTTER_KEY_Return ||
@@ -290,9 +283,8 @@ st_button_key_release (ClutterActor *actor,
ClutterKeyEvent *event) ClutterKeyEvent *event)
{ {
StButton *button = ST_BUTTON (actor); StButton *button = ST_BUTTON (actor);
StButtonPrivate *priv = st_button_get_instance_private (button);
if (priv->button_mask & ST_BUTTON_ONE) if (button->priv->button_mask & ST_BUTTON_ONE)
{ {
if (event->keyval == CLUTTER_KEY_space || if (event->keyval == CLUTTER_KEY_space ||
event->keyval == CLUTTER_KEY_Return || event->keyval == CLUTTER_KEY_Return ||
@@ -301,7 +293,7 @@ st_button_key_release (ClutterActor *actor,
{ {
gboolean is_click; gboolean is_click;
is_click = (priv->pressed & ST_BUTTON_ONE); is_click = (button->priv->pressed & ST_BUTTON_ONE);
st_button_release (button, NULL, ST_BUTTON_ONE, is_click ? 1 : 0, NULL); st_button_release (button, NULL, ST_BUTTON_ONE, is_click ? 1 : 0, NULL);
return TRUE; return TRUE;
} }
@@ -314,11 +306,10 @@ static void
st_button_key_focus_out (ClutterActor *actor) st_button_key_focus_out (ClutterActor *actor)
{ {
StButton *button = ST_BUTTON (actor); StButton *button = ST_BUTTON (actor);
StButtonPrivate *priv = st_button_get_instance_private (button);
/* If we lose focus between a key press and release, undo the press */ /* If we lose focus between a key press and release, undo the press */
if ((priv->pressed & ST_BUTTON_ONE) && if ((button->priv->pressed & ST_BUTTON_ONE) &&
!(priv->grabbed & ST_BUTTON_ONE)) !(button->priv->grabbed & ST_BUTTON_ONE))
st_button_release (button, NULL, ST_BUTTON_ONE, 0, NULL); st_button_release (button, NULL, ST_BUTTON_ONE, 0, NULL);
CLUTTER_ACTOR_CLASS (st_button_parent_class)->key_focus_out (actor); CLUTTER_ACTOR_CLASS (st_button_parent_class)->key_focus_out (actor);
@@ -329,19 +320,18 @@ st_button_enter (ClutterActor *actor,
ClutterCrossingEvent *event) ClutterCrossingEvent *event)
{ {
StButton *button = ST_BUTTON (actor); StButton *button = ST_BUTTON (actor);
StButtonPrivate *priv = st_button_get_instance_private (button);
gboolean ret; gboolean ret;
ret = CLUTTER_ACTOR_CLASS (st_button_parent_class)->enter_event (actor, event); ret = CLUTTER_ACTOR_CLASS (st_button_parent_class)->enter_event (actor, event);
if (priv->grabbed) if (button->priv->grabbed)
{ {
if (st_widget_get_hover (ST_WIDGET (button))) if (st_widget_get_hover (ST_WIDGET (button)))
st_button_press (button, priv->device, st_button_press (button, button->priv->device,
priv->grabbed, NULL); button->priv->grabbed, NULL);
else else
st_button_release (button, priv->device, st_button_release (button, button->priv->device,
priv->grabbed, 0, NULL); button->priv->grabbed, 0, NULL);
} }
return ret; return ret;
@@ -352,19 +342,18 @@ st_button_leave (ClutterActor *actor,
ClutterCrossingEvent *event) ClutterCrossingEvent *event)
{ {
StButton *button = ST_BUTTON (actor); StButton *button = ST_BUTTON (actor);
StButtonPrivate *priv = st_button_get_instance_private (button);
gboolean ret; gboolean ret;
ret = CLUTTER_ACTOR_CLASS (st_button_parent_class)->leave_event (actor, event); ret = CLUTTER_ACTOR_CLASS (st_button_parent_class)->leave_event (actor, event);
if (priv->grabbed) if (button->priv->grabbed)
{ {
if (st_widget_get_hover (ST_WIDGET (button))) if (st_widget_get_hover (ST_WIDGET (button)))
st_button_press (button, priv->device, st_button_press (button, button->priv->device,
priv->grabbed, NULL); button->priv->grabbed, NULL);
else else
st_button_release (button, priv->device, st_button_release (button, button->priv->device,
priv->grabbed, 0, NULL); button->priv->grabbed, 0, NULL);
} }
return ret; return ret;
@@ -406,7 +395,7 @@ st_button_get_property (GObject *gobject,
GValue *value, GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
StButtonPrivate *priv = st_button_get_instance_private (ST_BUTTON (gobject)); StButtonPrivate *priv = ST_BUTTON (gobject)->priv;
switch (prop_id) switch (prop_id)
{ {
@@ -436,7 +425,7 @@ st_button_get_property (GObject *gobject,
static void static void
st_button_finalize (GObject *gobject) st_button_finalize (GObject *gobject)
{ {
StButtonPrivate *priv = st_button_get_instance_private (ST_BUTTON (gobject)); StButtonPrivate *priv = ST_BUTTON (gobject)->priv;
g_free (priv->text); g_free (priv->text);
@@ -451,6 +440,8 @@ st_button_class_init (StButtonClass *klass)
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass); StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
GParamSpec *pspec; GParamSpec *pspec;
g_type_class_add_private (klass, sizeof (StButtonPrivate));
gobject_class->set_property = st_button_set_property; gobject_class->set_property = st_button_set_property;
gobject_class->get_property = st_button_get_property; gobject_class->get_property = st_button_get_property;
gobject_class->finalize = st_button_finalize; gobject_class->finalize = st_button_finalize;
@@ -521,10 +512,9 @@ st_button_class_init (StButtonClass *klass)
static void static void
st_button_init (StButton *button) st_button_init (StButton *button)
{ {
StButtonPrivate *priv = st_button_get_instance_private (button); button->priv = ST_BUTTON_GET_PRIVATE (button);
button->priv->spacing = 6;
priv->spacing = 6; button->priv->button_mask = ST_BUTTON_ONE;
priv->button_mask = ST_BUTTON_ONE;
clutter_actor_set_reactive (CLUTTER_ACTOR (button), TRUE); clutter_actor_set_reactive (CLUTTER_ACTOR (button), TRUE);
st_widget_set_track_hover (ST_WIDGET (button), TRUE); st_widget_set_track_hover (ST_WIDGET (button), TRUE);
@@ -570,7 +560,7 @@ st_button_get_label (StButton *button)
{ {
g_return_val_if_fail (ST_IS_BUTTON (button), NULL); g_return_val_if_fail (ST_IS_BUTTON (button), NULL);
return ((StButtonPrivate *)st_button_get_instance_private (button))->text; return button->priv->text;
} }
/** /**
@@ -589,7 +579,7 @@ st_button_set_label (StButton *button,
g_return_if_fail (ST_IS_BUTTON (button)); g_return_if_fail (ST_IS_BUTTON (button));
priv = st_button_get_instance_private (button); priv = button->priv;
g_free (priv->text); g_free (priv->text);
@@ -636,7 +626,7 @@ st_button_get_button_mask (StButton *button)
{ {
g_return_val_if_fail (ST_IS_BUTTON (button), 0); g_return_val_if_fail (ST_IS_BUTTON (button), 0);
return ((StButtonPrivate *)st_button_get_instance_private (button))->button_mask; return button->priv->button_mask;
} }
/** /**
@@ -650,12 +640,9 @@ void
st_button_set_button_mask (StButton *button, st_button_set_button_mask (StButton *button,
StButtonMask mask) StButtonMask mask)
{ {
StButtonPrivate *priv;
g_return_if_fail (ST_IS_BUTTON (button)); g_return_if_fail (ST_IS_BUTTON (button));
priv = st_button_get_instance_private (button); button->priv->button_mask = mask;
priv->button_mask = mask;
g_object_notify (G_OBJECT (button), "button-mask"); g_object_notify (G_OBJECT (button), "button-mask");
} }
@@ -673,7 +660,7 @@ st_button_get_toggle_mode (StButton *button)
{ {
g_return_val_if_fail (ST_IS_BUTTON (button), FALSE); g_return_val_if_fail (ST_IS_BUTTON (button), FALSE);
return ((StButtonPrivate *)st_button_get_instance_private (button))->is_toggle; return button->priv->is_toggle;
} }
/** /**
@@ -688,12 +675,9 @@ void
st_button_set_toggle_mode (StButton *button, st_button_set_toggle_mode (StButton *button,
gboolean toggle) gboolean toggle)
{ {
StButtonPrivate *priv;
g_return_if_fail (ST_IS_BUTTON (button)); g_return_if_fail (ST_IS_BUTTON (button));
priv = st_button_get_instance_private (button); button->priv->is_toggle = toggle;
priv->is_toggle = toggle;
g_object_notify (G_OBJECT (button), "toggle-mode"); g_object_notify (G_OBJECT (button), "toggle-mode");
} }
@@ -711,7 +695,7 @@ st_button_get_checked (StButton *button)
{ {
g_return_val_if_fail (ST_IS_BUTTON (button), FALSE); g_return_val_if_fail (ST_IS_BUTTON (button), FALSE);
return ((StButtonPrivate *)st_button_get_instance_private (button))->is_checked; return button->priv->is_checked;
} }
/** /**
@@ -726,14 +710,11 @@ void
st_button_set_checked (StButton *button, st_button_set_checked (StButton *button,
gboolean checked) gboolean checked)
{ {
StButtonPrivate *priv;
g_return_if_fail (ST_IS_BUTTON (button)); g_return_if_fail (ST_IS_BUTTON (button));
priv = st_button_get_instance_private (button); if (button->priv->is_checked != checked)
if (priv->is_checked != checked)
{ {
priv->is_checked = checked; button->priv->is_checked = checked;
if (checked) if (checked)
st_widget_add_style_pseudo_class (ST_WIDGET (button), "checked"); st_widget_add_style_pseudo_class (ST_WIDGET (button), "checked");
@@ -760,30 +741,25 @@ st_button_set_checked (StButton *button,
void void
st_button_fake_release (StButton *button) st_button_fake_release (StButton *button)
{ {
StButtonPrivate *priv; if (button->priv->pressed)
st_button_release (button, button->priv->device,
button->priv->pressed, 0, NULL);
g_return_if_fail (ST_IS_BUTTON (button)); if (button->priv->grabbed)
priv = st_button_get_instance_private (button);
if (priv->pressed)
st_button_release (button, priv->device,
priv->pressed, 0, NULL);
if (priv->grabbed)
{ {
priv->grabbed = 0; button->priv->grabbed = 0;
clutter_ungrab_pointer (); clutter_ungrab_pointer ();
} }
if (priv->device && if (button->priv->device &&
priv->press_sequence) button->priv->press_sequence)
{ {
clutter_input_device_sequence_ungrab (priv->device, clutter_input_device_sequence_ungrab (button->priv->device,
priv->press_sequence); button->priv->press_sequence);
priv->press_sequence = NULL; button->priv->press_sequence = NULL;
} }
priv->device = NULL; button->priv->device = NULL;
} }
/******************************************************************************/ /******************************************************************************/
@@ -846,7 +822,7 @@ st_button_accessible_get_name (AtkObject *obj)
if (name != NULL) if (name != NULL)
return name; return name;
return st_button_get_label (button); return button->priv->text;
} }
static void static void
@@ -876,7 +852,7 @@ static void
st_button_accessible_compute_role (AtkObject *accessible, st_button_accessible_compute_role (AtkObject *accessible,
StButton *button) StButton *button)
{ {
atk_object_set_role (accessible, st_button_get_toggle_mode (button) atk_object_set_role (accessible, button->priv->is_toggle
? ATK_ROLE_TOGGLE_BUTTON : ATK_ROLE_PUSH_BUTTON); ? ATK_ROLE_TOGGLE_BUTTON : ATK_ROLE_PUSH_BUTTON);
} }

View File

@@ -30,7 +30,30 @@ G_BEGIN_DECLS
#include <st/st-bin.h> #include <st/st-bin.h>
#define ST_TYPE_BUTTON (st_button_get_type ()) #define ST_TYPE_BUTTON (st_button_get_type ())
G_DECLARE_DERIVABLE_TYPE (StButton, st_button, ST, BUTTON, StBin) #define ST_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_BUTTON, StButton))
#define ST_IS_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_BUTTON))
#define ST_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_BUTTON, StButtonClass))
#define ST_IS_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_BUTTON))
#define ST_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_BUTTON, StButtonClass))
typedef struct _StButton StButton;
typedef struct _StButtonPrivate StButtonPrivate;
typedef struct _StButtonClass StButtonClass;
/**
* StButton:
*
* The contents of this structure is private and should only be accessed using
* the provided API.
*/
struct _StButton
{
/*< private >*/
StBin parent_instance;
StButtonPrivate *priv;
};
struct _StButtonClass struct _StButtonClass
{ {
@@ -43,6 +66,8 @@ struct _StButtonClass
void (* clicked) (StButton *button); void (* clicked) (StButton *button);
}; };
GType st_button_get_type (void) G_GNUC_CONST;
StWidget *st_button_new (void); StWidget *st_button_new (void);
StWidget *st_button_new_with_label (const gchar *text); StWidget *st_button_new_with_label (const gchar *text);
const gchar *st_button_get_label (StButton *button); const gchar *st_button_get_label (StButton *button);

View File

@@ -34,6 +34,11 @@
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
#include <string.h> #include <string.h>
G_DEFINE_TYPE (StClipboard, st_clipboard, G_TYPE_OBJECT)
#define CLIPBOARD_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), ST_TYPE_CLIPBOARD, StClipboardPrivate))
struct _StClipboardPrivate struct _StClipboardPrivate
{ {
Window clipboard_window; Window clipboard_window;
@@ -43,8 +48,6 @@ struct _StClipboardPrivate
gint n_targets; gint n_targets;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (StClipboard, st_clipboard, G_TYPE_OBJECT)
typedef struct _EventFilterData EventFilterData; typedef struct _EventFilterData EventFilterData;
struct _EventFilterData struct _EventFilterData
{ {
@@ -179,6 +182,8 @@ st_clipboard_class_init (StClipboardClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (StClipboardPrivate));
object_class->get_property = st_clipboard_get_property; object_class->get_property = st_clipboard_get_property;
object_class->set_property = st_clipboard_set_property; object_class->set_property = st_clipboard_set_property;
object_class->dispose = st_clipboard_dispose; object_class->dispose = st_clipboard_dispose;
@@ -192,7 +197,7 @@ st_clipboard_init (StClipboard *self)
Display *dpy; Display *dpy;
StClipboardPrivate *priv; StClipboardPrivate *priv;
priv = self->priv = st_clipboard_get_instance_private (self); priv = self->priv = CLIPBOARD_PRIVATE (self);
gdk_display = gdk_display_get_default (); gdk_display = gdk_display_get_default ();
dpy = GDK_DISPLAY_XDISPLAY (gdk_display); dpy = GDK_DISPLAY_XDISPLAY (gdk_display);

View File

@@ -29,9 +29,29 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define ST_TYPE_CLIPBOARD st_clipboard_get_type() #define ST_TYPE_CLIPBOARD st_clipboard_get_type()
G_DECLARE_FINAL_TYPE (StClipboard, st_clipboard, ST, CLIPBOARD, GObject)
#define ST_CLIPBOARD(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
ST_TYPE_CLIPBOARD, StClipboard))
#define ST_CLIPBOARD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), \
ST_TYPE_CLIPBOARD, StClipboardClass))
#define ST_IS_CLIPBOARD(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
ST_TYPE_CLIPBOARD))
#define ST_IS_CLIPBOARD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
ST_TYPE_CLIPBOARD))
#define ST_CLIPBOARD_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
ST_TYPE_CLIPBOARD, StClipboardClass))
typedef struct _StClipboard StClipboard; typedef struct _StClipboard StClipboard;
typedef struct _StClipboardClass StClipboardClass;
typedef struct _StClipboardPrivate StClipboardPrivate; typedef struct _StClipboardPrivate StClipboardPrivate;
/** /**
@@ -47,6 +67,11 @@ struct _StClipboard
StClipboardPrivate *priv; StClipboardPrivate *priv;
}; };
struct _StClipboardClass
{
GObjectClass parent_class;
};
typedef enum { typedef enum {
ST_CLIPBOARD_TYPE_PRIMARY, ST_CLIPBOARD_TYPE_PRIMARY,
ST_CLIPBOARD_TYPE_CLIPBOARD ST_CLIPBOARD_TYPE_CLIPBOARD
@@ -64,6 +89,8 @@ typedef void (*StClipboardCallbackFunc) (StClipboard *clipboard,
const gchar *text, const gchar *text,
gpointer user_data); gpointer user_data);
GType st_clipboard_get_type (void);
StClipboard* st_clipboard_get_default (void); StClipboard* st_clipboard_get_default (void);
void st_clipboard_get_text (StClipboard *clipboard, void st_clipboard_get_text (StClipboard *clipboard,

View File

@@ -36,14 +36,16 @@
#include <cairo.h> #include <cairo.h>
typedef struct _StDrawingAreaPrivate StDrawingAreaPrivate; G_DEFINE_TYPE(StDrawingArea, st_drawing_area, ST_TYPE_WIDGET);
struct _StDrawingAreaPrivate { struct _StDrawingAreaPrivate {
CoglTexture *texture;
CoglPipeline *pipeline;
cairo_t *context; cairo_t *context;
guint needs_repaint : 1;
guint in_repaint : 1; guint in_repaint : 1;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (StDrawingArea, st_drawing_area, ST_TYPE_WIDGET);
/* Signals */ /* Signals */
enum enum
{ {
@@ -53,61 +55,124 @@ enum
static guint st_drawing_area_signals [LAST_SIGNAL] = { 0 }; static guint st_drawing_area_signals [LAST_SIGNAL] = { 0 };
static gboolean static void
draw_content (ClutterCanvas *canvas, st_drawing_area_dispose (GObject *object)
cairo_t *cr,
int width,
int height,
gpointer user_data)
{ {
StDrawingArea *area = ST_DRAWING_AREA (user_data); StDrawingArea *area = ST_DRAWING_AREA (object);
StDrawingAreaPrivate *priv = st_drawing_area_get_instance_private (area); StDrawingAreaPrivate *priv = area->priv;
priv->context = cr; g_clear_pointer (&priv->pipeline, cogl_object_unref);
priv->in_repaint = TRUE; g_clear_pointer (&priv->texture, cogl_object_unref);
clutter_cairo_clear (cr); G_OBJECT_CLASS (st_drawing_area_parent_class)->dispose (object);
g_signal_emit (area, st_drawing_area_signals[REPAINT], 0);
priv->context = NULL;
priv->in_repaint = FALSE;
return TRUE;
} }
static void static void
st_drawing_area_allocate (ClutterActor *self, st_drawing_area_paint (ClutterActor *self)
const ClutterActorBox *box,
ClutterAllocationFlags flags)
{ {
StDrawingArea *area = ST_DRAWING_AREA (self);
StDrawingAreaPrivate *priv = area->priv;
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self));
ClutterContent *content = clutter_actor_get_content (self); ClutterActorBox allocation_box;
ClutterActorBox content_box; ClutterActorBox content_box;
int width, height; int width, height;
clutter_actor_set_allocation (self, box, flags); (CLUTTER_ACTOR_CLASS (st_drawing_area_parent_class))->paint (self);
st_theme_node_get_content_box (theme_node, box, &content_box);
clutter_actor_get_allocation_box (self, &allocation_box);
st_theme_node_get_content_box (theme_node, &allocation_box, &content_box);
width = (int)(0.5 + content_box.x2 - content_box.x1); width = (int)(0.5 + content_box.x2 - content_box.x1);
height = (int)(0.5 + content_box.y2 - content_box.y1); height = (int)(0.5 + content_box.y2 - content_box.y1);
clutter_canvas_set_size (CLUTTER_CANVAS (content), width, height);
if (priv->pipeline == NULL)
{
CoglContext *ctx =
clutter_backend_get_cogl_context (clutter_get_default_backend ());
priv->pipeline = cogl_pipeline_new (ctx);
}
if (priv->texture != NULL &&
(width != (int)cogl_texture_get_width (priv->texture) ||
height != (int)cogl_texture_get_height (priv->texture)))
{
cogl_object_unref (priv->texture);
priv->texture = NULL;
}
if (width > 0 && height > 0)
{
if (priv->texture == NULL)
{
priv->texture = cogl_texture_new_with_size (width, height,
COGL_TEXTURE_NONE,
CLUTTER_CAIRO_FORMAT_ARGB32);
priv->needs_repaint = TRUE;
}
if (priv->needs_repaint)
{
cairo_surface_t *surface;
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
priv->context = cairo_create (surface);
priv->in_repaint = TRUE;
priv->needs_repaint = FALSE;
g_signal_emit ((GObject*)area, st_drawing_area_signals[REPAINT], 0);
priv->in_repaint = FALSE;
cairo_destroy (priv->context);
priv->context = NULL;
cogl_texture_set_region (priv->texture, 0, 0, 0, 0, width, height, width, height,
CLUTTER_CAIRO_FORMAT_ARGB32,
cairo_image_surface_get_stride (surface),
cairo_image_surface_get_data (surface));
cairo_surface_destroy (surface);
}
}
cogl_pipeline_set_layer_texture (priv->pipeline, 0, priv->texture);
if (priv->texture)
{
CoglColor color;
guint8 paint_opacity;
CoglFramebuffer *fb = cogl_get_draw_framebuffer ();
paint_opacity = clutter_actor_get_paint_opacity (self);
cogl_color_init_from_4ub (&color, paint_opacity, paint_opacity, paint_opacity, paint_opacity);
cogl_pipeline_set_color (priv->pipeline, &color);
cogl_framebuffer_draw_rectangle (fb, priv->pipeline,
content_box.x1, content_box.y1,
content_box.x2, content_box.y2);
}
} }
static void static void
st_drawing_area_style_changed (StWidget *self) st_drawing_area_style_changed (StWidget *self)
{ {
StDrawingArea *area = ST_DRAWING_AREA (self);
StDrawingAreaPrivate *priv = area->priv;
(ST_WIDGET_CLASS (st_drawing_area_parent_class))->style_changed (self); (ST_WIDGET_CLASS (st_drawing_area_parent_class))->style_changed (self);
st_drawing_area_queue_repaint (ST_DRAWING_AREA (self)); priv->needs_repaint = TRUE;
} }
static void static void
st_drawing_area_class_init (StDrawingAreaClass *klass) st_drawing_area_class_init (StDrawingAreaClass *klass)
{ {
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass); StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
actor_class->allocate = st_drawing_area_allocate; gobject_class->dispose = st_drawing_area_dispose;
actor_class->paint = st_drawing_area_paint;
widget_class->style_changed = st_drawing_area_style_changed; widget_class->style_changed = st_drawing_area_style_changed;
st_drawing_area_signals[REPAINT] = st_drawing_area_signals[REPAINT] =
@@ -117,15 +182,16 @@ st_drawing_area_class_init (StDrawingAreaClass *klass)
G_STRUCT_OFFSET (StDrawingAreaClass, repaint), G_STRUCT_OFFSET (StDrawingAreaClass, repaint),
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 0); G_TYPE_NONE, 0);
g_type_class_add_private (gobject_class, sizeof (StDrawingAreaPrivate));
} }
static void static void
st_drawing_area_init (StDrawingArea *area) st_drawing_area_init (StDrawingArea *area)
{ {
ClutterContent *content = clutter_canvas_new (); area->priv = G_TYPE_INSTANCE_GET_PRIVATE (area, ST_TYPE_DRAWING_AREA,
g_signal_connect (content, "draw", G_CALLBACK (draw_content), area); StDrawingAreaPrivate);
clutter_actor_set_content (CLUTTER_ACTOR (area), content); area->priv->texture = NULL;
g_object_unref (content);
} }
/** /**
@@ -141,9 +207,14 @@ st_drawing_area_init (StDrawingArea *area)
void void
st_drawing_area_queue_repaint (StDrawingArea *area) st_drawing_area_queue_repaint (StDrawingArea *area)
{ {
StDrawingAreaPrivate *priv;
g_return_if_fail (ST_IS_DRAWING_AREA (area)); g_return_if_fail (ST_IS_DRAWING_AREA (area));
clutter_content_invalidate (clutter_actor_get_content (CLUTTER_ACTOR (area))); priv = area->priv;
priv->needs_repaint = TRUE;
clutter_actor_queue_redraw (CLUTTER_ACTOR (area));
} }
/** /**
@@ -158,14 +229,10 @@ st_drawing_area_queue_repaint (StDrawingArea *area)
cairo_t * cairo_t *
st_drawing_area_get_context (StDrawingArea *area) st_drawing_area_get_context (StDrawingArea *area)
{ {
StDrawingAreaPrivate *priv;
g_return_val_if_fail (ST_IS_DRAWING_AREA (area), NULL); g_return_val_if_fail (ST_IS_DRAWING_AREA (area), NULL);
g_return_val_if_fail (area->priv->in_repaint, NULL);
priv = st_drawing_area_get_instance_private (area); return area->priv->context;
g_return_val_if_fail (priv->in_repaint, NULL);
return priv->context;
} }
/** /**
@@ -184,19 +251,14 @@ st_drawing_area_get_surface_size (StDrawingArea *area,
guint *height) guint *height)
{ {
StDrawingAreaPrivate *priv; StDrawingAreaPrivate *priv;
ClutterContent *content;
float w, h;
g_return_if_fail (ST_IS_DRAWING_AREA (area)); g_return_if_fail (ST_IS_DRAWING_AREA (area));
g_return_if_fail (area->priv->in_repaint);
priv = st_drawing_area_get_instance_private (area); priv = area->priv;
g_return_if_fail (priv->in_repaint);
content = clutter_actor_get_content (CLUTTER_ACTOR (area));
clutter_content_get_preferred_size (content, &w, &h);
if (width) if (width)
*width = (guint)w; *width = cogl_texture_get_width (priv->texture);
if (height) if (height)
*height = (guint)h; *height = cogl_texture_get_height (priv->texture);
} }

View File

@@ -25,8 +25,23 @@
#include <cairo.h> #include <cairo.h>
#define ST_TYPE_DRAWING_AREA (st_drawing_area_get_type ()) #define ST_TYPE_DRAWING_AREA (st_drawing_area_get_type ())
G_DECLARE_DERIVABLE_TYPE (StDrawingArea, st_drawing_area, #define ST_DRAWING_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_DRAWING_AREA, StDrawingArea))
ST, DRAWING_AREA, StWidget) #define ST_DRAWING_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_DRAWING_AREA, StDrawingAreaClass))
#define ST_IS_DRAWING_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_DRAWING_AREA))
#define ST_IS_DRAWING_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_DRAWING_AREA))
#define ST_DRAWING_AREA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_DRAWING_AREA, StDrawingAreaClass))
typedef struct _StDrawingArea StDrawingArea;
typedef struct _StDrawingAreaClass StDrawingAreaClass;
typedef struct _StDrawingAreaPrivate StDrawingAreaPrivate;
struct _StDrawingArea
{
StWidget parent;
StDrawingAreaPrivate *priv;
};
struct _StDrawingAreaClass struct _StDrawingAreaClass
{ {
@@ -35,6 +50,8 @@ struct _StDrawingAreaClass
void (*repaint) (StDrawingArea *area); void (*repaint) (StDrawingArea *area);
}; };
GType st_drawing_area_get_type (void) G_GNUC_CONST;
void st_drawing_area_queue_repaint (StDrawingArea *area); void st_drawing_area_queue_repaint (StDrawingArea *area);
cairo_t *st_drawing_area_get_context (StDrawingArea *area); cairo_t *st_drawing_area_get_context (StDrawingArea *area);
void st_drawing_area_get_surface_size (StDrawingArea *area, void st_drawing_area_get_surface_size (StDrawingArea *area,

View File

@@ -87,10 +87,10 @@ enum
LAST_SIGNAL LAST_SIGNAL
}; };
#define ST_ENTRY_PRIV(x) st_entry_get_instance_private ((StEntry *) x) #define ST_ENTRY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ST_TYPE_ENTRY, StEntryPrivate))
#define ST_ENTRY_PRIV(x) ((StEntry *) x)->priv
typedef struct _StEntryPrivate StEntryPrivate;
struct _StEntryPrivate struct _StEntryPrivate
{ {
ClutterActor *entry; ClutterActor *entry;
@@ -108,7 +108,7 @@ struct _StEntryPrivate
static guint entry_signals[LAST_SIGNAL] = { 0, }; static guint entry_signals[LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE_WITH_PRIVATE (StEntry, st_entry, ST_TYPE_WIDGET); G_DEFINE_TYPE (StEntry, st_entry, ST_TYPE_WIDGET);
static GType st_entry_accessible_get_type (void) G_GNUC_CONST; static GType st_entry_accessible_get_type (void) G_GNUC_CONST;
@@ -183,8 +183,7 @@ st_entry_get_property (GObject *gobject,
static void static void
show_capslock_feedback (StEntry *entry) show_capslock_feedback (StEntry *entry)
{ {
StEntryPrivate *priv = ST_ENTRY_PRIV (entry); if (entry->priv->secondary_icon == NULL)
if (priv->secondary_icon == NULL)
{ {
ClutterActor *icon = g_object_new (ST_TYPE_ICON, ClutterActor *icon = g_object_new (ST_TYPE_ICON,
"style-class", "capslock-warning", "style-class", "capslock-warning",
@@ -192,18 +191,17 @@ show_capslock_feedback (StEntry *entry)
NULL); NULL);
st_entry_set_secondary_icon (entry, icon); st_entry_set_secondary_icon (entry, icon);
priv->capslock_warning_shown = TRUE; entry->priv->capslock_warning_shown = TRUE;
} }
} }
static void static void
remove_capslock_feedback (StEntry *entry) remove_capslock_feedback (StEntry *entry)
{ {
StEntryPrivate *priv = ST_ENTRY_PRIV (entry); if (entry->priv->capslock_warning_shown)
if (priv->capslock_warning_shown)
{ {
st_entry_set_secondary_icon (entry, NULL); st_entry_set_secondary_icon (entry, NULL);
priv->capslock_warning_shown = FALSE; entry->priv->capslock_warning_shown = FALSE;
} }
} }
@@ -212,9 +210,8 @@ keymap_state_changed (GdkKeymap *keymap,
gpointer user_data) gpointer user_data)
{ {
StEntry *entry = ST_ENTRY (user_data); StEntry *entry = ST_ENTRY (user_data);
StEntryPrivate *priv = ST_ENTRY_PRIV (entry);
if (clutter_text_get_password_char (CLUTTER_TEXT (priv->entry)) != 0) if (clutter_text_get_password_char (CLUTTER_TEXT (entry->priv->entry)) != 0)
{ {
if (gdk_keymap_get_caps_lock_state (keymap)) if (gdk_keymap_get_caps_lock_state (keymap))
show_capslock_feedback (entry); show_capslock_feedback (entry);
@@ -227,7 +224,7 @@ static void
st_entry_dispose (GObject *object) st_entry_dispose (GObject *object)
{ {
StEntry *entry = ST_ENTRY (object); StEntry *entry = ST_ENTRY (object);
StEntryPrivate *priv = ST_ENTRY_PRIV (entry); StEntryPrivate *priv = entry->priv;
GdkKeymap *keymap; GdkKeymap *keymap;
if (priv->entry) if (priv->entry)
@@ -483,7 +480,7 @@ clutter_text_focus_in_cb (ClutterText *text,
ClutterActor *actor) ClutterActor *actor)
{ {
StEntry *entry = ST_ENTRY (actor); StEntry *entry = ST_ENTRY (actor);
StEntryPrivate *priv = ST_ENTRY_PRIV (entry); StEntryPrivate *priv = entry->priv;
GdkKeymap *keymap; GdkKeymap *keymap;
/* remove the hint if visible */ /* remove the hint if visible */
@@ -509,7 +506,7 @@ clutter_text_focus_out_cb (ClutterText *text,
ClutterActor *actor) ClutterActor *actor)
{ {
StEntry *entry = ST_ENTRY (actor); StEntry *entry = ST_ENTRY (actor);
StEntryPrivate *priv = ST_ENTRY_PRIV (entry); StEntryPrivate *priv = entry->priv;
GdkKeymap *keymap; GdkKeymap *keymap;
st_widget_remove_style_pseudo_class (ST_WIDGET (actor), "focus"); st_widget_remove_style_pseudo_class (ST_WIDGET (actor), "focus");
@@ -535,9 +532,8 @@ clutter_text_password_char_cb (GObject *object,
gpointer user_data) gpointer user_data)
{ {
StEntry *entry = ST_ENTRY (user_data); StEntry *entry = ST_ENTRY (user_data);
StEntryPrivate *priv = ST_ENTRY_PRIV (entry);
if (clutter_text_get_password_char (CLUTTER_TEXT (priv->entry)) == 0) if (clutter_text_get_password_char (CLUTTER_TEXT (entry->priv->entry)) == 0)
remove_capslock_feedback (entry); remove_capslock_feedback (entry);
} }
@@ -546,8 +542,7 @@ st_entry_clipboard_callback (StClipboard *clipboard,
const gchar *text, const gchar *text,
gpointer data) gpointer data)
{ {
StEntryPrivate *priv = ST_ENTRY_PRIV (data); ClutterText *ctext = (ClutterText*)((StEntry *) data)->priv->entry;
ClutterText *ctext = (ClutterText*)priv->entry;
gint cursor_pos; gint cursor_pos;
if (!text) if (!text)
@@ -726,15 +721,14 @@ st_entry_set_cursor (StEntry *entry,
{ {
cursor_func (entry, use_ibeam, cursor_func_data); cursor_func (entry, use_ibeam, cursor_func_data);
((StEntryPrivate *)ST_ENTRY_PRIV (entry))->has_ibeam = use_ibeam; entry->priv->has_ibeam = use_ibeam;
} }
static gboolean static gboolean
st_entry_enter_event (ClutterActor *actor, st_entry_enter_event (ClutterActor *actor,
ClutterCrossingEvent *event) ClutterCrossingEvent *event)
{ {
StEntryPrivate *priv = ST_ENTRY_PRIV (actor); if (event->source == ST_ENTRY (actor)->priv->entry && event->related != NULL)
if (event->source == priv->entry && event->related != NULL)
st_entry_set_cursor (ST_ENTRY (actor), TRUE); st_entry_set_cursor (ST_ENTRY (actor), TRUE);
return CLUTTER_ACTOR_CLASS (st_entry_parent_class)->enter_event (actor, event); return CLUTTER_ACTOR_CLASS (st_entry_parent_class)->enter_event (actor, event);
@@ -744,8 +738,7 @@ static gboolean
st_entry_leave_event (ClutterActor *actor, st_entry_leave_event (ClutterActor *actor,
ClutterCrossingEvent *event) ClutterCrossingEvent *event)
{ {
StEntryPrivate *priv = ST_ENTRY_PRIV (actor); if (event->source == ST_ENTRY (actor)->priv->entry && event->related != NULL)
if (event->source == priv->entry && event->related != NULL)
st_entry_set_cursor (ST_ENTRY (actor), FALSE); st_entry_set_cursor (ST_ENTRY (actor), FALSE);
return CLUTTER_ACTOR_CLASS (st_entry_parent_class)->leave_event (actor, event); return CLUTTER_ACTOR_CLASS (st_entry_parent_class)->leave_event (actor, event);
@@ -754,8 +747,7 @@ st_entry_leave_event (ClutterActor *actor,
static void static void
st_entry_unmap (ClutterActor *actor) st_entry_unmap (ClutterActor *actor)
{ {
StEntryPrivate *priv = ST_ENTRY_PRIV (actor); if (ST_ENTRY (actor)->priv->has_ibeam)
if (priv->has_ibeam)
st_entry_set_cursor (ST_ENTRY (actor), FALSE); st_entry_set_cursor (ST_ENTRY (actor), FALSE);
CLUTTER_ACTOR_CLASS (st_entry_parent_class)->unmap (actor); CLUTTER_ACTOR_CLASS (st_entry_parent_class)->unmap (actor);
@@ -769,6 +761,8 @@ st_entry_class_init (StEntryClass *klass)
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass); StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
GParamSpec *pspec; GParamSpec *pspec;
g_type_class_add_private (klass, sizeof (StEntryPrivate));
gobject_class->set_property = st_entry_set_property; gobject_class->set_property = st_entry_set_property;
gobject_class->get_property = st_entry_get_property; gobject_class->get_property = st_entry_get_property;
gobject_class->finalize = st_entry_finalize; gobject_class->finalize = st_entry_finalize;
@@ -864,7 +858,7 @@ st_entry_init (StEntry *entry)
{ {
StEntryPrivate *priv; StEntryPrivate *priv;
priv = st_entry_get_instance_private (entry); priv = entry->priv = ST_ENTRY_GET_PRIVATE (entry);
priv->entry = g_object_new (ST_TYPE_IM_TEXT, priv->entry = g_object_new (ST_TYPE_IM_TEXT,
"line-alignment", PANGO_ALIGN_LEFT, "line-alignment", PANGO_ALIGN_LEFT,
@@ -926,15 +920,12 @@ st_entry_new (const gchar *text)
const gchar * const gchar *
st_entry_get_text (StEntry *entry) st_entry_get_text (StEntry *entry)
{ {
StEntryPrivate *priv;
g_return_val_if_fail (ST_IS_ENTRY (entry), NULL); g_return_val_if_fail (ST_IS_ENTRY (entry), NULL);
priv = st_entry_get_instance_private (entry); if (entry->priv->hint_visible)
if (priv->hint_visible)
return ""; return "";
else else
return clutter_text_get_text (CLUTTER_TEXT (priv->entry)); return clutter_text_get_text (CLUTTER_TEXT (entry->priv->entry));
} }
/** /**
@@ -952,7 +943,7 @@ st_entry_set_text (StEntry *entry,
g_return_if_fail (ST_IS_ENTRY (entry)); g_return_if_fail (ST_IS_ENTRY (entry));
priv = st_entry_get_instance_private (entry); priv = entry->priv;
/* set a hint if we are blanking the entry */ /* set a hint if we are blanking the entry */
if (priv->hint if (priv->hint
@@ -989,7 +980,7 @@ st_entry_get_clutter_text (StEntry *entry)
{ {
g_return_val_if_fail (ST_ENTRY (entry), NULL); g_return_val_if_fail (ST_ENTRY (entry), NULL);
return ((StEntryPrivate *)ST_ENTRY_PRIV (entry))->entry; return entry->priv->entry;
} }
/** /**
@@ -1009,7 +1000,7 @@ st_entry_set_hint_text (StEntry *entry,
g_return_if_fail (ST_IS_ENTRY (entry)); g_return_if_fail (ST_IS_ENTRY (entry));
priv = st_entry_get_instance_private (entry); priv = entry->priv;
g_free (priv->hint); g_free (priv->hint);
@@ -1039,7 +1030,7 @@ st_entry_get_hint_text (StEntry *entry)
{ {
g_return_val_if_fail (ST_IS_ENTRY (entry), NULL); g_return_val_if_fail (ST_IS_ENTRY (entry), NULL);
return ((StEntryPrivate *)ST_ENTRY_PRIV (entry))->hint; return entry->priv->hint;
} }
/** /**
@@ -1055,13 +1046,11 @@ void
st_entry_set_input_purpose (StEntry *entry, st_entry_set_input_purpose (StEntry *entry,
GtkInputPurpose purpose) GtkInputPurpose purpose)
{ {
StEntryPrivate *priv;
StIMText *imtext; StIMText *imtext;
g_return_if_fail (ST_IS_ENTRY (entry)); g_return_if_fail (ST_IS_ENTRY (entry));
priv = st_entry_get_instance_private (entry); imtext = ST_IM_TEXT (entry->priv->entry);
imtext = ST_IM_TEXT (priv->entry);
if (st_im_text_get_input_purpose (imtext) != purpose) if (st_im_text_get_input_purpose (imtext) != purpose)
{ {
@@ -1080,12 +1069,9 @@ st_entry_set_input_purpose (StEntry *entry,
GtkInputPurpose GtkInputPurpose
st_entry_get_input_purpose (StEntry *entry) st_entry_get_input_purpose (StEntry *entry)
{ {
StEntryPrivate *priv;
g_return_val_if_fail (ST_IS_ENTRY (entry), GTK_INPUT_PURPOSE_FREE_FORM); g_return_val_if_fail (ST_IS_ENTRY (entry), GTK_INPUT_PURPOSE_FREE_FORM);
priv = st_entry_get_instance_private (entry); return st_im_text_get_input_purpose (ST_IM_TEXT (entry->priv->entry));
return st_im_text_get_input_purpose (ST_IM_TEXT (priv->entry));
} }
/** /**
@@ -1100,13 +1086,11 @@ void
st_entry_set_input_hints (StEntry *entry, st_entry_set_input_hints (StEntry *entry,
GtkInputHints hints) GtkInputHints hints)
{ {
StEntryPrivate *priv;
StIMText *imtext; StIMText *imtext;
g_return_if_fail (ST_IS_ENTRY (entry)); g_return_if_fail (ST_IS_ENTRY (entry));
priv = st_entry_get_instance_private (entry); imtext = ST_IM_TEXT (entry->priv->entry);
imtext = ST_IM_TEXT (priv->entry);
if (st_im_text_get_input_hints (imtext) != hints) if (st_im_text_get_input_hints (imtext) != hints)
{ {
@@ -1125,12 +1109,9 @@ st_entry_set_input_hints (StEntry *entry,
GtkInputHints GtkInputHints
st_entry_get_input_hints (StEntry *entry) st_entry_get_input_hints (StEntry *entry)
{ {
StEntryPrivate *priv;
g_return_val_if_fail (ST_IS_ENTRY (entry), GTK_INPUT_HINT_NONE); g_return_val_if_fail (ST_IS_ENTRY (entry), GTK_INPUT_HINT_NONE);
priv = st_entry_get_instance_private (entry); return st_im_text_get_input_hints (ST_IM_TEXT (entry->priv->entry));
return st_im_text_get_input_hints (ST_IM_TEXT (priv->entry));
} }
static gboolean static gboolean
@@ -1138,7 +1119,7 @@ _st_entry_icon_press_cb (ClutterActor *actor,
ClutterButtonEvent *event, ClutterButtonEvent *event,
StEntry *entry) StEntry *entry)
{ {
StEntryPrivate *priv = ST_ENTRY_PRIV (actor); StEntryPrivate *priv = entry->priv;
if (actor == priv->primary_icon) if (actor == priv->primary_icon)
g_signal_emit (entry, entry_signals[PRIMARY_ICON_CLICKED], 0); g_signal_emit (entry, entry_signals[PRIMARY_ICON_CLICKED], 0);
@@ -1190,7 +1171,7 @@ st_entry_set_primary_icon (StEntry *entry,
g_return_if_fail (ST_IS_ENTRY (entry)); g_return_if_fail (ST_IS_ENTRY (entry));
priv = st_entry_get_instance_private (entry); priv = entry->priv;
_st_entry_set_icon (entry, &priv->primary_icon, icon); _st_entry_set_icon (entry, &priv->primary_icon, icon);
} }
@@ -1210,7 +1191,7 @@ st_entry_set_secondary_icon (StEntry *entry,
g_return_if_fail (ST_IS_ENTRY (entry)); g_return_if_fail (ST_IS_ENTRY (entry));
priv = st_entry_get_instance_private (entry); priv = entry->priv;
_st_entry_set_icon (entry, &priv->secondary_icon, icon); _st_entry_set_icon (entry, &priv->secondary_icon, icon);
} }
@@ -1261,7 +1242,6 @@ static gint
st_entry_accessible_get_n_children (AtkObject *obj) st_entry_accessible_get_n_children (AtkObject *obj)
{ {
StEntry *entry = NULL; StEntry *entry = NULL;
StEntryPrivate *priv;
g_return_val_if_fail (ST_IS_ENTRY_ACCESSIBLE (obj), 0); g_return_val_if_fail (ST_IS_ENTRY_ACCESSIBLE (obj), 0);
@@ -1270,8 +1250,7 @@ st_entry_accessible_get_n_children (AtkObject *obj)
if (entry == NULL) if (entry == NULL)
return 0; return 0;
priv = st_entry_get_instance_private (entry); if (entry->priv->entry == NULL)
if (priv->entry == NULL)
return 0; return 0;
else else
return 1; return 1;
@@ -1282,7 +1261,6 @@ st_entry_accessible_ref_child (AtkObject *obj,
gint i) gint i)
{ {
StEntry *entry = NULL; StEntry *entry = NULL;
StEntryPrivate *priv;
AtkObject *result = NULL; AtkObject *result = NULL;
g_return_val_if_fail (ST_IS_ENTRY_ACCESSIBLE (obj), NULL); g_return_val_if_fail (ST_IS_ENTRY_ACCESSIBLE (obj), NULL);
@@ -1293,11 +1271,10 @@ st_entry_accessible_ref_child (AtkObject *obj,
if (entry == NULL) if (entry == NULL)
return NULL; return NULL;
priv = st_entry_get_instance_private (entry); if (entry->priv->entry == NULL)
if (priv->entry == NULL)
return NULL; return NULL;
result = clutter_actor_get_accessible (priv->entry); result = clutter_actor_get_accessible (entry->priv->entry);
g_object_ref (result); g_object_ref (result);
return result; return result;

View File

@@ -29,7 +29,29 @@ G_BEGIN_DECLS
#include <st/st-widget.h> #include <st/st-widget.h>
#define ST_TYPE_ENTRY (st_entry_get_type ()) #define ST_TYPE_ENTRY (st_entry_get_type ())
G_DECLARE_DERIVABLE_TYPE (StEntry, st_entry, ST, ENTRY, StWidget) #define ST_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_ENTRY, StEntry))
#define ST_IS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_ENTRY))
#define ST_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_ENTRY, StEntryClass))
#define ST_IS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_ENTRY))
#define ST_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_ENTRY, StEntryClass))
typedef struct _StEntry StEntry;
typedef struct _StEntryPrivate StEntryPrivate;
typedef struct _StEntryClass StEntryClass;
/**
* StEntry:
*
* The contents of this structure is private and should only be accessed using
* the provided API.
*/
struct _StEntry
{
/*< private >*/
StWidget parent_instance;
StEntryPrivate *priv;
};
struct _StEntryClass struct _StEntryClass
{ {
@@ -40,6 +62,8 @@ struct _StEntryClass
void (*secondary_icon_clicked) (StEntry *entry); void (*secondary_icon_clicked) (StEntry *entry);
}; };
GType st_entry_get_type (void) G_GNUC_CONST;
StWidget *st_entry_new (const gchar *text); StWidget *st_entry_new (const gchar *text);
const gchar *st_entry_get_text (StEntry *entry); const gchar *st_entry_get_text (StEntry *entry);
void st_entry_set_text (StEntry *entry, void st_entry_set_text (StEntry *entry,

View File

@@ -33,12 +33,14 @@
#include "st-focus-manager.h" #include "st-focus-manager.h"
#define ST_FOCUS_MANAGER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ST_TYPE_FOCUS_MANAGER, StFocusManagerPrivate))
struct _StFocusManagerPrivate struct _StFocusManagerPrivate
{ {
GHashTable *groups; GHashTable *groups;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (StFocusManager, st_focus_manager, G_TYPE_OBJECT) G_DEFINE_TYPE (StFocusManager, st_focus_manager, G_TYPE_OBJECT)
static void static void
st_focus_manager_dispose (GObject *object) st_focus_manager_dispose (GObject *object)
@@ -59,13 +61,15 @@ st_focus_manager_class_init (StFocusManagerClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (StFocusManagerPrivate));
object_class->dispose = st_focus_manager_dispose; object_class->dispose = st_focus_manager_dispose;
} }
static void static void
st_focus_manager_init (StFocusManager *manager) st_focus_manager_init (StFocusManager *manager)
{ {
manager->priv = st_focus_manager_get_instance_private (manager); manager->priv = ST_FOCUS_MANAGER_GET_PRIVATE (manager);
manager->priv->groups = g_hash_table_new (NULL, NULL); manager->priv->groups = g_hash_table_new (NULL, NULL);
} }

View File

@@ -31,10 +31,15 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define ST_TYPE_FOCUS_MANAGER (st_focus_manager_get_type ()) #define ST_TYPE_FOCUS_MANAGER (st_focus_manager_get_type ())
G_DECLARE_FINAL_TYPE (StFocusManager, st_focus_manager, ST, FOCUS_MANAGER, GObject) #define ST_FOCUS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_FOCUS_MANAGER, StFocusManager))
#define ST_IS_FOCUS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_FOCUS_MANAGER))
#define ST_FOCUS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_FOCUS_MANAGER, StFocusManagerClass))
#define ST_IS_FOCUS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_FOCUS_MANAGER))
#define ST_FOCUS_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_FOCUS_MANAGER, StFocusManagerClass))
typedef struct _StFocusManager StFocusManager; typedef struct _StFocusManager StFocusManager;
typedef struct _StFocusManagerPrivate StFocusManagerPrivate; typedef struct _StFocusManagerPrivate StFocusManagerPrivate;
typedef struct _StFocusManagerClass StFocusManagerClass;
/** /**
* StFocusManager: * StFocusManager:
@@ -49,6 +54,19 @@ struct _StFocusManager
StFocusManagerPrivate *priv; StFocusManagerPrivate *priv;
}; };
/**
* StFocusManagerClass:
*
* The #StFocusManagerClass struct contains only private data
*/
struct _StFocusManagerClass
{
/*< private >*/
GObjectClass parent_class;
};
GType st_focus_manager_get_type (void) G_GNUC_CONST;
StFocusManager *st_focus_manager_get_for_stage (ClutterStage *stage); StFocusManager *st_focus_manager_get_for_stage (ClutterStage *stage);
void st_focus_manager_add_group (StFocusManager *manager, void st_focus_manager_add_group (StFocusManager *manager,

View File

@@ -42,6 +42,11 @@ enum
PROP_FALLBACK_ICON_NAME PROP_FALLBACK_ICON_NAME
}; };
G_DEFINE_TYPE (StIcon, st_icon, ST_TYPE_WIDGET)
#define ST_ICON_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), ST_TYPE_ICON, StIconPrivate))
struct _StIconPrivate struct _StIconPrivate
{ {
ClutterActor *icon_texture; ClutterActor *icon_texture;
@@ -60,8 +65,6 @@ struct _StIconPrivate
StShadow *shadow_spec; StShadow *shadow_spec;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (StIcon, st_icon, ST_TYPE_WIDGET)
static void st_icon_update (StIcon *icon); static void st_icon_update (StIcon *icon);
static gboolean st_icon_update_icon_size (StIcon *icon); static gboolean st_icon_update_icon_size (StIcon *icon);
@@ -217,6 +220,8 @@ st_icon_class_init (StIconClass *klass)
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass); StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
g_type_class_add_private (klass, sizeof (StIconPrivate));
object_class->get_property = st_icon_get_property; object_class->get_property = st_icon_get_property;
object_class->set_property = st_icon_set_property; object_class->set_property = st_icon_set_property;
object_class->dispose = st_icon_dispose; object_class->dispose = st_icon_dispose;
@@ -257,7 +262,7 @@ st_icon_init (StIcon *self)
{ {
ClutterLayoutManager *layout_manager; ClutterLayoutManager *layout_manager;
self->priv = st_icon_get_instance_private (self); self->priv = ST_ICON_GET_PRIVATE (self);
layout_manager = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_FILL, layout_manager = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_FILL,
CLUTTER_BIN_ALIGNMENT_FILL); CLUTTER_BIN_ALIGNMENT_FILL);

View File

@@ -37,7 +37,21 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define ST_TYPE_ICON st_icon_get_type() #define ST_TYPE_ICON st_icon_get_type()
G_DECLARE_FINAL_TYPE (StIcon, st_icon, ST, ICON, StWidget)
#define ST_ICON(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_ICON, StIcon))
#define ST_ICON_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_ICON, StIconClass))
#define ST_IS_ICON(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_ICON))
#define ST_IS_ICON_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_ICON))
#define ST_ICON_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_ICON, StIconClass))
typedef struct _StIconPrivate StIconPrivate; typedef struct _StIconPrivate StIconPrivate;
@@ -47,12 +61,25 @@ typedef struct _StIconPrivate StIconPrivate;
* The contents of this structure are private and should only be accessed * The contents of this structure are private and should only be accessed
* through the public API. * through the public API.
*/ */
struct _StIcon { typedef struct {
/*< private >*/ /*< private >*/
StWidget parent; StWidget parent;
StIconPrivate *priv; StIconPrivate *priv;
}; } StIcon;
typedef struct {
StWidgetClass parent_class;
/* padding for future expansion */
void (*_padding_0) (void);
void (*_padding_1) (void);
void (*_padding_2) (void);
void (*_padding_3) (void);
void (*_padding_4) (void);
} StIconClass;
GType st_icon_get_type (void);
ClutterActor* st_icon_new (void); ClutterActor* st_icon_new (void);

View File

@@ -58,6 +58,9 @@ enum
PROP_INPUT_HINTS, PROP_INPUT_HINTS,
}; };
#define ST_IM_TEXT_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), ST_TYPE_IM_TEXT, StIMTextPrivate))
struct _StIMTextPrivate struct _StIMTextPrivate
{ {
GtkIMContext *im_context; GtkIMContext *im_context;
@@ -67,7 +70,7 @@ struct _StIMTextPrivate
guint has_preedit : 1; guint has_preedit : 1;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (StIMText, st_im_text, CLUTTER_TYPE_TEXT) G_DEFINE_TYPE (StIMText, st_im_text, CLUTTER_TYPE_TEXT)
static void static void
st_im_text_dispose (GObject *object) st_im_text_dispose (GObject *object)
@@ -458,6 +461,8 @@ st_im_text_class_init (StIMTextClass *klass)
ClutterTextClass *text_class = CLUTTER_TEXT_CLASS (klass); ClutterTextClass *text_class = CLUTTER_TEXT_CLASS (klass);
GParamSpec *pspec; GParamSpec *pspec;
g_type_class_add_private (klass, sizeof (StIMTextPrivate));
object_class->dispose = st_im_text_dispose; object_class->dispose = st_im_text_dispose;
object_class->set_property = st_im_text_set_property; object_class->set_property = st_im_text_set_property;
object_class->get_property = st_im_text_get_property; object_class->get_property = st_im_text_get_property;
@@ -499,7 +504,7 @@ st_im_text_init (StIMText *self)
{ {
StIMTextPrivate *priv; StIMTextPrivate *priv;
self->priv = priv = st_im_text_get_instance_private (self); self->priv = priv = ST_IM_TEXT_GET_PRIVATE (self);
priv->im_context = gtk_im_multicontext_new (); priv->im_context = gtk_im_multicontext_new ();
g_signal_connect (priv->im_context, "commit", g_signal_connect (priv->im_context, "commit",

View File

@@ -36,10 +36,15 @@ G_BEGIN_DECLS
#include <clutter/clutter.h> #include <clutter/clutter.h>
#define ST_TYPE_IM_TEXT (st_im_text_get_type ()) #define ST_TYPE_IM_TEXT (st_im_text_get_type ())
G_DECLARE_FINAL_TYPE (StIMText, st_im_text, ST, IM_TEXT, ClutterText) #define ST_IM_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_IM_TEXT, StIMText))
#define ST_IS_IM_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_IM_TEXT))
#define ST_IM_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_IM_TEXT, StIMTextClass))
#define ST_IS_IM_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_IM_TEXT))
#define ST_IM_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_IM_TEXT, StIMTextClass))
typedef struct _StIMText StIMText; typedef struct _StIMText StIMText;
typedef struct _StIMTextPrivate StIMTextPrivate; typedef struct _StIMTextPrivate StIMTextPrivate;
typedef struct _StIMTextClass StIMTextClass;
struct _StIMText struct _StIMText
{ {
@@ -48,6 +53,13 @@ struct _StIMText
StIMTextPrivate *priv; StIMTextPrivate *priv;
}; };
struct _StIMTextClass
{
ClutterTextClass parent_class;
};
GType st_im_text_get_type (void) G_GNUC_CONST;
ClutterActor *st_im_text_new (const gchar *text); ClutterActor *st_im_text_new (const gchar *text);
void st_im_text_set_input_purpose (StIMText *imtext, void st_im_text_set_input_purpose (StIMText *imtext,
GtkInputPurpose purpose); GtkInputPurpose purpose);

View File

@@ -54,6 +54,8 @@ enum
PROP_TEXT PROP_TEXT
}; };
#define ST_LABEL_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ST_TYPE_LABEL, StLabelPrivate))
struct _StLabelPrivate struct _StLabelPrivate
{ {
ClutterActor *label; ClutterActor *label;
@@ -63,7 +65,7 @@ struct _StLabelPrivate
float shadow_height; float shadow_height;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (StLabel, st_label, ST_TYPE_WIDGET); G_DEFINE_TYPE (StLabel, st_label, ST_TYPE_WIDGET);
static GType st_label_accessible_get_type (void) G_GNUC_CONST; static GType st_label_accessible_get_type (void) G_GNUC_CONST;
@@ -237,6 +239,8 @@ st_label_class_init (StLabelClass *klass)
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass); StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
GParamSpec *pspec; GParamSpec *pspec;
g_type_class_add_private (klass, sizeof (StLabelPrivate));
gobject_class->set_property = st_label_set_property; gobject_class->set_property = st_label_set_property;
gobject_class->get_property = st_label_get_property; gobject_class->get_property = st_label_get_property;
gobject_class->dispose = st_label_dispose; gobject_class->dispose = st_label_dispose;
@@ -269,7 +273,7 @@ st_label_init (StLabel *label)
{ {
StLabelPrivate *priv; StLabelPrivate *priv;
label->priv = priv = st_label_get_instance_private (label); label->priv = priv = ST_LABEL_GET_PRIVATE (label);
label->priv->label = g_object_new (CLUTTER_TYPE_TEXT, label->priv->label = g_object_new (CLUTTER_TYPE_TEXT,
"ellipsize", PANGO_ELLIPSIZE_END, "ellipsize", PANGO_ELLIPSIZE_END,

View File

@@ -29,9 +29,15 @@ G_BEGIN_DECLS
#include <st/st-widget.h> #include <st/st-widget.h>
#define ST_TYPE_LABEL (st_label_get_type ()) #define ST_TYPE_LABEL (st_label_get_type ())
G_DECLARE_FINAL_TYPE (StLabel, st_label, ST, LABEL, StWidget) #define ST_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_LABEL, StLabel))
#define ST_IS_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_LABEL))
#define ST_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_LABEL, StLabelClass))
#define ST_IS_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_LABEL))
#define ST_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_LABEL, StLabelClass))
typedef struct _StLabel StLabel;
typedef struct _StLabelPrivate StLabelPrivate; typedef struct _StLabelPrivate StLabelPrivate;
typedef struct _StLabelClass StLabelClass;
/** /**
* StLabel: * StLabel:
@@ -47,6 +53,13 @@ struct _StLabel
StLabelPrivate *priv; StLabelPrivate *priv;
}; };
struct _StLabelClass
{
StWidgetClass parent_class;
};
GType st_label_get_type (void) G_GNUC_CONST;
StWidget * st_label_new (const gchar *text); StWidget * st_label_new (const gchar *text);
const gchar * st_label_get_text (StLabel *label); const gchar * st_label_get_text (StLabel *label);
void st_label_set_text (StLabel *label, void st_label_set_text (StLabel *label,

View File

@@ -211,7 +211,7 @@ calculate_gaussian_kernel (gdouble sigma,
{ {
gdouble *ret, sum; gdouble *ret, sum;
gdouble exp_divisor; gdouble exp_divisor;
guint half, i; int half, i;
g_return_val_if_fail (sigma > 0, NULL); g_return_val_if_fail (sigma > 0, NULL);
@@ -223,14 +223,14 @@ calculate_gaussian_kernel (gdouble sigma,
exp_divisor = 2 * sigma * sigma; exp_divisor = 2 * sigma * sigma;
/* n_values of 1D Gauss function */ /* n_values of 1D Gauss function */
for (i = 0; i < n_values; i++) for (i = 0; i < (int)n_values; i++)
{ {
ret[i] = exp (-(i - half) * (i - half) / exp_divisor); ret[i] = exp (-(i - half) * (i - half) / exp_divisor);
sum += ret[i]; sum += ret[i];
} }
/* normalize */ /* normalize */
for (i = 0; i < n_values; i++) for (i = 0; i < (int)n_values; i++)
ret[i] /= sum; ret[i] /= sum;
return ret; return ret;
@@ -347,6 +347,7 @@ _st_create_shadow_pipeline (StShadow *shadow_spec,
{ {
ClutterBackend *backend = clutter_get_default_backend (); ClutterBackend *backend = clutter_get_default_backend ();
CoglContext *ctx = clutter_backend_get_cogl_context (backend); CoglContext *ctx = clutter_backend_get_cogl_context (backend);
CoglError *error = NULL;
static CoglPipeline *shadow_pipeline_template = NULL; static CoglPipeline *shadow_pipeline_template = NULL;
@@ -377,7 +378,13 @@ _st_create_shadow_pipeline (StShadow *shadow_spec,
COGL_PIXEL_FORMAT_A_8, COGL_PIXEL_FORMAT_A_8,
rowstride_out, rowstride_out,
pixels_out, pixels_out,
NULL)); &error));
if (error)
{
g_warning ("Failed to allocate texture: %s", error->message);
cogl_error_free (error);
}
g_free (pixels_out); g_free (pixels_out);
@@ -395,7 +402,10 @@ _st_create_shadow_pipeline (StShadow *shadow_spec,
pipeline = cogl_pipeline_copy (shadow_pipeline_template); pipeline = cogl_pipeline_copy (shadow_pipeline_template);
cogl_pipeline_set_layer_texture (pipeline, 0, texture); cogl_pipeline_set_layer_texture (pipeline, 0, texture);
if (texture)
cogl_object_unref (texture); cogl_object_unref (texture);
return pipeline; return pipeline;
} }
@@ -442,6 +452,7 @@ _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
if (!cogl_framebuffer_allocate (fb, &catch_error)) if (!cogl_framebuffer_allocate (fb, &catch_error))
{ {
cogl_error_free (catch_error); cogl_error_free (catch_error);
cogl_object_unref (offscreen);
cogl_object_unref (buffer); cogl_object_unref (buffer);
return NULL; return NULL;
} }

View File

@@ -41,10 +41,13 @@
#include "st-private.h" #include "st-private.h"
#include "st-button.h" #include "st-button.h"
G_DEFINE_TYPE (StScrollBar, st_scroll_bar, ST_TYPE_WIDGET)
#define ST_SCROLL_BAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), ST_TYPE_SCROLL_BAR, StScrollBarPrivate))
#define PAGING_INITIAL_REPEAT_TIMEOUT 500 #define PAGING_INITIAL_REPEAT_TIMEOUT 500
#define PAGING_SUBSEQUENT_REPEAT_TIMEOUT 200 #define PAGING_SUBSEQUENT_REPEAT_TIMEOUT 200
typedef struct _StScrollBarPrivate StScrollBarPrivate;
struct _StScrollBarPrivate struct _StScrollBarPrivate
{ {
StAdjustment *adjustment; StAdjustment *adjustment;
@@ -69,10 +72,6 @@ struct _StScrollBarPrivate
guint vertical : 1; guint vertical : 1;
}; };
G_DEFINE_TYPE_WITH_PRIVATE (StScrollBar, st_scroll_bar, ST_TYPE_WIDGET)
#define ST_SCROLL_BAR_PRIVATE(sb) st_scroll_bar_get_instance_private (ST_SCROLL_BAR (sb))
enum enum
{ {
PROP_0, PROP_0,
@@ -106,7 +105,7 @@ st_scroll_bar_get_property (GObject *gobject,
GValue *value, GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
StScrollBarPrivate *priv = ST_SCROLL_BAR_PRIVATE (gobject); StScrollBarPrivate *priv = ST_SCROLL_BAR (gobject)->priv;
switch (prop_id) switch (prop_id)
{ {
@@ -131,7 +130,6 @@ st_scroll_bar_set_property (GObject *gobject,
GParamSpec *pspec) GParamSpec *pspec)
{ {
StScrollBar *bar = ST_SCROLL_BAR (gobject); StScrollBar *bar = ST_SCROLL_BAR (gobject);
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (bar);
switch (prop_id) switch (prop_id)
{ {
@@ -140,12 +138,12 @@ st_scroll_bar_set_property (GObject *gobject,
break; break;
case PROP_VERTICAL: case PROP_VERTICAL:
priv->vertical = g_value_get_boolean (value); bar->priv->vertical = g_value_get_boolean (value);
if (priv->vertical) if (bar->priv->vertical)
clutter_actor_set_name (CLUTTER_ACTOR (priv->handle), clutter_actor_set_name (CLUTTER_ACTOR (bar->priv->handle),
"vhandle"); "vhandle");
else else
clutter_actor_set_name (CLUTTER_ACTOR (priv->handle), clutter_actor_set_name (CLUTTER_ACTOR (bar->priv->handle),
"hhandle"); "hhandle");
clutter_actor_queue_relayout ((ClutterActor*) gobject); clutter_actor_queue_relayout ((ClutterActor*) gobject);
break; break;
@@ -160,7 +158,7 @@ static void
st_scroll_bar_dispose (GObject *gobject) st_scroll_bar_dispose (GObject *gobject)
{ {
StScrollBar *bar = ST_SCROLL_BAR (gobject); StScrollBar *bar = ST_SCROLL_BAR (gobject);
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (bar); StScrollBarPrivate *priv = bar->priv;
if (priv->adjustment) if (priv->adjustment)
st_scroll_bar_set_adjustment (bar, NULL); st_scroll_bar_set_adjustment (bar, NULL);
@@ -193,7 +191,7 @@ scroll_bar_allocate_children (StScrollBar *bar,
const ClutterActorBox *box, const ClutterActorBox *box,
ClutterAllocationFlags flags) ClutterAllocationFlags flags)
{ {
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (bar); StScrollBarPrivate *priv = bar->priv;
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (bar)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (bar));
ClutterActorBox content_box, trough_box; ClutterActorBox content_box, trough_box;
@@ -285,7 +283,7 @@ st_scroll_bar_get_preferred_width (ClutterActor *self,
gfloat *natural_width_p) gfloat *natural_width_p)
{ {
StScrollBar *bar = ST_SCROLL_BAR (self); StScrollBar *bar = ST_SCROLL_BAR (self);
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (bar); StScrollBarPrivate *priv = bar->priv;
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self));
gfloat trough_min_width, trough_natural_width; gfloat trough_min_width, trough_natural_width;
gfloat handle_min_width, handle_natural_width; gfloat handle_min_width, handle_natural_width;
@@ -325,7 +323,7 @@ st_scroll_bar_get_preferred_height (ClutterActor *self,
gfloat *natural_height_p) gfloat *natural_height_p)
{ {
StScrollBar *bar = ST_SCROLL_BAR (self); StScrollBar *bar = ST_SCROLL_BAR (self);
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (bar); StScrollBarPrivate *priv = bar->priv;
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self));
gfloat trough_min_height, trough_natural_height; gfloat trough_min_height, trough_natural_height;
gfloat handle_min_height, handle_natural_height; gfloat handle_min_height, handle_natural_height;
@@ -396,7 +394,7 @@ scroll_bar_update_positions (StScrollBar *bar)
static void static void
st_scroll_bar_style_changed (StWidget *widget) st_scroll_bar_style_changed (StWidget *widget)
{ {
StScrollBarPrivate *priv = ST_SCROLL_BAR_PRIVATE (widget); StScrollBarPrivate *priv = ST_SCROLL_BAR (widget)->priv;
st_widget_style_changed (ST_WIDGET (priv->trough)); st_widget_style_changed (ST_WIDGET (priv->trough));
st_widget_style_changed (ST_WIDGET (priv->handle)); st_widget_style_changed (ST_WIDGET (priv->handle));
@@ -410,9 +408,8 @@ bar_reactive_notify_cb (GObject *gobject,
gpointer user_data) gpointer user_data)
{ {
StScrollBar *bar = ST_SCROLL_BAR (gobject); StScrollBar *bar = ST_SCROLL_BAR (gobject);
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (bar);
clutter_actor_set_reactive (priv->handle, clutter_actor_set_reactive (bar->priv->handle,
clutter_actor_get_reactive (CLUTTER_ACTOR (bar))); clutter_actor_get_reactive (CLUTTER_ACTOR (bar)));
} }
@@ -465,7 +462,7 @@ static gboolean
st_scroll_bar_scroll_event (ClutterActor *actor, st_scroll_bar_scroll_event (ClutterActor *actor,
ClutterScrollEvent *event) ClutterScrollEvent *event)
{ {
StScrollBarPrivate *priv = ST_SCROLL_BAR_PRIVATE (actor); StScrollBarPrivate *priv = ST_SCROLL_BAR (actor)->priv;
if (clutter_event_is_pointer_emulated ((ClutterEvent *) event)) if (clutter_event_is_pointer_emulated ((ClutterEvent *) event))
return TRUE; return TRUE;
@@ -505,6 +502,8 @@ st_scroll_bar_class_init (StScrollBarClass *klass)
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass); StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
GParamSpec *pspec; GParamSpec *pspec;
g_type_class_add_private (klass, sizeof (StScrollBarPrivate));
object_class->get_property = st_scroll_bar_get_property; object_class->get_property = st_scroll_bar_get_property;
object_class->set_property = st_scroll_bar_set_property; object_class->set_property = st_scroll_bar_set_property;
object_class->dispose = st_scroll_bar_dispose; object_class->dispose = st_scroll_bar_dispose;
@@ -556,7 +555,7 @@ move_slider (StScrollBar *bar,
gfloat x, gfloat x,
gfloat y) gfloat y)
{ {
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (bar); StScrollBarPrivate *priv = bar->priv;
gdouble position, lower, upper, page_size; gdouble position, lower, upper, page_size;
gfloat ux, uy, pos, size; gfloat ux, uy, pos, size;
@@ -600,14 +599,13 @@ move_slider (StScrollBar *bar,
static void static void
stop_scrolling (StScrollBar *bar) stop_scrolling (StScrollBar *bar)
{ {
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (bar); if (!bar->priv->grabbed)
if (!priv->grabbed)
return; return;
st_widget_remove_style_pseudo_class (ST_WIDGET (priv->handle), "active"); st_widget_remove_style_pseudo_class (ST_WIDGET (bar->priv->handle), "active");
clutter_ungrab_pointer (); clutter_ungrab_pointer ();
priv->grabbed = FALSE; bar->priv->grabbed = FALSE;
g_signal_emit (bar, signals[SCROLL_STOP], 0); g_signal_emit (bar, signals[SCROLL_STOP], 0);
} }
@@ -616,8 +614,7 @@ handle_motion_event_cb (ClutterActor *trough,
ClutterMotionEvent *event, ClutterMotionEvent *event,
StScrollBar *bar) StScrollBar *bar)
{ {
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (bar); if (!bar->priv->grabbed)
if (!priv->grabbed)
return FALSE; return FALSE;
move_slider (bar, event->x, event->y); move_slider (bar, event->x, event->y);
@@ -641,7 +638,7 @@ handle_button_press_event_cb (ClutterActor *actor,
ClutterButtonEvent *event, ClutterButtonEvent *event,
StScrollBar *bar) StScrollBar *bar)
{ {
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (bar); StScrollBarPrivate *priv = bar->priv;
if (event->button != 1) if (event->button != 1)
return FALSE; return FALSE;
@@ -679,7 +676,6 @@ animation_completed_cb (ClutterAnimation *animation,
static gboolean static gboolean
trough_paging_cb (StScrollBar *self) trough_paging_cb (StScrollBar *self)
{ {
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (self);
gfloat handle_pos, event_pos, tx, ty; gfloat handle_pos, event_pos, tx, ty;
gdouble value; gdouble value;
gdouble page_increment; gdouble page_increment;
@@ -690,66 +686,66 @@ trough_paging_cb (StScrollBar *self)
GValue v = { 0, }; GValue v = { 0, };
ClutterTimeline *t; ClutterTimeline *t;
if (priv->paging_event_no == 0) if (self->priv->paging_event_no == 0)
{ {
/* Scroll on after initial timeout. */ /* Scroll on after initial timeout. */
mode = CLUTTER_EASE_OUT_CUBIC; mode = CLUTTER_EASE_OUT_CUBIC;
ret = FALSE; ret = FALSE;
priv->paging_event_no = 1; self->priv->paging_event_no = 1;
priv->paging_source_id = g_timeout_add ( self->priv->paging_source_id = g_timeout_add (
PAGING_INITIAL_REPEAT_TIMEOUT, PAGING_INITIAL_REPEAT_TIMEOUT,
(GSourceFunc) trough_paging_cb, (GSourceFunc) trough_paging_cb,
self); self);
g_source_set_name_by_id (priv->paging_source_id, "[gnome-shell] trough_paging_cb"); g_source_set_name_by_id (self->priv->paging_source_id, "[gnome-shell] trough_paging_cb");
} }
else if (priv->paging_event_no == 1) else if (self->priv->paging_event_no == 1)
{ {
/* Scroll on after subsequent timeout. */ /* Scroll on after subsequent timeout. */
ret = FALSE; ret = FALSE;
mode = CLUTTER_EASE_IN_CUBIC; mode = CLUTTER_EASE_IN_CUBIC;
priv->paging_event_no = 2; self->priv->paging_event_no = 2;
priv->paging_source_id = g_timeout_add ( self->priv->paging_source_id = g_timeout_add (
PAGING_SUBSEQUENT_REPEAT_TIMEOUT, PAGING_SUBSEQUENT_REPEAT_TIMEOUT,
(GSourceFunc) trough_paging_cb, (GSourceFunc) trough_paging_cb,
self); self);
g_source_set_name_by_id (priv->paging_source_id, "[gnome-shell] trough_paging_cb"); g_source_set_name_by_id (self->priv->paging_source_id, "[gnome-shell] trough_paging_cb");
} }
else else
{ {
/* Keep scrolling. */ /* Keep scrolling. */
ret = TRUE; ret = TRUE;
mode = CLUTTER_LINEAR; mode = CLUTTER_LINEAR;
priv->paging_event_no++; self->priv->paging_event_no++;
} }
/* Do the scrolling */ /* Do the scrolling */
st_adjustment_get_values (priv->adjustment, st_adjustment_get_values (self->priv->adjustment,
&value, NULL, NULL, &value, NULL, NULL,
NULL, &page_increment, NULL); NULL, &page_increment, NULL);
if (priv->vertical) if (self->priv->vertical)
handle_pos = clutter_actor_get_y (priv->handle); handle_pos = clutter_actor_get_y (self->priv->handle);
else else
handle_pos = clutter_actor_get_x (priv->handle); handle_pos = clutter_actor_get_x (self->priv->handle);
clutter_actor_transform_stage_point (CLUTTER_ACTOR (priv->trough), clutter_actor_transform_stage_point (CLUTTER_ACTOR (self->priv->trough),
priv->move_x, self->priv->move_x,
priv->move_y, self->priv->move_y,
&tx, &ty); &tx, &ty);
if (priv->vertical) if (self->priv->vertical)
event_pos = ty; event_pos = ty;
else else
event_pos = tx; event_pos = tx;
if (event_pos > handle_pos) if (event_pos > handle_pos)
{ {
if (priv->paging_direction == NONE) if (self->priv->paging_direction == NONE)
{ {
/* Remember direction. */ /* Remember direction. */
priv->paging_direction = DOWN; self->priv->paging_direction = DOWN;
} }
if (priv->paging_direction == UP) if (self->priv->paging_direction == UP)
{ {
/* Scrolled far enough. */ /* Scrolled far enough. */
return FALSE; return FALSE;
@@ -758,12 +754,12 @@ trough_paging_cb (StScrollBar *self)
} }
else else
{ {
if (priv->paging_direction == NONE) if (self->priv->paging_direction == NONE)
{ {
/* Remember direction. */ /* Remember direction. */
priv->paging_direction = UP; self->priv->paging_direction = UP;
} }
if (priv->paging_direction == DOWN) if (self->priv->paging_direction == DOWN)
{ {
/* Scrolled far enough. */ /* Scrolled far enough. */
return FALSE; return FALSE;
@@ -771,23 +767,24 @@ trough_paging_cb (StScrollBar *self)
value -= page_increment; value -= page_increment;
} }
if (priv->paging_animation) if (self->priv->paging_animation)
{ {
clutter_animation_completed (priv->paging_animation); clutter_animation_completed (self->priv->paging_animation);
} }
/* FIXME: Creating a new animation for each scroll is probably not the best /* FIXME: Creating a new animation for each scroll is probably not the best
* idea, but it's a lot less involved than extenind the current animation */ * idea, but it's a lot less involved than extenind the current animation */
a = priv->paging_animation = g_object_new (CLUTTER_TYPE_ANIMATION, a = self->priv->paging_animation = g_object_new (CLUTTER_TYPE_ANIMATION,
"object", priv->adjustment, "object", self->priv->adjustment,
"duration", (guint)(PAGING_SUBSEQUENT_REPEAT_TIMEOUT * st_slow_down_factor), "duration", (guint)(PAGING_SUBSEQUENT_REPEAT_TIMEOUT * st_slow_down_factor),
"mode", mode, "mode", mode,
NULL); NULL);
g_value_init (&v, G_TYPE_DOUBLE); g_value_init (&v, G_TYPE_DOUBLE);
g_value_set_double (&v, value); g_value_set_double (&v, value);
clutter_animation_bind (priv->paging_animation, "value", &v); clutter_animation_bind (self->priv->paging_animation, "value", &v);
t = clutter_animation_get_timeline (priv->paging_animation); t = clutter_animation_get_timeline (self->priv->paging_animation);
g_signal_connect (a, "completed", G_CALLBACK (animation_completed_cb), priv); g_signal_connect (a, "completed", G_CALLBACK (animation_completed_cb),
self->priv);
clutter_timeline_start (t); clutter_timeline_start (t);
return ret; return ret;
@@ -798,21 +795,18 @@ trough_button_press_event_cb (ClutterActor *actor,
ClutterButtonEvent *event, ClutterButtonEvent *event,
StScrollBar *self) StScrollBar *self)
{ {
StScrollBarPrivate *priv;
g_return_val_if_fail (self, FALSE); g_return_val_if_fail (self, FALSE);
if (event->button != 1) if (event->button != 1)
return FALSE; return FALSE;
priv = st_scroll_bar_get_instance_private (self); if (self->priv->adjustment == NULL)
if (priv->adjustment == NULL)
return FALSE; return FALSE;
priv->move_x = event->x; self->priv->move_x = event->x;
priv->move_y = event->y; self->priv->move_y = event->y;
priv->paging_direction = NONE; self->priv->paging_direction = NONE;
priv->paging_event_no = 0; self->priv->paging_event_no = 0;
trough_paging_cb (self); trough_paging_cb (self);
return TRUE; return TRUE;
@@ -823,15 +817,13 @@ trough_button_release_event_cb (ClutterActor *actor,
ClutterButtonEvent *event, ClutterButtonEvent *event,
StScrollBar *self) StScrollBar *self)
{ {
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (self);
if (event->button != 1) if (event->button != 1)
return FALSE; return FALSE;
if (priv->paging_source_id) if (self->priv->paging_source_id)
{ {
g_source_remove (priv->paging_source_id); g_source_remove (self->priv->paging_source_id);
priv->paging_source_id = 0; self->priv->paging_source_id = 0;
} }
return TRUE; return TRUE;
@@ -842,12 +834,10 @@ trough_leave_event_cb (ClutterActor *actor,
ClutterEvent *event, ClutterEvent *event,
StScrollBar *self) StScrollBar *self)
{ {
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (self); if (self->priv->paging_source_id)
if (priv->paging_source_id)
{ {
g_source_remove (priv->paging_source_id); g_source_remove (self->priv->paging_source_id);
priv->paging_source_id = 0; self->priv->paging_source_id = 0;
return TRUE; return TRUE;
} }
@@ -857,7 +847,7 @@ trough_leave_event_cb (ClutterActor *actor,
static void static void
st_scroll_bar_notify_reactive (StScrollBar *self) st_scroll_bar_notify_reactive (StScrollBar *self)
{ {
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (self); StScrollBarPrivate *priv = self->priv;
gboolean reactive = clutter_actor_get_reactive (CLUTTER_ACTOR (self)); gboolean reactive = clutter_actor_get_reactive (CLUTTER_ACTOR (self));
@@ -868,29 +858,29 @@ st_scroll_bar_notify_reactive (StScrollBar *self)
static void static void
st_scroll_bar_init (StScrollBar *self) st_scroll_bar_init (StScrollBar *self)
{ {
StScrollBarPrivate *priv = st_scroll_bar_get_instance_private (self); self->priv = ST_SCROLL_BAR_GET_PRIVATE (self);
priv->trough = (ClutterActor *) st_bin_new (); self->priv->trough = (ClutterActor *) st_bin_new ();
clutter_actor_set_reactive ((ClutterActor *) priv->trough, TRUE); clutter_actor_set_reactive ((ClutterActor *) self->priv->trough, TRUE);
clutter_actor_set_name (CLUTTER_ACTOR (priv->trough), "trough"); clutter_actor_set_name (CLUTTER_ACTOR (self->priv->trough), "trough");
clutter_actor_add_child (CLUTTER_ACTOR (self), clutter_actor_add_child (CLUTTER_ACTOR (self),
CLUTTER_ACTOR (priv->trough)); CLUTTER_ACTOR (self->priv->trough));
g_signal_connect (priv->trough, "button-press-event", g_signal_connect (self->priv->trough, "button-press-event",
G_CALLBACK (trough_button_press_event_cb), self); G_CALLBACK (trough_button_press_event_cb), self);
g_signal_connect (priv->trough, "button-release-event", g_signal_connect (self->priv->trough, "button-release-event",
G_CALLBACK (trough_button_release_event_cb), self); G_CALLBACK (trough_button_release_event_cb), self);
g_signal_connect (priv->trough, "leave-event", g_signal_connect (self->priv->trough, "leave-event",
G_CALLBACK (trough_leave_event_cb), self); G_CALLBACK (trough_leave_event_cb), self);
priv->handle = (ClutterActor *) st_button_new (); self->priv->handle = (ClutterActor *) st_button_new ();
clutter_actor_set_name (CLUTTER_ACTOR (priv->handle), "hhandle"); clutter_actor_set_name (CLUTTER_ACTOR (self->priv->handle), "hhandle");
clutter_actor_add_child (CLUTTER_ACTOR (self), clutter_actor_add_child (CLUTTER_ACTOR (self),
CLUTTER_ACTOR (priv->handle)); CLUTTER_ACTOR (self->priv->handle));
g_signal_connect (priv->handle, "button-press-event", g_signal_connect (self->priv->handle, "button-press-event",
G_CALLBACK (handle_button_press_event_cb), self); G_CALLBACK (handle_button_press_event_cb), self);
g_signal_connect (priv->handle, "button-release-event", g_signal_connect (self->priv->handle, "button-release-event",
G_CALLBACK (handle_button_release_event_cb), self); G_CALLBACK (handle_button_release_event_cb), self);
g_signal_connect (priv->handle, "motion-event", g_signal_connect (self->priv->handle, "motion-event",
G_CALLBACK (handle_motion_event_cb), self); G_CALLBACK (handle_motion_event_cb), self);
clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE); clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE);
@@ -930,7 +920,7 @@ st_scroll_bar_set_adjustment (StScrollBar *bar,
g_return_if_fail (ST_IS_SCROLL_BAR (bar)); g_return_if_fail (ST_IS_SCROLL_BAR (bar));
priv = st_scroll_bar_get_instance_private (bar); priv = bar->priv;
if (adjustment == priv->adjustment) if (adjustment == priv->adjustment)
return; return;
@@ -978,6 +968,6 @@ st_scroll_bar_get_adjustment (StScrollBar *bar)
{ {
g_return_val_if_fail (ST_IS_SCROLL_BAR (bar), NULL); g_return_val_if_fail (ST_IS_SCROLL_BAR (bar), NULL);
return ((StScrollBarPrivate *)ST_SCROLL_BAR_PRIVATE (bar))->adjustment; return bar->priv->adjustment;
} }

View File

@@ -31,7 +31,29 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define ST_TYPE_SCROLL_BAR (st_scroll_bar_get_type()) #define ST_TYPE_SCROLL_BAR (st_scroll_bar_get_type())
G_DECLARE_DERIVABLE_TYPE (StScrollBar, st_scroll_bar, ST, SCROLL_BAR, StWidget) #define ST_SCROLL_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_SCROLL_BAR, StScrollBar))
#define ST_IS_SCROLL_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_SCROLL_BAR))
#define ST_SCROLL_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_SCROLL_BAR, StScrollBarClass))
#define ST_IS_SCROLL_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_SCROLL_BAR))
#define ST_SCROLL_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_SCROLL_BAR, StScrollBarClass))
typedef struct _StScrollBar StScrollBar;
typedef struct _StScrollBarPrivate StScrollBarPrivate;
typedef struct _StScrollBarClass StScrollBarClass;
/**
* StScrollBar:
*
* The contents of this structure are private and should only be accessed
* through the public API.
*/
struct _StScrollBar
{
/*< private >*/
StWidget parent_instance;
StScrollBarPrivate *priv;
};
struct _StScrollBarClass struct _StScrollBarClass
{ {
@@ -42,6 +64,8 @@ struct _StScrollBarClass
void (*scroll_stop) (StScrollBar *bar); void (*scroll_stop) (StScrollBar *bar);
}; };
GType st_scroll_bar_get_type (void) G_GNUC_CONST;
StWidget *st_scroll_bar_new (StAdjustment *adjustment); StWidget *st_scroll_bar_new (StAdjustment *adjustment);
void st_scroll_bar_set_adjustment (StScrollBar *bar, void st_scroll_bar_set_adjustment (StScrollBar *bar,

View File

@@ -19,6 +19,10 @@
*/ */
#define ST_SCROLL_VIEW_FADE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_SCROLL_VIEW_FADE, StScrollViewFadeClass))
#define ST_IS_SCROLL_VIEW_FADE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_SCROLL_VIEW_FADE))
#define ST_SCROLL_VIEW_FADE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_SCROLL_VIEW_FADE, StScrollViewFadeClass))
#include "st-scroll-view-fade.h" #include "st-scroll-view-fade.h"
#include "st-scroll-view.h" #include "st-scroll-view.h"
#include "st-widget.h" #include "st-widget.h"
@@ -29,6 +33,8 @@
#include <clutter/clutter.h> #include <clutter/clutter.h>
#include <cogl/cogl.h> #include <cogl/cogl.h>
typedef struct _StScrollViewFadeClass StScrollViewFadeClass;
#define DEFAULT_FADE_OFFSET 68.0f #define DEFAULT_FADE_OFFSET 68.0f
#include "st-scroll-view-fade-generated.c" #include "st-scroll-view-fade-generated.c"
@@ -49,6 +55,11 @@ struct _StScrollViewFade
float hfade_offset; float hfade_offset;
}; };
struct _StScrollViewFadeClass
{
ClutterShaderEffectClass parent_class;
};
G_DEFINE_TYPE (StScrollViewFade, G_DEFINE_TYPE (StScrollViewFade,
st_scroll_view_fade, st_scroll_view_fade,
CLUTTER_TYPE_SHADER_EFFECT); CLUTTER_TYPE_SHADER_EFFECT);

View File

@@ -26,8 +26,12 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define ST_TYPE_SCROLL_VIEW_FADE (st_scroll_view_fade_get_type ()) #define ST_TYPE_SCROLL_VIEW_FADE (st_scroll_view_fade_get_type ())
G_DECLARE_FINAL_TYPE (StScrollViewFade, st_scroll_view_fade, #define ST_SCROLL_VIEW_FADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_SCROLL_VIEW_FADE, StScrollViewFade))
ST, SCROLL_VIEW_FADE, ClutterShaderEffect) #define ST_IS_SCROLL_VIEW_FADE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_SCROLL_VIEW_FADE))
typedef struct _StScrollViewFade StScrollViewFade;
GType st_scroll_view_fade_get_type (void) G_GNUC_CONST;
ClutterEffect *st_scroll_view_fade_new (void); ClutterEffect *st_scroll_view_fade_new (void);

View File

@@ -69,6 +69,14 @@ static void clutter_container_iface_init (ClutterContainerIface *iface);
static ClutterContainerIface *st_scroll_view_parent_iface = NULL; static ClutterContainerIface *st_scroll_view_parent_iface = NULL;
G_DEFINE_TYPE_WITH_CODE (StScrollView, st_scroll_view, ST_TYPE_BIN,
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER,
clutter_container_iface_init))
#define SCROLL_VIEW_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
ST_TYPE_SCROLL_VIEW, \
StScrollViewPrivate))
struct _StScrollViewPrivate struct _StScrollViewPrivate
{ {
/* a pointer to the child; this is actually stored /* a pointer to the child; this is actually stored
@@ -98,11 +106,6 @@ struct _StScrollViewPrivate
guint vscrollbar_visible : 1; guint vscrollbar_visible : 1;
}; };
G_DEFINE_TYPE_WITH_CODE (StScrollView, st_scroll_view, ST_TYPE_BIN,
G_ADD_PRIVATE (StScrollView)
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER,
clutter_container_iface_init))
enum { enum {
PROP_0, PROP_0,
@@ -787,6 +790,8 @@ st_scroll_view_class_init (StScrollViewClass *klass)
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass); StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
g_type_class_add_private (klass, sizeof (StScrollViewPrivate));
object_class->get_property = st_scroll_view_get_property; object_class->get_property = st_scroll_view_get_property;
object_class->set_property = st_scroll_view_set_property; object_class->set_property = st_scroll_view_set_property;
object_class->dispose = st_scroll_view_dispose; object_class->dispose = st_scroll_view_dispose;
@@ -869,7 +874,7 @@ st_scroll_view_class_init (StScrollViewClass *klass)
static void static void
st_scroll_view_init (StScrollView *self) st_scroll_view_init (StScrollView *self)
{ {
StScrollViewPrivate *priv = self->priv = st_scroll_view_get_instance_private (self); StScrollViewPrivate *priv = self->priv = SCROLL_VIEW_PRIVATE (self);
priv->hscrollbar_policy = GTK_POLICY_AUTOMATIC; priv->hscrollbar_policy = GTK_POLICY_AUTOMATIC;
priv->vscrollbar_policy = GTK_POLICY_AUTOMATIC; priv->vscrollbar_policy = GTK_POLICY_AUTOMATIC;

Some files were not shown because too many files have changed in this diff Show More