hyprcursor/tests/test.c

36 lines
893 B
C
Raw Normal View History

2024-03-07 17:36:26 +01:00
#include <hyprcursor/hyprcursor.h>
2024-03-07 16:10:45 +01:00
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
struct hyprcursor_manager_t* mgr = hyprcursor_manager_create(NULL);
if (!mgr) {
printf("mgr null\n");
return 1;
}
struct hyprcursor_cursor_style_info info = {.size = 48};
if (!hyprcursor_load_theme_style(mgr, info)) {
printf("load failed\n");
return 1;
}
2024-03-07 17:36:26 +01:00
int dataSize = 0;
hyprcursor_cursor_image_data** data = hyprcursor_get_cursor_image_data(mgr, "left_ptr", info, &dataSize);
2024-03-07 17:01:45 +01:00
if (data == NULL) {
printf("data failed\n");
2024-03-07 16:10:45 +01:00
return 1;
}
2024-03-07 17:01:45 +01:00
int ret = cairo_surface_write_to_png(data[0]->surface, "/tmp/arrowC.png");
hyprcursor_cursor_image_data_free(data, dataSize);
2024-03-07 16:10:45 +01:00
if (ret) {
printf("cairo failed\n");
return 1;
}
return 0;
}