~osomon/moovida/subtitle_size

« back to all changes in this revision

Viewing changes to elisa-plugins/elisa/plugins/poblesec/widgets/player/control_ribbon.py

  • Committer: Florian Boucault
  • Date: 2009-11-17 22:58:05 UTC
  • mfrom: (1462.2.22 transition)
  • Revision ID: florian@boucault.net-20091117225805-vtw7gkskmngbff8v
Removed a number of direct references to 'pgm' in order to allow multiple
implementations of its API, one using Pigment 0.3 and one using Pigment 0.5
in the near future. It also tries to facilitate the writing of the
implementation based on Pigment 0.5.

Changes in details:

 - For Pigment constants: relevant 'import pgm' replaced with
   'elisa.plugins.pigment.graph import [SPECIFIC CONSTANTS]' (look at
   elisa-plugins/elisa/plugins/pigment/graph/init.py).
 - For Pigment key symbols: relevant 'import pgm' replaced with 'from
   elisa.plugins.pigment import keysyms' (look at
   elisa-plugins/elisa/plugins/pigment/graph/keysyms.py)
 - Occurences of elisa.plugins.pigment.graph.image.Image have been
   replaced with the newly introduced elisa.plugins.pigment.graph.quad.Quad
   which should be used when only a background color is needed, not loading an
   actual picture; it is API compatible with future Pigment 0.5 quad geometry
   and has a 'color' property.
 - elisa.plugins.pigment.graph.node.Node is not a gobject anymore, instead
   elisa.plugins.pigment.graph.group.Group is: that was not used anywhere else
   and conflicting with Pigment 0.5.

Note: The transition is not complete and a few references to 'pgm' are left.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#
19
19
 
20
20
import gobject
21
 
import pgm
22
21
from elisa.plugins.pigment.animation.animation import DECELERATE
23
22
 
24
23
from elisa.core.utils import defer
25
24
 
26
25
from elisa.plugins.pigment.graph.image import Image
27
26
from elisa.plugins.pigment.graph.text import Text
 
27
from elisa.plugins.pigment.graph import keysyms
 
28
from elisa.plugins.pigment.graph import TEXT_ALIGN_CENTER
28
29
from elisa.plugins.pigment.widgets.const import *
29
30
from elisa.plugins.pigment.widgets.box import VBox, HBox, ALIGNMENT
30
31
from elisa.plugins.pigment.widgets.size_enforcer import Square
178
179
        self.caption = Text()
179
180
        self.caption.bg_a = 0
180
181
        self._caption_centerer.pack_start(self.caption)
181
 
        self.caption.alignment = pgm.TEXT_ALIGN_CENTER
 
182
        self.caption.alignment = TEXT_ALIGN_CENTER
182
183
        self.caption.visible = True
183
184
 
184
185
        # signal connection ids
417
418
            widget.add_control(control)
418
419
 
419
420
        def key_press_event_cb(self, viewport, event, ribbon):
420
 
            if event.keyval == pgm.keysyms.Right:
 
421
            if event.keyval == keysyms.Right:
421
422
                ribbon.select_next_control()
422
 
            elif event.keyval == pgm.keysyms.Left:
 
423
            elif event.keyval == keysyms.Left:
423
424
                ribbon.select_previous_control()
424
 
            elif event.keyval == pgm.keysyms.Return:
 
425
            elif event.keyval == keysyms.Return:
425
426
                ribbon.selected_control.activate()
426
427
 
427
428
        widget.connect('key-press-event', key_press_event_cb)
439
440
    try:
440
441
        __IPYTHON__
441
442
    except NameError:
 
443
        import pgm
442
444
        pgm.main()