Skip to content
24 changes: 12 additions & 12 deletions Lookin.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -679,19 +679,20 @@
AA05CCD1221ED50B0086CDD1 /* AttributeView */ = {
isa = PBXGroup;
children = (
AA0A2DD3233F7D2B008BF946 /* Constraint */,
A721E4882B1CE18800546017 /* JSON */,
AA05CCD8221ED5F60086CDD1 /* LKDashboardAttributeColorView.h */,
AA05CCD9221ED5F60086CDD1 /* LKDashboardAttributeColorView.m */,
1822E2C92B9396B50007C0B2 /* LKDashboardTextControlEditingFlag.h */,
1822E2CA2B9396B50007C0B2 /* LKDashboardTextControlEditingFlag.m */,
AAB636BE22B3854100885A2C /* LKDashboardAttributeClassView.h */,
AAB636BF22B3854100885A2C /* LKDashboardAttributeClassView.m */,
AAB636C122B3981200885A2C /* LKDashboardAttributeRelationView.h */,
AAB636C222B3981200885A2C /* LKDashboardAttributeRelationView.m */,
AAAEB36C22B408DF00A3DDE7 /* LKDashboardAttributeStringArrayView.h */,
AAAEB36D22B408DF00A3DDE7 /* LKDashboardAttributeStringArrayView.m */,
D41874D2234B68AE004D68A2 /* LKDashboardAttributeOpenImageView.h */,
D41874D3234B68AE004D68A2 /* LKDashboardAttributeOpenImageView.m */,
AA0A2DD3233F7D2B008BF946 /* Constraint */,
AAAEB36D22B408DF00A3DDE7 /* LKDashboardAttributeStringArrayView.m */,
AA05CCD9221ED5F60086CDD1 /* LKDashboardAttributeColorView.m */,
AA05CCDB221ED6110086CDD1 /* LKDashboardAttributeEnumsView.h */,
AA05CCDC221ED6110086CDD1 /* LKDashboardAttributeEnumsView.m */,
AACBACB022AEA6E900A8F89D /* LKDashboardAttributeInsetsView.h */,
Expand All @@ -705,12 +706,11 @@
AA28179D22B0305400A0874C /* LKDashboardAttributeRowsCountView.h */,
AA28179E22B0305400A0874C /* LKDashboardAttributeRowsCountView.m */,
AAED8ED622AFED490051242B /* LKDashboardAttributeSizeView.h */,
AAED8ED722AFED490051242B /* LKDashboardAttributeSizeView.m */,
AA17F38E232FBD710082F393 /* LKDashboardAttributeTextView.h */,
AA17F38F232FBD710082F393 /* LKDashboardAttributeTextView.m */,
A70A0C2C2B179754009A1937 /* LKDashboardAttributeShadowView.h */,
A721E4882B1CE18800546017 /* JSON */,
A70A0C2D2B179754009A1937 /* LKDashboardAttributeShadowView.m */,
AA17F38F232FBD710082F393 /* LKDashboardAttributeTextView.m */,
AAED8ED722AFED490051242B /* LKDashboardAttributeSizeView.m */,
AA05CCD5221ED5E80086CDD1 /* LKDashboardAttributeSwitchView.h */,
AA05CCD6221ED5E80086CDD1 /* LKDashboardAttributeSwitchView.m */,
AAA8C0E021CC17680017A345 /* LKDashboardAttributeView.h */,
Expand Down Expand Up @@ -918,12 +918,12 @@
AAA8C08721CC17670017A345 /* Connection */ = {
isa = PBXGroup;
children = (
AAA8C08B21CC17670017A345 /* LKAppsManager.m */,
AAA8C08821CC17670017A345 /* LKAppsManager.h */,
AAA8C08B21CC17670017A345 /* LKAppsManager.m */,
AAA8C08921CC17670017A345 /* LKConnectionManager.h */,
AAA8C08C21CC17670017A345 /* LKConnectionManager.m */,
AA7F157622C0F2B9004436AD /* LKConnectionRequest.h */,
AA7F157722C0F2B9004436AD /* LKConnectionRequest.m */,
AAA8C08921CC17670017A345 /* LKConnectionManager.h */,
AAA8C08D21CC17670017A345 /* LKInspectableApp.h */,
AAA8C08A21CC17670017A345 /* LKInspectableApp.m */,
);
Expand Down Expand Up @@ -1038,8 +1038,8 @@
AAC41E1522686A28005CDD6E /* LKStaticHierarchyDataSource.m */,
AAA8C0D421CC17680017A345 /* LKStaticWindowController.h */,
AAA8C11221CC17680017A345 /* LKStaticWindowController.m */,
AAA8C0CA21CC17670017A345 /* LKStaticHierarchyController.m */,
AAA8C0D121CC17670017A345 /* LKStaticHierarchyController.h */,
AAA8C0CA21CC17670017A345 /* LKStaticHierarchyController.m */,
A77AA1792AEED1B8006A7BF4 /* LKMessageManager.h */,
A77AA17A2AEED1B8006A7BF4 /* LKMessageManager.m */,
);
Expand All @@ -1052,9 +1052,9 @@
AAB65C0D2320FCFA001E4299 /* Search */,
AA05CCD1221ED50B0086CDD1 /* AttributeView */,
AAA8C0DA21CC17680017A345 /* LKDashboardCardView.h */,
AAA8C0EA21CC17680017A345 /* LKDashboardCardView.m */,
AA66C59F231924BD00085C76 /* LKDashboardAccessoryWindowController.h */,
AA66C5A0231924BD00085C76 /* LKDashboardAccessoryWindowController.m */,
AAA8C0EA21CC17680017A345 /* LKDashboardCardView.m */,
7BFFDF132AF134240039B828 /* LKDashboardSectionViewPool.h */,
7BFFDF142AF134240039B828 /* LKDashboardSectionViewPool.m */,
AAB636C422B3BA0F00885A2C /* LKDashboardCardTitleControl.h */,
Expand Down Expand Up @@ -1631,7 +1631,7 @@
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 14;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 5V3Z8FVWHU;
DEVELOPMENT_TEAM = D5Q73692VW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -1672,7 +1672,7 @@
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 14;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 5V3Z8FVWHU;
DEVELOPMENT_TEAM = D5Q73692VW;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down
21 changes: 21 additions & 0 deletions LookinClient/Assets.xcassets/icon_mac_big.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon_mac_big.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions LookinClient/Assets.xcassets/icon_mac_small.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon_mac_small.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 51 additions & 4 deletions LookinClient/Base/Category/LookinDisplayItem+LookinClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ - (NSString *)title {
return self.viewObject.lk_simpleDemangledClassName;
} else if (self.layerObject) {
return self.layerObject.lk_simpleDemangledClassName;
} else if (self.windowObject) {
return self.windowObject.lk_simpleDemangledClassName;
} else {
return nil;
}
Expand All @@ -35,7 +37,7 @@ - (NSString *)subtitle {
return [NSString stringWithFormat:@"%@.view", text];
}

LookinObject *representedObject = self.viewObject ? : self.layerObject;
LookinObject *representedObject = self.windowObject ? : self.viewObject ? : self.layerObject;
if (representedObject.specialTrace.length) {
return representedObject.specialTrace;

Expand All @@ -51,7 +53,7 @@ - (NSString *)subtitle {
}

- (BOOL)representedForSystemClass {
return [self.title hasPrefix:@"UI"] || [self.title hasPrefix:@"CA"] || [self.title hasPrefix:@"_"];
return [self.title hasPrefix:@"UI"] || [self.title hasPrefix:@"CA"] || [self.title hasPrefix:@"_"] || [self.title hasPrefix:@"NS"];
}

- (NSImage *)appropriateScreenshot {
Expand Down Expand Up @@ -82,25 +84,67 @@ - (BOOL)hasValidFrameToRoot {
return [LKHelper validateFrame:self.frame];
}

//- (CGRect)calculateFrameToRoot {
// if (self.customInfo) {
// return [self.customInfo.frameInWindow rectValue];
// }
// if (!self.superItem) {
// return self.frame;
// }
// CGRect superFrameToRoot = [self.superItem calculateFrameToRoot];
// CGRect superBounds = self.superItem.bounds;
// CGRect selfFrame = self.frame;
//
// CGFloat x = selfFrame.origin.x - superBounds.origin.x + superFrameToRoot.origin.x;
// CGFloat y = selfFrame.origin.y - superBounds.origin.y + superFrameToRoot.origin.y;
//
// CGFloat width = selfFrame.size.width;
// CGFloat height = selfFrame.size.height;
// return CGRectMake(x, y, width, height);
//}

- (CGRect)calculateFrameToRoot {
if (self.customInfo) {
return [self.customInfo.frameInWindow rectValue];
}
if (!self.superItem) {
return self.frame;
}

CGRect superFrameToRoot = [self.superItem calculateFrameToRoot];
CGRect superBounds = self.superItem.bounds;
CGRect selfFrame = self.frame;

CGFloat x = selfFrame.origin.x - superBounds.origin.x + superFrameToRoot.origin.x;
CGFloat y = selfFrame.origin.y - superBounds.origin.y + superFrameToRoot.origin.y;
CGFloat y;

if (self.superItem.isFlipped) {
y = superFrameToRoot.origin.y + (superBounds.size.height - selfFrame.origin.y - selfFrame.size.height);
} else {
y = selfFrame.origin.y - superBounds.origin.y + superFrameToRoot.origin.y;
}
/*

// 处理当前视图坐标系到父视图坐标系的转换
if (self.isFlipped == self.superItem.isFlipped) {
// 父子视图坐标系相同

} else {
// 父子视图坐标系不同
if (self.isFlipped) {
// 当前视图原点在左上角,父视图原点在左下角
} else {
// 当前视图原点在左下角,父视图原点在左上角
y = superFrameToRoot.origin.y + selfFrame.origin.y;
}
}
*/
CGFloat width = selfFrame.size.width;
CGFloat height = selfFrame.size.height;
return CGRectMake(x, y, width, height);
}


- (BOOL)isMatchedWithSearchString:(NSString *)string {
if (string.length == 0) {
NSAssert(NO, @"");
Expand All @@ -119,6 +163,9 @@ - (BOOL)isMatchedWithSearchString:(NSString *)string {
if ([self.layerObject.memoryAddress containsString:searchString]) {
return YES;
}
if ([self.windowObject.memoryAddress containsString:searchString]) {
return YES;
}
return NO;
}

Expand Down Expand Up @@ -164,7 +211,7 @@ - (BOOL)itemIsKindOfClassesWithNames:(NSSet<NSString *> *)targetClassNames {
if (!targetClassNames.count) {
return NO;
}
LookinObject *selfObj = self.viewObject ? : self.layerObject;
LookinObject *selfObj = self.windowObject ? : self.viewObject ? : self.layerObject;
if (!selfObj) {
return NO;
}
Expand Down
8 changes: 5 additions & 3 deletions LookinClient/Base/LKTipsView.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@ - (void)setImage:(NSImage *)image {
}

- (void)setImageByDeviceType:(LookinAppInfoDevice)type {
if (type == 0) {
if (type == LookinAppInfoDeviceSimulator) {
self.image = NSImageMake(@"icon_simulator_big");
} else if (type == 1) {
} else if (type == LookinAppInfoDeviceIPad) {
self.image = NSImageMake(@"icon_ipad_big");
} else if (type == 2) {
} else if (type == LookinAppInfoDeviceOthers) {
self.image = NSImageMake(@"icon_iphone_big");
} else if (type == LookinAppInfoDeviceMac) {
self.image = NSImageMake(@"icon_mac_big");
} else {
NSAssert(NO, @"");
}
Expand Down
2 changes: 1 addition & 1 deletion LookinClient/Connection/LKConnectionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#import "LKConnectionRequest.h"
#import "LKServerVersionRequestor.h"

static NSIndexSet * PushFrameTypeList() {
static NSIndexSet * PushFrameTypeList(void) {
static NSIndexSet *list;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Expand Down
2 changes: 1 addition & 1 deletion LookinClient/Console/LKConsoleDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ - (instancetype)initWithHierarchyDataSource:(LKHierarchyDataSource *)hierarchyDa
if (!item) {
return nil;
}
NSArray<LookinObject *> *objs = $(item.hostViewControllerObject, item.layerObject, item.viewObject).array;
NSArray<LookinObject *> *objs = $(item.hostViewControllerObject, item.layerObject, item.viewObject, item.windowObject).array;
return objs;
}];
}
Expand Down
9 changes: 9 additions & 0 deletions LookinClient/Dashboard/LKDashboardCardView.m
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,15 @@ + (NSImage *)imageWithAttrGroup:(LookinAttributesGroup *)group {
LookinAttrGroup_UITextField: NSImageMake(@"dashboard_textfield"),
LookinAttrGroup_UIVisualEffectView: NSImageMake(@"dashboard_effectview"),
LookinAttrGroup_UIStackView: NSImageMake(@"dashboard_stackview"),
LookinAttrGroup_NSImageView: NSImageMake(@"dashboard_imageview"),
LookinAttrGroup_NSButton: NSImageMake(@"dashboard_button"),
LookinAttrGroup_NSControl: NSImageMake(@"dashboard_control"),
LookinAttrGroup_NSScrollView: NSImageMake(@"dashboard_scrollview"),
LookinAttrGroup_NSTableView: NSImageMake(@"dashboard_tableview"),
LookinAttrGroup_NSTextView: NSImageMake(@"dashboard_textview"),
LookinAttrGroup_NSTextField: NSImageMake(@"dashboard_textfield"),
LookinAttrGroup_NSVisualEffectView: NSImageMake(@"dashboard_effectview"),
LookinAttrGroup_NSStackView: NSImageMake(@"dashboard_stackview"),
LookinAttrGroup_UserCustom: NSImageMake(@"dashboard_custom")
};
});
Expand Down
5 changes: 4 additions & 1 deletion LookinClient/Dashboard/LKDashboardSectionView.m
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ - (Class)_targetAttrClassForType:(LookinAttrType)type identifier:(LookinAttrIden
case LookinAttrTypeFloat:
case LookinAttrTypeDouble:
case LookinAttrTypeLong:
case LookinAttrTypeUnsignedLong:
case LookinAttrTypeInt:
case LookinAttrTypeUnsignedInt:
return [LKDashboardAttributeNumberInputView class];
case LookinAttrTypeUIColor:
return [LKDashboardAttributeColorView class];
Expand All @@ -279,7 +282,7 @@ - (Class)_targetAttrClassForType:(LookinAttrType)type identifier:(LookinAttrIden
return [LKDashboardAttributeRelationView class];
} else if ([identifier isEqualToString:LookinAttr_AutoLayout_Constraints_Constraints]) {
return [LKDashboardAttributeConstraintsView class];
} else if ([identifier isEqualToString:LookinAttr_UIImageView_Open_Open]) {
} else if ([identifier isEqualToString:LookinAttr_UIImageView_Open_Open] || [identifier isEqualToString:LookinAttr_NSImageView_Open_Open]) {
return [LKDashboardAttributeOpenImageView class];
} else if ([identifier isEqualToString:LookinAttr_UIVisualEffectView_Style_Style]) {
return [LKDashboardAttributeEnumsView class];
Expand Down
4 changes: 3 additions & 1 deletion LookinClient/Dashboard/LKDashboardViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ - (RACSignal *)modifyInbuiltAttribute:(LookinAttribute *)attribute newValue:(id)
modification.clientReadableVersion = [LKHelper lookinReadableVersion];
if ([LookinDashboardBlueprint isUIViewPropertyWithAttrID:attribute.identifier]) {
modification.targetOid = modifyingItem.viewObject.oid;
} else if ([LookinDashboardBlueprint isWindowPropertyWithAttrID:attribute.identifier]) {
modification.targetOid = modifyingItem.windowObject.oid;
} else {
modification.targetOid = modifyingItem.layerObject.oid;
}
Expand Down Expand Up @@ -406,7 +408,7 @@ - (void)dashboardHeaderView:(LKDashboardHeaderView *)view didInputString:(NSStri
[self.searchContainerView addSubview:self.searchMethodsView];
}

LookinObject *selectedObj = self.currentDataSource.selectedItem.viewObject ? : self.currentDataSource.selectedItem.layerObject;
LookinObject *selectedObj = self.currentDataSource.selectedItem.windowObject ? : self.currentDataSource.selectedItem.viewObject ? : self.currentDataSource.selectedItem.layerObject;
NSString *selectedClassName = [selectedObj rawClassName];
@weakify(self);
[[self.methodsDataSource fetchNonArgMethodsListWithClass:selectedClassName] subscribeNext:^(NSArray<NSString *> *methodsList) {
Expand Down
Loading