start on jtk module

This commit is contained in:
Josh Holtrop 2018-07-25 22:04:57 -04:00
parent e7acf05cc4
commit 5d6c6b0e0f
2 changed files with 54 additions and 0 deletions

View File

@ -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
View 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
{
}