31 Commits (master)

Author SHA1 Message Date
Martin Abente Lahaye 7739336fb6 Provide access to Gtk.Clipboard.set_with_data
As described in SL#4307 Gtk.Clipboard.set_with_data is not
introspectable, therefore it can't be accessed though python
Gtk bindings.

Therefore, as a workaround for this issue, we provide acesss
to this method though a custom SugarExt binding.

This solution uses Carlos Garnacho annotations as described in
https://bugzilla.gnome.org/show_bug.cgi?id=656312#c18

Fixes SL#4307.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
9 years ago
Gonzalo Odiard d7c9645b60 Move SpeechManager from sugar to sugar-toolkit-gtk3
This is done to be able to use this implementation of the feature
in the activities. A complementary patch is needed in sugar module.
10 years ago
Gonzalo Odiard 7678540056 Remove c implementation of mime methods
Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
10 years ago
Gonzalo Odiard 62b60fa1e1 Inhibit suspend while a activity is shared
In some network environments, suspend/reume can make loose
messages and break collaboration. This patch inhibit suspend
when collaboration start. The implementation can be used by activities
or Sugar to inhibit suspend/resume when needed.

More information in http://dev.laptop.org/ticket/10363

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
10 years ago
Emil Dudev d918e7afff Remove GConf completely
Removes sugar-gconf from SugarExt
Removes gconf-2 dependency
10 years ago
Daniel Narvaez 28423249f6 Make gir files depend on their library
Otherwise with parallel builds we might try to build gir files
before the library causing an error. This happened once in the
buildbot.

Fix #4606
11 years ago
Daniel Narvaez 9717e5954b Fix translations in non standard prefix
This drops a lot of code at the same time. The code in
__init__ was:

* Using a SUGAR_PREFIX environment variable that is not
defined anywhere
* Hardcoding prefix to /usr
* Setting up the sugar-base domain which doesn't exist anymore

The i18n module code was overcomplex because it was thought
for language packs which we don't support anymore, it was
not handling correctly locales with a country prefix, it
was hard coding the python prefix and it was not sorting
the directories as it intended too anyway.

The logic is very simple now. Use the locale directory in
the same prefix sugar-toolkit-gtk3 was installed, unless
SUGAR_LOCALEDIR is defined (for self contained bundles).
11 years ago
Manuel Quiñones fa7a765f4e Drop session.py
SessionManager has been moved to shell, and the other class has
nothing inside.
11 years ago
Daniel Narvaez 8fff409046 Add missing headers
Fixes distcheck
11 years ago
Walter Bender 3e5c37f3f8 Adding SugarExt for setting hidden attribute on FAT files
This extension is used by Sugar to set the HIDDEN attribute for
.Sugar-Metadata. By creating an extension, we avoid the need to add an
additional dependency (fatattr) to Sugar. The code is modeled after
fatattr, using an IOCTL call get and set FAT file attributes.

There is a corresponding patch for model.py in sugar/src/jarabe/journal
11 years ago
Daniel Narvaez 680c501ad6 Add a binding for gconf_client_set_list (using strings) 11 years ago
Daniel Narvaez 6202d4d5cc Bind xdgmime in SugarExt
And use it in the sugar3.mime modules. This allows
to get rid of the pygtk generated sugarbase module,
along with the wrapping code.

Also add more cases to test_time to make sure
everything is still working.
11 years ago
Daniel Narvaez e6397cf2db Some initial infrastructure for UI tests
The uitree module exposes the at-spi tree. We can use it to do
functional tests of the UI, by checking if the expected
widgets exists, clicking them etc.

A simple example of how this can be used is in the test, which
runs a window and check that it has the expected button.
11 years ago
Daniel Narvaez 7ba72c4c61 Remove duplicated library flags
They are already provided by the pc files.
11 years ago
Simon Schampijer 97869472ff Fixup of 4234ca684e 12 years ago
Daniel Drake 4234ca684e Restore use of XSMP client
In the GTK3 port we mistakenly moved from using the EggSMClientXSMP
class to the (stub-like) EggSMClient base class for Sugar's XSMPClient
class, instantiated for every activity.

This meant that the GTK3 activities weren't registering with the
session manager, meaning that they won't automatically save their work
when the user shuts down, and they can't inhibit shutdown, etc.

Restore this functionality by adding the appropriate header so that
EggSMClientXSMP is introspectable, and then use it from the Python code.

Acked-by: Simon Schampijer <simon@laptop.org>
12 years ago
Simon Schampijer f91cfbfc8a Cursor tracker: only display the cursor in mouse/trackpad mode
Listen on RawEvents: listen for raw events on the root
window and decide whether the cursor is shown or not. A
touch begin event will hide the cursor a motion or button
press event will show it.

There is no API in XFixes to know whether a cursor is shown
or not so we keep track of the current state. Furthermore
we trap X errors if any bad access should happen.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-by: Carlos Garnacho <carlos@lanedo.com>
Acked-by: Manuel Quiñones <manuq@laptop.org>
12 years ago
Simon Schampijer d16afa8f16 Build fixup of c635ee5dd7 12 years ago
Carlos Garnacho c635ee5dd7 Include SugarGestureGrabber in .gir generation
Signed-off-by: Carlos Garnacho <carlos@lanedo.com>
Acked-by: Simon Schampijer <simon@laptop.org>
12 years ago
Carlos Garnacho c5fe8a26f6 Add API to allow for tracking global gestures
The new API is added to SugarExt. Similar to the
KeyGrabber we listen on the root window for the
events. We then filter for gestures recognized by
an event controller.

You can add any event controller of the ones recently
added to the toolkit to be tracked and can pass a
specific area where the starting point of the gesture
should be, it's then allowed to go out of bounds as
it moves.

Signed-off-by: Carlos Garnacho <carlos@lanedo.com>
Acked-by: Simon Schampijer <simon@laptop.org>
12 years ago
Simon Schampijer ad950f4d06 event-controller: Put event-controller in alphabetical order in the Makefile 12 years ago
Carlos Garnacho ade02f958b event-controller: Add separate library for event controllers
SugarEventController is an abstract object that attaches to a widget
and interprets an arbitrary set of events. Implementations of that
object get to define the sequence of events that trigger these.

The basic touch gestures (long press, rotate, swipe, zoom) have
been implemented on top of that object.

Signed-off-by: Carlos Garnacho <carlos@lanedo.com>
Acked-by: Simon Schampijer <simon@laptop.org>
12 years ago
Daniel Narvaez 4cc6967c8d Reimplement the wm module in C
The wm module in sugar-toolkit-gtk3 has been reimplemented
in C and made available through introspection. The same was
hard to achieve directly using the Gdk API.

We can drop wm.py and the wrapper around gdk_property_change.

Signed-off-by: Daniel Narvaez <dwnarvaez@gmail.com>
Acked-by: Simon Schampijer <simon@laptop.org>
12 years ago
Simon Schampijer 425e9becfc Remove the workaround for missing gobject-introspection bindings of Rsvg
gobject introspection bindings for librsvg have been pushed to librsvg
master [1] in 2.35.0, which solved [2]. We only have slight adopts to
make in our usage, for example we can not pass the data property
to the default constructor anymore and get_width and get_height is not
available anymore for the handle, but we can use the properties
instead.

The sugar-toolkit-gtk3 and therefore Activities that have been ported
to it do need a version of librsvg >= 2.35.0 to be able to work,
which ships for example with Fedora 17.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Daniel Drake <dsd@laptop.org>

[1] http://git.gnome.org/browse/librsvg/
[2] https://bugzilla.gnome.org/show_bug.cgi?id=663049
[3] http://developer.gnome.org/rsvg/stable/RsvgHandle.html
12 years ago
Daniel Drake 48ad255a78 Reimplement Palettes for GTK3
Moving from GTK2 to GTK3 has presented various challenges regarding
palettes.

In GTK2, we were able to access some internal API of the GtkMenu class
and use it to embed a GtkMenu in a regular window. As of GTK3, that API
has become private and we can no longer access it.

We still want to use GtkMenu for the advanced functionality it provides
(multiple-level menus, keyboard navigation, etc), but we are now limited
to popping it up with its own (internal) window, rather than being able
to pack it into one of our own.

Our palettes can historically be used either as a menu, or as a general
area where widgets can be added, or both. The new restrictions upon
GtkMenu force some changes here, but we work hard to stick to the old
API as far as possible.

A Palette instance now acts as a controller of either a "window widget"
(where any type of widget can be displayed as usual) or a "menu widget"
which just pops up a GtkMenu. A Palette defaults to the window mode, but
dynamically switches to menu mode if/when the user attempts to access
the menu element.

As a result of this, palettes can now pack either a user-defined collection
of widgets, or a menu, but types can no longer be mixed. This should
only affect a handful of palettes which will need to pick a single
approach and convert to it.

Some further challenges are presented by the fact that GtkMenu performs a
grab on the whole screen, meaning that all input events are delivered to
the GtkMenu widget. Through some careful event filtering and examination
of the mouse cursor position we are still able to determine when the mouse
has entered or left the invoker or menu areas.

This work is authored by Benjamin Berg, Marco Pesenti Gritti, Simon
Schampijer and Daniel Drake.
13 years ago
Daniel Drake 8126575461 SugarExt: make SugarGrid introspectable
This will be used by a future GTK3 port of the shell.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
13 years ago
Daniel Drake e2c07af748 Import sugar-base into sugar-toolkit
Probably needs cleaning up a bit. And we use pygtk-codegen, ugh...

This is the commit id when we imported sugar-base:
b9406e5c9c9df5404c5b0d995178b5edb4d93628

Signed-off-by: Daniel Drake <dsd@laptop.org>
[squashed two patches into one]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago
Raul Gutierrez Segales 3372317922 Add wrapper for rsvg
Signed-off-by: Raul Gutierrez Segales <rgs@collabora.co.uk>
[split patch into several parts]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago
Raul Gutierrez Segales 1005c67ad2 Add GdkWrapper to access non-introspectable Gdk API
See https://bugzilla.gnome.org/show_bug.cgi?id=663261

Signed-off-by: Raul Gutierrez Segales <rgs@collabora.co.uk>
13 years ago
Simon Schampijer 10d7f7d3f9 Switch sugarext to be an introspectable library
This makes sugarext accessible through introspection. It is used
from the shell (key grabber, sound volume management) and the
shell session management.

Making the sugarext introspectable was done following the
descriptions at: http://live.gnome.org/GObjectIntrospection#Using_GI

Signed-off-by: Simon Schampijer <simon@schampijer.de>
13 years ago
Simon Schampijer 000ed75cbe Rename the module to sugar3
The old gtk-2 based module will be present in
the 0.94 branch in the sugar-toolkit.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago