# Path: mvc/signals.py
# class NestedSignalError(StandardError):
# class WeakMethodReference:
# class Callback:
# class WeakCallback:
# class SignalEmitter(object):
# class SystemSignals(SignalEmitter):
#     def __init__(self, method):
#     def __call__(self):
#     def __init__(self, func, extra_args):
#     def invoke(self, obj, args):
#     def compare_function(self, func):
#     def is_dead(self):
#     def __init__(self, method, extra_args):
#     def compare_function(self, func):
#     def invoke(self, obj, args):
#     def is_dead(self):
#     def __init__(self, *signal_names):
#     def freeze_signals(self):
#     def thaw_signals(self):
#     def create_signal(self, name):
#     def get_callbacks(self, signal_name):
#     def _check_already_connected(self, name, func):
#     def connect(self, name, func, *extra_args):
#     def connect_weak(self, name, method, *extra_args):
#     def disconnect(self, callback_handle):
#     def disconnect_all(self):
#     def emit(self, name, *args):
#     def _run_signal(self, name, args):
#     def clear_old_weak_references(self):
#     def __init__(self):
#     def shutdown(self):
#     def update_available(self, latest):
#     def new_dialog(self, dialog):
#     def theme_first_run(self, theme):
#     def videos_added(self, view):
#     def download_complete(self, item):
#     def failed_exn(self, when, details=None):
#     def failed(self, when, with_exception=False, details=None):
# 
# Path: mvc/widgets/osx/viewport.py
# class Viewport(object):
#     """Used when a widget creates it's own NSView."""
#     def __init__(self, view, initial_frame):
#         self.view = view
#         self.view.setFrame_(initial_frame)
#         self.placement = initial_frame
# 
#     def at_position(self, rect):
#         """Check if a viewport is currently positioned at rect."""
#         return self.placement == rect
# 
#     def reposition(self, rect):
#         """Move the viewport to a different position."""
#         self.view.setFrame_(rect)
#         self.placement = rect
# 
#     def remove(self):
#         self.view.removeFromSuperview()
# 
#     def area(self):
#         """Area of our view that is occupied by the viewport."""
#         return NSRect(self.view.bounds().origin, self.placement.size)
# 
#     def get_width(self):
#         return self.view.frame().size.width
# 
#     def get_height(self):
#         return self.view.frame().size.height
# 
#     def queue_redraw(self):
#         opaque_view = self.view.opaqueAncestor()
#         if opaque_view is not None:
#             rect = opaque_view.convertRect_fromView_(self.area(), self.view)
#             opaque_view.setNeedsDisplayInRect_(rect)
# 
#     def redraw_now(self):
#         self.view.displayRect_(self.area())
# 
# class BorrowedViewport(Viewport):
#     """Used when a widget uses the NSView of one of it's ancestors.  We store
#     the view that we borrow as well as an NSRect specifying where on that view
#     we are placed.
#     """
#     def __init__(self, view, placement):
#         self.view = view
#         self.placement = placement
# 
#     def at_position(self, rect):
#         return self.placement == rect
# 
#     def reposition(self, rect):
#         self.placement = rect
# 
#     def remove(self):
#         pass
# 
#     def area(self):
#         return self.placement
# 
#     def get_width(self):
#         return self.placement.size.width
# 
#     def get_height(self):
#         return self.placement.size.height


from AppKit import *
from Foundation import *
from objc import YES, NO, nil
from mvc import signals
from .viewport import Viewport, BorrowedViewport
        from mvc.widgets.osx import size_request_manager
        from mvc.widgets.osx import size_request_manager
import wrappermap
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
#
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.

""".base.py -- Widget base classes."""



class Widget(signals.SignalEmitter):
    """Base class for Cocoa widgets.
    
    attributes:

    CREATES_VIEW -- Does the widget create a view for itself?  If this is True
    the widget must have an attribute named view, which is the view that the
    widget uses.

    placement -- What portion of view the widget occupies.
    """

    CREATES_VIEW = True 

    def __init__(self):

# Path: mvc/signals.py
# class NestedSignalError(StandardError):
# class WeakMethodReference:
# class Callback:
# class WeakCallback:
# class SignalEmitter(object):
# class SystemSignals(SignalEmitter):
#     def __init__(self, method):
#     def __call__(self):
#     def __init__(self, func, extra_args):
#     def invoke(self, obj, args):
#     def compare_function(self, func):
#     def is_dead(self):
#     def __init__(self, method, extra_args):
#     def compare_function(self, func):
#     def invoke(self, obj, args):
#     def is_dead(self):
#     def __init__(self, *signal_names):
#     def freeze_signals(self):
#     def thaw_signals(self):
#     def create_signal(self, name):
#     def get_callbacks(self, signal_name):
#     def _check_already_connected(self, name, func):
#     def connect(self, name, func, *extra_args):
#     def connect_weak(self, name, method, *extra_args):
#     def disconnect(self, callback_handle):
#     def disconnect_all(self):
#     def emit(self, name, *args):
#     def _run_signal(self, name, args):
#     def clear_old_weak_references(self):
#     def __init__(self):
#     def shutdown(self):
#     def update_available(self, latest):
#     def new_dialog(self, dialog):
#     def theme_first_run(self, theme):
#     def videos_added(self, view):
#     def download_complete(self, item):
#     def failed_exn(self, when, details=None):
#     def failed(self, when, with_exception=False, details=None):
# 
# Path: mvc/widgets/osx/viewport.py
# class Viewport(object):
#     """Used when a widget creates it's own NSView."""
#     def __init__(self, view, initial_frame):
#         self.view = view
#         self.view.setFrame_(initial_frame)
#         self.placement = initial_frame
# 
#     def at_position(self, rect):
#         """Check if a viewport is currently positioned at rect."""
#         return self.placement == rect
# 
#     def reposition(self, rect):
#         """Move the viewport to a different position."""
#         self.view.setFrame_(rect)
#         self.placement = rect
# 
#     def remove(self):
#         self.view.removeFromSuperview()
# 
#     def area(self):
#         """Area of our view that is occupied by the viewport."""
#         return NSRect(self.view.bounds().origin, self.placement.size)
# 
#     def get_width(self):
#         return self.view.frame().size.width
# 
#     def get_height(self):
#         return self.view.frame().size.height
# 
#     def queue_redraw(self):
#         opaque_view = self.view.opaqueAncestor()
#         if opaque_view is not None:
#             rect = opaque_view.convertRect_fromView_(self.area(), self.view)
#             opaque_view.setNeedsDisplayInRect_(rect)
# 
#     def redraw_now(self):
#         self.view.displayRect_(self.area())
# 
# class BorrowedViewport(Viewport):
#     """Used when a widget uses the NSView of one of it's ancestors.  We store
#     the view that we borrow as well as an NSRect specifying where on that view
#     we are placed.
#     """
#     def __init__(self, view, placement):
#         self.view = view
#         self.placement = placement
# 
#     def at_position(self, rect):
#         return self.placement == rect
# 
#     def reposition(self, rect):
#         self.placement = rect
# 
#     def remove(self):
#         pass
# 
#     def area(self):
#         return self.placement
# 
#     def get_width(self):
#         return self.placement.size.width
# 
#     def get_height(self):
#         return self.placement.size.height


# Path: mvc/widgets/osx/base.py
from AppKit import *
from Foundation import *
from objc import YES, NO, nil
from mvc import signals
from .viewport import Viewport, BorrowedViewport
        from mvc.widgets.osx import size_request_manager
        from mvc.widgets.osx import size_request_manager
import wrappermap

# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
#
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.

""".base.py -- Widget base classes."""



class Widget(signals.SignalEmitter):
    """Base class for Cocoa widgets.
    
    attributes:

    CREATES_VIEW -- Does the widget create a view for itself?  If this is True
    the widget must have an attribute named view, which is the view that the
    widget uses.

    placement -- What portion of view the widget occupies.
    """

    CREATES_VIEW = True 

    def __init__(self):

        signals.SignalEmitter.__init__(self, 'size-request-changed',