X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin2_src%2FShell_src%2Fmain.c;h=f1c0416be9713795b8d7c5bc3a767ebeeaa57f02;hb=ada42e7583b4fa07b30d5c1a3e813c9754ec5e0f;hp=b357dea5b734004c19845b72e21b16672596d45d;hpb=872dbea3900b09c78092d3cdf035513f400bcfe8;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin2_src/Shell_src/main.c b/Usermode/Applications/axwin2_src/Shell_src/main.c index b357dea5..f1c0416b 100644 --- a/Usermode/Applications/axwin2_src/Shell_src/main.c +++ b/Usermode/Applications/axwin2_src/Shell_src/main.c @@ -1,21 +1,50 @@ /* - * Acess2 GUI Shell + * Acess2 GUI Test App * - By John Hodge (thePowersGang) */ -#include +#include +#include +#include + +// === CONSTANTS === +enum eTerminal_Events +{ + EVENT_NULL, + EVENT_NEW_TAB, + EVENT_CLOSE_TAB, + EVENT_EXIT +}; // === PROTOTYPES === int main(int argc, char *argv[]); - int Menubar_HandleMessage(tAxWin_Message *Message); + int Global_HandleMessage(tAxWin_Message *Message); + int Shell_HandleMessage(tAxWin_Message *Message); // === GLOBALS === -tAxWin_Handle ghMenubarWindow; +tAxWin_Element *geConsole; // === CODE === int main(int argc, char *argv[]) -{ - // Create Window - ghMenubarWindow = AxWin_CreateWindow(0, 0, -1, -1, WINFLAG_NOBORDER, Menubar_HandleMessage); +{ + tAxWin_Element *menu, *tab; + + if(argc != 1) + { + fprintf(stderr, "Usage: %s\n", argv[0]); + fprintf(stderr, "\tThis application takes no arguments\n"); + return 0; + } + + AxWin_Register("Terminal", Global_HandleMessage); + + menu = AxWin_AddMenuItem(NULL, "File", 0); + AxWin_AddMenuItem(menu, "&New Tab\tCtrl-Shift-N", EVENT_NEW_TAB); + AxWin_AddMenuItem(menu, NULL, 0); + AxWin_AddMenuItem(menu, "&Close Tab\tCtrl-Shift-W", EVENT_CLOSE_TAB); + AxWin_AddMenuItem(menu, "E&xit\tAlt-F4", EVENT_EXIT); + + tab = AxWin_CreateWindow("root@acess: ~"); + //geConsole = AxWin_CreateElement(); AxWin_MessageLoop(); @@ -24,7 +53,20 @@ int main(int argc, char *argv[]) /** */ -int Menubar_HandleMessage(tAxWin_Message *Message) +int Global_HandleMessage(tAxWin_Message *Message) { - return 0; + switch(Message->ID) + { + default: + return 0; + } +} + +int Shell_HandleMessage(tAxWin_Message *Message) +{ + switch(Message->ID) + { + default: + return 0; + } }