mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2025-02-20 11:43:27 +08:00
PhycialDisplay: tidy
This commit is contained in:
parent
1d1ce83567
commit
abae204ab8
@ -3,8 +3,8 @@
|
||||
typedef struct FFPhycialDisplayResult
|
||||
{
|
||||
FFstrbuf name;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t width; // native / maximum resolution, in pixels
|
||||
uint32_t height; // native / maximum resolution, in pixels
|
||||
} FFPhycialDisplayResult;
|
||||
|
||||
const char* ffDetectPhycialDisplay(FFlist* results);
|
||||
|
@ -23,14 +23,14 @@ static const char* detectWithDisplayServices(const FFDisplayServerResult* displa
|
||||
width <= 0 || height <= 0)
|
||||
continue;
|
||||
|
||||
FFPhycialDisplayResult* display = (FFPhycialDisplayResult*) ffListAdd(results);
|
||||
display->width = (uint32_t) width;
|
||||
display->height = (uint32_t) height;
|
||||
ffStrbufInit(&display->name);
|
||||
FFPhycialDisplayResult* phycialDisplay = (FFPhycialDisplayResult*) ffListAdd(results);
|
||||
phycialDisplay->width = (uint32_t) width;
|
||||
phycialDisplay->height = (uint32_t) height;
|
||||
ffStrbufInit(&phycialDisplay->name);
|
||||
|
||||
CFDictionaryRef productNames;
|
||||
if(!ffCfDictGetDict(displayInfo, CFSTR(kDisplayProductName), &productNames))
|
||||
ffCfDictGetString(productNames, CFSTR("en_US"), &display->name);
|
||||
ffCfDictGetString(productNames, CFSTR("en_US"), &phycialDisplay->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -83,7 +83,7 @@ static const char* detectWithDdcci(FFlist* results)
|
||||
continue;
|
||||
|
||||
uint32_t width, height;
|
||||
ffEdidGetPhycialDisplay(CFDataGetBytePtr(edid), &width, &height);
|
||||
ffEdidGetPhycialResolution(CFDataGetBytePtr(edid), &width, &height);
|
||||
if (width == 0 || height == 0) continue;
|
||||
|
||||
FFPhycialDisplayResult* display = (FFPhycialDisplayResult*) ffListAdd(results);
|
||||
|
@ -36,7 +36,7 @@ const char* ffDetectPhycialDisplay(FFlist* results)
|
||||
}
|
||||
|
||||
uint32_t width, height;
|
||||
ffEdidGetPhycialDisplay(edidData, &width, &height);
|
||||
ffEdidGetPhycialResolution(edidData, &width, &height);
|
||||
if (width != 0 && height != 0)
|
||||
{
|
||||
const char* plainName = entry->d_name;
|
||||
|
@ -33,7 +33,7 @@ const char* ffDetectPhycialDisplay(FFlist* results)
|
||||
uint8_t edidData[256] = {};
|
||||
if (!ffRegReadData(hKey, L"EDID", edidData, sizeof(edidData), NULL)) continue;
|
||||
uint32_t width, height;
|
||||
ffEdidGetPhycialDisplay(edidData, &width, &height);
|
||||
ffEdidGetPhycialResolution(edidData, &width, &height);
|
||||
if (width == 0 || height == 0) continue;
|
||||
|
||||
wchar_t wName[MAX_PATH] = {}; // MONITOR\BOE09F9
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "edidHelper.h"
|
||||
|
||||
void ffEdidGetPhycialDisplay(const uint8_t edid[128], uint32_t* width, uint32_t* height)
|
||||
void ffEdidGetPhycialResolution(const uint8_t edid[128], uint32_t* width, uint32_t* height)
|
||||
{
|
||||
const int dtd = 54;
|
||||
*width = (((uint32_t) edid[dtd + 4] >> 4) << 8) | edid[dtd + 2];
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <stdint.h>
|
||||
#include "util/FFstrbuf.h"
|
||||
|
||||
void ffEdidGetPhycialDisplay(const uint8_t edid[128], uint32_t* width, uint32_t* height);
|
||||
void ffEdidGetName(const uint8_t edid[128], FFstrbuf* name);
|
||||
void ffEdidGetPhycialResolution(const uint8_t edid[128], uint32_t* width, uint32_t* height);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user