59 Commits (12a899f3740f2d82ea16c2ec28b24198f76fd47a)

Author SHA1 Message Date
Daniel Drake 15946211cf Trivial GTK3 porting fixes
Fix some trivial issues missed earlier: various missing imports,
some minor API changes to adapt to, do_size_request simple porting,
etc.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
13 years ago
Daniel Drake 3962517a58 activity.py: Apply sugar GTK3 theme and icon theme
In GTK2, theme name and icon theme name properties could be set in the
GTK2 RC file, at runtime, or by the X settings daemon.

For GTK3, the RC file configuration route for these settings has been
removed. As we do not currently have a settings daemon implementation,
apply these important settings at runtime, early in the Activity
class.

Signed-off-by: Daniel Drake <dsd@laptop.org>
13 years ago
Daniel Drake 4e137f6e4f sugar-activity: import and make independent of sugar-toolkit GTK versions
As we move to adding support for a second UI toolkit (GTK+ 3.x),
the sugar-activity binary used by all activities must become
backend-toolkit-independent. It would be wasteful to have two backend
toolkits loaded in memory, and in the GTK2/GTK3 case, it is impossible
(importing both results in an instant crash).

To achieve this, we split the existing sugar-toolkit activity/main.py:main()
functionality into two parts, moving it into the sugar-activity binary and
the Activity class as follows:
 1. All toolkit-specific stuff is moved into the Activity class (i.e.
   everything that interacts with GTK)
 2. Everything that can be reasonably/easily moved into the Activity class
   is also moved.
 3. What remains is the stuff that is inherently involved with the
   construction of the Activity object, not related to UI toolkits. This
   is moved into the sugar-activity binary.

main.py is then removed from sugar-toolkit, and sugar-activity is moved
from sugar to sugar-toolkit-gtk3 in order to keep toolkit-related code
with the toolkit itself.

With this work done, the one remaining question is how to invoke the main
loop. An optional run_main_loop() method is added to the activity class,
for GTK2 this will run the GTK2 main loop, for GTK3 the GTK3 main loop will
be run, etc.

Signed-off-by: Daniel Drake <dsd@laptop.org>
13 years ago
Sascha Silbe c82a775267 Use accessor functions for data fields
The following data fields that were provided by PyGTK are not accessible
directly in GTK3+pygi and need to be replaced by accessor calls:

Adjustment.lower
Adjustment.page_size
Adjustment.upper
Adjustment.value
Bin.child
Widget.parent
Widget.style
Widget.window

Based on patches by Daniel Drake <dsd@laptop.org>.

Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago
Simon Schampijer 8efb7c3f93 Adapt to changed Gtk.Window.set_geometry_hints() API
Unlike PyGTK [1], GTK3+pygi [2] wants GDK Geometry and WindowHints objects,
rather than individual values.

[1] http://developer.gnome.org/pygtk/stable/class-gtkwindow.html#method-gtkwindow--set-geometry-hints
[2] http://developer.gnome.org/gtk3/3.0/GtkWindow.html#gtk-window-set-geometry-hints

Signed-off-by: Simon Schampijer <simon@schampijer.de>
[replaced description, included fix-up commit]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago
Sascha Silbe 820efa56b9 Run pygi-convert.sh for automatic conversion from GTK2 to GTK3 + pygi.
This is only on a best-effort basis; the code will be in a broken state after
this patch and need to be fixed manually.

The purpose of committing the intermediate, non-working output is to make it
reproducible. It's impractical to manually review the changes.

The exact version used was 4f637212f13b197a95c824967a58496b9e3b877c from the
main pygobject repository [1] plus a custom patch [2] that hasn't been sent
upstream yet.

[1] git://git.gnome.org/pygobject
[2] https://sascha.silbe.org/patches/pygobject-convert-sugar-20111122.patch

Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago
Simon Schampijer 89ef6304a1 Fix broken imports
8f1a821d68 only changed imports starting with
"import", but not those using "from ... import ...".

[replaced description]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago
Simon Schampijer 8f1a821d68 Rename imports from sugar to sugar3
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Sascha Silbe <silbe@activitycentral.com>
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