Skip to content

Commit 758f352

Browse files
authored
[WRAPPER] Added 2 more wayland listeners (#3980)
Needed by Wine-Wayland in GE-Proton10-34
1 parent 274c5a8 commit 758f352

1 file changed

Lines changed: 111 additions & 0 deletions

File tree

src/wrapped/wrappedwaylandclient.c

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,10 +1143,117 @@ static void* find_zxdg_toplevel_decoration_v1_listener_Fct(void* fct)
11431143
printf_log(LOG_NONE, "Warning, no more slot for wayland-client zxdg_toplevel_decoration_v1_listener_listener callback\n");
11441144
return NULL;
11451145
}
1146+
// wp_color_manager_v1 ...
1147+
typedef struct my_wp_color_manager_v1_listener_s {
1148+
uintptr_t supported_intent; // vFppu
1149+
uintptr_t supported_feature; // vFppu
1150+
uintptr_t supported_tf_named; // vFppu
1151+
uintptr_t supported_primaries_named; // vFppu
1152+
uintptr_t done; // vFpp
1153+
} my_wp_color_manager_v1_listener_t;
1154+
#define GO(A) \
1155+
static my_wp_color_manager_v1_listener_t* ref_wp_color_manager_v1_listener_##A = NULL; \
1156+
static void my_wp_color_manager_v1_listener_supported_intent_##A(void* a, void* b, uint32_t c) \
1157+
{ \
1158+
RunFunctionFmt(ref_wp_color_manager_v1_listener_##A->supported_intent, "ppu", a, b, c); \
1159+
} \
1160+
static void my_wp_color_manager_v1_listener_supported_feature_##A(void* a, void* b, uint32_t c) \
1161+
{ \
1162+
RunFunctionFmt(ref_wp_color_manager_v1_listener_##A->supported_feature, "ppu", a, b, c); \
1163+
} \
1164+
static void my_wp_color_manager_v1_listener_supported_tf_named_##A(void* a, void* b, uint32_t c) \
1165+
{ \
1166+
RunFunctionFmt(ref_wp_color_manager_v1_listener_##A->supported_tf_named, "ppu", a, b, c); \
1167+
} \
1168+
static void my_wp_color_manager_v1_listener_supported_primaries_named_##A(void* a, void* b, uint32_t c) \
1169+
{ \
1170+
RunFunctionFmt(ref_wp_color_manager_v1_listener_##A->supported_primaries_named, "ppu", a, b, c); \
1171+
} \
1172+
static void my_wp_color_manager_v1_listener_done_##A(void* a, void* b) \
1173+
{ \
1174+
RunFunctionFmt(ref_wp_color_manager_v1_listener_##A->done, "pp", a, b); \
1175+
} \
1176+
static my_wp_color_manager_v1_listener_t my_wp_color_manager_v1_listener_fct_##A = { \
1177+
(uintptr_t)my_wp_color_manager_v1_listener_supported_intent_##A, \
1178+
(uintptr_t)my_wp_color_manager_v1_listener_supported_feature_##A, \
1179+
(uintptr_t)my_wp_color_manager_v1_listener_supported_tf_named_##A, \
1180+
(uintptr_t)my_wp_color_manager_v1_listener_supported_primaries_named_##A, \
1181+
(uintptr_t)my_wp_color_manager_v1_listener_done_##A, \
1182+
};
1183+
SUPER()
1184+
#undef GO
1185+
static void* find_wp_color_manager_v1_listener_Fct(void* fct)
1186+
{
1187+
if (!fct) return fct;
1188+
#define GO(A) \
1189+
if (ref_wp_color_manager_v1_listener_##A == fct) return &my_wp_color_manager_v1_listener_fct_##A;
1190+
SUPER()
1191+
#undef GO
1192+
#define GO(A) \
1193+
if (ref_wp_color_manager_v1_listener_##A == 0) { \
1194+
ref_wp_color_manager_v1_listener_##A = fct; \
1195+
return &my_wp_color_manager_v1_listener_fct_##A; \
1196+
}
1197+
SUPER()
1198+
#undef GO
1199+
printf_log(LOG_NONE, "Warning, no more slot for wayland-client wp_color_manager_v1_listener callback\n");
1200+
return NULL;
1201+
}
1202+
// ext_data_control_device_v1 ...
1203+
typedef struct my_ext_data_control_device_v1_listener_s {
1204+
uintptr_t data_offer; // vFppp
1205+
uintptr_t selection; // vFppp
1206+
uintptr_t finished; // vFpp
1207+
uintptr_t primary_selection; // vFppp
1208+
} my_ext_data_control_device_v1_listener_t;
1209+
#define GO(A) \
1210+
static my_ext_data_control_device_v1_listener_t* ref_ext_data_control_device_v1_listener_##A = NULL; \
1211+
static void my_ext_data_control_device_v1_listener_data_offer_##A(void* a, void* b, void* c) \
1212+
{ \
1213+
RunFunctionFmt(ref_ext_data_control_device_v1_listener_##A->data_offer, "ppp", a, b, c); \
1214+
} \
1215+
static void my_ext_data_control_device_v1_listener_selection_##A(void* a, void* b, void* c) \
1216+
{ \
1217+
RunFunctionFmt(ref_ext_data_control_device_v1_listener_##A->selection, "ppp", a, b, c); \
1218+
} \
1219+
static void my_ext_data_control_device_v1_listener_finished_##A(void* a, void* b) \
1220+
{ \
1221+
RunFunctionFmt(ref_ext_data_control_device_v1_listener_##A->finished, "pp", a, b); \
1222+
} \
1223+
static void my_ext_data_control_device_v1_listener_primary_selection_##A(void* a, void* b, void* c) \
1224+
{ \
1225+
RunFunctionFmt(ref_ext_data_control_device_v1_listener_##A->primary_selection, "ppp", a, b, c); \
1226+
} \
1227+
static my_ext_data_control_device_v1_listener_t my_ext_data_control_device_v1_listener_fct_##A = { \
1228+
(uintptr_t)my_ext_data_control_device_v1_listener_data_offer_##A, \
1229+
(uintptr_t)my_ext_data_control_device_v1_listener_selection_##A, \
1230+
(uintptr_t)my_ext_data_control_device_v1_listener_finished_##A, \
1231+
(uintptr_t)my_ext_data_control_device_v1_listener_primary_selection_##A, \
1232+
};
1233+
SUPER()
1234+
#undef GO
1235+
static void* find_ext_data_control_device_v1_listener_Fct(void* fct)
1236+
{
1237+
if (!fct) return fct;
1238+
#define GO(A) \
1239+
if (ref_ext_data_control_device_v1_listener_##A == fct) return &my_ext_data_control_device_v1_listener_fct_##A;
1240+
SUPER()
1241+
#undef GO
1242+
#define GO(A) \
1243+
if (ref_ext_data_control_device_v1_listener_##A == 0) { \
1244+
ref_ext_data_control_device_v1_listener_##A = fct; \
1245+
return &my_ext_data_control_device_v1_listener_fct_##A; \
1246+
}
1247+
SUPER()
1248+
#undef GO
1249+
printf_log(LOG_NONE, "Warning, no more slot for wayland-client ext_data_control_device_v1_listener callback\n");
1250+
return NULL;
1251+
}
11461252
#undef SUPER
11471253

11481254
EXPORT int my_wl_proxy_add_listener(x64emu_t* emu, void* proxy, void** l, void* data)
11491255
{
1256+
if (!proxy) return -1;
11501257
const char* proxy_name = **(const char***)proxy;
11511258
if(!strcmp(proxy_name, "wl_registry")) {
11521259
l = find_wl_registry_listener_Fct(l);
@@ -1200,6 +1307,10 @@ EXPORT int my_wl_proxy_add_listener(x64emu_t* emu, void* proxy, void** l, void*
12001307
l = find_wp_image_description_info_v1_listener_Fct(l);
12011308
} else if (!strcmp(proxy_name, "zxdg_toplevel_decoration_v1")) {
12021309
l = find_zxdg_toplevel_decoration_v1_listener_Fct(l);
1310+
} else if (!strcmp(proxy_name, "wp_color_manager_v1")) {
1311+
l = find_wp_color_manager_v1_listener_Fct(l);
1312+
} else if (!strcmp(proxy_name, "ext_data_control_device_v1")) {
1313+
l = find_ext_data_control_device_v1_listener_Fct(l);
12031314
} else
12041315
printf_log(LOG_INFO, "Error, Wayland-client, add_listener to %s unknown, will crash soon!\n", proxy_name);
12051316
return my->wl_proxy_add_listener(proxy, l, data);

0 commit comments

Comments
 (0)