Difference between revisions of "Activity Team/Sweetener"

From Sugar Labs
Jump to navigation Jump to search
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
(Note: This page is not finished.)
 
 
 
Sweetener is a desktop framework which provides compatibility between Sugar and other Desktops. Does all the repetitive parts, for be more friendly with developers. It's divided in modules, they can be included in an activity for do a specific task.
 
Sweetener is a desktop framework which provides compatibility between Sugar and other Desktops. Does all the repetitive parts, for be more friendly with developers. It's divided in modules, they can be included in an activity for do a specific task.
  
 
== Maintainers ==
 
== Maintainers ==
*[[User:Daniel_Francis]]
+
*[[User:Francis|Daniel Francis]]
  
 
== Current Release ==
 
== Current Release ==
 
At the moment it hasn't got a stable release. Clone the [http://git.sugarlabs.org/sweetener GIT Repository] and feel free to send patches, request merges or contact the maintainers.
 
At the moment it hasn't got a stable release. Clone the [http://git.sugarlabs.org/sweetener GIT Repository] and feel free to send patches, request merges or contact the maintainers.
 +
 +
== Documentation ==
 +
 +
The Sweetener documentation is available in [http://people.sugarlabs.org/francis/sweetenerdoc].
 +
 +
Its source code is in Git:
 +
http://git.sugarlabs.org/sweetener/doc
  
 
== Get started creating an activity==
 
== Get started creating an activity==
 
* Start a repository on [http://git.sugarlabs.org/ Git]
 
* Start a repository on [http://git.sugarlabs.org/ Git]
 
* Clone Sweetener
 
* Clone Sweetener
  git clone git://git.sugarlabs.org/sweetener/sweetener.git
+
  $ git clone git://git.sugarlabs.org/sweetener/sweetener.git
 
* Copy to your new activity directory the following files:
 
* Copy to your new activity directory the following files:
** Makefile
+
Makefile
** activity.py
+
activity.py
** canvas.py
+
canvas.py
** options.py
+
info.py
** info.py<br> Optional, only if you want to get your activity working on other Linux desktops:
+
options.py
** application.py
+
setup.py
** hello-integration (rename it to your activity name)
+
Optional, only if you want to get your activity working on other Linux desktops:
 +
application.py
 +
hello-integration # (rename it to your activity name)
 
* Make the following directories inside your activity:
 
* Make the following directories inside your activity:
** sugar/sweetener
+
activity/
** desktop/sweetener (Only if you want to run your activity on Linux desktops)
+
sugar/
* Copy basic modules:<br> Sweetener is divided in modules, for a very basic activity, you'll need to copy from (sugar - desktop)/sweetener:
+
desktop/ # (Only if you want to run your activity on Linux desktops)
** __init__.py
+
* Clone sweetener submodules
** basic_options.py
+
$ git submodule add git://git.sugarlabs.org/sweetener/makescripts
** itembox.py
+
$ git submodule add git://git.sugarlabs.org/sweetener/sugar sugar/sweetener
** itemgroup.py<br> (Optional if your activity has only the main ToolbarBox and the ActivityToolbar, obligatory for run the activty on Linux desktop)
+
** item.py
+
  # This is only for other Linux desktops.
** stock.py
+
$ git submodule add git://git.sugarlabs.org/sweetener/desktop desktop/sweetener
* Fill info.py with the information about your activity.
+
 
 +
* Fill info.py with information about your activity. See [[Activity_Team/Sweetener#Activity_information|info.py fields]].
 +
* Create a sugarized icon on activity/activity-(lower-name).svg where lower-name must be the same as the variable on info.py
 +
* Generate the activity.info file trough the command make.
 +
  $ make activity
 +
* Install it
 +
  $ python setup.py dev
 +
* Make a .xo bundle
 +
  $ make xo_bundle
 +
* Make a desktop tarball
 +
  $ make dist_tarball
 +
 
 +
== Activity information ==
 +
The way to tell the framework scripts and all your program some data is through the file info.py
 +
 
 +
We recommend a text search for fill the following fields:
 +
 
 +
* Activity Service Name
 +
* IO Mode<br>  Document or Config. Important at desktops.
 +
* Generic Name<br> Only for desktops. See examples at the file comments.
 +
* Activity Name
 +
* lower-name
 +
* copyright note (Obligatory for desktops, recommended)
 +
* Version
 +
* Summary
 +
* Authors
 +
* If any, Web site and documentation URL (Only for desktops)
 +
* Categories (Only for desktops)
 +
* Filter<br>  Important on desktops with IO mode Document, also needed to create your own mimetype.
 +
* license name
  
 
== Key accelerators ==
 
== Key accelerators ==
Line 37: Line 73:
 
Sweetener sets and overwrites some key accelerators for integrate them with Sugar.<br>
 
Sweetener sets and overwrites some key accelerators for integrate them with Sugar.<br>
 
Keep this in mind when setting up key accelerators in your activity.
 
Keep this in mind when setting up key accelerators in your activity.
<table border=1>
+
At your convenience, edit files sugar/sweetener/stock.py and desktop/sweetener/stock.py.
<tr><th>Stock label</th><th>Key accelerator on Sugar</th><th>Key accelerator on Linux desktops</th></tr>
+
 
<tr><td>Add</td><td>Ctrl + A</td><td>Ctrl + A</td></tr>
+
{| class="wikitable"
<tr><td>Fullscreen</td><td>Alt + Return</td><td>F11</td></tr>
+
|-
<tr><td>Normal Size</td><td>Ctrl + 0</td><td>Ctrl + 0</td></tr>
+
! '''Stock label''' !! '''Key accelerator on Sugar''' !! '''Key accelerator on Linux desktops'''
<tr><td>Remove</td><td>Shift + Del</td><td>Ctrl + R</td></tr>
+
|-
<tr><td>Save as</td><td>Unused :)</td><td>Ctrl + Shift + S</td></tr>
+
| Add || Ctrl + A || Ctrl + A
<tr><td>Select Color</td><td>Ctrl + L</td><td>Ctrl + L</td></tr>
+
|-
<tr><td>Zoom In</td><td>Ctrl + +</td><td>Ctrl + +</td></tr>
+
| Fullscreen || Alt + Return || F11
<tr><td>Zoom Out</td><td>Ctrl + -</td><td>Ctrl + -</td></tr>
+
|-
</table>
+
| Normal Size || Ctrl + 0 || Ctrl + 0
 +
|-
 +
| Remove || Shift + Del || Ctrl + R
 +
|-
 +
| Save as || Unused :) || Ctrl + Shift + S
 +
|-
 +
| Select Color || Ctrl + L || Ctrl + L
 +
|-
 +
| Zoom In || Ctrl + + || Ctrl + +
 +
|-
 +
| Zoom Out || Ctrl + - || Ctrl + -
 +
|}
  
 
== Activities using Sweetener==
 
== Activities using Sweetener==
* [[Activities/Graph_Plotter]]
+
* [[Activities/Graph_Plotter|Graph Plotter]]
 +
* [http://git.sugarlabs.org/illustrate-sugar-integration/illustrate-sweetener Illustrate Sweetener] (Development)
  
 
== Gtk2 and Gtk3 Support ==
 
== Gtk2 and Gtk3 Support ==
 
There are efforts to port Sweetener to Gtk3[http://git.sugarlabs.org/sudoku/mainline], but at the moment it isn't possible thanks to the upstream bug [https://bugzilla.gnome.org/show_bug.cgi?id=652697 GNOME#652697].
 
There are efforts to port Sweetener to Gtk3[http://git.sugarlabs.org/sudoku/mainline], but at the moment it isn't possible thanks to the upstream bug [https://bugzilla.gnome.org/show_bug.cgi?id=652697 GNOME#652697].

Latest revision as of 17:12, 4 November 2012

Sweetener is a desktop framework which provides compatibility between Sugar and other Desktops. Does all the repetitive parts, for be more friendly with developers. It's divided in modules, they can be included in an activity for do a specific task.

Maintainers

Current Release

At the moment it hasn't got a stable release. Clone the GIT Repository and feel free to send patches, request merges or contact the maintainers.

Documentation

The Sweetener documentation is available in [1].

Its source code is in Git: http://git.sugarlabs.org/sweetener/doc

Get started creating an activity

  • Start a repository on Git
  • Clone Sweetener
$ git clone git://git.sugarlabs.org/sweetener/sweetener.git
  • Copy to your new activity directory the following files:
Makefile
activity.py
canvas.py
info.py
options.py
setup.py

Optional, only if you want to get your activity working on other Linux desktops:

application.py
hello-integration # (rename it to your activity name)
  • Make the following directories inside your activity:
activity/
sugar/
desktop/  # (Only if you want to run your activity on Linux desktops)
  • Clone sweetener submodules
$ git submodule add git://git.sugarlabs.org/sweetener/makescripts
$ git submodule add git://git.sugarlabs.org/sweetener/sugar sugar/sweetener

# This is only for other Linux desktops.
$ git submodule add git://git.sugarlabs.org/sweetener/desktop desktop/sweetener
  • Fill info.py with information about your activity. See info.py fields.
  • Create a sugarized icon on activity/activity-(lower-name).svg where lower-name must be the same as the variable on info.py
  • Generate the activity.info file trough the command make.
 $ make activity
  • Install it
 $ python setup.py dev
  • Make a .xo bundle
 $ make xo_bundle
  • Make a desktop tarball
 $ make dist_tarball

Activity information

The way to tell the framework scripts and all your program some data is through the file info.py

We recommend a text search for fill the following fields:

  • Activity Service Name
  • IO Mode
    Document or Config. Important at desktops.
  • Generic Name
    Only for desktops. See examples at the file comments.
  • Activity Name
  • lower-name
  • copyright note (Obligatory for desktops, recommended)
  • Version
  • Summary
  • Authors
  • If any, Web site and documentation URL (Only for desktops)
  • Categories (Only for desktops)
  • Filter
    Important on desktops with IO mode Document, also needed to create your own mimetype.
  • license name

Key accelerators

Gtk Stock sets by default some accelerators for convention, like Ctrl+Q for Quit. Sweetener sets and overwrites some key accelerators for integrate them with Sugar.
Keep this in mind when setting up key accelerators in your activity. At your convenience, edit files sugar/sweetener/stock.py and desktop/sweetener/stock.py.

Stock label Key accelerator on Sugar Key accelerator on Linux desktops
Add Ctrl + A Ctrl + A
Fullscreen Alt + Return F11
Normal Size Ctrl + 0 Ctrl + 0
Remove Shift + Del Ctrl + R
Save as Unused :) Ctrl + Shift + S
Select Color Ctrl + L Ctrl + L
Zoom In Ctrl + + Ctrl + +
Zoom Out Ctrl + - Ctrl + -

Activities using Sweetener

Gtk2 and Gtk3 Support

There are efforts to port Sweetener to Gtk3[2], but at the moment it isn't possible thanks to the upstream bug GNOME#652697.