This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpanel.h
83 lines (68 loc) · 2.1 KB
/
panel.h
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/**
* @brief Panel extensions header
*
* Exposed API for the panel
*
* @copyright
* This file is part of SiriusOS and is released under the terms
* of the NCSA / University of Illinois License - see LICENSE.md
* Copyright (C) 2021 K. Lange
* Copyright (C) 2024 Gamma Microsystems
*/
#pragma once
#include <_cheader.h>
#include <stdint.h>
#include <sirius/yutani-ng.h>
#include <sirius/text.h>
_Begin_C_Header
struct PanelContext {
uint32_t color_text_normal;
uint32_t color_text_hilighted;
uint32_t color_text_focused;
uint32_t color_icon_normal;
uint32_t color_special;
int font_size_default;
yutani_window_t * basewindow;
struct TT_Font * font;
struct TT_Font * font_bold;
struct TT_Font * font_mono;
struct TT_Font * font_mono_bold;
int extra_widget_spacing;
};
struct PanelWidget {
struct PanelContext * pctx;
int highlighted;
int left;
int width;
int fill;
int (*click)(struct PanelWidget *, struct yutani_msg_window_mouse_event *);
int (*right_click)(struct PanelWidget *, struct yutani_msg_window_mouse_event *);
int (*leave)(struct PanelWidget *, struct yutani_msg_window_mouse_event *);
int (*enter)(struct PanelWidget *, struct yutani_msg_window_mouse_event *);
int (*move)(struct PanelWidget *, struct yutani_msg_window_mouse_event *);
int (*draw)(struct PanelWidget *, gfx_context_t * ctx);
int (*update)(struct PanelWidget *, int *force_updates);
int (*onkey)(struct PanelWidget *, struct yutani_msg_key_event *);
};
extern yutani_t * yctx;
extern list_t * widgets_enabled;
extern struct PanelWidget * widget_new(void);
extern void launch_application_menu(struct MenuEntry * self);
struct window_ad {
yutani_wid_t wid;
uint32_t flags;
char * name;
char * icon;
char * strings;
int left;
uint32_t bufid;
uint32_t width;
uint32_t height;
};
extern struct window_ad * ads_by_z[];
extern list_t * window_list;
extern void redraw(void);
extern int panel_menu_show(struct PanelWidget * this, struct MenuList * menu);
extern int panel_menu_show_at(struct MenuList * menu, int x);
extern void panel_highlight_widget(struct PanelWidget * this, gfx_context_t * ctx, int active);
_End_C_Header