summaryrefslogtreecommitdiff
path: root/src/perl/common
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-06-27 22:56:17 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-06-27 22:56:17 +0000
commit89d7498019b64ae5f89b6f09f32aaa9d876a9da3 (patch)
tree1b289e5394b6dc0db092459fbabaaf049b285715 /src/perl/common
parentd7342a6c4fac7956ddef141c8a2f88a1e7b0378c (diff)
downloadirssi-89d7498019b64ae5f89b6f09f32aaa9d876a9da3.zip
Moved fe_perl module to use Irssi::UI .. this breaks several scripts that
use UI-specific code, but simply adding the "use Irssi::UI;" after use Irssi; should work. make install now removes libfe_perl.* files from global module directory, but if you have it somewhere else you should manually remove it. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1582 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/perl/common')
-rw-r--r--src/perl/common/Irssi.xs3
-rw-r--r--src/perl/common/Themes.xs124
-rw-r--r--src/perl/common/Window.xs277
-rw-r--r--src/perl/common/module.h16
-rw-r--r--src/perl/common/typemap4
5 files changed, 3 insertions, 421 deletions
diff --git a/src/perl/common/Irssi.xs b/src/perl/common/Irssi.xs
index b2cb24fc..272b27fd 100644
--- a/src/perl/common/Irssi.xs
+++ b/src/perl/common/Irssi.xs
@@ -1,5 +1,4 @@
#include "module.h"
-#include "levels.h"
MODULE = Irssi PACKAGE = Irssi
@@ -14,5 +13,3 @@ INCLUDE: Query.xs
INCLUDE: Rawlog.xs
INCLUDE: Server.xs
INCLUDE: Settings.xs
-INCLUDE: Themes.xs
-INCLUDE: Window.xs
diff --git a/src/perl/common/Themes.xs b/src/perl/common/Themes.xs
deleted file mode 100644
index e8d5c595..00000000
--- a/src/perl/common/Themes.xs
+++ /dev/null
@@ -1,124 +0,0 @@
-
-MODULE = Irssi PACKAGE = Irssi
-
-void
-theme_register(formats)
- SV *formats
-PREINIT:
- STRLEN n_a;
- AV *av;
- FORMAT_REC *formatrecs;
- char *key, *value;
- int len, n, fpos;
-CODE:
-
- if (!SvROK(formats))
- croak("formats is not a reference to list");
- av = (AV *) SvRV(formats);
- len = av_len(av)+1;
- if (len == 0 || (len & 1) != 0)
- croak("formats list is invalid - not dividable by 3 (%d)", len);
-
- formatrecs = g_new0(FORMAT_REC, len/2+2);
- formatrecs[0].tag = g_strdup(perl_get_package());
- formatrecs[0].def = g_strdup("Perl script");
-
- for (fpos = 1, n = 0; n < len; n++, fpos++) {
- key = SvPV(*av_fetch(av, n, 0), n_a); n++;
- value = SvPV(*av_fetch(av, n, 0), n_a);
-
- formatrecs[fpos].tag = g_strdup(key);
- formatrecs[fpos].def = g_strdup(value);
- formatrecs[fpos].params = MAX_FORMAT_PARAMS;
- }
-
- theme_register_module(perl_get_package(), formatrecs);
-
-void
-printformat(level, format, ...)
- int level
- char *format
-PREINIT:
- STRLEN n_a;
- TEXT_DEST_REC dest;
- char *arglist[MAX_FORMAT_PARAMS];
- int n;
-CODE:
- format_create_dest(&dest, NULL, NULL, level, NULL);
- memset(arglist, 0, sizeof(arglist));
- for (n = 2; n < 2+MAX_FORMAT_PARAMS; n++) {
- arglist[n-2] = n < items ? SvPV(ST(n), n_a) : "";
- }
-
- printformat_perl(&dest, format, arglist);
-
-#*******************************
-MODULE = Irssi PACKAGE = Irssi::Server
-#*******************************
-
-void
-printformat(server, target, level, format, ...)
- Irssi::Server server
- char *target
- int level
- char *format
-PREINIT:
- STRLEN n_a;
- TEXT_DEST_REC dest;
- char *arglist[MAX_FORMAT_PARAMS];
- int n;
-CODE:
- format_create_dest(&dest, server, target, level, NULL);
- memset(arglist, 0, sizeof(arglist));
- for (n = 4; n < 4+MAX_FORMAT_PARAMS; n++) {
- arglist[n-4] = n < items ? SvPV(ST(n), n_a) : "";
- }
-
- printformat_perl(&dest, format, arglist);
-
-#*******************************
-MODULE = Irssi PACKAGE = Irssi::Window
-#*******************************
-
-void
-printformat(window, level, format, ...)
- Irssi::Window window
- int level
- char *format
-PREINIT:
- STRLEN n_a;
- TEXT_DEST_REC dest;
- char *arglist[MAX_FORMAT_PARAMS];
- int n;
-CODE:
- format_create_dest(&dest, NULL, NULL, level, window);
- memset(arglist, 0, sizeof(arglist));
- for (n = 3; n < 3+MAX_FORMAT_PARAMS; n++) {
- arglist[n-3] = n < items ? SvPV(ST(n), n_a) : "";
- }
-
- printformat_perl(&dest, format, arglist);
-
-#*******************************
-MODULE = Irssi PACKAGE = Irssi::Windowitem
-#*******************************
-
-void
-printformat(item, level, format, ...)
- Irssi::Windowitem item
- int level
- char *format
-PREINIT:
- STRLEN n_a;
- TEXT_DEST_REC dest;
- char *arglist[MAX_FORMAT_PARAMS];
- int n;
-CODE:
- format_create_dest(&dest, item->server, item->name, level, NULL);
- memset(arglist, 0, sizeof(arglist));
- for (n = 3; n < 3+MAX_FORMAT_PARAMS; n++) {
- arglist[n-3] = n < items ? SvPV(ST(n), n_a) : "";
- }
-
- printformat_perl(&dest, format, arglist);
-
diff --git a/src/perl/common/Window.xs b/src/perl/common/Window.xs
deleted file mode 100644
index 027289cc..00000000
--- a/src/perl/common/Window.xs
+++ /dev/null
@@ -1,277 +0,0 @@
-MODULE = Irssi PACKAGE = Irssi
-
-void
-windows()
-PREINIT:
- GSList *tmp;
-PPCODE:
- for (tmp = windows; tmp != NULL; tmp = tmp->next) {
- XPUSHs(sv_2mortal(plain_bless(tmp->data, "Irssi::Window")));
- }
-
-
-Irssi::Window
-active_win()
-CODE:
- RETVAL = active_win;
-OUTPUT:
- RETVAL
-
-Irssi::Server
-active_server()
-CODE:
- RETVAL = active_win->active_server;
-OUTPUT:
- RETVAL
-
-void
-print(str, level=MSGLEVEL_CLIENTNOTICE)
- char *str
- int level;
-CODE:
- printtext_string(NULL, NULL, level, str);
-
-void
-command(cmd)
- char *cmd
-CODE:
- perl_command(cmd, active_win->active_server, active_win->active);
-
-Irssi::Window
-window_find_name(name)
- char *name
-
-Irssi::Window
-window_find_refnum(refnum)
- int refnum
-
-int
-window_refnum_prev(refnum, wrap)
- int refnum
- int wrap
-
-int
-window_refnum_next(refnum, wrap)
- int refnum
- int wrap
-
-int
-windows_refnum_last()
-
-Irssi::Window
-window_find_level(level)
- int level
-CODE:
- RETVAL = window_find_level(NULL, level);
-OUTPUT:
- RETVAL
-
-Irssi::Window
-window_find_item(name)
- char *name
-CODE:
- RETVAL = window_find_item(NULL, name);
-OUTPUT:
- RETVAL
-
-Irssi::Window
-window_find_closest(name, level)
- char *name
- int level
-CODE:
- RETVAL = window_find_closest(NULL, name, level);
-OUTPUT:
- RETVAL
-
-Irssi::Windowitem
-window_item_find(name)
- char *name
-CODE:
- RETVAL = window_item_find(NULL, name);
-OUTPUT:
- RETVAL
-
-
-#*******************************
-MODULE = Irssi PACKAGE = Irssi::Server
-#*******************************
-
-void
-command(server, cmd)
- Irssi::Server server
- char *cmd
-CODE:
- perl_command(cmd, server, active_win->active);
-
-void
-print(server, channel, str, level)
- Irssi::Server server
- char *channel
- char *str
- int level
-CODE:
- printtext_string(server, channel, level, str);
-
-Irssi::Windowitem
-window_item_find(server, name)
- Irssi::Server server
- char *name
-
-Irssi::Window
-window_find_item(server, name)
- Irssi::Server server
- char *name
-
-Irssi::Window
-window_find_level(server, level)
- Irssi::Server server
- int level
-
-Irssi::Window
-window_find_closest(server, name, level)
- Irssi::Server server
- char *name
- int level
-
-
-#*******************************
-MODULE = Irssi PACKAGE = Irssi::Window PREFIX=window_
-#*******************************
-
-void
-items(window)
- Irssi::Window window
-PREINIT:
- GSList *tmp;
-PPCODE:
- for (tmp = window->items; tmp != NULL; tmp = tmp->next) {
- CHANNEL_REC *rec = tmp->data;
-
- XPUSHs(sv_2mortal(irssi_bless(rec)));
- }
-
-void
-print(window, str, level=MSGLEVEL_CLIENTNOTICE)
- Irssi::Window window
- char *str
- int level;
-CODE:
- printtext_window(window, level, str);
-
-void
-command(window, cmd)
- Irssi::Window window
- char *cmd
-CODE:
- perl_command(cmd, window->active_server, window->active);
-
-void
-window_item_add(window, item, automatic)
- Irssi::Window window
- Irssi::Windowitem item
- int automatic
-
-void
-window_item_remove(item)
- Irssi::Windowitem item
-
-void
-window_item_destroy(item)
- Irssi::Windowitem item
-
-void
-window_item_prev(window)
- Irssi::Window window
-
-void
-window_item_next(window)
- Irssi::Window window
-
-void
-window_destroy(window)
- Irssi::Window window
-
-void
-window_set_active(window)
- Irssi::Window window
-
-void
-window_change_server(window, server)
- Irssi::Window window
- Irssi::Server server
-
-void
-window_set_refnum(window, refnum)
- Irssi::Window window
- int refnum
-
-void
-window_set_name(window, name)
- Irssi::Window window
- char *name
-
-void
-window_set_level(window, level)
- Irssi::Window window
- int level
-
-char *
-window_get_active_name(window)
- Irssi::Window window
-
-Irssi::Windowitem
-window_item_find(window, server, name)
- Irssi::Window window
- Irssi::Server server
- char *name
-CODE:
- RETVAL = window_item_find_window(window, server, name);
-OUTPUT:
- RETVAL
-
-#*******************************
-MODULE = Irssi PACKAGE = Irssi::Windowitem PREFIX = window_item_
-#*******************************
-
-void
-print(item, str, level=MSGLEVEL_CLIENTNOTICE)
- Irssi::Windowitem item
- int level
- char *str
-CODE:
- printtext_string(item->server, item->name, level, str);
-
-void
-command(item, cmd)
- Irssi::Windowitem item
- char *cmd
-CODE:
- perl_command(cmd, item->server, item);
-
-Irssi::Window
-window_create(item, automatic)
- Irssi::Windowitem item
- int automatic
-
-Irssi::Window
-window(item)
- Irssi::Windowitem item
-CODE:
- RETVAL = window_item_window(item);
-OUTPUT:
- RETVAL
-
-void
-window_item_change_server(item, server)
- Irssi::Windowitem item
- Irssi::Server server
-
-int
-window_item_is_active(item)
- Irssi::Windowitem item
-
-void
-window_item_set_active(item)
- Irssi::Windowitem item
-CODE:
- window_item_set_active(window_item_window(item), item);
diff --git a/src/perl/common/module.h b/src/perl/common/module.h
index 23cbad63..80d46b77 100644
--- a/src/perl/common/module.h
+++ b/src/perl/common/module.h
@@ -8,6 +8,7 @@
#include "../module.h"
#include "network.h"
+#include "levels.h"
#include "commands.h"
#include "log.h"
#include "rawlog.h"
@@ -15,6 +16,7 @@
#include "settings.h"
#include "masks.h"
#include "special-vars.h"
+#include "window-item-def.h"
#include "chatnets.h"
#include "servers.h"
@@ -25,13 +27,6 @@
#include "queries.h"
#include "nicklist.h"
-#include "fe-common/core/fe-windows.h"
-#include "fe-common/core/formats.h"
-#include "fe-common/core/printtext.h"
-#include "fe-common/core/window-items.h"
-#include "fe-common/core/themes.h"
-#include "fe-common/core/keyboard.h"
-
#include "perl/perl-common.h"
#include "perl/perl-signals.h"
@@ -41,6 +36,7 @@ typedef LOG_ITEM_REC *Irssi__Logitem;
typedef RAWLOG_REC *Irssi__Rawlog;
typedef IGNORE_REC *Irssi__Ignore;
typedef MODULE_REC *Irssi__Module;
+typedef WI_ITEM_REC *Irssi__Windowitem;
typedef CHATNET_REC *Irssi__Chatnet;
typedef SERVER_REC *Irssi__Server;
@@ -49,9 +45,3 @@ typedef RECONNECT_REC *Irssi__Reconnect;
typedef CHANNEL_REC *Irssi__Channel;
typedef QUERY_REC *Irssi__Query;
typedef NICK_REC *Irssi__Nick;
-
-typedef THEME_REC *Irssi__Theme;
-typedef KEYINFO_REC *Irssi__Keyinfo;
-typedef WINDOW_REC *Irssi__Window;
-typedef WI_ITEM_REC *Irssi__Windowitem;
-typedef TEXT_DEST_REC *Irssi__TextDest;
diff --git a/src/perl/common/typemap b/src/perl/common/typemap
index f2432f17..9de29109 100644
--- a/src/perl/common/typemap
+++ b/src/perl/common/typemap
@@ -12,11 +12,7 @@ Irssi::Log T_PlainObj
Irssi::Logitem T_PlainObj
Irssi::Rawlog T_PlainObj
Irssi::Module T_PlainObj
-Irssi::Theme T_PlainObj
-Irssi::Keyinfo T_PlainObj
-Irssi::Window T_PlainObj
Irssi::Windowitem T_IrssiObj
-Irssi::TextDest T_PlainObj
INPUT