Skip to content

Commit 878e516

Browse files
committed
DisplayServer (Linux): upgrade wayland protocol kde-output-device-v2
Ref: fastfetch-cli#1504
1 parent 4e3673a commit 878e516

File tree

3 files changed

+134
-56
lines changed

3 files changed

+134
-56
lines changed

src/detection/displayserver/linux/wayland/kde-output-device-v2-client-protocol.h

Lines changed: 126 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
/* Generated by wayland-scanner 1.22.0 */
1+
/* Generated by wayland-scanner 1.23.1 */
22

33
#ifndef KDE_OUTPUT_DEVICE_V2_CLIENT_PROTOCOL_H
44
#define KDE_OUTPUT_DEVICE_V2_CLIENT_PROTOCOL_H
55

66
#include <stdint.h>
77
#include <stddef.h>
8-
#include <wayland-util.h>
8+
#include "wayland-client.h"
99

1010
#ifdef __cplusplus
1111
extern "C" {
@@ -53,6 +53,11 @@ struct kde_output_device_v2;
5353
* This object is published as global during start up for every available
5454
* display devices, or when one later becomes available, for example by
5555
* being hotplugged via a physical connector.
56+
*
57+
* Warning! The protocol described in this file is a desktop environment
58+
* implementation detail. Regular clients must not use this protocol.
59+
* Backward incompatible changes may be added without bumping the major
60+
* version of the extension.
5661
* @section page_iface_kde_output_device_v2_api API
5762
* See @ref iface_kde_output_device_v2.
5863
*/
@@ -75,6 +80,11 @@ struct kde_output_device_v2;
7580
* This object is published as global during start up for every available
7681
* display devices, or when one later becomes available, for example by
7782
* being hotplugged via a physical connector.
83+
*
84+
* Warning! The protocol described in this file is a desktop environment
85+
* implementation detail. Regular clients must not use this protocol.
86+
* Backward incompatible changes may be added without bumping the major
87+
* version of the extension.
7888
*/
7989
extern const struct wl_interface kde_output_device_v2_interface;
8090
#endif
@@ -199,6 +209,11 @@ enum kde_output_device_v2_capability {
199209
* @since 5
200210
*/
201211
KDE_OUTPUT_DEVICE_V2_CAPABILITY_ICC_PROFILE = 0x40,
212+
/**
213+
* if this outputdevice supports the brightness setting
214+
* @since 9
215+
*/
216+
KDE_OUTPUT_DEVICE_V2_CAPABILITY_BRIGHTNESS = 0x80,
202217
};
203218
/**
204219
* @ingroup iface_kde_output_device_v2
@@ -216,6 +231,10 @@ enum kde_output_device_v2_capability {
216231
* @ingroup iface_kde_output_device_v2
217232
*/
218233
#define KDE_OUTPUT_DEVICE_V2_CAPABILITY_ICC_PROFILE_SINCE_VERSION 5
234+
/**
235+
* @ingroup iface_kde_output_device_v2
236+
*/
237+
#define KDE_OUTPUT_DEVICE_V2_CAPABILITY_BRIGHTNESS_SINCE_VERSION 9
219238
#endif /* KDE_OUTPUT_DEVICE_V2_CAPABILITY_ENUM */
220239

221240
#ifndef KDE_OUTPUT_DEVICE_V2_VRR_POLICY_ENUM
@@ -274,6 +293,29 @@ enum kde_output_device_v2_color_profile_source {
274293
};
275294
#endif /* KDE_OUTPUT_DEVICE_V2_COLOR_PROFILE_SOURCE_ENUM */
276295

296+
#ifndef KDE_OUTPUT_DEVICE_V2_COLOR_POWER_TRADEOFF_ENUM
297+
#define KDE_OUTPUT_DEVICE_V2_COLOR_POWER_TRADEOFF_ENUM
298+
/**
299+
* @ingroup iface_kde_output_device_v2
300+
* tradeoff between power and accuracy
301+
*
302+
* The compositor can do a lot of things that trade between
303+
* performance, power and color accuracy. This setting describes
304+
* a high level preference from the user about in which direction
305+
* that tradeoff should be made.
306+
*/
307+
enum kde_output_device_v2_color_power_tradeoff {
308+
/**
309+
* prefer efficiency and performance
310+
*/
311+
KDE_OUTPUT_DEVICE_V2_COLOR_POWER_TRADEOFF_EFFICIENCY = 0,
312+
/**
313+
* prefer accuracy
314+
*/
315+
KDE_OUTPUT_DEVICE_V2_COLOR_POWER_TRADEOFF_ACCURACY = 1,
316+
};
317+
#endif /* KDE_OUTPUT_DEVICE_V2_COLOR_POWER_TRADEOFF_ENUM */
318+
277319
/**
278320
* @ingroup iface_kde_output_device_v2
279321
* @struct kde_output_device_v2_listener
@@ -514,7 +556,7 @@ struct kde_output_device_v2_listener {
514556
/**
515557
* describes when auto rotate is used
516558
*
517-
*
559+
*
518560
* @since 4
519561
*/
520562
void (*auto_rotate_policy)(void *data,
@@ -523,7 +565,7 @@ struct kde_output_device_v2_listener {
523565
/**
524566
* describes when auto rotate is used
525567
*
526-
*
568+
*
527569
* @since 5
528570
*/
529571
void (*icc_profile_path)(void *data,
@@ -532,7 +574,7 @@ struct kde_output_device_v2_listener {
532574
/**
533575
* metadata about the screen's brightness limits
534576
*
535-
*
577+
*
536578
* @param max_peak_brightness in nits
537579
* @param max_frame_average_brightness in nits
538580
* @param min_brightness in 0.0001 nits
@@ -546,7 +588,7 @@ struct kde_output_device_v2_listener {
546588
/**
547589
* overrides for the screen's brightness limits
548590
*
549-
*
591+
*
550592
* @param max_peak_brightness -1 for no override, positive values are the brightness in nits
551593
* @param max_average_brightness -1 for no override, positive values are the brightness in nits
552594
* @param min_brightness -1 for no override, positive values are the brightness in 0.0001 nits
@@ -572,7 +614,7 @@ struct kde_output_device_v2_listener {
572614
/**
573615
* describes which source the compositor uses for the color profile on an output
574616
*
575-
*
617+
*
576618
* @since 7
577619
*/
578620
void (*color_profile_source)(void *data,
@@ -593,6 +635,29 @@ struct kde_output_device_v2_listener {
593635
void (*brightness)(void *data,
594636
struct kde_output_device_v2 *kde_output_device_v2,
595637
uint32_t brightness);
638+
/**
639+
* the preferred color/power tradeoff
640+
*
641+
*
642+
* @since 10
643+
*/
644+
void (*color_power_tradeoff)(void *data,
645+
struct kde_output_device_v2 *kde_output_device_v2,
646+
uint32_t preference);
647+
/**
648+
* dimming multiplier
649+
*
650+
* This is the dimming multiplier of the output. This is similar
651+
* to the brightness setting, except it's meant to be a temporary
652+
* setting only, not persistent and may be implemented differently
653+
* depending on the display. 0 is the minimum dimming factor (not
654+
* completely dark) and 10000 means the output is not dimmed.
655+
* @param multiplier multiplier in 0-10000
656+
* @since 11
657+
*/
658+
void (*dimming)(void *data,
659+
struct kde_output_device_v2 *kde_output_device_v2,
660+
uint32_t multiplier);
596661
};
597662

598663
/**
@@ -706,34 +771,42 @@ kde_output_device_v2_add_listener(struct kde_output_device_v2 *kde_output_device
706771
* @ingroup iface_kde_output_device_v2
707772
*/
708773
#define KDE_OUTPUT_DEVICE_V2_BRIGHTNESS_SINCE_VERSION 8
774+
/**
775+
* @ingroup iface_kde_output_device_v2
776+
*/
777+
#define KDE_OUTPUT_DEVICE_V2_COLOR_POWER_TRADEOFF_SINCE_VERSION 10
778+
/**
779+
* @ingroup iface_kde_output_device_v2
780+
*/
781+
#define KDE_OUTPUT_DEVICE_V2_DIMMING_SINCE_VERSION 11
709782

710783

711-
// /** @ingroup iface_kde_output_device_v2 */
712-
// static inline void
713-
// kde_output_device_v2_set_user_data(struct kde_output_device_v2 *kde_output_device_v2, void *user_data)
714-
// {
715-
// wl_proxy_set_user_data((struct wl_proxy *) kde_output_device_v2, user_data);
716-
// }
784+
/** @ingroup iface_kde_output_device_v2 */
785+
static inline void
786+
kde_output_device_v2_set_user_data(struct kde_output_device_v2 *kde_output_device_v2, void *user_data)
787+
{
788+
wl_proxy_set_user_data((struct wl_proxy *) kde_output_device_v2, user_data);
789+
}
717790

718-
// /** @ingroup iface_kde_output_device_v2 */
719-
// static inline void *
720-
// kde_output_device_v2_get_user_data(struct kde_output_device_v2 *kde_output_device_v2)
721-
// {
722-
// return wl_proxy_get_user_data((struct wl_proxy *) kde_output_device_v2);
723-
// }
791+
/** @ingroup iface_kde_output_device_v2 */
792+
static inline void *
793+
kde_output_device_v2_get_user_data(struct kde_output_device_v2 *kde_output_device_v2)
794+
{
795+
return wl_proxy_get_user_data((struct wl_proxy *) kde_output_device_v2);
796+
}
724797

725-
// static inline uint32_t
726-
// kde_output_device_v2_get_version(struct kde_output_device_v2 *kde_output_device_v2)
727-
// {
728-
// return wl_proxy_get_version((struct wl_proxy *) kde_output_device_v2);
729-
// }
798+
static inline uint32_t
799+
kde_output_device_v2_get_version(struct kde_output_device_v2 *kde_output_device_v2)
800+
{
801+
return wl_proxy_get_version((struct wl_proxy *) kde_output_device_v2);
802+
}
730803

731-
// /** @ingroup iface_kde_output_device_v2 */
732-
// static inline void
733-
// kde_output_device_v2_destroy(struct kde_output_device_v2 *kde_output_device_v2)
734-
// {
735-
// wl_proxy_destroy((struct wl_proxy *) kde_output_device_v2);
736-
// }
804+
/** @ingroup iface_kde_output_device_v2 */
805+
static inline void
806+
kde_output_device_v2_destroy(struct kde_output_device_v2 *kde_output_device_v2)
807+
{
808+
wl_proxy_destroy((struct wl_proxy *) kde_output_device_v2);
809+
}
737810

738811
/**
739812
* @ingroup iface_kde_output_device_mode_v2
@@ -811,32 +884,32 @@ kde_output_device_mode_v2_add_listener(struct kde_output_device_mode_v2 *kde_out
811884
#define KDE_OUTPUT_DEVICE_MODE_V2_REMOVED_SINCE_VERSION 1
812885

813886

814-
// /** @ingroup iface_kde_output_device_mode_v2 */
815-
// static inline void
816-
// kde_output_device_mode_v2_set_user_data(struct kde_output_device_mode_v2 *kde_output_device_mode_v2, void *user_data)
817-
// {
818-
// wl_proxy_set_user_data((struct wl_proxy *) kde_output_device_mode_v2, user_data);
819-
// }
887+
/** @ingroup iface_kde_output_device_mode_v2 */
888+
static inline void
889+
kde_output_device_mode_v2_set_user_data(struct kde_output_device_mode_v2 *kde_output_device_mode_v2, void *user_data)
890+
{
891+
wl_proxy_set_user_data((struct wl_proxy *) kde_output_device_mode_v2, user_data);
892+
}
820893

821-
// /** @ingroup iface_kde_output_device_mode_v2 */
822-
// static inline void *
823-
// kde_output_device_mode_v2_get_user_data(struct kde_output_device_mode_v2 *kde_output_device_mode_v2)
824-
// {
825-
// return wl_proxy_get_user_data((struct wl_proxy *) kde_output_device_mode_v2);
826-
// }
894+
/** @ingroup iface_kde_output_device_mode_v2 */
895+
static inline void *
896+
kde_output_device_mode_v2_get_user_data(struct kde_output_device_mode_v2 *kde_output_device_mode_v2)
897+
{
898+
return wl_proxy_get_user_data((struct wl_proxy *) kde_output_device_mode_v2);
899+
}
827900

828-
// static inline uint32_t
829-
// kde_output_device_mode_v2_get_version(struct kde_output_device_mode_v2 *kde_output_device_mode_v2)
830-
// {
831-
// return wl_proxy_get_version((struct wl_proxy *) kde_output_device_mode_v2);
832-
// }
901+
static inline uint32_t
902+
kde_output_device_mode_v2_get_version(struct kde_output_device_mode_v2 *kde_output_device_mode_v2)
903+
{
904+
return wl_proxy_get_version((struct wl_proxy *) kde_output_device_mode_v2);
905+
}
833906

834-
// /** @ingroup iface_kde_output_device_mode_v2 */
835-
// static inline void
836-
// kde_output_device_mode_v2_destroy(struct kde_output_device_mode_v2 *kde_output_device_mode_v2)
837-
// {
838-
// wl_proxy_destroy((struct wl_proxy *) kde_output_device_mode_v2);
839-
// }
907+
/** @ingroup iface_kde_output_device_mode_v2 */
908+
static inline void
909+
kde_output_device_mode_v2_destroy(struct kde_output_device_mode_v2 *kde_output_device_mode_v2)
910+
{
911+
wl_proxy_destroy((struct wl_proxy *) kde_output_device_mode_v2);
912+
}
840913

841914
#ifdef __cplusplus
842915
}

src/detection/displayserver/linux/wayland/kde-output-device-v2-protocol.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifdef FF_HAVE_WAYLAND
22

3-
/* Generated by wayland-scanner 1.22.0 */
3+
/* Generated by wayland-scanner 1.23.1 */
44

55
/*
66
* SPDX-FileCopyrightText: 2008-2011 Kristian Høgsberg
@@ -12,6 +12,7 @@
1212
* SPDX-License-Identifier: MIT-CMU
1313
*/
1414

15+
#include <stdbool.h>
1516
#include <stdlib.h>
1617
#include <stdint.h>
1718
#include <wayland-util.h>
@@ -57,12 +58,14 @@ static const struct wl_message kde_output_device_v2_events[] = {
5758
{ "sdr_gamut_wideness", "6u", kde_output_device_v2_types + 0 },
5859
{ "color_profile_source", "7u", kde_output_device_v2_types + 0 },
5960
{ "brightness", "8u", kde_output_device_v2_types + 0 },
61+
{ "color_power_tradeoff", "10u", kde_output_device_v2_types + 0 },
62+
{ "dimming", "11u", kde_output_device_v2_types + 0 },
6063
};
6164

6265
WL_EXPORT const struct wl_interface kde_output_device_v2_interface = {
63-
"kde_output_device_v2", 8,
66+
"kde_output_device_v2", 11,
6467
0, NULL,
65-
25, kde_output_device_v2_events,
68+
27, kde_output_device_v2_events,
6669
};
6770

6871
static const struct wl_message kde_output_device_mode_v2_events[] = {

src/detection/displayserver/linux/wayland/kde-output.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ static struct kde_output_device_v2_listener outputListener = {
163163
.sdr_gamut_wideness = (void*) stubListener,
164164
.color_profile_source = (void*) stubListener,
165165
.brightness = (void*) stubListener,
166+
.color_power_tradeoff = (void*) stubListener,
167+
.dimming = (void*) stubListener,
166168
};
167169

168170
void ffWaylandHandleKdeOutput(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version)

0 commit comments

Comments
 (0)