irssi-import / bugs.irssi.org

bugs.irssi.org archive
https://github.com/irssi/irssi/issues
0 stars 0 forks source link

fe-text headers & deal with statusbar in modules #535

Open irssibot opened 17 years ago

irssibot commented 17 years ago

The only API to deal with statusbar is in fe-text/statusbar.h. But this header is in noinst_HEADERS in fe-text/Makefile.am so it won't be installed.

If this header isn't available, modules (in C) which want to deal with statusbar won't build.

I suggest this header (fe-text/statusbar.h and maybe some others in fe-text/) should be installed (in /usr/.../include/irssi...).
irssibot commented 16 years ago

I'd really like to see this fixed. I developed a module irssi-otr [1] for Off-The-Record Messaging (OTR) [2] in which I use the statusbar. As a workaround I currently download statusbar.h, mainwindows.h, and term.h during the build process from the web svn. I've attached a patch that seems to solve the problem.

Thanks,

Uli

[1] http://irssi-otr.tuxfamily.org/ [2] http://www.cypherpunks.ca/otr/

irssibot commented 16 years ago

irssi-include-statusbar.patch

Index: src/fe-text/mainwindows.h
===================================================================
--- src/fe-text/mainwindows.h   (revision 4864)
+++ src/fe-text/mainwindows.h   (working copy)
@@ -1,8 +1,8 @@
 #ifndef __MAINWINDOWS_H
 #define __MAINWINDOWS_H

-#include "fe-windows.h"
-#include "term.h"
+#include <fe-common/core/fe-windows.h>
+#include <fe-text/term.h>

 #define WINDOW_MIN_SIZE 2

Index: src/fe-text/statusbar.h
===================================================================
--- src/fe-text/statusbar.h (revision 4864)
+++ src/fe-text/statusbar.h (working copy)
@@ -1,7 +1,7 @@
 #ifndef __STATUSBAR_H
 #define __STATUSBAR_H

-#include "mainwindows.h"
+#include <fe-text/mainwindows.h>

 #define STATUSBAR_PRIORITY_HIGH        100
 #define STATUSBAR_PRIORITY_NORMAL  0
Index: src/fe-text/Makefile.am
===================================================================
--- src/fe-text/Makefile.am (revision 4864)
+++ src/fe-text/Makefile.am (working copy)
@@ -71,10 +71,7 @@
         gui-printtext.h \
         gui-readline.h \
         gui-windows.h \
-        mainwindows.h \
-        statusbar.h \
         statusbar-config.h \
-   term.h \
    terminfo-core.h \
         textbuffer.h \
         textbuffer-view.h \
irssibot commented 16 years ago

For irssi-xmpp I have just copied a slightly modified statusbar.h (so it doesn't need mainwindows.h and term.h) into the sources of irssi-xmpp.

See: http://cvs.gna.org/cvsweb/irssi-xmpp/src/fe-text/include/irssi/src/fe-text/?cvsroot=irssi-xmpp

And when I need to deal with statusbars I just include this file (statusbar.h): http://cvs.gna.org/cvsweb/irssi-xmpp/src/fe-text/xep/text-composing.c?rev=1.1;content-type=text%2Fplain;cvsroot=irssi-xmpp

irssibot commented 16 years ago

I added a public header statusbar-item.h with the necessary interfaces. The struct SBAR_ITEM_REC is opaque, so I added a function statusbar_item_set_size to set min_size/max_size in the callback. Is it fine for you?