summaryrefslogtreecommitdiff
path: root/src/gui/desktop.h
blob: 09a2d752666c8c4d12a084a0c8ae18cd8cd934e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef DESKTOP_H
#define DESKTOP_H

#include "composite_widget.h"

#define MAX_NOF_WIDGET_CHILDREN 100

#include <stdbool.h>

typedef struct {
	composite_widget_vtable_t base;
} desktop_vtable_t;

typedef struct {
	composite_widget_t base;
	int mouse_x;
	int mouse_y;
	bool needs_redrawing;
} desktop_t;

void desktop_init( desktop_t *widget, const int w, const int h, const vga_color_t background_color );

void desktop_draw( void *obj, graphics_context_t *context );
void desktop_on_mouse_down( void *obj, const int x, const int y );
void desktop_on_mouse_up( void *obj, const int x, const int y );
void desktop_on_mouse_move( void *obj, const int old_x, const int old_y, const int x, const int y );
void desktop_on_key_down( void *obj, char c );

#endif // DESKTOP_H