2022-05-21 11:02:23 +00:00
|
|
|
/**
|
|
|
|
|
* Copyright 2022 Eugenio Paolantonio (g7)
|
2024-01-12 09:51:43 +01:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2022-05-21 11:02:23 +00:00
|
|
|
*/
|
|
|
|
|
|
2024-01-25 09:59:45 +00:00
|
|
|
|
2022-05-21 11:02:23 +00:00
|
|
|
#include "backends.h"
|
|
|
|
|
|
2025-09-27 23:23:41 +03:00
|
|
|
#include "log.h"
|
2024-03-28 13:44:33 +01:00
|
|
|
|
2022-05-21 11:02:23 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
|
2025-09-27 23:23:41 +03:00
|
|
|
static const char *backends[] = {
|
2024-01-25 09:59:45 +00:00
|
|
|
#if LV_USE_LINUX_FBDEV
|
2022-05-21 11:02:23 +00:00
|
|
|
"fbdev",
|
2025-09-27 23:23:41 +03:00
|
|
|
#endif
|
2024-01-25 09:59:45 +00:00
|
|
|
#if LV_USE_LINUX_DRM
|
2022-05-21 11:02:23 +00:00
|
|
|
"drm",
|
2025-11-29 21:37:51 +01:00
|
|
|
#endif
|
|
|
|
|
#if LV_USE_SDL
|
|
|
|
|
"sdl",
|
2025-09-27 23:23:41 +03:00
|
|
|
#endif
|
2022-05-21 11:02:23 +00:00
|
|
|
NULL
|
|
|
|
|
};
|
|
|
|
|
|
2025-09-23 01:48:35 -07:00
|
|
|
bbx_backends_backend_id_t bbx_backends_find_backend_with_name(const char *name) {
|
2025-09-27 23:23:41 +03:00
|
|
|
for (int i = 0; backends[i] != NULL; ++i) {
|
|
|
|
|
if (strcmp(backends[i], name) == 0) {
|
2024-03-30 20:52:01 +01:00
|
|
|
bbx_log(BBX_LOG_LEVEL_VERBOSE, "Found backend: %s\n", name);
|
2022-05-21 11:02:23 +00:00
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-30 20:52:01 +01:00
|
|
|
bbx_log(BBX_LOG_LEVEL_WARNING, "Backend %s not found\n", name);
|
2025-09-23 01:48:35 -07:00
|
|
|
return BBX_BACKENDS_BACKEND_NONE;
|
2022-05-21 11:02:23 +00:00
|
|
|
}
|