From 0dd55a90dfc0073f9432635a621c3ec6d2d9bca9 Mon Sep 17 00:00:00 2001 From: "John Hodge (sonata)" Date: Sun, 28 Dec 2014 10:39:14 +0800 Subject: [PATCH] Usermode/AxWin4 - Minor cleanups (change background colour, remove commented lines) --- Usermode/Applications/axwin4_src/Server/compositor.cpp | 1 + Usermode/Applications/axwin4_src/Server/ipc.cpp | 2 +- Usermode/Applications/axwin4_src/UI/main.c | 2 +- Usermode/Applications/axwin4_src/UI/taskbar.c | 5 ----- .../Libraries/libaxwin4.so_src/include_exp/axwin4/axwin.h | 8 ++++++++ 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Usermode/Applications/axwin4_src/Server/compositor.cpp b/Usermode/Applications/axwin4_src/Server/compositor.cpp index cf8192ec..e488380f 100644 --- a/Usermode/Applications/axwin4_src/Server/compositor.cpp +++ b/Usermode/Applications/axwin4_src/Server/compositor.cpp @@ -134,6 +134,7 @@ void CCompositor::MouseButton(unsigned int Cursor, unsigned int X, unsigned int void CCompositor::KeyState(unsigned int KeyboardID, uint32_t KeySym, bool Press, uint32_t Codepoint) { _SysDebug("KeyState(%i, 0x%x, %b, 0x%x)", KeyboardID, KeySym, Press, Codepoint); + // TODO: Global hotkeys if( m_focussed_window ) { m_focussed_window->KeyEvent(KeySym, "", Press); diff --git a/Usermode/Applications/axwin4_src/Server/ipc.cpp b/Usermode/Applications/axwin4_src/Server/ipc.cpp index 059e90e1..f522ac22 100644 --- a/Usermode/Applications/axwin4_src/Server/ipc.cpp +++ b/Usermode/Applications/axwin4_src/Server/ipc.cpp @@ -120,7 +120,7 @@ void SendMessage_MouseButton(CClient& client, unsigned int WinID, unsigned int X } void SendMessage_MouseMove(CClient& client, unsigned int WinID, unsigned int X, unsigned int Y) { - _SysDebug("TODO: IPC::SendMessage_MouseButton"); + _SysDebug("TODO: IPC::SendMessage_MouseMove"); } void SendMessage_KeyEvent(CClient& client, unsigned int WinID, uint32_t KeySym, bool Pressed, const char *Translated) { diff --git a/Usermode/Applications/axwin4_src/UI/main.c b/Usermode/Applications/axwin4_src/UI/main.c index 8577a26b..624e381a 100644 --- a/Usermode/Applications/axwin4_src/UI/main.c +++ b/Usermode/Applications/axwin4_src/UI/main.c @@ -59,7 +59,7 @@ tAxWin4_Window *CreateBGWin(int w, int h) } else { - AxWin4_FillRect(bgwin, 0, 0, w, h, 0x0000CC); + AxWin4_FillRect(bgwin, 0, 0, w, h, 0x8888CC); } //AxWin4_DamageRect(bgwin, 0, 0, w, h); AxWin4_ShowWindow(bgwin, true); diff --git a/Usermode/Applications/axwin4_src/UI/taskbar.c b/Usermode/Applications/axwin4_src/UI/taskbar.c index f6261d4e..b62a0420 100644 --- a/Usermode/Applications/axwin4_src/UI/taskbar.c +++ b/Usermode/Applications/axwin4_src/UI/taskbar.c @@ -84,12 +84,7 @@ void Taskbar_Redraw(void) strftime(timestr, 5, "%H%M", localtime(&rawtime)); //AxWin4_DrawControl(gpTaskbar_Window, clock_start_x, TASKBAR_BORDER, TASKBAR_CLOCKSIZE, active_height, AXWIN4_CTL_BOX); - //unsigned int clock_height = 16; // Hard-code the standard font height - //unsigned int clock_yofs = (active_height - clock_height)/2; - //AxWin4_DrawText(gpTaskbar_Window, clock_start_x, TASKBAR_BORDER + clock_yofs, TASKBAR_CLOCKSIZE, clock_height, 0, timestr); AxWin4_DrawText(gpTaskbar_Window, clock_start_x, TASKBAR_BORDER, TASKBAR_CLOCKSIZE, active_height, 0, timestr); - - //AxWin4_DrawText(gpTaskbar_Window, clock_start_x, TASKBAR_BORDER, TASKBAR_CLOCKSIZE, 16, 0, timestr); } AxWin4_DamageRect(gpTaskbar_Window, 0, 0, w, h); diff --git a/Usermode/Libraries/libaxwin4.so_src/include_exp/axwin4/axwin.h b/Usermode/Libraries/libaxwin4.so_src/include_exp/axwin4/axwin.h index 14b25f07..255b0e1d 100644 --- a/Usermode/Libraries/libaxwin4.so_src/include_exp/axwin4/axwin.h +++ b/Usermode/Libraries/libaxwin4.so_src/include_exp/axwin4/axwin.h @@ -28,6 +28,14 @@ extern void AxWin4_GetScreenDimensions(unsigned int ScreenIndex, unsigned int *W extern tAxWin4_Window *AxWin4_CreateWindow(const char *Name); extern void AxWin4_DestroyWindow(tAxWin4_Window *Window); + +// Callbacks +typedef int tAxWin4_KeyCallback(tAxWin4_Window* Winow, unsigned int Key, const char *Translated); +extern void AxWin4_SetCallback_Key(tAxWin4_Window* Window, tAxWin4_KeyCallback* cb); +typedef int tAxWin4_MouseBtnCallback(tAxWin4_Window* Winow, unsigned int Mouse, unsigned int X, unsigned int Y, unsigned int Button, bool IsPress); +extern void AxWin4_SetCallback_MouseBtn(tAxWin4_Window* Window, tAxWin4_MouseBtnCallback* cb); +typedef int tAxWin4_MouseMoveCallback(tAxWin4_Window* Winow, unsigned int Mouse, unsigned int X, unsigned int Y); + extern void AxWin4_ShowWindow(tAxWin4_Window *Window, bool Shown); extern void AxWin4_SetWindowFlags(tAxWin4_Window *Window, unsigned int NewFlags); extern void AxWin4_SetTitle(tAxWin4_Window *Window, const char *Title); -- 2.20.1