XenevaOS
Loading...
Searching...
No Matches
button.h
Go to the documentation of this file.
1
30#ifndef __BUTTON_H__
31#define __BUTTON_H__
32
33#include <stdint.h>
34#include <stdarg.h>
35#include <chitralekha.h>
36#include <widgets\window.h>
37
49
50typedef struct _button_ {
51 int x;
52 int y;
53 int w;
54 int h;
57 bool clicked;
58 bool hover;
61 char* title;
62 char* appname;
63 char* param;
64 bool focused;
66 void(*actionHandler)(_button_* button, ChWindow*);
67 void(*mouseEvent)(_button_* button, ChWindow* win, int x, int y, int but);
69 void(*destroy)(_button_* button, ChWindow* win);
71
72/*
73* CreateLaunchButton -- creates a new launch button
74* @param x -- X coordinate, if no grid, it needs to set manually
75* @param y -- Y coordinate, if no grid, it needs to set manually
76* @param w -- width of the button
77* @param h -- height of the button
78* @param title -- title of the button
79* @param appname -- name of the application associated with this
80* button
81*/
82LaunchButton *CreateLaunchButton(int x, int y, int w, int h, char* title, char* appname);
83
84ButtonIcon* CreateLaunchButtonIcon(char* iconfile, LaunchButton* button);
85
86#endif
ButtonIcon * CreateLaunchButtonIcon(char *iconfile, LaunchButton *button)
Definition button.cpp:173
LaunchButton * CreateLaunchButton(int x, int y, int w, int h, char *title, char *appname)
Definition button.cpp:153
struct _button_ LaunchButton
struct _ButtonIcon_ ButtonIcon
unsigned int uint32_t
Definition acefiex.h:163
unsigned char uint8_t
Definition acefiex.h:161
ChWindow * win
Definition namdapha.cpp:45
Definition button.h:38
int usageCount
Definition button.h:47
char * filename
Definition button.h:39
int iconBpp
Definition button.h:42
uint32_t fileSize
Definition button.h:46
int iconWidth
Definition button.h:40
uint8_t * fileBuffer
Definition button.h:44
int iconFd
Definition button.h:43
uint8_t * imageData
Definition button.h:45
int iconHeight
Definition button.h:41
Definition button.h:50
char * appname
Definition button.h:62
int w
Definition button.h:53
void(* destroy)(_button_ *button, ChWindow *win)
Definition button.h:69
void(* actionHandler)(_button_ *button, ChWindow *)
Definition button.h:66
void(* drawLaunchButton)(_button_ *button, ChWindow *win)
Definition button.h:68
ButtonIcon * buttonIcon
Definition button.h:65
char * param
Definition button.h:63
int last_mouse_y
Definition button.h:56
int y
Definition button.h:52
int last_mouse_x
Definition button.h:55
int h
Definition button.h:54
char * title
Definition button.h:61
bool focused
Definition button.h:64
bool hover_painted
Definition button.h:59
bool clicked
Definition button.h:57
bool kill_focus
Definition button.h:60
void(* mouseEvent)(_button_ *button, ChWindow *win, int x, int y, int but)
Definition button.h:67
int x
Definition button.h:51
bool hover
Definition button.h:58
Definition window.h:90