@$(RM) $(OBJ) $(DEPFILES) $(_BIN) $(BIN).dsm Map.txt
install: $(_BIN)
+ @echo [xCP] $(DISTROOT)/$(DIR)/$(BIN)
@$(xMKDIR) $(DISTROOT)/$(DIR); true
- $(xCP) $(_BIN) $(DISTROOT)/$(DIR)/
+ @$(STRIP) $(_BIN) -o $(_BIN)_
+ @$(xCP) $(_BIN)_ $(DISTROOT)/$(DIR)/$(BIN)
+ @$(RM) $(_BIN)_
$(_BIN): $(OBJ)
@mkdir -p $(dir $(_BIN))
{
if(FD_ISSET(giTerminalFD, set))
{
- // TODO:
+ uint32_t codepoint;
+ if( read(giTerminalFD, sizeof(codepoint), &codepoint) != sizeof(codepoint) )
+ {
+ // oops, error
+ }
+ // TODO: pass on to message handler
}
if(FD_ISSET(giMouseFD, set))
readlen = read(giNetworkFileHandle, sizeof(staticBuf), staticBuf);
- // Assume that all connections are from localhost
identlen = 4 + Net_GetAddressSize( ((uint16_t*)staticBuf)[1] );
msg = staticBuf + identlen;
IPC_Handle(&gIPC_Type_Datagram, staticBuf, readlen - identlen, (void*)msg);
+ _SysDebug("IPC_HandleSelect: UDP handled");
}
while(SysGetMessage(NULL, NULL))
SysGetMessage(NULL, data);
IPC_Handle(&gIPC_Type_SysMessage, &tid, len, (void*)data);
+ _SysDebug("IPC_HandleSelect: Message handled");
}
}
tApplication *app;
tElement *ele;
+ _SysDebug("IPC_Handle: (IPCType=%p, Ident=%p, MsgLen=%i, Msg=%p)",
+ IPCType, Ident, MsgLen, Msg);
+
if( MsgLen < sizeof(tAxWin_Message) )
return ;
if( MsgLen < sizeof(tAxWin_Message) + Msg->Size )
{
// --- Ping message (reset timeout and get server version)
case MSG_SREQ_PING:
+ _SysDebug(" IPC_Handle: MSG_SREQ_PING");
if( MsgLen < sizeof(tAxWin_Message) + 4 ) return;
Msg->ID = MSG_SRSP_VERSION;
Msg->Size = 4;
// --- Register an application
case MSG_SREQ_REGISTER:
+ _SysDebug(" IPC_Handle: MSG_SREQ_REGISTER");
if( Msg->Data[Msg->Size-1] != '\0' ) {
// Invalid message
+ _SysDebug("IPC_Handle: RETURN - Not NULL terminated");
return ;
}
// --- Create a window
case MSG_SREQ_ADDWIN:
+ _SysDebug(" IPC_Handle: MSG_SREQ_ADDWIN");
if( Msg->Data[Msg->Size-1] != '\0' ) {
// Invalid message
return ;
// --- Set a window's icon
case MSG_SREQ_SETICON:
+ _SysDebug(" IPC_Handle: MSG_SREQ_SETICON");
// TODO: Find a good way of implementing this
break;
// --- Create an element
case MSG_SREQ_INSERT: {
+ _SysDebug(" IPC_Handle: MSG_SREQ_INSERT");
struct sAxWin_SReq_NewElement *info = (void *)Msg->Data;
if( Msg->Size != sizeof(*info) ) return;
win = calloc(1, sizeof(tWindow) + 1);
if(!win) return NULL;
- ret = &win->Element;
+ ret = &win->RootElement;
ret->Type = ELETYPE_WINDOW;
ret->Data = win;
ret->Parent = &App->MetaElement;
#define DEFAULT_ELEMENTS_PER_APP 128
typedef struct sAxWin_Element tElement;
+typedef struct sMenuItem tMenuItem;
typedef struct sWindow tWindow;
typedef struct sApplication tApplication;
char DebugName[];
};
+struct sMenuItem
+{
+ tMenuItem *Next;
+ int Flags;
+ int ID; //!< ID number sent to application
+ const char *Label;
+ const char *Right;
+ tMenuItem *FirstChild;
+};
+
struct sWindow
{
int X, Y, W, H;
void *Icon;
+ tApplication *App;
+
tWindow *OrderNext; // Render order
- tElement Element;
+ tMenuItem *Menus;
+
+ tElement RootElement;
};
struct sApplication
int MaxElementIndex; //!< Number of entries in \a EleIndex
tElement **EleIndex; //!< Array of pointers to elements owned by this application
- tElement MetaElement; //!< Windows child off this
+ tElement MetaElement; //!< Tabs child off this
};
// === FUNCTIONS ===
$(RM) $(_BIN) $(_XBIN) $(OBJ) $(_BIN).dsm $(DEPFILES)
install: all
+ @echo [xCP] $(DISTROOT)/Libs/$(BIN)
@$(xMKDIR) $(DISTROOT)/Libs; true
- $(xCP) $(_BIN) $(_XBIN) $(DISTROOT)/Libs/
+ @$(STRIP) $(_BIN) -o $(_BIN)_
+ @$(xCP) $(_BIN)_ $(DISTROOT)/Libs/$(BIN)
+ @$(RM) $(_BIN)_
+ifneq ($(_XBIN),)
+ $(xCP) $(_XBIN) $(DISTROOT)/Libs/
+endif
$(_BIN): $(OBJ)
@mkdir -p $(dir $(_BIN))
.text : AT(ADDR(.text)) {
code = .;
*(.text)
- *(.rodata*)
+ }
+
+ .rodata : AT(ADDR(.rodata)) {
+ *(.rodata .rodata.*)
}
.data ALIGN (0x1000) : AT(ADDR(.data)) {
bss = .;
}
_end = .;
+
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
}
// === GLOBALS ===
int giAxWin_Mode = 0;
- int giAxWin_PID = 0;
+ int giAxWin_PID = 9; // HACK!
tAxWin_MessageCallback *gAxWin_DefaultCallback;
// === CODE ===
{
int length;
pid_t src;
- tAxWin_Message *ret;
+ tAxWin_Message *ret = NULL;
switch( giAxWin_Mode )
{
default:
break;
}
- return 0;
+ return ret;
}
/**