Beispiel #1
0
 def remove_viewport(self):
     self.item_changed_handler = None
     self.prevent_system_sleep(False)
     self.detach_from_parent_window()
     self.video_window.close()
     self.video_window = None
     Widget.remove_viewport(self)
Beispiel #2
0
 def viewport_created(self):
     Widget.viewport_created(self)
     self.notifications.connect(self.on_changed,
                                'NSTextDidChangeNotification')
     self.notifications.connect(self.on_end_editing,
                                'NSControlTextDidEndEditingNotification')
     self.invalidate_size_request()
Beispiel #3
0
 def remove_viewport(self):
     self.item_changed_handler = None
     self.prevent_system_sleep(False)
     self.detach_from_parent_window()
     self.video_window.close()
     self.video_window = None
     Widget.remove_viewport(self)
Beispiel #4
0
 def __init__(self, path):
     Widget.__init__(self)
     self.nsimage = NSImage.alloc().initByReferencingFile_(
         filename_to_unicode(path))
     self.view = MiroImageView.alloc().init()
     self.view.setImage_(self.nsimage)
     # enabled when viewWillMoveToWindow:aWindow invoked
     self.view.setAnimates_(NO)
Beispiel #5
0
 def __init__(self, path):
     Widget.__init__(self)
     self.nsimage = NSImage.alloc().initByReferencingFile_(
       filename_to_unicode(path))
     self.view = MiroImageView.alloc().init()
     self.view.setImage_(self.nsimage)
     # enabled when viewWillMoveToWindow:aWindow invoked
     self.view.setAnimates_(NO)
Beispiel #6
0
 def viewport_created(self):
     Widget.viewport_created(self)
     if self.view.isLoading():
         # We haven't set up our delegates yet, but have already started
         # loading a webpage.  Send the net-start signal now because the
         # delegate will miss it.
         self.emit("net-start")
     self._set_webkit_delegates(self.delegate)
Beispiel #7
0
 def remove_viewport(self):
     app.info_updater.item_changed_callbacks.remove('manual', 'playback-list', self.on_items_changed)
     self.item_changed_handler = None
     self.prevent_system_sleep(False)
     self.detach_from_parent_window()
     self.video_window.close()
     self.video_window = None
     Widget.remove_viewport(self)
Beispiel #8
0
 def viewport_created(self):
     Widget.viewport_created(self)
     if self.view.isLoading():
         # We haven't set up our delegates yet, but have already started
         # loading a webpage.  Send the net-start signal now because the
         # delegate will miss it.
         self.emit("net-start")
     self._set_webkit_delegates(self.delegate)
Beispiel #9
0
 def __init__(self):
     Widget.__init__(self)
     self.url = None
     self.create_signal('net-start')
     self.create_signal('net-stop')
     self.delegate = BrowserDelegate.alloc().initWithBrowser_(self)
     self.view = MiroWebView.alloc().initWithFrame_(NSRect((0,0), self.calc_size_request()))
     self.view.setMaintainsBackForwardList_(YES)
     self.view.setApplicationNameForUserAgent_("%s/%s (%s)" % \
                                   (app.config.get(prefs.SHORT_APP_NAME),
                                    app.config.get(prefs.APP_VERSION),
                                    app.config.get(prefs.PROJECT_URL),))
Beispiel #10
0
 def __init__(self):
     Widget.__init__(self)
     self.create_signal('pressed')
     self.create_signal('released')
     self.create_signal('changed')
     self.create_signal('moved')
     self.view = CustomSliderView.alloc().init()
     self.view.setRefusesFirstResponder_(NO)
     if self.is_continuous():
         self.view.setContinuous_(YES)
     else:
         self.view.setContinuous_(NO)
Beispiel #11
0
 def __init__(self, initial_text=None):
     Widget.__init__(self)
     if initial_text is None:
         initial_text = ""
     self.view = NSTextView.alloc().initWithFrame_(NSRect((0,0),(50,50)))
     self.view.setMaxSize_((1.0e7, 1.0e7))
     self.view.setHorizontallyResizable_(NO)
     self.view.setVerticallyResizable_(YES)
     self.notifications = NotificationForwarder.create(self.view)
     if initial_text is not None:
         self.set_text(initial_text)
     self.set_size(widgetconst.SIZE_NORMAL)
Beispiel #12
0
 def __init__(self, initial_text=None):
     Widget.__init__(self)
     if initial_text is None:
         initial_text = ""
     self.view = NSTextView.alloc().initWithFrame_(NSRect((0, 0), (50, 50)))
     self.view.setMaxSize_((1.0e7, 1.0e7))
     self.view.setHorizontallyResizable_(NO)
     self.view.setVerticallyResizable_(YES)
     self.notifications = NotificationForwarder.create(self.view)
     self.create_signal('changed')
     if initial_text is not None:
         self.set_text(initial_text)
     self.set_size(widgetconst.SIZE_NORMAL)
Beispiel #13
0
 def __init__(self, text="", wrap=False):
     Widget.__init__(self)
     self.view = NSTextField.alloc().init()
     self.view.setEditable_(NO)
     self.view.setBezeled_(NO)
     self.view.setBordered_(NO)
     self.view.setDrawsBackground_(NO)
     self.wrap = wrap
     self.bold = False
     self.size = NSFont.systemFontSize()
     self.sizer_cell = self.view.cell().copy()
     self.set_font()
     self.set_text(text)
     self.__color = self.view.textColor()
Beispiel #14
0
 def __init__(self, text="", wrap=False):
     Widget.__init__(self)
     self.view = NSTextField.alloc().init()
     self.view.setEditable_(NO)
     self.view.setBezeled_(NO)
     self.view.setBordered_(NO)
     self.view.setDrawsBackground_(NO)
     self.wrap = wrap
     self.bold = False
     self.size = NSFont.systemFontSize()
     self.sizer_cell = self.view.cell().copy()
     self.set_font()
     self.set_text(text)
     self.__color = self.view.textColor()
Beispiel #15
0
 def __init__(self):
     Widget.__init__(self)
     self.url = None
     self.create_signal('net-start')
     self.create_signal('net-stop')
     self.delegate = BrowserDelegate.alloc().initWithBrowser_(self)
     self.view = MiroWebView.alloc().initWithFrame_(
         NSRect((0, 0), self.calc_size_request()))
     self.view.setMaintainsBackForwardList_(YES)
     self.view.setApplicationNameForUserAgent_("%s %s/%s (%s)" % \
                                   ('Safari/531.2+', # FIXME hack for #17370
                                    app.config.get(prefs.SHORT_APP_NAME),
                                    app.config.get(prefs.APP_VERSION),
                                    app.config.get(prefs.PROJECT_URL),))
Beispiel #16
0
 def __init__(self):
     Widget.__init__(self)
     self.url = None
     self.create_signal('net-start')
     self.create_signal('net-stop')
     self.create_signal('download-finished')
     self.delegate = BrowserDelegate.alloc().initWithBrowser_(self)
     self.view = MiroWebView.alloc().initWithFrame_(NSRect((0,0), self.calc_size_request()))
     self.view.setMaintainsBackForwardList_(YES)
     # XXX SL and better only
     if self.view.respondsToSelector_('setShouldUpdateWhileOffscreen:'):
         self.view.setShouldUpdateWhileOffscreen_(NO)
     self.view.setApplicationNameForUserAgent_("%s %s/%s (%s)" % \
                                   ('Safari/531.2+', # FIXME hack for #17370
                                    app.config.get(prefs.SHORT_APP_NAME),
                                    app.config.get(prefs.APP_VERSION),
                                    app.config.get(prefs.PROJECT_URL),))
Beispiel #17
0
 def __init__(self):
     Widget.__init__(self)
     self.url = None
     self.create_signal('net-start')
     self.create_signal('net-stop')
     self.create_signal('download-finished')
     self.delegate = BrowserDelegate.alloc().initWithBrowser_(self)
     self.view = MiroWebView.alloc().initWithFrame_(
         NSRect((0, 0), self.calc_size_request()))
     self.view.setMaintainsBackForwardList_(YES)
     # XXX SL and better only
     if self.view.respondsToSelector_('setShouldUpdateWhileOffscreen:'):
         self.view.setShouldUpdateWhileOffscreen_(NO)
     self.view.setApplicationNameForUserAgent_("%s %s/%s (%s)" % \
                                   ('Safari/531.2+', # FIXME hack for #17370
                                    app.config.get(prefs.SHORT_APP_NAME),
                                    app.config.get(prefs.APP_VERSION),
                                    app.config.get(prefs.PROJECT_URL),))
Beispiel #18
0
    def __init__(self):
        quicktime.Player.__init__(self, SUPPORTED_MEDIA_TYPES)
        Widget.__init__(self)

        frame = ((0,0),(200,200))

        self.view = NSView.alloc().initWithFrame_(frame)

        self.video_view = MiroMovieView.alloc().initWithFrame_(frame)
        self.video_view.setFillColor_(NSColor.blackColor())
        self.video_view.setControllerVisible_(NO)
        self.video_view.setEditable_(NO)
        self.video_view.setPreservesAspectRatio_(YES)

        self.movie = None
        self.movie_notifications = None
        self.system_activity_updater_timer = None
        self.window_moved_handler = None
        self.item_changed_handler = None
Beispiel #19
0
    def __init__(self):
        quicktime.Player.__init__(self, SUPPORTED_MEDIA_TYPES)
        Widget.__init__(self)

        frame = ((0,0),(200,200))

        self.view = VideoBackgroundView.alloc().initWithFrame_(frame)

        self.video_view = MiroMovieView.alloc().initWithFrame_(frame)
        self.video_view.setFillColor_(NSColor.blackColor())
        self.video_view.setControllerVisible_(NO)
        self.video_view.setEditable_(NO)
        self.video_view.setPreservesAspectRatio_(YES)

        self.video_window = None

        self.movie = None
        self.movie_notifications = None
        self.system_activity_updater_timer = None
        self.window_moved_handler = None
        self.item_changed_handler = None
Beispiel #20
0
 def __init__(self, model):
     Widget.__init__(self)
     self.create_signal('selection-changed')
     self.create_signal('hotspot-clicked')
     self.create_signal('row-double-clicked')
     # row-activated is never emitted, but it should be
     # when space or enter is pressed with a row selected. --Kaz
     self.create_signal('row-activated')
     self.model = model
     self.columns = []
     self.drag_source = None
     self.context_menu_callback = None
     if self.is_tree():
         self.create_signal('row-expanded')
         self.create_signal('row-collapsed')
         self.tableview = MiroOutlineView.alloc().init()
         self.data_source = tablemodel.MiroOutlineViewDataSource.alloc()
     else:
         self.tableview = MiroTableView.alloc().init()
         self.data_source = tablemodel.MiroTableViewDataSource.alloc()
     self.view = self.tableview
     self.data_source.initWithModel_(self.model)
     self.tableview.setDataSource_(self.data_source)
     self.tableview.setVerticalMotionCanBeginDrag_(YES)
     self.set_columns_draggable(False)
     self.set_auto_resizes(False)
     self.draws_selection = True
     self.row_height_set = False
     self.set_fixed_height(False)
     self.auto_resizing = False
     self.header_view = MiroTableHeaderView.alloc().initWithFrame_(
         NSMakeRect(0, 0, 0, HEADER_HEIGHT))
     self.set_show_headers(True)
     self.notifications = NotificationForwarder.create(self.tableview)
     self._selected_before_change = None
     self.model.connect_weak('row-changed', self.on_row_change)
     self.model.connect_weak('structure-will-change',
             self.on_model_structure_change)
     self.iters_to_update = []
     self.height_changed = self.reload_needed = False
Beispiel #21
0
 def __init__(self):
     Widget.__init__(self)
     self.view = DrawingView.alloc().init()
Beispiel #22
0
 def viewport_created(self):
     Widget.viewport_created(self)
     self.notifications.connect(self.on_changed, 'NSTextDidChangeNotification')
     self.notifications.connect(self.on_end_editing,
             'NSControlTextDidEndEditingNotification')
     self.invalidate_size_request()
Beispiel #23
0
 def enable(self):
     Widget.enable(self)
     self.view.setTextColor_(self.__color)
     self.view.setEnabled_(True)
Beispiel #24
0
 def __init__(self):
     Widget.__init__(self)
     self.view = DrawingView.alloc().init()
Beispiel #25
0
 def disable(self):
     Widget.disable(self)
     self.view.setNeedsDisplay_(YES)
Beispiel #26
0
 def viewport_created(self):
     Widget.viewport_created(self)
     self.notifications.connect(self.on_changed, 'NSTextDidChangeNotification')
     self.invalidate_size_request()
Beispiel #27
0
 def remove_viewport(self):
     Widget.remove_viewport(self)
     self.notifications.disconnect()
Beispiel #28
0
 def __init__(self, image=None):
     Widget.__init__(self)
     self.create_signal('clicked')
     self.view = NSImageDisplay.alloc().init()
     self.set_image(image)
Beispiel #29
0
 def enable(self):
     Widget.enable(self)
     self.view.setEnabled_(True)
Beispiel #30
0
 def disable(self):
     Widget.disable(self)
     self.view.setEnabled_(False)
Beispiel #31
0
 def place(self, rect, containing_view):
     Widget.place(self, rect, containing_view)
     self.adjust_video_frame()
Beispiel #32
0
 def __init__(self, image=None):
     Widget.__init__(self)
     self.create_signal('clicked')
     self.view = NSImageDisplay.alloc().init()
     self.set_image(image)
Beispiel #33
0
 def __init__(self):
     Widget.__init__(self)
     self.create_signal('clicked')
     self.view = DrawableButton.alloc().init()
     self.view.setRefusesFirstResponder_(NO)
Beispiel #34
0
 def __init__(self):
     Widget.__init__(self)
     self.view = NSBox.alloc().init()
     self.view.setBoxType_(NSBoxSeparator)
Beispiel #35
0
 def disable(self):
     Widget.disable(self)
     self.view.setNeedsDisplay_(YES)
Beispiel #36
0
 def __init__(self):
     Widget.__init__(self)
     self.view = NSProgressIndicator.alloc().init()
     self.view.setMaxValue_(1.0)
     self.view.setIndeterminate_(False)
Beispiel #37
0
 def __init__(self):
     Widget.__init__(self)
     self.view = NSBox.alloc().init()
     self.view.setBoxType_(NSBoxSeparator)
Beispiel #38
0
 def enable(self):
     Widget.enable(self)
     self.view.setNeedsDisplay_(YES)
Beispiel #39
0
 def enable(self):
     Widget.enable(self)
     self.view.setTextColor_(self.__color)
     self.view.setEnabled_(True)
Beispiel #40
0
 def enable(self):
     Widget.enable(self)
     self.view.setNeedsDisplay_(YES)
Beispiel #41
0
 def disable(self):
     Widget.disable(self)
     self.view.setTextColor_(self.__color.colorWithAlphaComponent_(0.5))
     self.view.setEnabled_(False)
Beispiel #42
0
 def disable(self):
     Widget.disable(self)
     self.view.setTextColor_(self.__color.colorWithAlphaComponent_(0.5))
     self.view.setEnabled_(False)
Beispiel #43
0
 def __init__(self):
     Widget.__init__(self)
     self.view = NSProgressIndicator.alloc().init()
     self.view.setMaxValue_(1.0)
     self.view.setIndeterminate_(False)
Beispiel #44
0
 def remove_viewport(self):
     Widget.remove_viewport(self)
     self.notifications.disconnect()
Beispiel #45
0
 def __init__(self, image):
     Widget.__init__(self)
     self.image = image
     self.image.nsimage.setCacheMode_(NSImageCacheNever)
     self.view = NSImageDisplay.alloc().initWithImage_(self.image)
Beispiel #46
0
 def remove_viewport(self):
     self.view.remove_tracking_rect()
     Widget.remove_viewport(self)
Beispiel #47
0
 def __init__(self, path):
     Widget.__init__(self)
     self.nsimage = NSImage.alloc().initByReferencingFile_(filename_to_unicode(path))
     self.view = NSImageView.alloc().init()
     self.view.setImage_(self.nsimage)