-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwidget.h
More file actions
36 lines (35 loc) · 1.09 KB
/
Copy pathwidget.h
File metadata and controls
36 lines (35 loc) · 1.09 KB
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
#ifndef _WIDGET_H_
#define _WIDGET_H_
#include "wrstruct.h"
#include "color.h"
#include "list.h"
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <commctrl.h>
typedef struct wwWidget wwWidget;
typedef void (*wwWidgetCallback)(wwWidget *widget, wwWindowAndRenderer *windowAndRenderer);
struct wwWidget
{
HWND window;
wchar_t *text;
int x;
int y;
int width;
int height;
unsigned short id;
unsigned short widgetId;
wwWidgetCallback callback;
void *userData;
};
void wwWidget_Create(wwWidget *widget, wchar_t *text, int x, int y, int width, int height);
void wwWidget_SetCallback(wwWidget *widget, wwWidgetCallback callback, void *userData);
void wwWidget_SetText(wwWidget *widget, wchar_t *text);
void wwWidget_SetX(wwWidget *widget, int x);
void wwWidget_SetY(wwWidget *widget, int y);
void wwWidget_SetWidth(wwWidget *widget, int width);
void wwWidget_SetHeight(wwWidget *widget, int height);
void wwWidget_FreeFunc(void *data);
/* returns malloc() pointer, should free() after usage */
wchar_t* wwWidget_GetText(wwWidget *widget);
#endif /* _WIDGET_H_ */