You've already forked meshtastic-device-ui
mirror of
https://github.com/m5stack/meshtastic-device-ui.git
synced 2026-05-20 11:51:03 -07:00
1d46e59518
* fix warnings
31 lines
780 B
C++
31 lines
780 B
C++
#ifdef USE_X11
|
|
#include "graphics/driver/X11Driver.h"
|
|
#include "util/ILog.h"
|
|
#include <stdio.h>
|
|
|
|
LV_IMG_DECLARE(mouse_cursor_icon);
|
|
|
|
X11Driver *X11Driver::x11driver = nullptr;
|
|
|
|
X11Driver &X11Driver::create(uint16_t width, uint16_t height)
|
|
{
|
|
if (!x11driver)
|
|
x11driver = new X11Driver(width, height);
|
|
return *x11driver;
|
|
}
|
|
|
|
X11Driver::X11Driver(uint16_t width, uint16_t height) : DisplayDriver(width, height) {}
|
|
|
|
void X11Driver::init(DeviceGUI *gui)
|
|
{
|
|
ILOG_DEBUG("X11Driver::init...");
|
|
// Initialize LVGL
|
|
DisplayDriver::init(gui);
|
|
|
|
char title[25];
|
|
sprintf(title, "Meshtastic (%dx%d)", screenWidth, screenHeight);
|
|
display = lv_x11_window_create(title, screenWidth, screenHeight);
|
|
lv_x11_inputs_create(display, &mouse_cursor_icon);
|
|
}
|
|
|
|
#endif |