1 #include "desktop/widget.h"
2 #include "io/serial_port.h"
6 Widget_t* new_bare_widget(renderer_func_t renderer, destroyer_func_t destroyer,
size_t x,
size_t y,
size_t width,
size_t height) {
12 wgt->renderer = renderer;
13 wgt->destroyer = destroyer;
20 void destroy_widget(
Widget_t* widget) {
21 qemu_log(
"Destroying widget at %x: W: %d; H: %d", widget, widget->width, widget->height);
22 widget->destroyer(widget);
24 qemu_ok(
"Destroyed widget");
27 void widget_notify(
struct Window* window,
struct Widget* widget, WidgetNotifyCode_t code,
void* data) {
28 qemu_log(
"Reached widget_notify()");
29 qemu_log(
"Got WIDGET notifcation: (WINDOW@%v)(id: %d) (WIDGET@%v) (CODE: %s)",
33 (code == WIDGET_CLICK ?
39 if(code == WIDGET_CLICK) {
40 qemu_log(
"Code check: onclick at %x", widget->on_click);
41 if(widget->on_click) {
42 qemu_log(
"On Click: %x", widget->on_click);
44 qemu_log(
"Returning from on_click");
46 qemu_log(
"Function widget->on_click not defined!!!");