diff options
| author | Christopher Davis <loafier@gmail.com> | 2006-06-19 12:25:06 +0000 |
|---|---|---|
| committer | Christopher Davis <loafier@gmail.com> | 2006-06-19 12:25:06 +0000 |
| commit | bb48c914c6239ed1dbcb29eb62d33d3ab91e7215 (patch) | |
| tree | 0b6910959f96f683f3aa11a8e2f53572e42b3305 /objects/factory.h | |
| parent | efef73ae301947875602d67d0979a8ce3bd57dd0 (diff) | |
| download | irssi-python-bb48c914c6239ed1dbcb29eb62d33d3ab91e7215.tar.gz irssi-python-bb48c914c6239ed1dbcb29eb62d33d3ab91e7215.tar.xz irssi-python-bb48c914c6239ed1dbcb29eb62d33d3ab91e7215.zip | |
initial import
git-svn-id: http://svn.irssi.org/repos/irssi-python@4282 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'objects/factory.h')
| -rw-r--r-- | objects/factory.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/objects/factory.h b/objects/factory.h new file mode 100644 index 0000000..1171003 --- /dev/null +++ b/objects/factory.h @@ -0,0 +1,46 @@ +#ifndef _FACTORY_H_ +#define _FACTORY_H_ + +#include <Python.h> +#include "pyscript-object.h" +#include "base-objects.h" +#include "window-item-object.h" +#include "channel-object.h" +#include "query-object.h" +#include "server-object.h" +#include "connect-object.h" +#include "irc-server-object.h" +#include "irc-connect-object.h" +#include "irc-channel-object.h" +#include "ban-object.h" +#include "nick-object.h" +#include "chatnet-object.h" +#include "reconnect-object.h" +#include "window-object.h" +#include "textdest-object.h" +#include "rawlog-object.h" +#include "log-object.h" +#include "logitem-object.h" +#include "ignore-object.h" +#include "dcc-object.h" + +int factory_init(void); +void factory_deinit(void); + +/*managed == 1: object invalidates itself + *managed == 0: caller responsible for invalidating object + *XXX: most objects invalidate themselves, ignoring "managed" switch, + * and some are never managed (Reconnect) + */ + +/* For objects with a type member but no chat_type */ +PyObject *py_irssi_new(void *typeobj, int managed); +/* For objects with both type and chat_type members */ +PyObject *py_irssi_chat_new(void *typeobj, int managed); + +typedef PyObject *(*InitFunc)(void *, int); +PyObject *py_irssi_objlist_new(GSList *node, int managed, InitFunc init); +#define py_irssi_chatlist_new(n, m) py_irssi_objlist_new(n, m, py_irssi_chat_new) +#define py_irssi_list_new(n, m) py_irssi_objlist_new(n, m, py_irssi_new) + +#endif |
