mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-06 13:14:21 +01:00
Global: replaces NULL to nullptr
This commit is contained in:
@@ -18,7 +18,7 @@ FFDisplayResult* ffdsAppendDisplay(
|
||||
uint32_t physicalHeight,
|
||||
const char* platformApi) {
|
||||
if (width == 0 || height == 0) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
FFDisplayResult* display = FF_LIST_ADD(FFDisplayResult, result->displays);
|
||||
|
||||
@@ -33,8 +33,8 @@ static void detectWithDumpsys(FFDisplayServerResult* ds) {
|
||||
if (ffProcessAppendStdOut(&buf, (char*[]) {
|
||||
"/system/bin/dumpsys",
|
||||
"display",
|
||||
NULL,
|
||||
}) != NULL ||
|
||||
nullptr,
|
||||
}) != nullptr ||
|
||||
buf.length == 0) {
|
||||
return; // Only works in `adb shell`, or when rooted
|
||||
}
|
||||
@@ -119,7 +119,7 @@ static bool detectWithGetprop(FFDisplayServerResult* ds) {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
nullptr,
|
||||
FF_DISPLAY_TYPE_BUILTIN,
|
||||
false,
|
||||
0,
|
||||
|
||||
@@ -50,7 +50,7 @@ static void detectDisplays(FFDisplayServerResult* ds) {
|
||||
}
|
||||
|
||||
ffStrbufClear(&buffer);
|
||||
CFDictionaryRef FF_CFTYPE_AUTO_RELEASE displayInfo = NULL;
|
||||
CFDictionaryRef FF_CFTYPE_AUTO_RELEASE displayInfo = nullptr;
|
||||
#ifdef MAC_OS_X_VERSION_10_15
|
||||
if (CoreDisplay_DisplayCreateInfoDictionary) {
|
||||
displayInfo = CoreDisplay_DisplayCreateInfoDictionary(screen);
|
||||
@@ -77,14 +77,14 @@ static void detectDisplays(FFDisplayServerResult* ds) {
|
||||
ffEdidGetPhysicalSize(edidData, &physicalWidth, &physicalHeight);
|
||||
ffEdidGetSerial(edidData, &serial);
|
||||
}
|
||||
} else if (!builtin && ffCfDictGetString(displayInfo, CFSTR(kIODisplayLocationKey), &buffer) == NULL) {
|
||||
} else if (!builtin && ffCfDictGetString(displayInfo, CFSTR(kIODisplayLocationKey), &buffer) == nullptr) {
|
||||
FF_IOOBJECT_AUTO_RELEASE io_registry_entry_t ioDisplay = IORegistryEntryFromPath(MACH_PORT_NULL, buffer.chars);
|
||||
ffStrbufClear(&buffer);
|
||||
if (ioDisplay) {
|
||||
FF_CFTYPE_AUTO_RELEASE CFDictionaryRef displayAttrRef = IORegistryEntryCreateCFProperty(ioDisplay, CFSTR("DisplayAttributes"), kCFAllocatorDefault, kNilOptions);
|
||||
if (displayAttrRef && CFGetTypeID(displayAttrRef) == CFDictionaryGetTypeID()) {
|
||||
CFDictionaryRef productAttrs;
|
||||
if (ffCfDictGetDict(displayAttrRef, CFSTR("ProductAttributes"), &productAttrs) == NULL) {
|
||||
if (ffCfDictGetDict(displayAttrRef, CFSTR("ProductAttributes"), &productAttrs) == nullptr) {
|
||||
ffCfDictGetString(productAttrs, CFSTR("AlphanumericSerialNumber"), &serial);
|
||||
ffCfDictGetString(productAttrs, CFSTR("ProductName"), &buffer);
|
||||
}
|
||||
@@ -94,13 +94,13 @@ static void detectDisplays(FFDisplayServerResult* ds) {
|
||||
|
||||
if (!buffer.length) {
|
||||
CFDictionaryRef productNames;
|
||||
if (ffCfDictGetDict(displayInfo, CFSTR(kDisplayProductName), &productNames) == NULL) {
|
||||
if (ffCfDictGetDict(displayInfo, CFSTR(kDisplayProductName), &productNames) == nullptr) {
|
||||
ffCfDictGetString(productNames, CFSTR("en_US"), &buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if (!physicalWidth || !physicalHeight) {
|
||||
if (ffCfDictGetInt(displayInfo, CFSTR(kDisplayHorizontalImageSize), (int*) &physicalWidth) == NULL) {
|
||||
if (ffCfDictGetInt(displayInfo, CFSTR(kDisplayHorizontalImageSize), (int*) &physicalWidth) == nullptr) {
|
||||
ffCfDictGetInt(displayInfo, CFSTR(kDisplayVerticalImageSize), (int*) &physicalHeight);
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@ static void detectDisplays(FFDisplayServerResult* ds) {
|
||||
ffCfDictGetInt(displayInfo, CFSTR("kCGDisplayPixelWidth"), (int*) &preferredWidth);
|
||||
ffCfDictGetInt(displayInfo, CFSTR("kCGDisplayPixelHeight"), (int*) &preferredHeight);
|
||||
if (preferredWidth && preferredHeight) {
|
||||
FF_CFTYPE_AUTO_RELEASE CFArrayRef allModes = CGDisplayCopyAllDisplayModes(screen, NULL);
|
||||
FF_CFTYPE_AUTO_RELEASE CFArrayRef allModes = CGDisplayCopyAllDisplayModes(screen, nullptr);
|
||||
if (allModes) {
|
||||
for (CFIndex i = 0, count = CFArrayGetCount(allModes); i < count; i++) {
|
||||
CGDisplayModeRef modeInfo = (CGDisplayModeRef) CFArrayGetValueAtIndex(allModes, i);
|
||||
@@ -196,10 +196,10 @@ static void detectDisplays(FFDisplayServerResult* ds) {
|
||||
|
||||
if (displayInfo) {
|
||||
int value;
|
||||
if (ffCfDictGetInt(displayInfo, CFSTR(kDisplayYearOfManufacture), &value) == NULL) {
|
||||
if (ffCfDictGetInt(displayInfo, CFSTR(kDisplayYearOfManufacture), &value) == nullptr) {
|
||||
display->manufactureYear = (uint16_t) value;
|
||||
}
|
||||
if (ffCfDictGetInt(displayInfo, CFSTR(kDisplayWeekOfManufacture), &value) == NULL) {
|
||||
if (ffCfDictGetInt(displayInfo, CFSTR(kDisplayWeekOfManufacture), &value) == nullptr) {
|
||||
display->manufactureWeek = (uint16_t) value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ static inline void freeArgBuffer(FFArgBuffer* buffer) {
|
||||
if (buffer->data) {
|
||||
free(buffer->data);
|
||||
}
|
||||
buffer->data = NULL;
|
||||
buffer->data = nullptr;
|
||||
buffer->length = 0;
|
||||
}
|
||||
#define FF_AUTO_FREE_ARG_BUFFER FF_A_CLEANUP(freeArgBuffer)
|
||||
@@ -31,7 +31,7 @@ static void detectDisplays(FFDisplayServerResult* ds) {
|
||||
paths,
|
||||
&modeCount,
|
||||
modes,
|
||||
NULL) == ERROR_SUCCESS) {
|
||||
nullptr) == ERROR_SUCCESS) {
|
||||
for (uint32_t i = 0; i < pathCount; ++i) {
|
||||
const DISPLAYCONFIG_PATH_INFO* path = &paths[i];
|
||||
const DISPLAYCONFIG_SOURCE_MODE* sourceMode = &modes[path->sourceInfo.modeInfoIdx].sourceMode;
|
||||
@@ -64,9 +64,9 @@ static void detectDisplays(FFDisplayServerResult* ds) {
|
||||
}
|
||||
wcscpy(pRegPath, L"Device Parameters");
|
||||
|
||||
FF_AUTO_CLOSE_FD HANDLE hKey = NULL;
|
||||
if (ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, regPath, &hKey, NULL) &&
|
||||
ffRegReadData(hKey, L"EDID", &edid, NULL) &&
|
||||
FF_AUTO_CLOSE_FD HANDLE hKey = nullptr;
|
||||
if (ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, regPath, &hKey, nullptr) &&
|
||||
ffRegReadData(hKey, L"EDID", &edid, nullptr) &&
|
||||
ffEdidIsValid(edid.data, edid.length)) {
|
||||
ffEdidGetName(edid.data, &name);
|
||||
ffEdidGetPhysicalSize(edid.data, &physicalWidth, &physicalHeight);
|
||||
@@ -122,12 +122,12 @@ static void detectDisplays(FFDisplayServerResult* ds) {
|
||||
}
|
||||
|
||||
if (systemDpi == 0) {
|
||||
HDC hdc = GetDC(NULL);
|
||||
HDC hdc = GetDC(nullptr);
|
||||
systemDpi = (uint32_t) GetDeviceCaps(hdc, LOGPIXELSX);
|
||||
if (systemDpi == 0) {
|
||||
systemDpi = 96;
|
||||
}
|
||||
ReleaseDC(NULL, hdc);
|
||||
ReleaseDC(nullptr, hdc);
|
||||
}
|
||||
|
||||
if (path->targetInfo.rotation == DISPLAYCONFIG_ROTATION_ROTATE90 ||
|
||||
|
||||
@@ -22,12 +22,12 @@ static void getWMProtocolNameFromEnv(FFDisplayServerResult* result) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (getenv("WAYLAND_DISPLAY") != NULL || getenv("WAYLAND_SOCKET") != NULL) {
|
||||
if (getenv("WAYLAND_DISPLAY") != nullptr || getenv("WAYLAND_SOCKET") != nullptr) {
|
||||
ffStrbufSetStatic(&result->wmProtocolName, FF_WM_PROTOCOL_WAYLAND);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getenv("DISPLAY") != NULL) // XWayland also set this
|
||||
if (getenv("DISPLAY") != nullptr) // XWayland also set this
|
||||
{
|
||||
ffStrbufSetStatic(&result->wmProtocolName, FF_WM_PROTOCOL_X11);
|
||||
return;
|
||||
@@ -73,7 +73,7 @@ void ffConnectDisplayServerImpl(FFDisplayServerResult* ds) {
|
||||
ffStrbufClear(&buf);
|
||||
if (ffSettingsGetFreeBSDKenv("screen.height", &buf)) {
|
||||
uint32_t height = (uint32_t) ffStrbufToUInt(&buf, 0);
|
||||
ffdsAppendDisplay(ds, width, height, 0, 0, 0, 0, 0, 0, NULL, FF_DISPLAY_TYPE_UNKNOWN, false, 0, 0, 0, "kenv");
|
||||
ffdsAppendDisplay(ds, width, height, 0, 0, 0, 0, 0, 0, nullptr, FF_DISPLAY_TYPE_UNKNOWN, false, 0, 0, 0, "kenv");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ static const char* drmParseSysfs(FFDisplayServerResult* result) {
|
||||
const char* drmDirPath = "/sys/class/drm/";
|
||||
|
||||
FF_AUTO_CLOSE_DIR DIR* dirp = opendir(drmDirPath);
|
||||
if (dirp == NULL) {
|
||||
if (dirp == nullptr) {
|
||||
return "opendir(drmDirPath) failed";
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ static const char* drmParseSysfs(FFDisplayServerResult* result) {
|
||||
uint32_t drmDirLength = drmDir.length;
|
||||
|
||||
struct dirent* entry;
|
||||
while ((entry = readdir(dirp)) != NULL) {
|
||||
while ((entry = readdir(dirp)) != nullptr) {
|
||||
if (entry->d_name[0] == '.') {
|
||||
continue;
|
||||
}
|
||||
@@ -105,7 +105,7 @@ static const char* drmParseSysfs(FFDisplayServerResult* result) {
|
||||
ffStrbufSubstrBefore(&drmDir, drmDirLength);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -179,7 +179,7 @@ FF_A_UNUSED static const char* drmGetEdidByConnId(uint32_t connId, uint8_t* edid
|
||||
const char* drmDirPath = "/sys/class/drm/";
|
||||
|
||||
FF_AUTO_CLOSE_DIR DIR* dirp = opendir(drmDirPath);
|
||||
if (dirp == NULL) {
|
||||
if (dirp == nullptr) {
|
||||
return "opendir(drmDirPath) failed";
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ FF_A_UNUSED static const char* drmGetEdidByConnId(uint32_t connId, uint8_t* edid
|
||||
uint32_t drmDirLength = drmDir.length;
|
||||
|
||||
struct dirent* entry;
|
||||
while ((entry = readdir(dirp)) != NULL) {
|
||||
while ((entry = readdir(dirp)) != nullptr) {
|
||||
if (entry->d_name[0] == '.') {
|
||||
continue;
|
||||
}
|
||||
@@ -201,7 +201,7 @@ FF_A_UNUSED static const char* drmGetEdidByConnId(uint32_t connId, uint8_t* edid
|
||||
|
||||
ffStrbufAppendS(&drmDir, "/connector_id");
|
||||
ffReadFileData(drmDir.chars, ARRAY_SIZE(connectorId), connectorId);
|
||||
if (strtoul(connectorId, NULL, 10) != connId) {
|
||||
if (strtoul(connectorId, nullptr, 10) != connId) {
|
||||
ffStrbufSubstrBefore(&drmDir, drmDirLength);
|
||||
continue;
|
||||
}
|
||||
@@ -209,7 +209,7 @@ FF_A_UNUSED static const char* drmGetEdidByConnId(uint32_t connId, uint8_t* edid
|
||||
ffStrbufSubstrBefore(&drmDir, drmDirWithDnameLength);
|
||||
ffStrbufAppendS(&drmDir, "/edid");
|
||||
*edidLength = ffReadFileData(drmDir.chars, (uint32_t) *edidLength, edidData);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return "Failed to match connector ID";
|
||||
@@ -217,7 +217,7 @@ FF_A_UNUSED static const char* drmGetEdidByConnId(uint32_t connId, uint8_t* edid
|
||||
|
||||
static const char* drmConnectLibdrm(FFDisplayServerResult* result) {
|
||||
FF_AUTO_CLOSE_DIR DIR* dirp = opendir("/dev/dri/");
|
||||
if (dirp == NULL) {
|
||||
if (dirp == nullptr) {
|
||||
return "opendir(/dev/dri/) failed";
|
||||
}
|
||||
int drifd = dirfd(dirp);
|
||||
@@ -225,7 +225,7 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result) {
|
||||
int nSuccess = 0;
|
||||
|
||||
struct dirent* entry;
|
||||
while ((entry = readdir(dirp)) != NULL) {
|
||||
while ((entry = readdir(dirp)) != nullptr) {
|
||||
if (entry->d_name[0] == '.' || !ffStrStartsWith(entry->d_name, "card")) {
|
||||
continue;
|
||||
}
|
||||
@@ -392,7 +392,7 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result) {
|
||||
|
||||
if (name.length == 0) {
|
||||
const char* connectorTypeName = drmType2Name(conn.connector_type);
|
||||
if (connectorTypeName == NULL) {
|
||||
if (connectorTypeName == nullptr) {
|
||||
connectorTypeName = "Unknown";
|
||||
}
|
||||
ffStrbufSetF(&name, "%s-%d", connectorTypeName, iConn + 1);
|
||||
@@ -429,7 +429,7 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result) {
|
||||
}
|
||||
}
|
||||
|
||||
return nSuccess > 0 ? NULL : "No connectors found using libdrm";
|
||||
return nSuccess > 0 ? nullptr : "No connectors found using libdrm";
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -437,8 +437,8 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result) {
|
||||
const char* ffdsConnectDrm(FF_A_UNUSED FFDisplayServerResult* result) {
|
||||
#if FF_HAVE_DRM
|
||||
if (instance.config.general.dsForceDrm != FF_DS_FORCE_DRM_TYPE_SYSFS_ONLY) {
|
||||
if (drmConnectLibdrm(result) == NULL) {
|
||||
return NULL;
|
||||
if (drmConnectLibdrm(result) == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -100,8 +100,8 @@ static const struct wp_image_description_info_v1_listener wpImageDescInfoListene
|
||||
const char* ffWaylandHandleGlobalOutput(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version) {
|
||||
const char* api = "wayland-base";
|
||||
uint32_t bindVersion = min(version, WL_OUTPUT_DESCRIPTION_SINCE_VERSION);
|
||||
struct wl_proxy* output = wldata->ffwl_proxy_marshal_constructor_versioned((struct wl_proxy*) registry, WL_REGISTRY_BIND, &wl_output_interface, bindVersion, name, wl_output_interface.name, bindVersion, NULL);
|
||||
if (output == NULL) {
|
||||
struct wl_proxy* output = wldata->ffwl_proxy_marshal_constructor_versioned((struct wl_proxy*) registry, WL_REGISTRY_BIND, &wl_output_interface, bindVersion, name, wl_output_interface.name, bindVersion, nullptr);
|
||||
if (output == nullptr) {
|
||||
return "Failed to create wl_output";
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ const char* ffWaylandHandleGlobalOutput(WaylandData* wldata, struct wl_registry*
|
||||
|
||||
if (wldata->zxdgOutputManager) {
|
||||
uint32_t bindVersion = min(version, ZXDG_OUTPUT_V1_DESCRIPTION_SINCE_VERSION);
|
||||
struct wl_proxy* zxdgOutput = wldata->ffwl_proxy_marshal_constructor_versioned(wldata->zxdgOutputManager, ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT, &zxdg_output_v1_interface, bindVersion, NULL, output);
|
||||
struct wl_proxy* zxdgOutput = wldata->ffwl_proxy_marshal_constructor_versioned(wldata->zxdgOutputManager, ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT, &zxdg_output_v1_interface, bindVersion, nullptr, output);
|
||||
|
||||
if (zxdgOutput) {
|
||||
wldata->ffwl_proxy_add_listener(zxdgOutput, (void (**)(void)) &zxdgOutputListener, &display);
|
||||
@@ -137,12 +137,12 @@ const char* ffWaylandHandleGlobalOutput(WaylandData* wldata, struct wl_registry*
|
||||
|
||||
if (wldata->wpColorManager) {
|
||||
uint32_t bindVersion = min(version, WP_COLOR_MANAGER_V1_GET_OUTPUT_SINCE_VERSION);
|
||||
struct wl_proxy* wpColorOutput = wldata->ffwl_proxy_marshal_constructor_versioned(wldata->wpColorManager, WP_COLOR_MANAGER_V1_GET_OUTPUT, &wp_color_management_output_v1_interface, bindVersion, NULL, output);
|
||||
struct wl_proxy* wpColorOutput = wldata->ffwl_proxy_marshal_constructor_versioned(wldata->wpColorManager, WP_COLOR_MANAGER_V1_GET_OUTPUT, &wp_color_management_output_v1_interface, bindVersion, nullptr, output);
|
||||
|
||||
if (wpColorOutput) {
|
||||
struct wl_proxy* wpImageDesc = wldata->ffwl_proxy_marshal_constructor_versioned(wpColorOutput, WP_COLOR_MANAGEMENT_OUTPUT_V1_GET_IMAGE_DESCRIPTION, &wp_image_description_v1_interface, bindVersion, NULL);
|
||||
struct wl_proxy* wpImageDesc = wldata->ffwl_proxy_marshal_constructor_versioned(wpColorOutput, WP_COLOR_MANAGEMENT_OUTPUT_V1_GET_IMAGE_DESCRIPTION, &wp_image_description_v1_interface, bindVersion, nullptr);
|
||||
if (wpImageDesc) {
|
||||
struct wl_proxy* wpImageDescInfo = wldata->ffwl_proxy_marshal_constructor_versioned(wpImageDesc, WP_IMAGE_DESCRIPTION_V1_GET_INFORMATION, &wp_image_description_info_v1_interface, bindVersion, NULL);
|
||||
struct wl_proxy* wpImageDescInfo = wldata->ffwl_proxy_marshal_constructor_versioned(wpImageDesc, WP_IMAGE_DESCRIPTION_V1_GET_INFORMATION, &wp_image_description_info_v1_interface, bindVersion, nullptr);
|
||||
if (wpImageDescInfo) {
|
||||
wldata->ffwl_proxy_add_listener(wpImageDescInfo, (void (**)(void)) &wpImageDescInfoListener, &display);
|
||||
wldata->ffwl_display_roundtrip(wldata->display);
|
||||
@@ -205,31 +205,31 @@ const char* ffWaylandHandleGlobalOutput(WaylandData* wldata, struct wl_registry*
|
||||
ffStrbufDestroy(&display.name);
|
||||
ffStrbufDestroy(&display.edidName);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const char* ffWaylandHandleZxdgOutput(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version) {
|
||||
uint32_t bindVersion = min(version, ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT_SINCE_VERSION);
|
||||
struct wl_proxy* manager = wldata->ffwl_proxy_marshal_constructor_versioned((struct wl_proxy*) registry, WL_REGISTRY_BIND, &zxdg_output_manager_v1_interface, bindVersion, name, zxdg_output_manager_v1_interface.name, bindVersion, NULL);
|
||||
if (manager == NULL) {
|
||||
struct wl_proxy* manager = wldata->ffwl_proxy_marshal_constructor_versioned((struct wl_proxy*) registry, WL_REGISTRY_BIND, &zxdg_output_manager_v1_interface, bindVersion, name, zxdg_output_manager_v1_interface.name, bindVersion, nullptr);
|
||||
if (manager == nullptr) {
|
||||
return "Failed to create zxdg_output_manager_v1";
|
||||
}
|
||||
|
||||
wldata->zxdgOutputManager = manager;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const char* ffWaylandHandleWpColor(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version) {
|
||||
uint32_t bindVersion = min(version, WP_COLOR_MANAGER_V1_GET_OUTPUT_SINCE_VERSION);
|
||||
struct wl_proxy* manager = wldata->ffwl_proxy_marshal_constructor_versioned((struct wl_proxy*) registry, WL_REGISTRY_BIND, &wp_color_manager_v1_interface, bindVersion, name, wp_color_manager_v1_interface.name, bindVersion, NULL);
|
||||
if (manager == NULL) {
|
||||
struct wl_proxy* manager = wldata->ffwl_proxy_marshal_constructor_versioned((struct wl_proxy*) registry, WL_REGISTRY_BIND, &wp_color_manager_v1_interface, bindVersion, name, wp_color_manager_v1_interface.name, bindVersion, nullptr);
|
||||
if (manager == nullptr) {
|
||||
return "Failed to create wp_color_manager_v1";
|
||||
}
|
||||
|
||||
wldata->wpColorManager = manager;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -252,7 +252,7 @@ kde_output_device_registry_v2_destroy(struct kde_output_device_registry_v2* kde_
|
||||
// kde_output_device_registry_v2_stop(struct kde_output_device_registry_v2* kde_output_device_registry_v2) {
|
||||
// wl_proxy_marshal_flags((struct wl_proxy*) kde_output_device_registry_v2,
|
||||
// KDE_OUTPUT_DEVICE_REGISTRY_V2_STOP,
|
||||
// NULL,
|
||||
// nullptr,
|
||||
// wl_proxy_get_version((struct wl_proxy*) kde_output_device_registry_v2),
|
||||
// 0);
|
||||
// }
|
||||
@@ -1248,7 +1248,7 @@ kde_output_device_v2_destroy(struct kde_output_device_v2* kde_output_device_v2)
|
||||
// kde_output_device_v2_release(struct kde_output_device_v2* kde_output_device_v2) {
|
||||
// wl_proxy_marshal_flags((struct wl_proxy*) kde_output_device_v2,
|
||||
// KDE_OUTPUT_DEVICE_V2_RELEASE,
|
||||
// NULL,
|
||||
// nullptr,
|
||||
// wl_proxy_get_version((struct wl_proxy*) kde_output_device_v2),
|
||||
// WL_MARSHAL_FLAG_DESTROY);
|
||||
// }
|
||||
|
||||
@@ -21,14 +21,14 @@ extern const struct wl_interface kde_output_device_mode_v2_interface;
|
||||
extern const struct wl_interface kde_output_device_v2_interface;
|
||||
|
||||
static const struct wl_interface* kde_output_device_v2_types[] = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&kde_output_device_v2_interface,
|
||||
&kde_output_device_mode_v2_interface,
|
||||
&kde_output_device_mode_v2_interface,
|
||||
@@ -120,7 +120,7 @@ WL_EXPORT const struct wl_interface kde_output_device_mode_v2_interface = {
|
||||
"kde_output_device_mode_v2",
|
||||
22,
|
||||
0,
|
||||
NULL,
|
||||
nullptr,
|
||||
5,
|
||||
kde_output_device_mode_v2_events,
|
||||
};
|
||||
|
||||
@@ -103,7 +103,7 @@ static void waylandKdeEdidListener(void* data, FF_A_UNUSED struct kde_output_dev
|
||||
static void waylandKdeEnabledListener(void* data, FF_A_UNUSED struct kde_output_device_v2* _, int32_t enabled) {
|
||||
WaylandDisplay* wldata = (WaylandDisplay*) data;
|
||||
if (!enabled) {
|
||||
wldata->internal = NULL;
|
||||
wldata->internal = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ static const char* waylandKdeHandleOutput(WaylandData* wldata, struct wl_proxy*
|
||||
FF_LIST_FOR_EACH (WaylandKdeMode, m, modes) {
|
||||
if (m->pMode) {
|
||||
wldata->ffwl_proxy_destroy((struct wl_proxy*) m->pMode);
|
||||
m->pMode = NULL;
|
||||
m->pMode = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,14 +268,14 @@ static const char* waylandKdeHandleOutput(WaylandData* wldata, struct wl_proxy*
|
||||
ffStrbufDestroy(&display.name);
|
||||
ffStrbufDestroy(&display.edidName);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const char* ffWaylandHandleKdeOutput(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version) {
|
||||
// TODO: remove this in future versions
|
||||
uint32_t bindVersion = min(version, KDE_OUTPUT_DEVICE_V2_PRIORITY_SINCE_VERSION);
|
||||
struct wl_proxy* output = wldata->ffwl_proxy_marshal_constructor_versioned((struct wl_proxy*) registry, WL_REGISTRY_BIND, &kde_output_device_v2_interface, bindVersion, name, kde_output_device_v2_interface.name, bindVersion, NULL);
|
||||
if (output == NULL) {
|
||||
struct wl_proxy* output = wldata->ffwl_proxy_marshal_constructor_versioned((struct wl_proxy*) registry, WL_REGISTRY_BIND, &kde_output_device_v2_interface, bindVersion, name, kde_output_device_v2_interface.name, bindVersion, nullptr);
|
||||
if (output == nullptr) {
|
||||
return "Failed to create kde_output_device_v2";
|
||||
}
|
||||
|
||||
@@ -293,8 +293,8 @@ static struct kde_output_device_registry_v2_listener registryListener = {
|
||||
|
||||
const char* ffWaylandHandleKdeOutputRegistry(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version) {
|
||||
uint32_t bindVersion = min(version, KDE_OUTPUT_DEVICE_REGISTRY_V2_OUTPUT_SINCE_VERSION);
|
||||
struct wl_proxy* outputRegistry = wldata->ffwl_proxy_marshal_constructor_versioned((struct wl_proxy*) registry, WL_REGISTRY_BIND, &kde_output_device_registry_v2_interface, bindVersion, name, kde_output_device_registry_v2_interface.name, bindVersion, NULL);
|
||||
if (outputRegistry == NULL) {
|
||||
struct wl_proxy* outputRegistry = wldata->ffwl_proxy_marshal_constructor_versioned((struct wl_proxy*) registry, WL_REGISTRY_BIND, &kde_output_device_registry_v2_interface, bindVersion, name, kde_output_device_registry_v2_interface.name, bindVersion, nullptr);
|
||||
if (outputRegistry == nullptr) {
|
||||
return "Failed to create kde_output_device_registry_v2";
|
||||
}
|
||||
if (wldata->ffwl_proxy_add_listener(outputRegistry, (void (**)(void)) ®istryListener, wldata) < 0) {
|
||||
@@ -307,7 +307,7 @@ const char* ffWaylandHandleKdeOutputRegistry(WaylandData* wldata, struct wl_regi
|
||||
}
|
||||
|
||||
wldata->ffwl_proxy_destroy(outputRegistry);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -48,7 +48,7 @@ static bool waylandDetectWM(int fd, FFDisplayServerResult* result) {
|
||||
size_t size = 4096;
|
||||
ffStrbufEnsureFixedLengthFree(&result->wmProcessName, (uint32_t) size);
|
||||
|
||||
if (sysctl((int[]) { CTL_KERN, KERN_PROC, KERN_PROC_ARGS, ucred.cr_pid }, 4, result->wmProcessName.chars, &size, NULL, 0) != 0) {
|
||||
if (sysctl((int[]) { CTL_KERN, KERN_PROC, KERN_PROC_ARGS, ucred.cr_pid }, 4, result->wmProcessName.chars, &size, nullptr, 0) != 0) {
|
||||
return false;
|
||||
}
|
||||
result->wmProcessName.length = (uint32_t) size - 1;
|
||||
@@ -82,17 +82,17 @@ static void waylandGlobalAddListener(void* data, struct wl_registry* registry, u
|
||||
|
||||
if ((wldata->protocolType == FF_WAYLAND_PROTOCOL_TYPE_NONE || wldata->protocolType == FF_WAYLAND_PROTOCOL_TYPE_GLOBAL) && ffStrEquals(interface, wl_output_interface.name)) {
|
||||
wldata->protocolType = FF_WAYLAND_PROTOCOL_TYPE_GLOBAL;
|
||||
if (ffWaylandHandleGlobalOutput(wldata, registry, name, version) != NULL) {
|
||||
if (ffWaylandHandleGlobalOutput(wldata, registry, name, version) != nullptr) {
|
||||
wldata->protocolType = FF_WAYLAND_PROTOCOL_TYPE_NONE;
|
||||
}
|
||||
} else if ((wldata->protocolType == FF_WAYLAND_PROTOCOL_TYPE_NONE) && ffStrEquals(interface, kde_output_device_registry_v2_interface.name)) {
|
||||
wldata->protocolType = FF_WAYLAND_PROTOCOL_TYPE_KDE_REGISTRY;
|
||||
if (ffWaylandHandleKdeOutputRegistry(wldata, registry, name, version) != NULL) {
|
||||
if (ffWaylandHandleKdeOutputRegistry(wldata, registry, name, version) != nullptr) {
|
||||
wldata->protocolType = FF_WAYLAND_PROTOCOL_TYPE_NONE;
|
||||
}
|
||||
} else if ((wldata->protocolType == FF_WAYLAND_PROTOCOL_TYPE_NONE || wldata->protocolType == FF_WAYLAND_PROTOCOL_TYPE_KDE_DEPRECATED) && ffStrEquals(interface, kde_output_device_v2_interface.name)) {
|
||||
wldata->protocolType = FF_WAYLAND_PROTOCOL_TYPE_KDE_DEPRECATED;
|
||||
if (ffWaylandHandleKdeOutput(wldata, registry, name, version) != NULL) {
|
||||
if (ffWaylandHandleKdeOutput(wldata, registry, name, version) != nullptr) {
|
||||
wldata->protocolType = FF_WAYLAND_PROTOCOL_TYPE_NONE;
|
||||
}
|
||||
} else if ((wldata->protocolType == FF_WAYLAND_PROTOCOL_TYPE_GLOBAL || wldata->protocolType == FF_WAYLAND_PROTOCOL_TYPE_NONE) && ffStrEquals(interface, zxdg_output_manager_v1_interface.name)) {
|
||||
@@ -109,12 +109,12 @@ static FF_A_UNUSED bool matchDrmConnector(const char* connName, WaylandDisplay*
|
||||
const char* drmDirPath = "/sys/class/drm/";
|
||||
|
||||
FF_AUTO_CLOSE_DIR DIR* dirp = opendir(drmDirPath);
|
||||
if (dirp == NULL) {
|
||||
if (dirp == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
struct dirent* entry;
|
||||
while ((entry = readdir(dirp)) != NULL) {
|
||||
while ((entry = readdir(dirp)) != nullptr) {
|
||||
const char* plainName = entry->d_name;
|
||||
if (ffStrStartsWith(plainName, "card")) {
|
||||
const char* tmp = strchr(plainName + strlen("card"), '-');
|
||||
@@ -218,7 +218,7 @@ uint32_t ffWaylandHandleRotation(WaylandDisplay* display) {
|
||||
}
|
||||
|
||||
const char* ffdsConnectWayland(FFDisplayServerResult* result) {
|
||||
if (getenv("XDG_RUNTIME_DIR") == NULL) {
|
||||
if (getenv("XDG_RUNTIME_DIR") == nullptr) {
|
||||
return "Wayland requires $XDG_RUNTIME_DIR being set";
|
||||
}
|
||||
|
||||
@@ -236,17 +236,17 @@ const char* ffdsConnectWayland(FFDisplayServerResult* result) {
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(wayland, data, wl_proxy_destroy)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(wayland, data, wl_display_roundtrip)
|
||||
|
||||
data.display = ffwl_display_connect(NULL);
|
||||
if (data.display == NULL) {
|
||||
return "wl_display_connect returned NULL";
|
||||
data.display = ffwl_display_connect(nullptr);
|
||||
if (data.display == nullptr) {
|
||||
return "wl_display_connect returned nullptr";
|
||||
}
|
||||
|
||||
waylandDetectWM(ffwl_display_get_fd(data.display), result);
|
||||
|
||||
struct wl_proxy* registry = ffwl_proxy_marshal_constructor((struct wl_proxy*) data.display, WL_DISPLAY_GET_REGISTRY, &wl_registry_interface, NULL);
|
||||
if (registry == NULL) {
|
||||
struct wl_proxy* registry = ffwl_proxy_marshal_constructor((struct wl_proxy*) data.display, WL_DISPLAY_GET_REGISTRY, &wl_registry_interface, nullptr);
|
||||
if (registry == nullptr) {
|
||||
ffwl_display_disconnect(data.display);
|
||||
return "wl_display_get_registry returned NULL";
|
||||
return "wl_display_get_registry returned nullptr";
|
||||
}
|
||||
|
||||
data.result = result;
|
||||
@@ -275,7 +275,7 @@ const char* ffdsConnectWayland(FFDisplayServerResult* result) {
|
||||
? "monitors.xml"
|
||||
: ffStrbufEqualS(&result->wmProcessName, "cinnamon")
|
||||
? "cinnamon-monitors.xml"
|
||||
: NULL;
|
||||
: nullptr;
|
||||
if (fileName) {
|
||||
FF_STRBUF_AUTO_DESTROY monitorsXml = ffStrbufCreate();
|
||||
FF_LIST_FOR_EACH (FFstrbuf, basePath, instance.state.platform.configDirs) {
|
||||
@@ -336,7 +336,7 @@ const char* ffdsConnectWayland(FFDisplayServerResult* result) {
|
||||
// So we can set set the session type to wayland.
|
||||
// This is used as an indicator that we are running wayland by the x11 backends.
|
||||
ffStrbufSetStatic(&result->wmProtocolName, FF_WM_PROTOCOL_WAYLAND);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
@@ -52,38 +52,38 @@ extern const struct wl_interface wl_surface_interface;
|
||||
extern const struct wl_interface wl_touch_interface;
|
||||
|
||||
static const struct wl_interface *wayland_types[] = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&wl_callback_interface,
|
||||
&wl_registry_interface,
|
||||
&wl_surface_interface,
|
||||
&wl_region_interface,
|
||||
&wl_buffer_interface,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&wl_shm_pool_interface,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&wl_data_source_interface,
|
||||
&wl_surface_interface,
|
||||
&wl_surface_interface,
|
||||
NULL,
|
||||
nullptr,
|
||||
&wl_data_source_interface,
|
||||
NULL,
|
||||
nullptr,
|
||||
&wl_data_offer_interface,
|
||||
NULL,
|
||||
nullptr,
|
||||
&wl_surface_interface,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&wl_data_offer_interface,
|
||||
&wl_data_offer_interface,
|
||||
&wl_data_source_interface,
|
||||
@@ -92,27 +92,27 @@ static const struct wl_interface *wayland_types[] = {
|
||||
&wl_shell_surface_interface,
|
||||
&wl_surface_interface,
|
||||
&wl_seat_interface,
|
||||
NULL,
|
||||
nullptr,
|
||||
&wl_seat_interface,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&wl_surface_interface,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&wl_output_interface,
|
||||
&wl_seat_interface,
|
||||
NULL,
|
||||
nullptr,
|
||||
&wl_surface_interface,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&wl_output_interface,
|
||||
&wl_buffer_interface,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&wl_callback_interface,
|
||||
&wl_region_interface,
|
||||
&wl_region_interface,
|
||||
@@ -121,27 +121,27 @@ static const struct wl_interface *wayland_types[] = {
|
||||
&wl_pointer_interface,
|
||||
&wl_keyboard_interface,
|
||||
&wl_touch_interface,
|
||||
NULL,
|
||||
nullptr,
|
||||
&wl_surface_interface,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&wl_surface_interface,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&wl_surface_interface,
|
||||
NULL,
|
||||
nullptr,
|
||||
&wl_surface_interface,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&wl_surface_interface,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&wl_surface_interface,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&wl_subsurface_interface,
|
||||
&wl_surface_interface,
|
||||
&wl_surface_interface,
|
||||
@@ -187,7 +187,7 @@ static const struct wl_message wl_callback_events[] = {
|
||||
|
||||
WL_EXPORT const struct wl_interface wl_callback_interface = {
|
||||
"wl_callback", 1,
|
||||
0, NULL,
|
||||
0, nullptr,
|
||||
1, wl_callback_events,
|
||||
};
|
||||
|
||||
@@ -199,7 +199,7 @@ static const struct wl_message wl_compositor_requests[] = {
|
||||
WL_EXPORT const struct wl_interface wl_compositor_interface = {
|
||||
"wl_compositor", 6,
|
||||
2, wl_compositor_requests,
|
||||
0, NULL,
|
||||
0, nullptr,
|
||||
};
|
||||
|
||||
static const struct wl_message wl_shm_pool_requests[] = {
|
||||
@@ -211,7 +211,7 @@ static const struct wl_message wl_shm_pool_requests[] = {
|
||||
WL_EXPORT const struct wl_interface wl_shm_pool_interface = {
|
||||
"wl_shm_pool", 2,
|
||||
3, wl_shm_pool_requests,
|
||||
0, NULL,
|
||||
0, nullptr,
|
||||
};
|
||||
|
||||
static const struct wl_message wl_shm_requests[] = {
|
||||
@@ -313,7 +313,7 @@ static const struct wl_message wl_data_device_manager_requests[] = {
|
||||
WL_EXPORT const struct wl_interface wl_data_device_manager_interface = {
|
||||
"wl_data_device_manager", 3,
|
||||
2, wl_data_device_manager_requests,
|
||||
0, NULL,
|
||||
0, nullptr,
|
||||
};
|
||||
|
||||
static const struct wl_message wl_shell_requests[] = {
|
||||
@@ -323,7 +323,7 @@ static const struct wl_message wl_shell_requests[] = {
|
||||
WL_EXPORT const struct wl_interface wl_shell_interface = {
|
||||
"wl_shell", 1,
|
||||
1, wl_shell_requests,
|
||||
0, NULL,
|
||||
0, nullptr,
|
||||
};
|
||||
|
||||
static const struct wl_message wl_shell_surface_requests[] = {
|
||||
@@ -488,7 +488,7 @@ static const struct wl_message wl_region_requests[] = {
|
||||
WL_EXPORT const struct wl_interface wl_region_interface = {
|
||||
"wl_region", 1,
|
||||
3, wl_region_requests,
|
||||
0, NULL,
|
||||
0, nullptr,
|
||||
};
|
||||
|
||||
static const struct wl_message wl_subcompositor_requests[] = {
|
||||
@@ -499,7 +499,7 @@ static const struct wl_message wl_subcompositor_requests[] = {
|
||||
WL_EXPORT const struct wl_interface wl_subcompositor_interface = {
|
||||
"wl_subcompositor", 1,
|
||||
2, wl_subcompositor_requests,
|
||||
0, NULL,
|
||||
0, nullptr,
|
||||
};
|
||||
|
||||
static const struct wl_message wl_subsurface_requests[] = {
|
||||
@@ -514,7 +514,7 @@ static const struct wl_message wl_subsurface_requests[] = {
|
||||
WL_EXPORT const struct wl_interface wl_subsurface_interface = {
|
||||
"wl_subsurface", 1,
|
||||
6, wl_subsurface_requests,
|
||||
0, NULL,
|
||||
0, nullptr,
|
||||
};
|
||||
|
||||
static const struct wl_message wl_fixes_requests[] = {
|
||||
@@ -525,7 +525,7 @@ static const struct wl_message wl_fixes_requests[] = {
|
||||
WL_EXPORT const struct wl_interface wl_fixes_interface = {
|
||||
"wl_fixes", 1,
|
||||
2, wl_fixes_requests,
|
||||
0, NULL,
|
||||
0, nullptr,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+31
-31
@@ -1059,7 +1059,7 @@ static inline void
|
||||
wp_color_manager_v1_destroy(struct wp_color_manager_v1 *wp_color_manager_v1)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_color_manager_v1,
|
||||
WP_COLOR_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
WP_COLOR_MANAGER_V1_DESTROY, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1076,7 +1076,7 @@ wp_color_manager_v1_get_output(struct wp_color_manager_v1 *wp_color_manager_v1,
|
||||
struct wl_proxy *id;
|
||||
|
||||
id = wl_proxy_marshal_flags((struct wl_proxy *) wp_color_manager_v1,
|
||||
WP_COLOR_MANAGER_V1_GET_OUTPUT, &wp_color_management_output_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), 0, NULL, output);
|
||||
WP_COLOR_MANAGER_V1_GET_OUTPUT, &wp_color_management_output_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), 0, nullptr, output);
|
||||
|
||||
return (struct wp_color_management_output_v1 *) id;
|
||||
}
|
||||
@@ -1098,7 +1098,7 @@ wp_color_manager_v1_get_surface(struct wp_color_manager_v1 *wp_color_manager_v1,
|
||||
struct wl_proxy *id;
|
||||
|
||||
id = wl_proxy_marshal_flags((struct wl_proxy *) wp_color_manager_v1,
|
||||
WP_COLOR_MANAGER_V1_GET_SURFACE, &wp_color_management_surface_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), 0, NULL, surface);
|
||||
WP_COLOR_MANAGER_V1_GET_SURFACE, &wp_color_management_surface_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), 0, nullptr, surface);
|
||||
|
||||
return (struct wp_color_management_surface_v1 *) id;
|
||||
}
|
||||
@@ -1118,7 +1118,7 @@ wp_color_manager_v1_get_surface_feedback(struct wp_color_manager_v1 *wp_color_ma
|
||||
struct wl_proxy *id;
|
||||
|
||||
id = wl_proxy_marshal_flags((struct wl_proxy *) wp_color_manager_v1,
|
||||
WP_COLOR_MANAGER_V1_GET_SURFACE_FEEDBACK, &wp_color_management_surface_feedback_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), 0, NULL, surface);
|
||||
WP_COLOR_MANAGER_V1_GET_SURFACE_FEEDBACK, &wp_color_management_surface_feedback_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), 0, nullptr, surface);
|
||||
|
||||
return (struct wp_color_management_surface_feedback_v1 *) id;
|
||||
}
|
||||
@@ -1141,7 +1141,7 @@ wp_color_manager_v1_create_icc_creator(struct wp_color_manager_v1 *wp_color_mana
|
||||
struct wl_proxy *obj;
|
||||
|
||||
obj = wl_proxy_marshal_flags((struct wl_proxy *) wp_color_manager_v1,
|
||||
WP_COLOR_MANAGER_V1_CREATE_ICC_CREATOR, &wp_image_description_creator_icc_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), 0, NULL);
|
||||
WP_COLOR_MANAGER_V1_CREATE_ICC_CREATOR, &wp_image_description_creator_icc_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), 0, nullptr);
|
||||
|
||||
return (struct wp_image_description_creator_icc_v1 *) obj;
|
||||
}
|
||||
@@ -1164,7 +1164,7 @@ wp_color_manager_v1_create_parametric_creator(struct wp_color_manager_v1 *wp_col
|
||||
struct wl_proxy *obj;
|
||||
|
||||
obj = wl_proxy_marshal_flags((struct wl_proxy *) wp_color_manager_v1,
|
||||
WP_COLOR_MANAGER_V1_CREATE_PARAMETRIC_CREATOR, &wp_image_description_creator_params_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), 0, NULL);
|
||||
WP_COLOR_MANAGER_V1_CREATE_PARAMETRIC_CREATOR, &wp_image_description_creator_params_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), 0, nullptr);
|
||||
|
||||
return (struct wp_image_description_creator_params_v1 *) obj;
|
||||
}
|
||||
@@ -1223,7 +1223,7 @@ wp_color_manager_v1_create_windows_scrgb(struct wp_color_manager_v1 *wp_color_ma
|
||||
struct wl_proxy *image_description;
|
||||
|
||||
image_description = wl_proxy_marshal_flags((struct wl_proxy *) wp_color_manager_v1,
|
||||
WP_COLOR_MANAGER_V1_CREATE_WINDOWS_SCRGB, &wp_image_description_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), 0, NULL);
|
||||
WP_COLOR_MANAGER_V1_CREATE_WINDOWS_SCRGB, &wp_image_description_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), 0, nullptr);
|
||||
|
||||
return (struct wp_image_description_v1 *) image_description;
|
||||
}
|
||||
@@ -1242,7 +1242,7 @@ wp_color_manager_v1_get_image_description(struct wp_color_manager_v1 *wp_color_m
|
||||
struct wl_proxy *image_description;
|
||||
|
||||
image_description = wl_proxy_marshal_flags((struct wl_proxy *) wp_color_manager_v1,
|
||||
WP_COLOR_MANAGER_V1_GET_IMAGE_DESCRIPTION, &wp_image_description_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), 0, NULL, reference);
|
||||
WP_COLOR_MANAGER_V1_GET_IMAGE_DESCRIPTION, &wp_image_description_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_manager_v1), 0, nullptr, reference);
|
||||
|
||||
return (struct wp_image_description_v1 *) image_description;
|
||||
}
|
||||
@@ -1325,7 +1325,7 @@ static inline void
|
||||
wp_color_management_output_v1_destroy(struct wp_color_management_output_v1 *wp_color_management_output_v1)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_color_management_output_v1,
|
||||
WP_COLOR_MANAGEMENT_OUTPUT_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wp_color_management_output_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
WP_COLOR_MANAGEMENT_OUTPUT_V1_DESTROY, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_color_management_output_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1369,7 +1369,7 @@ wp_color_management_output_v1_get_image_description(struct wp_color_management_o
|
||||
struct wl_proxy *image_description;
|
||||
|
||||
image_description = wl_proxy_marshal_flags((struct wl_proxy *) wp_color_management_output_v1,
|
||||
WP_COLOR_MANAGEMENT_OUTPUT_V1_GET_IMAGE_DESCRIPTION, &wp_image_description_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_management_output_v1), 0, NULL);
|
||||
WP_COLOR_MANAGEMENT_OUTPUT_V1_GET_IMAGE_DESCRIPTION, &wp_image_description_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_management_output_v1), 0, nullptr);
|
||||
|
||||
return (struct wp_image_description_v1 *) image_description;
|
||||
}
|
||||
@@ -1444,7 +1444,7 @@ static inline void
|
||||
wp_color_management_surface_v1_destroy(struct wp_color_management_surface_v1 *wp_color_management_surface_v1)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_color_management_surface_v1,
|
||||
WP_COLOR_MANAGEMENT_SURFACE_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wp_color_management_surface_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
WP_COLOR_MANAGEMENT_SURFACE_V1_DESTROY, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_color_management_surface_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1494,7 +1494,7 @@ static inline void
|
||||
wp_color_management_surface_v1_set_image_description(struct wp_color_management_surface_v1 *wp_color_management_surface_v1, struct wp_image_description_v1 *image_description, uint32_t render_intent)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_color_management_surface_v1,
|
||||
WP_COLOR_MANAGEMENT_SURFACE_V1_SET_IMAGE_DESCRIPTION, NULL, wl_proxy_get_version((struct wl_proxy *) wp_color_management_surface_v1), 0, image_description, render_intent);
|
||||
WP_COLOR_MANAGEMENT_SURFACE_V1_SET_IMAGE_DESCRIPTION, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_color_management_surface_v1), 0, image_description, render_intent);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1511,7 +1511,7 @@ static inline void
|
||||
wp_color_management_surface_v1_unset_image_description(struct wp_color_management_surface_v1 *wp_color_management_surface_v1)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_color_management_surface_v1,
|
||||
WP_COLOR_MANAGEMENT_SURFACE_V1_UNSET_IMAGE_DESCRIPTION, NULL, wl_proxy_get_version((struct wl_proxy *) wp_color_management_surface_v1), 0);
|
||||
WP_COLOR_MANAGEMENT_SURFACE_V1_UNSET_IMAGE_DESCRIPTION, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_color_management_surface_v1), 0);
|
||||
}
|
||||
|
||||
#ifndef WP_COLOR_MANAGEMENT_SURFACE_FEEDBACK_V1_ERROR_ENUM
|
||||
@@ -1647,7 +1647,7 @@ static inline void
|
||||
wp_color_management_surface_feedback_v1_destroy(struct wp_color_management_surface_feedback_v1 *wp_color_management_surface_feedback_v1)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_color_management_surface_feedback_v1,
|
||||
WP_COLOR_MANAGEMENT_SURFACE_FEEDBACK_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wp_color_management_surface_feedback_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
WP_COLOR_MANAGEMENT_SURFACE_FEEDBACK_V1_DESTROY, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_color_management_surface_feedback_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1693,7 +1693,7 @@ wp_color_management_surface_feedback_v1_get_preferred(struct wp_color_management
|
||||
struct wl_proxy *image_description;
|
||||
|
||||
image_description = wl_proxy_marshal_flags((struct wl_proxy *) wp_color_management_surface_feedback_v1,
|
||||
WP_COLOR_MANAGEMENT_SURFACE_FEEDBACK_V1_GET_PREFERRED, &wp_image_description_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_management_surface_feedback_v1), 0, NULL);
|
||||
WP_COLOR_MANAGEMENT_SURFACE_FEEDBACK_V1_GET_PREFERRED, &wp_image_description_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_management_surface_feedback_v1), 0, nullptr);
|
||||
|
||||
return (struct wp_image_description_v1 *) image_description;
|
||||
}
|
||||
@@ -1714,7 +1714,7 @@ wp_color_management_surface_feedback_v1_get_preferred_parametric(struct wp_color
|
||||
struct wl_proxy *image_description;
|
||||
|
||||
image_description = wl_proxy_marshal_flags((struct wl_proxy *) wp_color_management_surface_feedback_v1,
|
||||
WP_COLOR_MANAGEMENT_SURFACE_FEEDBACK_V1_GET_PREFERRED_PARAMETRIC, &wp_image_description_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_management_surface_feedback_v1), 0, NULL);
|
||||
WP_COLOR_MANAGEMENT_SURFACE_FEEDBACK_V1_GET_PREFERRED_PARAMETRIC, &wp_image_description_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_color_management_surface_feedback_v1), 0, nullptr);
|
||||
|
||||
return (struct wp_image_description_v1 *) image_description;
|
||||
}
|
||||
@@ -1818,7 +1818,7 @@ wp_image_description_creator_icc_v1_create(struct wp_image_description_creator_i
|
||||
struct wl_proxy *image_description;
|
||||
|
||||
image_description = wl_proxy_marshal_flags((struct wl_proxy *) wp_image_description_creator_icc_v1,
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_ICC_V1_CREATE, &wp_image_description_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_icc_v1), WL_MARSHAL_FLAG_DESTROY, NULL);
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_ICC_V1_CREATE, &wp_image_description_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_icc_v1), WL_MARSHAL_FLAG_DESTROY, nullptr);
|
||||
|
||||
return (struct wp_image_description_v1 *) image_description;
|
||||
}
|
||||
@@ -1870,7 +1870,7 @@ static inline void
|
||||
wp_image_description_creator_icc_v1_set_icc_file(struct wp_image_description_creator_icc_v1 *wp_image_description_creator_icc_v1, int32_t icc_profile, uint32_t offset, uint32_t length)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_image_description_creator_icc_v1,
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_ICC_V1_SET_ICC_FILE, NULL, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_icc_v1), 0, icc_profile, offset, length);
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_ICC_V1_SET_ICC_FILE, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_icc_v1), 0, icc_profile, offset, length);
|
||||
}
|
||||
|
||||
#ifndef WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_ERROR_ENUM
|
||||
@@ -2027,7 +2027,7 @@ wp_image_description_creator_params_v1_create(struct wp_image_description_creato
|
||||
struct wl_proxy *image_description;
|
||||
|
||||
image_description = wl_proxy_marshal_flags((struct wl_proxy *) wp_image_description_creator_params_v1,
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_CREATE, &wp_image_description_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), WL_MARSHAL_FLAG_DESTROY, NULL);
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_CREATE, &wp_image_description_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), WL_MARSHAL_FLAG_DESTROY, nullptr);
|
||||
|
||||
return (struct wp_image_description_v1 *) image_description;
|
||||
}
|
||||
@@ -2052,7 +2052,7 @@ static inline void
|
||||
wp_image_description_creator_params_v1_set_tf_named(struct wp_image_description_creator_params_v1 *wp_image_description_creator_params_v1, uint32_t tf)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_image_description_creator_params_v1,
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_TF_NAMED, NULL, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, tf);
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_TF_NAMED, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, tf);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2081,7 +2081,7 @@ static inline void
|
||||
wp_image_description_creator_params_v1_set_tf_power(struct wp_image_description_creator_params_v1 *wp_image_description_creator_params_v1, uint32_t eexp)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_image_description_creator_params_v1,
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_TF_POWER, NULL, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, eexp);
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_TF_POWER, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, eexp);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2102,7 +2102,7 @@ static inline void
|
||||
wp_image_description_creator_params_v1_set_primaries_named(struct wp_image_description_creator_params_v1 *wp_image_description_creator_params_v1, uint32_t primaries)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_image_description_creator_params_v1,
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_PRIMARIES_NAMED, NULL, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, primaries);
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_PRIMARIES_NAMED, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, primaries);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2126,7 +2126,7 @@ static inline void
|
||||
wp_image_description_creator_params_v1_set_primaries(struct wp_image_description_creator_params_v1 *wp_image_description_creator_params_v1, int32_t r_x, int32_t r_y, int32_t g_x, int32_t g_y, int32_t b_x, int32_t b_y, int32_t w_x, int32_t w_y)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_image_description_creator_params_v1,
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_PRIMARIES, NULL, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, r_x, r_y, g_x, g_y, b_x, b_y, w_x, w_y);
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_PRIMARIES, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, r_x, r_y, g_x, g_y, b_x, b_y, w_x, w_y);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2186,7 +2186,7 @@ static inline void
|
||||
wp_image_description_creator_params_v1_set_luminances(struct wp_image_description_creator_params_v1 *wp_image_description_creator_params_v1, uint32_t min_lum, uint32_t max_lum, uint32_t reference_lum)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_image_description_creator_params_v1,
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_LUMINANCES, NULL, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, min_lum, max_lum, reference_lum);
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_LUMINANCES, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, min_lum, max_lum, reference_lum);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2243,7 +2243,7 @@ static inline void
|
||||
wp_image_description_creator_params_v1_set_mastering_display_primaries(struct wp_image_description_creator_params_v1 *wp_image_description_creator_params_v1, int32_t r_x, int32_t r_y, int32_t g_x, int32_t g_y, int32_t b_x, int32_t b_y, int32_t w_x, int32_t w_y)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_image_description_creator_params_v1,
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_MASTERING_DISPLAY_PRIMARIES, NULL, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, r_x, r_y, g_x, g_y, b_x, b_y, w_x, w_y);
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_MASTERING_DISPLAY_PRIMARIES, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, r_x, r_y, g_x, g_y, b_x, b_y, w_x, w_y);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2287,7 +2287,7 @@ static inline void
|
||||
wp_image_description_creator_params_v1_set_mastering_luminance(struct wp_image_description_creator_params_v1 *wp_image_description_creator_params_v1, uint32_t min_lum, uint32_t max_lum)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_image_description_creator_params_v1,
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_MASTERING_LUMINANCE, NULL, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, min_lum, max_lum);
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_MASTERING_LUMINANCE, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, min_lum, max_lum);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2301,7 +2301,7 @@ static inline void
|
||||
wp_image_description_creator_params_v1_set_max_cll(struct wp_image_description_creator_params_v1 *wp_image_description_creator_params_v1, uint32_t max_cll)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_image_description_creator_params_v1,
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_MAX_CLL, NULL, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, max_cll);
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_MAX_CLL, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, max_cll);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2316,7 +2316,7 @@ static inline void
|
||||
wp_image_description_creator_params_v1_set_max_fall(struct wp_image_description_creator_params_v1 *wp_image_description_creator_params_v1, uint32_t max_fall)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_image_description_creator_params_v1,
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_MAX_FALL, NULL, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, max_fall);
|
||||
WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_SET_MAX_FALL, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_image_description_creator_params_v1), 0, max_fall);
|
||||
}
|
||||
|
||||
#ifndef WP_IMAGE_DESCRIPTION_V1_ERROR_ENUM
|
||||
@@ -2515,7 +2515,7 @@ static inline void
|
||||
wp_image_description_v1_destroy(struct wp_image_description_v1 *wp_image_description_v1)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_image_description_v1,
|
||||
WP_IMAGE_DESCRIPTION_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wp_image_description_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
WP_IMAGE_DESCRIPTION_V1_DESTROY, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_image_description_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2535,7 +2535,7 @@ wp_image_description_v1_get_information(struct wp_image_description_v1 *wp_image
|
||||
struct wl_proxy *information;
|
||||
|
||||
information = wl_proxy_marshal_flags((struct wl_proxy *) wp_image_description_v1,
|
||||
WP_IMAGE_DESCRIPTION_V1_GET_INFORMATION, &wp_image_description_info_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_image_description_v1), 0, NULL);
|
||||
WP_IMAGE_DESCRIPTION_V1_GET_INFORMATION, &wp_image_description_info_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_image_description_v1), 0, nullptr);
|
||||
|
||||
return (struct wp_image_description_info_v1 *) information;
|
||||
}
|
||||
@@ -2861,7 +2861,7 @@ static inline void
|
||||
wp_image_description_reference_v1_destroy(struct wp_image_description_reference_v1 *wp_image_description_reference_v1)
|
||||
{
|
||||
wl_proxy_marshal_flags((struct wl_proxy *) wp_image_description_reference_v1,
|
||||
WP_IMAGE_DESCRIPTION_REFERENCE_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wp_image_description_reference_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
WP_IMAGE_DESCRIPTION_REFERENCE_V1_DESTROY, nullptr, wl_proxy_get_version((struct wl_proxy *) wp_image_description_reference_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -47,14 +47,14 @@ extern const struct wl_interface wp_image_description_reference_v1_interface;
|
||||
extern const struct wl_interface wp_image_description_v1_interface;
|
||||
|
||||
static const struct wl_interface *color_management_v1_types[] = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&wp_color_management_output_v1_interface,
|
||||
&wl_output_interface,
|
||||
&wp_color_management_surface_v1_interface,
|
||||
@@ -68,7 +68,7 @@ static const struct wl_interface *color_management_v1_types[] = {
|
||||
&wp_image_description_reference_v1_interface,
|
||||
&wp_image_description_v1_interface,
|
||||
&wp_image_description_v1_interface,
|
||||
NULL,
|
||||
nullptr,
|
||||
&wp_image_description_v1_interface,
|
||||
&wp_image_description_v1_interface,
|
||||
&wp_image_description_v1_interface,
|
||||
@@ -125,7 +125,7 @@ static const struct wl_message wp_color_management_surface_v1_requests[] = {
|
||||
WL_EXPORT const struct wl_interface wp_color_management_surface_v1_interface = {
|
||||
"wp_color_management_surface_v1", 2,
|
||||
3, wp_color_management_surface_v1_requests,
|
||||
0, NULL,
|
||||
0, nullptr,
|
||||
};
|
||||
|
||||
static const struct wl_message wp_color_management_surface_feedback_v1_requests[] = {
|
||||
@@ -153,7 +153,7 @@ static const struct wl_message wp_image_description_creator_icc_v1_requests[] =
|
||||
WL_EXPORT const struct wl_interface wp_image_description_creator_icc_v1_interface = {
|
||||
"wp_image_description_creator_icc_v1", 2,
|
||||
2, wp_image_description_creator_icc_v1_requests,
|
||||
0, NULL,
|
||||
0, nullptr,
|
||||
};
|
||||
|
||||
static const struct wl_message wp_image_description_creator_params_v1_requests[] = {
|
||||
@@ -172,7 +172,7 @@ static const struct wl_message wp_image_description_creator_params_v1_requests[]
|
||||
WL_EXPORT const struct wl_interface wp_image_description_creator_params_v1_interface = {
|
||||
"wp_image_description_creator_params_v1", 2,
|
||||
10, wp_image_description_creator_params_v1_requests,
|
||||
0, NULL,
|
||||
0, nullptr,
|
||||
};
|
||||
|
||||
static const struct wl_message wp_image_description_v1_requests[] = {
|
||||
@@ -208,7 +208,7 @@ static const struct wl_message wp_image_description_info_v1_events[] = {
|
||||
|
||||
WL_EXPORT const struct wl_interface wp_image_description_info_v1_interface = {
|
||||
"wp_image_description_info_v1", 2,
|
||||
0, NULL,
|
||||
0, nullptr,
|
||||
11, wp_image_description_info_v1_events,
|
||||
};
|
||||
|
||||
@@ -219,7 +219,7 @@ static const struct wl_message wp_image_description_reference_v1_requests[] = {
|
||||
WL_EXPORT const struct wl_interface wp_image_description_reference_v1_interface = {
|
||||
"wp_image_description_reference_v1", 1,
|
||||
1, wp_image_description_reference_v1_requests,
|
||||
0, NULL,
|
||||
0, nullptr,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -172,7 +172,7 @@ extern const struct wl_interface zxdg_output_v1_interface;
|
||||
// zxdg_output_manager_v1_destroy(struct zxdg_output_manager_v1 *zxdg_output_manager_v1)
|
||||
// {
|
||||
// wl_proxy_marshal_flags((struct wl_proxy *) zxdg_output_manager_v1,
|
||||
// ZXDG_OUTPUT_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_output_manager_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
// ZXDG_OUTPUT_MANAGER_V1_DESTROY, nullptr, wl_proxy_get_version((struct wl_proxy *) zxdg_output_manager_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
// }
|
||||
|
||||
// /**
|
||||
@@ -186,7 +186,7 @@ extern const struct wl_interface zxdg_output_v1_interface;
|
||||
// struct wl_proxy *id;
|
||||
|
||||
// id = wl_proxy_marshal_flags((struct wl_proxy *) zxdg_output_manager_v1,
|
||||
// ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT, &zxdg_output_v1_interface, wl_proxy_get_version((struct wl_proxy *) zxdg_output_manager_v1), 0, NULL, output);
|
||||
// ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT, &zxdg_output_v1_interface, wl_proxy_get_version((struct wl_proxy *) zxdg_output_manager_v1), 0, nullptr, output);
|
||||
|
||||
// return (struct zxdg_output_v1 *) id;
|
||||
// }
|
||||
@@ -404,7 +404,7 @@ zxdg_output_v1_add_listener(struct zxdg_output_v1* zxdg_output_v1,
|
||||
// zxdg_output_v1_destroy(struct zxdg_output_v1 *zxdg_output_v1)
|
||||
// {
|
||||
// wl_proxy_marshal_flags((struct wl_proxy *) zxdg_output_v1,
|
||||
// ZXDG_OUTPUT_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_output_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
// ZXDG_OUTPUT_V1_DESTROY, nullptr, wl_proxy_get_version((struct wl_proxy *) zxdg_output_v1), WL_MARSHAL_FLAG_DESTROY);
|
||||
// }
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -32,8 +32,8 @@ extern const struct wl_interface wl_output_interface;
|
||||
extern const struct wl_interface zxdg_output_v1_interface;
|
||||
|
||||
static const struct wl_interface* xdg_output_unstable_v1_types[] = {
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
&zxdg_output_v1_interface,
|
||||
&wl_output_interface,
|
||||
};
|
||||
@@ -49,7 +49,7 @@ WL_EXPORT const struct wl_interface zxdg_output_manager_v1_interface = {
|
||||
2,
|
||||
zxdg_output_manager_v1_requests,
|
||||
0,
|
||||
NULL,
|
||||
nullptr,
|
||||
};
|
||||
|
||||
static const struct wl_message zxdg_output_v1_requests[] = {
|
||||
|
||||
@@ -51,39 +51,39 @@ static const char* parseEnv(void) {
|
||||
return env;
|
||||
}
|
||||
|
||||
if (getenv("KDE_FULL_SESSION") != NULL || getenv("KDE_SESSION_UID") != NULL || getenv("KDE_SESSION_VERSION") != NULL) {
|
||||
if (getenv("KDE_FULL_SESSION") != nullptr || getenv("KDE_SESSION_UID") != nullptr || getenv("KDE_SESSION_VERSION") != nullptr) {
|
||||
return "KDE";
|
||||
}
|
||||
|
||||
if (getenv("GNOME_DESKTOP_SESSION_ID") != NULL) {
|
||||
if (getenv("GNOME_DESKTOP_SESSION_ID") != nullptr) {
|
||||
return "GNOME";
|
||||
}
|
||||
|
||||
if (getenv("MATE_DESKTOP_SESSION_ID") != NULL) {
|
||||
if (getenv("MATE_DESKTOP_SESSION_ID") != nullptr) {
|
||||
return "Mate";
|
||||
}
|
||||
|
||||
if (getenv("TDE_FULL_SESSION") != NULL) {
|
||||
if (getenv("TDE_FULL_SESSION") != nullptr) {
|
||||
return "Trinity";
|
||||
}
|
||||
|
||||
if (getenv("HYPRLAND_CMD") != NULL) {
|
||||
if (getenv("HYPRLAND_CMD") != nullptr) {
|
||||
return "Hyprland";
|
||||
}
|
||||
|
||||
if (getenv("SWAYSOCK") != NULL) {
|
||||
if (getenv("SWAYSOCK") != nullptr) {
|
||||
return "Sway";
|
||||
}
|
||||
|
||||
#if __linux__ && !__ANDROID__
|
||||
if (
|
||||
getenv("WAYLAND_DISPLAY") != NULL &&
|
||||
getenv("WAYLAND_DISPLAY") != nullptr &&
|
||||
ffPathExists("/mnt/wslg/", FF_PATHTYPE_DIRECTORY)) {
|
||||
return "WSLg";
|
||||
}
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static void applyPrettyNameIfWM(FFDisplayServerResult* result, const char* name) {
|
||||
@@ -285,12 +285,12 @@ static const char* getFromProcesses(FFDisplayServerResult* result) {
|
||||
int request[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, (int) userId };
|
||||
size_t length = 0;
|
||||
|
||||
if (sysctl(request, ARRAY_SIZE(request), NULL, &length, NULL, 0) != 0) {
|
||||
return "sysctl({CTL_KERN, KERN_PROC, KERN_PROC_UID}, NULL) failed";
|
||||
if (sysctl(request, ARRAY_SIZE(request), nullptr, &length, nullptr, 0) != 0) {
|
||||
return "sysctl({CTL_KERN, KERN_PROC, KERN_PROC_UID}, nullptr) failed";
|
||||
}
|
||||
|
||||
FF_AUTO_FREE struct kinfo_proc* procs = (struct kinfo_proc*) malloc(length);
|
||||
if (sysctl(request, ARRAY_SIZE(request), procs, &length, NULL, 0) != 0) {
|
||||
if (sysctl(request, ARRAY_SIZE(request), procs, &length, nullptr, 0) != 0) {
|
||||
return "sysctl({CTL_KERN, KERN_PROC, KERN_PROC_UID}, procs) failed";
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ static const char* getFromProcesses(FFDisplayServerResult* result) {
|
||||
}
|
||||
}
|
||||
#elif __OpenBSD__
|
||||
kvm_t* kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, NULL);
|
||||
kvm_t* kd = kvm_open(nullptr, nullptr, nullptr, KVM_NO_FILES, nullptr);
|
||||
int count = 0;
|
||||
const struct kinfo_proc* proc = kvm_getprocs(kd, KERN_PROC_UID, (int) userId, sizeof(*proc), &count);
|
||||
if (proc) {
|
||||
@@ -331,7 +331,7 @@ static const char* getFromProcesses(FFDisplayServerResult* result) {
|
||||
kvm_close(kd);
|
||||
#elif __sun
|
||||
FF_AUTO_CLOSE_DIR DIR* procdir = opendir("/proc");
|
||||
if (procdir == NULL) {
|
||||
if (procdir == nullptr) {
|
||||
return "opendir(\"/proc\") failed";
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ static const char* getFromProcesses(FFDisplayServerResult* result) {
|
||||
uint32_t procPathLength = procPath.length;
|
||||
|
||||
struct dirent* dirent;
|
||||
while ((dirent = readdir(procdir)) != NULL) {
|
||||
while ((dirent = readdir(procdir)) != nullptr) {
|
||||
if (!ffCharIsDigit(dirent->d_name[0])) {
|
||||
continue;
|
||||
}
|
||||
@@ -371,7 +371,7 @@ static const char* getFromProcesses(FFDisplayServerResult* result) {
|
||||
}
|
||||
#elif __linux__ || __GNU__
|
||||
FF_AUTO_CLOSE_DIR DIR* procdir = opendir("/proc");
|
||||
if (procdir == NULL) {
|
||||
if (procdir == nullptr) {
|
||||
return "opendir(\"/proc\") failed";
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ static const char* getFromProcesses(FFDisplayServerResult* result) {
|
||||
FF_STRBUF_AUTO_DESTROY processName = ffStrbufCreateA(256); // Some processes have large command lines (looking at you chrome)
|
||||
|
||||
struct dirent* dirent;
|
||||
while ((dirent = readdir(procdir)) != NULL) {
|
||||
while ((dirent = readdir(procdir)) != nullptr) {
|
||||
// Match only folders starting with a number (the pid folders)
|
||||
if (dirent->d_type != DT_DIR || !ffCharIsDigit(dirent->d_name[0])) {
|
||||
continue;
|
||||
@@ -428,13 +428,13 @@ static const char* getFromProcesses(FFDisplayServerResult* result) {
|
||||
int request[] = { CTL_KERN, KERN_PROC2, KERN_PROC_UID, (int) userId, sizeof(struct kinfo_proc2), INT_MAX };
|
||||
|
||||
size_t size = 0;
|
||||
if (sysctl(request, ARRAY_SIZE(request), NULL, &size, NULL, 0) != 0) {
|
||||
return "sysctl(KERN_PROC_UID, NULL) failed";
|
||||
if (sysctl(request, ARRAY_SIZE(request), nullptr, &size, nullptr, 0) != 0) {
|
||||
return "sysctl(KERN_PROC_UID, nullptr) failed";
|
||||
}
|
||||
|
||||
FF_AUTO_FREE struct kinfo_proc2* procs = malloc(size);
|
||||
|
||||
if (sysctl(request, ARRAY_SIZE(request), procs, &size, NULL, 0) != 0) {
|
||||
if (sysctl(request, ARRAY_SIZE(request), procs, &size, nullptr, 0) != 0) {
|
||||
return "sysctl(KERN_PROC_UID, procs) failed";
|
||||
}
|
||||
|
||||
@@ -453,7 +453,7 @@ static const char* getFromProcesses(FFDisplayServerResult* result) {
|
||||
}
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ffdsDetectWMDE(FFDisplayServerResult* result) {
|
||||
|
||||
@@ -55,20 +55,20 @@ typedef struct XcbRandrData {
|
||||
|
||||
static void* xcbGetProperty(XcbRandrData* data, xcb_window_t window, const char* request) {
|
||||
xcb_intern_atom_cookie_t requestAtomCookie = data->ffxcb_intern_atom(data->connection, true, (uint16_t) strlen(request), request);
|
||||
FF_AUTO_FREE xcb_intern_atom_reply_t* requestAtomReply = data->ffxcb_intern_atom_reply(data->connection, requestAtomCookie, NULL);
|
||||
if (requestAtomReply == NULL) {
|
||||
return NULL;
|
||||
FF_AUTO_FREE xcb_intern_atom_reply_t* requestAtomReply = data->ffxcb_intern_atom_reply(data->connection, requestAtomCookie, nullptr);
|
||||
if (requestAtomReply == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t propertyCookie = data->ffxcb_get_property(data->connection, false, window, requestAtomReply->atom, XCB_ATOM_ANY, 0, 8 * 1024);
|
||||
FF_AUTO_FREE xcb_get_property_reply_t* propertyReply = data->ffxcb_get_property_reply(data->connection, propertyCookie, NULL);
|
||||
if (propertyReply == NULL) {
|
||||
return NULL;
|
||||
FF_AUTO_FREE xcb_get_property_reply_t* propertyReply = data->ffxcb_get_property_reply(data->connection, propertyCookie, nullptr);
|
||||
if (propertyReply == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int length = data->ffxcb_get_property_value_length(propertyReply);
|
||||
if (length <= 0) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Why are xcb property strings not null terminated???
|
||||
@@ -81,13 +81,13 @@ static void* xcbGetProperty(XcbRandrData* data, xcb_window_t window, const char*
|
||||
|
||||
static xcb_randr_get_output_property_reply_t* xcbRandrGetProperty(XcbRandrData* data, xcb_randr_output_t output, const char* name) {
|
||||
xcb_intern_atom_cookie_t requestAtomCookie = data->ffxcb_intern_atom(data->connection, true, (uint16_t) strlen(name), name);
|
||||
FF_AUTO_FREE xcb_intern_atom_reply_t* requestAtomReply = data->ffxcb_intern_atom_reply(data->connection, requestAtomCookie, NULL);
|
||||
FF_AUTO_FREE xcb_intern_atom_reply_t* requestAtomReply = data->ffxcb_intern_atom_reply(data->connection, requestAtomCookie, nullptr);
|
||||
|
||||
if (requestAtomReply) {
|
||||
xcb_randr_get_output_property_cookie_t outputPropertyCookie = data->ffxcb_randr_get_output_property(data->connection, output, requestAtomReply->atom, XCB_GET_PROPERTY_TYPE_ANY, 0, 100, false, false);
|
||||
return data->ffxcb_randr_get_output_property_reply(data->connection, outputPropertyCookie, NULL);
|
||||
return data->ffxcb_randr_get_output_property_reply(data->connection, outputPropertyCookie, nullptr);
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static void xcbDetectWMfromEWMH(XcbRandrData* data, xcb_window_t rootWindow, FFDisplayServerResult* result) {
|
||||
@@ -96,7 +96,7 @@ static void xcbDetectWMfromEWMH(XcbRandrData* data, xcb_window_t rootWindow, FFD
|
||||
}
|
||||
|
||||
FF_AUTO_FREE xcb_window_t* wmWindow = (xcb_window_t*) xcbGetProperty(data, rootWindow, "_NET_SUPPORTING_WM_CHECK");
|
||||
if (wmWindow == NULL) {
|
||||
if (wmWindow == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -131,13 +131,13 @@ static void xcbFetchServerVendor(XcbRandrData* data, FFDisplayServerResult* resu
|
||||
|
||||
static bool xcbRandrHandleOutput(XcbRandrData* data, xcb_randr_output_t output, FFstrbuf* name, bool primary, FFDisplayType displayType, struct xcb_randr_get_screen_resources_current_reply_t* screenResources, uint8_t bitDepth, uint32_t dpi) {
|
||||
xcb_randr_get_output_info_cookie_t outputInfoCookie = data->ffxcb_randr_get_output_info(data->connection, output, XCB_CURRENT_TIME);
|
||||
FF_AUTO_FREE xcb_randr_get_output_info_reply_t* outputInfoReply = data->ffxcb_randr_get_output_info_reply(data->connection, outputInfoCookie, NULL);
|
||||
if (outputInfoReply == NULL) {
|
||||
FF_AUTO_FREE xcb_randr_get_output_info_reply_t* outputInfoReply = data->ffxcb_randr_get_output_info_reply(data->connection, outputInfoCookie, nullptr);
|
||||
if (outputInfoReply == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
FF_AUTO_FREE xcb_randr_get_output_property_reply_t* edidReply = xcbRandrGetProperty(data, output, "EDID");
|
||||
uint8_t* edidData = NULL;
|
||||
uint8_t* edidData = nullptr;
|
||||
uint32_t edidLength = 0;
|
||||
if (edidReply) {
|
||||
int len = data->ffxcb_randr_get_output_property_data_length(edidReply);
|
||||
@@ -162,8 +162,8 @@ static bool xcbRandrHandleOutput(XcbRandrData* data, xcb_randr_output_t output,
|
||||
}
|
||||
|
||||
xcb_randr_get_crtc_info_cookie_t crtcInfoCookie = data->ffxcb_randr_get_crtc_info(data->connection, outputInfoReply->crtc, XCB_CURRENT_TIME);
|
||||
FF_AUTO_FREE xcb_randr_get_crtc_info_reply_t* crtcInfoReply = data->ffxcb_randr_get_crtc_info_reply(data->connection, crtcInfoCookie, NULL);
|
||||
if (crtcInfoReply == NULL) {
|
||||
FF_AUTO_FREE xcb_randr_get_crtc_info_reply_t* crtcInfoReply = data->ffxcb_randr_get_crtc_info_reply(data->connection, crtcInfoCookie, nullptr);
|
||||
if (crtcInfoReply == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -183,8 +183,8 @@ static bool xcbRandrHandleOutput(XcbRandrData* data, xcb_randr_output_t output,
|
||||
break;
|
||||
}
|
||||
|
||||
xcb_randr_mode_info_t* currentMode = NULL;
|
||||
xcb_randr_mode_info_t* preferredMode = NULL;
|
||||
xcb_randr_mode_info_t* currentMode = nullptr;
|
||||
xcb_randr_mode_info_t* preferredMode = nullptr;
|
||||
|
||||
if (screenResources) {
|
||||
xcb_randr_mode_info_iterator_t modesIterator = data->ffxcb_randr_get_screen_resources_current_modes_iterator(screenResources);
|
||||
@@ -253,7 +253,7 @@ static bool xcbRandrHandleMonitor(XcbRandrData* data, xcb_randr_monitor_info_t*
|
||||
FF_AUTO_FREE xcb_get_atom_name_reply_t* nameReply = data->ffxcb_get_atom_name_reply(
|
||||
data->connection,
|
||||
data->ffxcb_get_atom_name(data->connection, monitor->name),
|
||||
NULL);
|
||||
nullptr);
|
||||
FF_STRBUF_AUTO_DESTROY name = ffStrbufCreateNS(
|
||||
(uint32_t) data->ffxcb_get_atom_name_name_length(nameReply),
|
||||
data->ffxcb_get_atom_name_name(nameReply));
|
||||
@@ -297,14 +297,14 @@ static bool xcbRandrHandleMonitor(XcbRandrData* data, xcb_randr_monitor_info_t*
|
||||
|
||||
static bool xcbRandrHandleMonitors(XcbRandrData* data, xcb_screen_t* screen) {
|
||||
xcb_randr_get_monitors_cookie_t monitorsCookie = data->ffxcb_randr_get_monitors(data->connection, screen->root, true);
|
||||
FF_AUTO_FREE xcb_randr_get_monitors_reply_t* monitorsReply = data->ffxcb_randr_get_monitors_reply(data->connection, monitorsCookie, NULL);
|
||||
if (monitorsReply == NULL) {
|
||||
FF_AUTO_FREE xcb_randr_get_monitors_reply_t* monitorsReply = data->ffxcb_randr_get_monitors_reply(data->connection, monitorsCookie, nullptr);
|
||||
if (monitorsReply == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Init screen resources. They are used to iterate over all modes. xcbRandrHandleMode checks for " == NULL", to fail as late as possible.
|
||||
// Init screen resources. They are used to iterate over all modes. xcbRandrHandleMode checks for " == nullptr", to fail as late as possible.
|
||||
xcb_randr_get_screen_resources_current_cookie_t screenResourcesCookie = data->ffxcb_randr_get_screen_resources_current(data->connection, screen->root);
|
||||
FF_AUTO_FREE struct xcb_randr_get_screen_resources_current_reply_t* screenResources = data->ffxcb_randr_get_screen_resources_current_reply(data->connection, screenResourcesCookie, NULL);
|
||||
FF_AUTO_FREE struct xcb_randr_get_screen_resources_current_reply_t* screenResources = data->ffxcb_randr_get_screen_resources_current_reply(data->connection, screenResourcesCookie, nullptr);
|
||||
|
||||
uint32_t dpi = 0;
|
||||
FF_AUTO_FREE const char* resourceManager = xcbGetProperty(data, screen->root, "RESOURCE_MANAGER");
|
||||
@@ -347,7 +347,7 @@ static void xcbRandrHandleScreen(XcbRandrData* data, xcb_screen_t* screen) {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
nullptr,
|
||||
FF_DISPLAY_TYPE_UNKNOWN,
|
||||
false,
|
||||
(uint64_t) screen->root,
|
||||
@@ -401,7 +401,7 @@ const char* ffdsConnectXcbRandr(FFDisplayServerResult* result) {
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_randr_get_crtc_info)
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xcbRandr, data, xcb_randr_get_crtc_info_reply)
|
||||
|
||||
data.connection = ffxcb_connect(NULL, NULL);
|
||||
data.connection = ffxcb_connect(nullptr, nullptr);
|
||||
if (ffxcb_connection_has_error(data.connection) > 0) {
|
||||
ffxcb_disconnect(data.connection);
|
||||
return "xcb_connect() failed";
|
||||
@@ -428,7 +428,7 @@ const char* ffdsConnectXcbRandr(FFDisplayServerResult* result) {
|
||||
ffStrbufSetS(&result->wmProtocolName, FF_WM_PROTOCOL_X11);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
@@ -34,15 +34,15 @@ typedef struct XrandrData {
|
||||
static unsigned char* x11GetProperty(XrandrData* data, Display* display, Window window, const char* request) {
|
||||
Atom requestAtom = data->ffXInternAtom(display, request, False);
|
||||
if (requestAtom == None) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Atom actualType;
|
||||
unsigned long unused;
|
||||
unsigned char* result = NULL;
|
||||
unsigned char* result = nullptr;
|
||||
|
||||
if (data->ffXGetWindowProperty(display, window, requestAtom, 0, 64, False, AnyPropertyType, &actualType, (int*) &unused, &unused, &unused, &result) != Success) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -50,7 +50,7 @@ static unsigned char* x11GetProperty(XrandrData* data, Display* display, Window
|
||||
|
||||
static uint8_t* xrandrGetProperty(XrandrData* data, RROutput output, const char* name, uint32_t* bufSize) {
|
||||
unsigned long size = 0;
|
||||
uint8_t* result = NULL;
|
||||
uint8_t* result = nullptr;
|
||||
Atom atomEdid = data->ffXInternAtom(data->display, name, true);
|
||||
if (atomEdid != None) {
|
||||
int actual_format = 0;
|
||||
@@ -68,7 +68,7 @@ static uint8_t* xrandrGetProperty(XrandrData* data, RROutput output, const char*
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static void x11DetectWMFromEWMH(XrandrData* data, FFDisplayServerResult* result) {
|
||||
@@ -77,7 +77,7 @@ static void x11DetectWMFromEWMH(XrandrData* data, FFDisplayServerResult* result)
|
||||
}
|
||||
|
||||
Window* wmWindow = (Window*) x11GetProperty(data, data->display, DefaultRootWindow(data->display), "_NET_SUPPORTING_WM_CHECK");
|
||||
if (wmWindow == NULL) {
|
||||
if (wmWindow == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -103,12 +103,12 @@ static void x11FetchServerVendor(XrandrData* data, FFDisplayServerResult* result
|
||||
|
||||
static bool xrandrHandleCrtc(XrandrData* data, XRROutputInfo* output, FFstrbuf* name, bool primary, FFDisplayType displayType, uint8_t* edidData, uint32_t edidLength, XRRScreenResources* screenResources, uint8_t bitDepth, uint32_t dpi, bool randrEmulation) {
|
||||
// We do the check here, because we want the best fallback display if this call failed
|
||||
if (screenResources == NULL) {
|
||||
if (screenResources == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
XRRCrtcInfo* crtcInfo = data->ffXRRGetCrtcInfo(data->display, screenResources, output->crtc);
|
||||
if (crtcInfo == NULL) {
|
||||
if (crtcInfo == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ static bool xrandrHandleCrtc(XrandrData* data, XRROutputInfo* output, FFstrbuf*
|
||||
break;
|
||||
}
|
||||
|
||||
XRRModeInfo* currentMode = NULL;
|
||||
XRRModeInfo* currentMode = nullptr;
|
||||
for (int i = 0; i < screenResources->nmode; i++) {
|
||||
if (screenResources->modes[i].id == crtcInfo->mode) {
|
||||
currentMode = &screenResources->modes[i];
|
||||
@@ -136,7 +136,7 @@ static bool xrandrHandleCrtc(XrandrData* data, XRROutputInfo* output, FFstrbuf*
|
||||
}
|
||||
}
|
||||
|
||||
XRRModeInfo* preferredMode = output->npreferred > 0 ? &screenResources->modes[0] : NULL;
|
||||
XRRModeInfo* preferredMode = output->npreferred > 0 ? &screenResources->modes[0] : nullptr;
|
||||
|
||||
FFDisplayResult* item = ffdsAppendDisplay(
|
||||
data->result,
|
||||
@@ -179,7 +179,7 @@ static bool xrandrHandleCrtc(XrandrData* data, XRROutputInfo* output, FFstrbuf*
|
||||
|
||||
static bool xrandrHandleOutput(XrandrData* data, RROutput output, FFstrbuf* name, bool primary, FFDisplayType displayType, XRRScreenResources* screenResources, uint8_t bitDepth, uint32_t dpi) {
|
||||
XRROutputInfo* outputInfo = data->ffXRRGetOutputInfo(data->display, screenResources, output);
|
||||
if (outputInfo == NULL) {
|
||||
if (outputInfo == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ static bool xrandrHandleOutput(XrandrData* data, RROutput output, FFstrbuf* name
|
||||
edidLength = 0;
|
||||
}
|
||||
|
||||
uint8_t* randrEmulation = xrandrGetProperty(data, output, "RANDR Emulation", NULL);
|
||||
uint8_t* randrEmulation = xrandrGetProperty(data, output, "RANDR Emulation", nullptr);
|
||||
|
||||
bool res = xrandrHandleCrtc(data, outputInfo, name, primary, displayType, edidData, edidLength, screenResources, bitDepth, dpi, randrEmulation ? !!randrEmulation[0] : false);
|
||||
|
||||
@@ -250,7 +250,7 @@ static bool xrandrHandleMonitor(XrandrData* data, XRRMonitorInfo* monitorInfo, X
|
||||
static bool xrandrHandleMonitors(XrandrData* data, Screen* screen) {
|
||||
int numberOfMonitors;
|
||||
XRRMonitorInfo* monitorInfos = data->ffXRRGetMonitors(data->display, RootWindowOfScreen(screen), True, &numberOfMonitors);
|
||||
if (monitorInfos == NULL) {
|
||||
if (monitorInfos == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ static void xrandrHandleScreen(XrandrData* data, Screen* screen) {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
nullptr,
|
||||
FF_DISPLAY_TYPE_UNKNOWN,
|
||||
false,
|
||||
RootWindowOfScreen(screen),
|
||||
@@ -329,8 +329,8 @@ const char* ffdsConnectXrandr(FFDisplayServerResult* result) {
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xrandr, data, XRRFreeScreenResources);
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(xrandr, data, XRRFreeMonitors);
|
||||
|
||||
data.display = ffXOpenDisplay(NULL);
|
||||
if (data.display == NULL) {
|
||||
data.display = ffXOpenDisplay(nullptr);
|
||||
if (data.display == nullptr) {
|
||||
return "XOpenDisplay() failed";
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ const char* ffdsConnectXrandr(FFDisplayServerResult* result) {
|
||||
ffStrbufSetS(&result->wmProtocolName, FF_WM_PROTOCOL_X11);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user