summary refs log tree commit diff stats
path: root/src/fe-gtk/Makefile.am
blob: 868656b55d8e3e64badf2d2bdba7bd9f432d4f66 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
localedir = $(datadir)/locale

bin_PROGRAMS = hexchat

INCLUDES = $(GUI_CFLAGS) -DG_DISABLE_CAST_CHECKS -DLOCALEDIR=\"$(localedir)\"

hexchat_LDADD = ../common/libxchatcommon.a $(GUI_LIBS)

EXTRA_DIST = \
	about.h ascii.h banlist.h chanlist.h chanview.h chanview-tabs.c \
	chanview-tree.c custom-list.h editlist.h fe-gtk.h fkeys.h gtkutil.h joind.h \
	maingui.h menu.h mmx_cmod.S mmx_cmod.h notifygui.h palette.h pixmaps.h \
	plugin-tray.h plugingui.c plugingui.h rawlog.h search.h sexy-iso-codes.h \
	sexy-spell-entry.h sexy-marshal.h textgui.h urlgrab.h userlistgui.h xtext.h

if USE_MMX
mmx_cmod_S = mmx_cmod.S
endif

if DO_PLUGIN
plugingui_c = plugingui.c
endif

if USE_LIBSEXY
sexy_spell = \
	sexy-iso-codes.c sexy-marshal.c sexy-spell-entry.c
endif

hexchat_SOURCES = about.c ascii.c banlist.c chanlist.c chanview.c custom-list.c \
	dccgui.c editlist.c fe-gtk.c fkeys.c gtkutil.c ignoregui.c joind.c menu.c \
	maingui.c $(mmx_cmod_S) notifygui.c palette.c pixmaps.c plugin-tray.c $(plugingui_c) \
	rawlog.c search.c servlistgui.c setup.c $(sexy_spell) textgui.c \
	urlgrab.c userlistgui.c xtext.c
n class="n">line) builder.cdef(''.join(output)) builder.embedding_api(''' extern "Python" int _on_py_command(char **, char **, void *); extern "Python" int _on_load_command(char **, char **, void *); extern "Python" int _on_unload_command(char **, char **, void *); extern "Python" int _on_reload_command(char **, char **, void *); extern "Python" int _on_say_command(char **, char **, void *); extern "Python" int _on_command_hook(char **, char **, void *); extern "Python" int _on_print_hook(char **, void *); extern "Python" int _on_print_attrs_hook(char **, hexchat_event_attrs *, void *); extern "Python" int _on_server_hook(char **, char **, void *); extern "Python" int _on_server_attrs_hook(char **, char **, hexchat_event_attrs *, void *); extern "Python" int _on_timer_hook(void *); extern "Python" int _on_plugin_init(char **, char **, char **, char *, char *); extern "Python" int _on_plugin_deinit(void); static hexchat_plugin *ph; ''') builder.set_source('_hexchat_embedded', ''' /* Python's header defines these.. */ #undef HAVE_MEMRCHR #undef HAVE_STRINGS_H #include "config.h" #include "hexchat-plugin.h" static hexchat_plugin *ph; CFFI_DLLEXPORT int _on_plugin_init(char **, char **, char **, char *, char *); CFFI_DLLEXPORT int _on_plugin_deinit(void); int hexchat_plugin_init(hexchat_plugin *plugin_handle, char **name_out, char **description_out, char **version_out, char *arg) { if (ph != NULL) { puts ("Python plugin already loaded\\n"); return 0; /* Prevent loading twice */ } ph = plugin_handle; return _on_plugin_init(name_out, description_out, version_out, arg, HEXCHATLIBDIR); } int hexchat_plugin_deinit(void) { int ret = _on_plugin_deinit(); ph = NULL; return ret; } ''') # python.py with open(sys.argv[2]) as f: builder.embedding_init_code(f.read()) # python.c builder.emit_c_code(sys.argv[3])