OBJ += renderers/passthru.o
OBJ += renderers/background.o
OBJ += renderers/menu.o
+OBJ += renderers/richtext.o
# TODO: Move to a lower makefile
OBJ += renderers/widget.o
OBJ += renderers/widget/button.o
extern int Renderer_Widget_Init(void);
extern int Renderer_Background_Init(void);
extern int Renderer_Framebuffer_Init(void);
+extern int Renderer_RichText_Init(void);
extern void WM_Update(void);
extern void WM_Hotkey_Register(int nKeys, uint32_t *Keys, const char *ActionName);
Renderer_Widget_Init();
Renderer_Background_Init();
Renderer_Framebuffer_Init();
+ Renderer_RichText_Init();
WM_Initialise();
// TODO: Config
--- /dev/null
+/*
+ * Acess2 Window Manager v3
+ * - By John Hodge (thePowersGang)
+ *
+ * render/richtext.c
+ * - Formatted Line Editor
+ */
+#include <common.h>
+#include <wm_renderer.h>
+#include <richtext_messages.h>
+
+// === PROTOTYPES ===
+ int Renderer_RichText_Init(void);
+tWindow *Renderer_RichText_Create(int Flags);
+void Renderer_RichText_Redraw(tWindow *Window);
+ int Renderer_RichText_HandleMessage(tWindow *Target, int Msg, int Len, const void *Data);
+
+// === GLOBALS ===
+tWMRenderer gRenderer_RichText = {
+ .Name = "RichText",
+ .CreateWindow = Renderer_RichText_Create,
+ .Redraw = Renderer_RichText_Redraw,
+ .HandleMessage = Renderer_RichText_HandleMessage
+};
+
+// === CODE ===
+int Renderer_RichText_Init(void)
+{
+ WM_RegisterRenderer(&gRenderer_RichText);
+ return 0;
+}
+
+tWindow *Renderer_RichText_Create(int Flags)
+{
+ return NULL;
+}
+
+void Renderer_RichText_Redraw(tWindow *Window)
+{
+ return;
+}
+
+int Renderer_RichText_HandleMessage(tWindow *Target, int Msg, int Len, const void *Data)
+{
+ switch(Msg)
+ {
+ case MSG_RICHTEXT_SETATTR:
+ break;
+ }
+ return 0;
+}
MSG_RICHTEXT_ADDLINE,
// Events
-
- MSG_RICHTEXT_SENDLINE, // Bi-directional
- MSG_RICHTEXT_REQLINE // Bi-directional
+ MSG_RICHTEXT_KEYPRESS,
+ MSG_RICHTEXT_MOUSEBTN,
+
+ // Bi-directional messages
+ // - Sent by server to get a line that is not cached
+ // - Sent by client to read line contents
+ MSG_RICHTEXT_REQLINE,
+ // - Response to _REQLINE
+ MSG_RICHTEXT_SENDLINE,
};
struct sRichTextMsg_SetAttr
typedef int (*tAxWin3_RichText_KeyHandler)(tHWND Window, int bPress, uint32_t Sym, uint32_t Unicode);
typedef int (*tAxWin3_RichText_MouseHandler)(tHWND Window, int bPress, int Button, int Row, int Col);
+typedef int (*tAxWin3_RichText_LineHandler)(tHWND Window, int Row);
-#define AXWIN3_RICHTEXT_NOSCROLL 0x0001
+#define AXWIN3_RICHTEXT_NOSCROLL 0x0001 // Disables server-side scrolling
+#define AXWIN3_RICHTEXT_READONLY 0x0002 // Disables automatic insertion of translated characters
enum eAxWin3_RichText_CursorType {
AXWIN3_RICHTEXT_CURSOR_NONE,
AXWIN3_RICHTEXT_CURSOR_VLINE, // Vertical line
extern tHWND AxWin3_RichText_CreateWindow(tHWND Parent, int Flags);
extern void AxWin3_RichText_SetKeyHandler(tHWND Window, tAxWin3_RichText_KeyHandler Handler);
extern void AxWin3_RichText_SetMouseHandler(tHWND Window, tAxWin3_RichText_MouseHandler Handler);
+/**
+ * \brief Sets the function called when the server requests an update on a line's contents
+ */
+extern void AxWin3_RichText_SetLineHandler(tHWND Window, tAxWin3_RichText_LineHandler Handler);
extern void AxWin3_RichText_EnableScroll(tHWND Window, int bEnable);
extern void AxWin3_RichText_SetLineCount(tHWND Window, int Lines);
extern void AxWin3_RichText_SetColCount(tHWND Window, int Cols);