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')
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')
def run(self, args, options): layer = viewHelpers.convertToLayer(args[0]) lldb.debugger.HandleCommand("expr (void)[%s setBorderWidth:%s]" % (layer, options.width)) lldb.debugger.HandleCommand( "expr (void)[%s setBorderColor:(CGColorRef)[(id)[UIColor %sColor] CGColor]]" % (layer, options.color) ) lldb.debugger.HandleCommand("caflush")
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')
def run(self, args, options): colorClassName = 'UIColor' isMac = runtimeHelpers.isMacintoshArch() if isMac: colorClassName = 'NSColor' layer = viewHelpers.convertToLayer(args[0]) lldb.debugger.HandleCommand('expr (void)[%s setBorderWidth:(CGFloat)%s]' % (layer, options.width)) lldb.debugger.HandleCommand('expr (void)[%s setBorderColor:(CGColorRef)[(id)[%s %sColor] CGColor]]' % (layer, colorClassName, options.color)) lldb.debugger.HandleCommand('caflush')
def run(self, args, options): colorClassName = 'UIColor' isMac = runtimeHelpers.isMacintoshArch() if isMac: colorClassName = 'NSColor' layer = viewHelpers.convertToLayer(args[0]) lldb.debugger.HandleCommand( 'expr (void)[%s setBorderWidth:(CGFloat)%s]' % (layer, options.width)) lldb.debugger.HandleCommand( 'expr (void)[%s setBorderColor:(CGColorRef)[(id)[%s %sColor] CGColor]]' % (layer, colorClassName, options.color)) lldb.debugger.HandleCommand('caflush')
def setBorderOnAmbiguousViewRecursive(view, width, color): if not fb.evaluateBooleanExpression('[(id)%s isKindOfClass:(Class)[UIView class]]' % view): return isAmbiguous = fb.evaluateBooleanExpression('(BOOL)[%s hasAmbiguousLayout]' % view) if isAmbiguous: layer = viewHelpers.convertToLayer(view) fb.evaluateEffect('[%s setBorderWidth:(CGFloat)%s]' % (layer, width)) fb.evaluateEffect('[%s setBorderColor:(CGColorRef)[(id)[UIColor %sColor] CGColor]]' % (layer, color)) subviews = fb.evaluateExpression('(id)[%s subviews]' % view) subviewsCount = int(fb.evaluateExpression('(int)[(id)%s count]' % subviews)) if subviewsCount > 0: for i in range(0, subviewsCount): subview = fb.evaluateExpression('(id)[%s objectAtIndex:%i]' % (subviews, i)) setBorderOnAmbiguousViewRecursive(subview, width, color)
def run(self, args, options): layer = viewHelpers.convertToLayer(args[0]) lldb.debugger.HandleCommand( 'expr (void)[%s setBorderWidth:(CGFloat)%s]' % (layer, 0)) lldb.debugger.HandleCommand('caflush')
def run(self, args, options): layer = viewHelpers.convertToLayer(args[0]) lldb.debugger.HandleCommand('expr (void)[%s setBorderWidth:(CGFloat)%s]' % (layer, 0)) lldb.debugger.HandleCommand('caflush')
def run(self, args, options): layer = viewHelpers.convertToLayer(args[0]) lldb.debugger.HandleCommand('expr (void)[%s setBorderWidth:(CGFloat)%s]' % (layer, options.width)) lldb.debugger.HandleCommand('expr (void)[%s setBorderColor:(CGColorRef)[(id)[UIColor %sColor] CGColor]]' % (layer, options.color)) lldb.debugger.HandleCommand('caflush')
def run(self, args, options): layer = viewHelpers.convertToLayer(args[0]) lldb.debugger.HandleCommand("expr (void)[%s setBorderWidth:%s]" % (layer, 0)) lldb.debugger.HandleCommand("caflush")