Beispiel #1
0
    def run(self, args, options):
        def setBorder(layer, width, color, colorClass):
            fb.evaluateEffect('[%s setBorderWidth:(CGFloat)%s]' %
                              (layer, width))
            fb.evaluateEffect(
                '[%s setBorderColor:(CGColorRef)[(id)[%s %sColor] CGColor]]' %
                (layer, colorClass, color))

        obj = fb.evaluateInputExpression(args[0])
        depth = int(options.depth)
        isMac = runtimeHelpers.isMacintoshArch()
        color = options.color
        assert color in self.colors, "Color must be one of the following: {}".format(
            " ".join(self.colors))
        colorClassName = 'UIColor'
        if isMac:
            colorClassName = 'NSColor'

        if viewHelpers.isView(obj):
            prevLevel = 0
            for view, level in viewHelpers.subviewsOfView(obj):
                if level > depth:
                    break
                if prevLevel != level:
                    color = self.nextColorAfterColor(color)
                    prevLevel = level
                layer = viewHelpers.convertToLayer(view)
                setBorder(layer, options.width, color, colorClassName)
        else:
            # `obj` is not a view, make sure recursive bordering is not requested
            assert depth <= 0, "Recursive bordering is only supported for UIViews or NSViews"
            layer = viewHelpers.convertToLayer(obj)
            setBorder(layer, options.width, color, colorClassName)

        lldb.debugger.HandleCommand('caflush')
Beispiel #2
0
  def run(self, args, options):
    def setBorder(layer, width, color, colorClass):
      fb.evaluateEffect('[%s setBorderWidth:(CGFloat)%s]' % (layer, width))
      fb.evaluateEffect('[%s setBorderColor:(CGColorRef)[(id)[%s %sColor] CGColor]]' % (layer, colorClass, color))

    obj = fb.evaluateInputExpression(args[0])
    depth = int(options.depth)
    isMac = runtimeHelpers.isMacintoshArch()
    color = options.color
    assert color in self.colors, "Color must be one of the following: {}".format(" ".join(self.colors))
    colorClassName = 'UIColor'
    if isMac:
      colorClassName = 'NSColor'

    if viewHelpers.isView(obj):
      prevLevel = 0
      for view, level in viewHelpers.subviewsOfView(obj):
        if level > depth:
           break
        if prevLevel != level:
          color = self.nextColorAfterColor(color)
          prevLevel = level
        layer = viewHelpers.convertToLayer(view)
        setBorder(layer, options.width, color, colorClassName)
    else:
      # `obj` is not a view, make sure recursive bordering is not requested
      assert depth <= 0, "Recursive bordering is only supported for UIViews or NSViews"
      layer = viewHelpers.convertToLayer(obj)
      setBorder(layer, options.width, color, colorClassName)

    lldb.debugger.HandleCommand('caflush')
Beispiel #3
0
    def run(self, args, options):
        def setUnborder(layer):
            fb.evaluateEffect('[%s setBorderWidth:(CGFloat)%s]' % (layer, 0))

        obj = args[0]
        depth = int(options.depth)
        if viewHelpers.isView(obj):
            for view, level in viewHelpers.subviewsOfView(obj):
                if level > depth:
                    break
                layer = viewHelpers.convertToLayer(view)
                setUnborder(layer)
        else:
            # `obj` is not a view, make sure recursive unbordering is not requested
            assert depth <= 0, "Recursive unbordering is only supported for UIViews or NSViews"
            layer = viewHelpers.convertToLayer(obj)
            setUnborder(layer)

        lldb.debugger.HandleCommand('caflush')
Beispiel #4
0
  def run(self, args, options):
    def setUnborder(layer):
        fb.evaluateEffect('[%s setBorderWidth:(CGFloat)%s]' % (layer, 0))

    obj = args[0]
    depth = int(options.depth)
    if viewHelpers.isView(obj):
      for view, level in viewHelpers.subviewsOfView(obj):
        if level > depth:
           break
        layer = viewHelpers.convertToLayer(view)
        setUnborder(layer)
    else:
      # `obj` is not a view, make sure recursive unbordering is not requested
      assert depth <= 0, "Recursive unbordering is only supported for UIViews or NSViews"
      layer = viewHelpers.convertToLayer(obj)
      setUnborder(layer)

    lldb.debugger.HandleCommand('caflush')