diff options
author | Tom Feist <shabble@metavore.org> | 2011-02-19 16:28:57 +0000 |
---|---|---|
committer | Tom Feist <shabble@metavore.org> | 2011-02-19 16:28:57 +0000 |
commit | 5bbf53a0369922ea853efc51ff54adaa0f8686e1 (patch) | |
tree | b17a6937ef859eb16909b6715da26ae868e10e0a | |
parent | updated auto-testing to ebe able to handle inputs, and partially process the ... (diff) | |
download | irssi-scripts-5bbf53a0369922ea853efc51ff54adaa0f8686e1.tar.gz irssi-scripts-5bbf53a0369922ea853efc51ff54adaa0f8686e1.zip |
added a 'overlay' loadable module that's hopefully going to do osme dirty dirty
things to the curses layer.
-rw-r--r-- | modules/overlays/Makefile | 20 | ||||
-rw-r--r-- | modules/overlays/overlay_core.c | 12 | ||||
-rw-r--r-- | modules/overlays/overlay_impl.c | 9 | ||||
-rw-r--r-- | modules/overlays/overlay_impl.h | 8 | ||||
-rw-r--r-- | modules/overlays/overlay_irssi.h | 1 |
5 files changed, 36 insertions, 14 deletions
diff --git a/modules/overlays/Makefile b/modules/overlays/Makefile index 917abb6..ba5d787 100644 --- a/modules/overlays/Makefile +++ b/modules/overlays/Makefile @@ -22,15 +22,17 @@ LDFLAGS = -avoid-version -module -bundle -flat_namespace -undefined suppress OBJECTS = overlay_core.o \ overlay_impl.o -IRSSI_INCLUDE = -I$(IRSSI_DIST) \ - -I$(IRSSI_DIST)/src \ - -I$(IRSSI_DIST)/src/fe-common/core \ - -I$(IRSSI_DIST)/src/core \ - -I$(IRSSI_DIST)/src/fe-text \ - -I$(IRSSI_DIST)/src/irc \ - -I$(IRSSI_DIST)/src/irc/core \ - -I$(IRSSI_DIST)/src/irc/dcc \ - -I$(IRSSI_DIST)/src/irc/notifylist +IRSSI_INC = $(HOME)/sources/irssi-git + +IRSSI_INCLUDE = -I$(IRSSI_INC) \ + -I$(IRSSI_INC)/src \ + -I$(IRSSI_INC)/src/fe-common/core \ + -I$(IRSSI_INC)/src/core \ + -I$(IRSSI_INC)/src/fe-text \ + -I$(IRSSI_INC)/src/irc \ + -I$(IRSSI_INC)/src/irc/core \ + -I$(IRSSI_INC)/src/irc/dcc \ + -I$(IRSSI_INC)/src/irc/notifylist GLIB_CFLAGS = $(shell pkg-config glib-2.0 --cflags) diff --git a/modules/overlays/overlay_core.c b/modules/overlays/overlay_core.c index 8c75065..590a1be 100644 --- a/modules/overlays/overlay_core.c +++ b/modules/overlays/overlay_core.c @@ -23,12 +23,24 @@ #include <overlay_core.h> #include <overlay_irssi.h> #include <overlay_impl.h> +#include <terminfo-core.h> + +static void cmd_overlay(const char *data, SERVER_REC *server) { + + terminfo_move(current_term->width, current_term->height); + //terminfo_clear(); + print_random_message("What is going on here?"); +} void overlay_init() { module_register(MODULE_NAME, "core"); print_load_message(); + + command_bind("overlay", NULL, (SIGNAL_FUNC) cmd_overlay); } + void overlay_deinit() { + command_unbind("overlay", (SIGNAL_FUNC) cmd_overlay); print_unload_message(); } diff --git a/modules/overlays/overlay_impl.c b/modules/overlays/overlay_impl.c index 6626680..dbb9748 100644 --- a/modules/overlays/overlay_impl.c +++ b/modules/overlays/overlay_impl.c @@ -5,14 +5,19 @@ void print_load_message(void) { printtext(NULL, NULL, MSGLEVEL_CLIENTERROR, - "Hello, World. xxx \"%s\"", MODULE_NAME); + "Hello, World, ~~ \"%s\"", MODULE_NAME); } +void print_random_message(char *str) { + printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP, + "%s", str); +} + void print_unload_message(void) { printtext(NULL, NULL, MSGLEVEL_CLIENTERROR, - "Goodbye, Cruel World. ~signed \"%s\"", MODULE_NAME); + "Goodbye, Cruel World. ~~ \"%s\"", MODULE_NAME); } diff --git a/modules/overlays/overlay_impl.h b/modules/overlays/overlay_impl.h index 17f0148..9f2d6ee 100644 --- a/modules/overlays/overlay_impl.h +++ b/modules/overlays/overlay_impl.h @@ -1,7 +1,9 @@ -#ifndef _KEY_EMITTER_IMPL_H_ -#define _KEY_EMITTER_IMPL_H_ 1 +#ifndef _OVERLAY_IMPL_H_ +#define _OVERLAY_IMPL_H_ 1 void print_load_message(void); void print_unload_message(void); +void print_random_message(char *str); -#endif /* _KEY_EMITTER_IMPL_H_ */ + +#endif /* _OVERLAY_IMPL_H_ */ diff --git a/modules/overlays/overlay_irssi.h b/modules/overlays/overlay_irssi.h index 4fd2a2e..8c80623 100644 --- a/modules/overlays/overlay_irssi.h +++ b/modules/overlays/overlay_irssi.h @@ -24,6 +24,7 @@ #define UOFF_T_LONG_LONG 1 /* #include "config.h" */ + #include "core.h" #include "common.h" #include "modules.h" |