int giScreenWidth = 640;
int giScreenHeight = 480;
-uint32_t *gpScreenBuffer = NULL;
int giTerminalFD = -1;
int giMouseFD = -1;
// --- Helpers ---
-tElement *_GetElementById(tWidgetWin *Info, uint32_t ID)
+tElement *Widget_GetElementById(tWidgetWin *Info, uint32_t ID)
{
tElement *ele;
- int num;
if( ID < Info->TableSize ) return Info->ElementTable[ID];
- while( ID >= Info->TableSize ) {
- num ++;
- ID -= Info->TableSize;
- }
-
- ele = Info->ElementTable[num];
- while(num-- && ele) ele = ele->ListNext;
+ ele = Info->ElementTable[ID % Info->TableSize];
+ while(ele && ele->ID != ID) ele = ele->ListNext;
return ele;
}
// --- Message Handlers ---
-void _NewWidget(tWidgetWin *Info, size_t Len, tWidgetMsg_Create *Msg)
+void Widget_NewWidget(tWidgetWin *Info, size_t Len, tWidgetMsg_Create *Msg)
{
const int max_debugname_len = Len - sizeof(tWidgetMsg_Create);
tElement *parent;
tWidgetWin *info = Target->RendererInfo;
switch(Msg)
{
+ // New Widget
case MSG_WIDGET_CREATE:
- _NewWidget(info, Len, Data);
+ Widget_NewWidget(info, Len, Data);
return 0;
+ //
default:
return 1; // Unhandled
}
--- /dev/null
+# Acess 2 - AxWin GUI Library
+#
+
+include ../Makefile.cfg
+
+CPPFLAGS +=
+CFLAGS += -Wall
+LDFLAGS += -lc -soname libaxwin3.so
+
+OBJ = main.o msg.o r_widget.o
+BIN = libaxwin3.so
+
+include ../Makefile.tpl
--- /dev/null
+/*
+ * AxWin3 Interface Library
+ * - By John Hodge (thePowersGang)
+ *
+ * main.c
+ * - Entrypoint and setup
+ */
+#include <axwin3/axwin.h>
+
+// === CODE ===
+int SoMain(void *Base, int argc, const char *argv[], const char **envp)
+{
+ // TODO: Parse the environment for the AXWIN3_PID variable
+ return 0;
+}
+
+void AxWin3_Connect(const char *ServerDesc)
+{
+ // TODO: Handle Message passing, Local UDP and TCP streams
+}
--- /dev/null
+/*
+ * Acess2 GUI Version 3 (AxWin3)
+ * - By John Hodge (thePowersGang)
+ *
+ * axwin.h
+ * - Core API Header
+ */
+#ifndef _AXWIN3_AXWIN_H_
+#define _AXWIN3_AXWIN_H_
+
+typedef void *tHWND;
+
+extern void AxWin3_Connect(const char *ServerDesc);
+
+extern tHWND AxWin3_CreateWindow(tHWND Parent, const char *Renderer, int Flags);
+extern void AxWin3_DestroyWindow(tHWND Window);
+
+extern void AxWin3_SendMessage(tHWND Window, int Length, void *Data);
+extern void AxWin3_SetWindowPos(tHWND Window, int X, int Y, int W, int H);
+extern void AxWin3_SetWindowShown(tHWND Window, int bShow);
+
+#endif
+