예제 #1
0
    def __init__(self,
                 position,
                 page,
                 job_factories,
                 job_schedulers,
                 show_all_boxes=False,
                 sentence=u""):
        Drawer.__init__(self)

        self.max_size = page.size
        self.page = page
        self.show_all_boxes = show_all_boxes

        self.surface = None
        self.boxes = {
            'all': [],
            'highlighted': [],
            'mouse_over': None,
        }
        self.sentence = sentence
        self.visible = False
        self.loading = False

        self.factories = job_factories
        self.schedulers = job_schedulers

        self._position = position
        self._size = self.max_size
        self.spinner = SpinnerAnimation((0, 0))
        self.upd_spinner_position()
예제 #2
0
 def __init__(self):
     Drawer.__init__(self)
     self.ticks_enabled = False
예제 #3
0
    def __init__(self, page,
                 job_factories,
                 job_schedulers,
                 previous_page_drawer=None,
                 show_boxes=True,
                 show_all_boxes=False,
                 show_border=False,
                 enable_editor=False,
                 sentence=u""):
        GObject.GObject.__init__(self)
        Drawer.__init__(self)

        self.max_size = page.size
        self.page = page
        self.show_boxes = show_boxes
        self.show_all_boxes = show_all_boxes
        self.show_border = show_border
        self.enable_editor = enable_editor
        self.mouse_over = False
        self.mouse_over_button = None
        self.previous_page_drawer = previous_page_drawer
        self.is_drag_source = False
        self.drag_enabled = True

        self.surface = None
        self.boxes = {
            'all': set(),
            'highlighted': set(),
            'mouse_over': None,
        }
        self.sentence = sentence
        self.visible = False
        self.loading = False

        self.factories = job_factories
        self.schedulers = job_schedulers

        self._size = self.max_size
        self._position = (0, 0)
        self.angle = 0
        self.spinner = SpinnerAnimation((0, 0))
        self.upd_spinner_position()

        icon_theme = Gtk.IconTheme.get_default()

        first_editor_buttons = []
        first_editor_buttons_pos = 10

        if self.page.can_edit:
            first_editor_buttons.append(
                # button 'start edit'
                ((-10 - self.BUTTON_SIZE, first_editor_buttons_pos),
                 icon_theme.lookup_icon(
                     self.ICON_EDIT_START, self.BUTTON_SIZE,
                     Gtk.IconLookupFlags.NO_SVG).load_icon(),
                 self._on_edit_start,
                 _("Edit")),
            )
            first_editor_buttons_pos += 10 + self.BUTTON_SIZE

        if self.page.doc.can_edit:
            first_editor_buttons.append(
                # button 'delete'
                ((-10 - self.BUTTON_SIZE, first_editor_buttons_pos),
                 icon_theme.lookup_icon(
                     self.ICON_DELETE, self.BUTTON_SIZE,
                     Gtk.IconLookupFlags.NO_SVG).load_icon(),
                 self._on_delete,
                 _("Delete page")),
            )
            first_editor_buttons_pos += 10 + self.BUTTON_SIZE

        self.editor_buttons = {
            "before": first_editor_buttons,
            "during": [
                # button 'cancel'
                ((-10 - self.BUTTON_SIZE, 10 + (0 * (10 + self.BUTTON_SIZE))),
                 icon_theme.lookup_icon(
                     self.ICON_EDIT_CANCEL, self.BUTTON_SIZE,
                     Gtk.IconLookupFlags.NO_SVG).load_icon(),
                 self._on_edit_cancel,
                 _("Cancel")),
                # button 'crop'
                ((-10 - self.BUTTON_SIZE, 10 + (1 * (10 + self.BUTTON_SIZE))),
                 icon_theme.lookup_icon(
                     self.ICON_EDIT_CROP, self.BUTTON_SIZE,
                     Gtk.IconLookupFlags.NO_SVG).load_icon(),
                 self._on_edit_crop,
                 _("Crop")),
                # button 'rotate_counter_clockwise'
                ((-10 - self.BUTTON_SIZE, 10 + (2 * (10 + self.BUTTON_SIZE))),
                 icon_theme.lookup_icon(
                     self.ICON_EDIT_ROTATE_COUNTERCLOCKWISE, self.BUTTON_SIZE,
                     Gtk.IconLookupFlags.NO_SVG).load_icon(),
                 self._on_edit_counterclockwise,
                 _("Rotate counter-clockwise")),
                # button 'rotate_clockwise'
                ((-10 - self.BUTTON_SIZE, 10 + (3 * (10 + self.BUTTON_SIZE))),
                 icon_theme.lookup_icon(
                     self.ICON_EDIT_ROTATE_CLOCKWISE, self.BUTTON_SIZE,
                     Gtk.IconLookupFlags.NO_SVG).load_icon(),
                 self._on_edit_clockwise,
                 _("Rotate clockwise")),
                # button 'done'
                ((-10 - self.BUTTON_SIZE, 10 + (4 * (10 + self.BUTTON_SIZE))),
                 icon_theme.lookup_icon(
                     self.ICON_EDIT_APPLY, self.BUTTON_SIZE,
                     Gtk.IconLookupFlags.NO_SVG).load_icon(),
                 self._on_edit_apply,
                 _("Apply")),
            ]
        }
        self.editor_state = "before"
        self.editor_grips = None
예제 #4
0
 def __init__(self):
     Drawer.__init__(self)
     self.ticks_enabled = False