AxWin2 - Huge changes, getting to the working point
[tpg/acess2.git] / Usermode / Applications / axwin2_src / Shell_src / main.c
1 /*
2  * Acess2 GUI Test App
3  * - By John Hodge (thePowersGang)
4  */
5 #include <axwin2/axwin.h>
6 #include <stdlib.h>
7 #include <stdio.h>
8
9 // === CONSTANTS ===
10 enum eTerminal_Events
11 {
12         EVENT_NULL,
13         EVENT_NEW_TAB,
14         EVENT_CLOSE_TAB,
15         EVENT_EXIT
16 };
17
18 // === PROTOTYPES ===
19  int    main(int argc, char *argv[]);
20  int    Global_HandleMessage(tAxWin_Message *Message);
21  int    Shell_HandleMessage(tAxWin_Message *Message);
22
23 // === GLOBALS ===
24 tAxWin_Element  *geConsole;
25
26 // === CODE ===
27 int main(int argc, char *argv[])
28 {
29         tAxWin_Element  *menu, *tab;
30         
31         if(argc != 1)
32         {
33                 fprintf(stderr, "Usage: %s\n", argv[0]);
34                 fprintf(stderr, "\tThis application takes no arguments\n");
35                 return 0;
36         }
37
38         AxWin_Register("Terminal", Global_HandleMessage);
39
40         menu = AxWin_AddMenuItem(NULL, "File", 0);
41         AxWin_AddMenuItem(menu, "&New Tab\tCtrl-Shift-N", EVENT_NEW_TAB);
42         AxWin_AddMenuItem(menu, NULL, 0);
43         AxWin_AddMenuItem(menu, "&Close Tab\tCtrl-Shift-W", EVENT_CLOSE_TAB);
44         AxWin_AddMenuItem(menu, "E&xit\tAlt-F4", EVENT_EXIT);
45
46         tab = AxWin_CreateTab("root@acess: ~");
47         //geConsole = AxWin_CreateElement();
48         
49         AxWin_MessageLoop();
50         
51         return 0;
52 }
53
54 /**
55  */
56 int Global_HandleMessage(tAxWin_Message *Message)
57 {
58         switch(Message->ID)
59         {
60         default:
61                 return 0;
62         }
63 }
64
65 int Shell_HandleMessage(tAxWin_Message *Message)
66 {
67         switch(Message->ID)
68         {
69         default:
70                 return 0;
71         }
72 }

UCC git Repository :: git.ucc.asn.au