Loading include/input/DisplayViewport.h +37 −34 Original line number Original line Diff line number Diff line Loading @@ -74,36 +74,40 @@ struct DisplayViewport { int32_t physicalBottom; int32_t physicalBottom; int32_t deviceWidth; int32_t deviceWidth; int32_t deviceHeight; int32_t deviceHeight; bool isActive; std::string uniqueId; std::string uniqueId; // The actual (hardware) port that the associated display is connected to. // The actual (hardware) port that the associated display is connected to. // Not all viewports will have this specified. // Not all viewports will have this specified. std::optional<uint8_t> physicalPort; std::optional<uint8_t> physicalPort; ViewportType type; ViewportType type; DisplayViewport() : DisplayViewport() displayId(ADISPLAY_ID_NONE), orientation(DISPLAY_ORIENTATION_0), : displayId(ADISPLAY_ID_NONE), logicalLeft(0), logicalTop(0), logicalRight(0), logicalBottom(0), orientation(DISPLAY_ORIENTATION_0), physicalLeft(0), physicalTop(0), physicalRight(0), physicalBottom(0), logicalLeft(0), deviceWidth(0), deviceHeight(0), uniqueId(), physicalPort(std::nullopt), logicalTop(0), type(ViewportType::VIEWPORT_INTERNAL) { logicalRight(0), } logicalBottom(0), physicalLeft(0), physicalTop(0), physicalRight(0), physicalBottom(0), deviceWidth(0), deviceHeight(0), isActive(false), uniqueId(), physicalPort(std::nullopt), type(ViewportType::VIEWPORT_INTERNAL) {} bool operator==(const DisplayViewport& other) const { bool operator==(const DisplayViewport& other) const { return displayId == other.displayId return displayId == other.displayId && orientation == other.orientation && && orientation == other.orientation logicalLeft == other.logicalLeft && logicalTop == other.logicalTop && && logicalLeft == other.logicalLeft logicalRight == other.logicalRight && logicalBottom == other.logicalBottom && && logicalTop == other.logicalTop physicalLeft == other.physicalLeft && physicalTop == other.physicalTop && && logicalRight == other.logicalRight physicalRight == other.physicalRight && physicalBottom == other.physicalBottom && && logicalBottom == other.logicalBottom deviceWidth == other.deviceWidth && deviceHeight == other.deviceHeight && && physicalLeft == other.physicalLeft isActive == other.isActive && uniqueId == other.uniqueId && && physicalTop == other.physicalTop physicalPort == other.physicalPort && type == other.type; && physicalRight == other.physicalRight && physicalBottom == other.physicalBottom && deviceWidth == other.deviceWidth && deviceHeight == other.deviceHeight && uniqueId == other.uniqueId && physicalPort == other.physicalPort && type == other.type; } } bool operator!=(const DisplayViewport& other) const { bool operator!=(const DisplayViewport& other) const { Loading @@ -127,6 +131,7 @@ struct DisplayViewport { physicalBottom = height; physicalBottom = height; deviceWidth = width; deviceWidth = width; deviceHeight = height; deviceHeight = height; isActive = false; uniqueId.clear(); uniqueId.clear(); physicalPort = std::nullopt; physicalPort = std::nullopt; type = ViewportType::VIEWPORT_INTERNAL; type = ViewportType::VIEWPORT_INTERNAL; Loading @@ -136,16 +141,14 @@ struct DisplayViewport { return StringPrintf("Viewport %s: displayId=%d, uniqueId=%s, port=%s, orientation=%d, " return StringPrintf("Viewport %s: displayId=%d, uniqueId=%s, port=%s, orientation=%d, " "logicalFrame=[%d, %d, %d, %d], " "logicalFrame=[%d, %d, %d, %d], " "physicalFrame=[%d, %d, %d, %d], " "physicalFrame=[%d, %d, %d, %d], " "deviceSize=[%d, %d]", "deviceSize=[%d, %d], " viewportTypeToString(type), displayId, "isActive=[%d]", uniqueId.c_str(), viewportTypeToString(type), displayId, uniqueId.c_str(), physicalPort ? StringPrintf("%" PRIu8, *physicalPort).c_str() : "<none>", physicalPort ? StringPrintf("%" PRIu8, *physicalPort).c_str() orientation, : "<none>", logicalLeft, logicalTop, orientation, logicalLeft, logicalTop, logicalRight, logicalBottom, logicalRight, logicalBottom, physicalLeft, physicalTop, physicalRight, physicalBottom, deviceWidth, physicalLeft, physicalTop, deviceHeight, isActive); physicalRight, physicalBottom, deviceWidth, deviceHeight); } } }; }; Loading Loading
include/input/DisplayViewport.h +37 −34 Original line number Original line Diff line number Diff line Loading @@ -74,36 +74,40 @@ struct DisplayViewport { int32_t physicalBottom; int32_t physicalBottom; int32_t deviceWidth; int32_t deviceWidth; int32_t deviceHeight; int32_t deviceHeight; bool isActive; std::string uniqueId; std::string uniqueId; // The actual (hardware) port that the associated display is connected to. // The actual (hardware) port that the associated display is connected to. // Not all viewports will have this specified. // Not all viewports will have this specified. std::optional<uint8_t> physicalPort; std::optional<uint8_t> physicalPort; ViewportType type; ViewportType type; DisplayViewport() : DisplayViewport() displayId(ADISPLAY_ID_NONE), orientation(DISPLAY_ORIENTATION_0), : displayId(ADISPLAY_ID_NONE), logicalLeft(0), logicalTop(0), logicalRight(0), logicalBottom(0), orientation(DISPLAY_ORIENTATION_0), physicalLeft(0), physicalTop(0), physicalRight(0), physicalBottom(0), logicalLeft(0), deviceWidth(0), deviceHeight(0), uniqueId(), physicalPort(std::nullopt), logicalTop(0), type(ViewportType::VIEWPORT_INTERNAL) { logicalRight(0), } logicalBottom(0), physicalLeft(0), physicalTop(0), physicalRight(0), physicalBottom(0), deviceWidth(0), deviceHeight(0), isActive(false), uniqueId(), physicalPort(std::nullopt), type(ViewportType::VIEWPORT_INTERNAL) {} bool operator==(const DisplayViewport& other) const { bool operator==(const DisplayViewport& other) const { return displayId == other.displayId return displayId == other.displayId && orientation == other.orientation && && orientation == other.orientation logicalLeft == other.logicalLeft && logicalTop == other.logicalTop && && logicalLeft == other.logicalLeft logicalRight == other.logicalRight && logicalBottom == other.logicalBottom && && logicalTop == other.logicalTop physicalLeft == other.physicalLeft && physicalTop == other.physicalTop && && logicalRight == other.logicalRight physicalRight == other.physicalRight && physicalBottom == other.physicalBottom && && logicalBottom == other.logicalBottom deviceWidth == other.deviceWidth && deviceHeight == other.deviceHeight && && physicalLeft == other.physicalLeft isActive == other.isActive && uniqueId == other.uniqueId && && physicalTop == other.physicalTop physicalPort == other.physicalPort && type == other.type; && physicalRight == other.physicalRight && physicalBottom == other.physicalBottom && deviceWidth == other.deviceWidth && deviceHeight == other.deviceHeight && uniqueId == other.uniqueId && physicalPort == other.physicalPort && type == other.type; } } bool operator!=(const DisplayViewport& other) const { bool operator!=(const DisplayViewport& other) const { Loading @@ -127,6 +131,7 @@ struct DisplayViewport { physicalBottom = height; physicalBottom = height; deviceWidth = width; deviceWidth = width; deviceHeight = height; deviceHeight = height; isActive = false; uniqueId.clear(); uniqueId.clear(); physicalPort = std::nullopt; physicalPort = std::nullopt; type = ViewportType::VIEWPORT_INTERNAL; type = ViewportType::VIEWPORT_INTERNAL; Loading @@ -136,16 +141,14 @@ struct DisplayViewport { return StringPrintf("Viewport %s: displayId=%d, uniqueId=%s, port=%s, orientation=%d, " return StringPrintf("Viewport %s: displayId=%d, uniqueId=%s, port=%s, orientation=%d, " "logicalFrame=[%d, %d, %d, %d], " "logicalFrame=[%d, %d, %d, %d], " "physicalFrame=[%d, %d, %d, %d], " "physicalFrame=[%d, %d, %d, %d], " "deviceSize=[%d, %d]", "deviceSize=[%d, %d], " viewportTypeToString(type), displayId, "isActive=[%d]", uniqueId.c_str(), viewportTypeToString(type), displayId, uniqueId.c_str(), physicalPort ? StringPrintf("%" PRIu8, *physicalPort).c_str() : "<none>", physicalPort ? StringPrintf("%" PRIu8, *physicalPort).c_str() orientation, : "<none>", logicalLeft, logicalTop, orientation, logicalLeft, logicalTop, logicalRight, logicalBottom, logicalRight, logicalBottom, physicalLeft, physicalTop, physicalRight, physicalBottom, deviceWidth, physicalLeft, physicalTop, deviceHeight, isActive); physicalRight, physicalBottom, deviceWidth, deviceHeight); } } }; }; Loading