start on jtk module
This commit is contained in:
parent
e7acf05cc4
commit
5d6c6b0e0f
@ -2,5 +2,6 @@ Rscons::Environment.new do |env|
|
||||
env["sources"] = Dir[
|
||||
"src/**/*.d",
|
||||
"src/**/*.c"]
|
||||
env["D_IMPORT_PATH"] += Dir["src/**/"]
|
||||
env.Program("#{env.build_root}/jes", "${sources}")
|
||||
end
|
||||
|
53
src/gui/jtk.d
Normal file
53
src/gui/jtk.d
Normal file
@ -0,0 +1,53 @@
|
||||
struct Event
|
||||
{
|
||||
enum Type : ubyte
|
||||
{
|
||||
WINDOW_CLOSE,
|
||||
WINDOW_EXPOSE,
|
||||
KEY_PRESS,
|
||||
KEY_RELEASE,
|
||||
BUTTON_PRESS,
|
||||
BUTTON_RELEASE,
|
||||
TIMER,
|
||||
WINDOW_RESIZE,
|
||||
};
|
||||
|
||||
struct KeyEvent
|
||||
{
|
||||
bool repeat;
|
||||
uint key;
|
||||
uint x_keycode;
|
||||
};
|
||||
|
||||
struct ButtonEvent
|
||||
{
|
||||
uint mods;
|
||||
ubyte button;
|
||||
};
|
||||
|
||||
struct TimerEvent
|
||||
{
|
||||
uint timer_id;
|
||||
void * user1;
|
||||
void * user2;
|
||||
};
|
||||
|
||||
struct WindowResizeEvent
|
||||
{
|
||||
uint width;
|
||||
uint height;
|
||||
};
|
||||
|
||||
Type type;
|
||||
union
|
||||
{
|
||||
KeyEvent key;
|
||||
ButtonEvent button;
|
||||
TimerEvent timer;
|
||||
WindowResizeEvent resize;
|
||||
};
|
||||
}
|
||||
|
||||
class Window
|
||||
{
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user