diff --git a/CMakeLists.txt b/CMakeLists.txt index 98ce76f0d..7dbb2b2a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,7 @@ OPTION(DISABLE_ASPELL "Disable Aspell plugin") OPTION(DISABLE_CHARSET "Disable Charset plugin") OPTION(DISABLE_FIFO "Disable FIFO plugin") OPTION(DISABLE_TRIGGER "Disable Trigger plugin") +OPTION(ENABLE_DEMO "Enable Demo plugin") OPTION(DISABLE_DOC "Disable Doc") ADD_SUBDIRECTORY( po ) diff --git a/configure.in b/configure.in index aadc44890..b9d53aef9 100644 --- a/configure.in +++ b/configure.in @@ -100,6 +100,7 @@ AH_VERBATIM([PLUGIN_ASPELL], [#undef PLUGIN_ASPELL]) AH_VERBATIM([PLUGIN_CHARSET], [#undef PLUGIN_CHARSET]) AH_VERBATIM([PLUGIN_FIFO], [#undef PLUGIN_FIFO]) AH_VERBATIM([PLUGIN_TRIGGER], [#undef PLUGIN_TRIGGER]) +AH_VERBATIM([PLUGIN_DEMO], [#undef PLUGIN_DEMO]) AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS]) AH_VERBATIM([HAVE_FLOCK], [#undef HAVE_FLOCK]) AH_VERBATIM([DEBUG], [#undef DEBUG]) @@ -107,9 +108,9 @@ AH_VERBATIM([DEBUG], [#undef DEBUG]) # Arguments for ./configure AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=compiled if found)],enable_ncurses=$enableval,enable_ncurses=yes) -AC_ARG_ENABLE(wxwidgets, [ --enable-wxwidgets Turn on WxWidgets interface (default=no wxwidgets)],enable_wxwidgets=$enableval,enable_wxwidgets=no) -AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk interface (default=no Gtk)],enable_gtk=$enableval,enable_gtk=no) -AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no Qt)],enable_qt=$enableval,enable_qt=no) +AC_ARG_ENABLE(wxwidgets, [ --enable-wxwidgets Turn on WxWidgets interface (default=off)],enable_wxwidgets=$enableval,enable_wxwidgets=no) +AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk interface (default=off)],enable_gtk=$enableval,enable_gtk=no) +AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=off)],enable_qt=$enableval,enable_qt=no) AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes) AC_ARG_ENABLE(irc, [ --disable-irc Turn off IRC plugin (default=compiled)],enable_irc=$enableval,enable_irc=yes) AC_ARG_ENABLE(scripts, [ --disable-scripts Turn off script plugins (default=compiled if found)],enable_scripts=$enableval,enable_scripts=yes) @@ -124,6 +125,7 @@ AC_ARG_ENABLE(aspell, [ --disable-aspell Turn off Aspell plugin ( AC_ARG_ENABLE(charset, [ --disable-charset Turn off Charset plugin (default=compiled if found)],enable_charset=$enableval,enable_charset=yes) AC_ARG_ENABLE(fifo, [ --disable-fifo Turn off Fifo plugin (default=compiled if found)],enable_fifo=$enableval,enable_fifo=yes) AC_ARG_ENABLE(trigger, [ --disable-trigger Turn off Trigger plugin (default=compiled if found)],enable_trigger=$enableval,enable_trigger=yes) +AC_ARG_ENABLE(demo, [ --enable-demo Turn on Demo plugin (default=off)],enable_demo=$enableval,enable_demo=no) AC_ARG_WITH(doc_xsl_prefix, [ --with-doc-xsl-prefix=DIR Docbook html/chunk.xsl is in DIR (default=autodetect)],doc_xsl_prefix=$withval,doc_xsl_prefix='') AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=1)],debug=$withval,debug=1) @@ -623,6 +625,18 @@ else not_asked="$not_asked trigger" fi +# ---------------------------------- demo -------------------------------------- + +if test "x$enable_demo" = "xyes" ; then + DEMO_CFLAGS="" + DEMO_LFLAGS="" + AC_SUBST(DEMO_CFLAGS) + AC_SUBST(DEMO_LFLAGS) + AC_DEFINE(PLUGIN_DEMO) +else + not_asked="$not_asked demo" +fi + # ------------------------------------------------------------------------------ # gnutls # ------------------------------------------------------------------------------ @@ -814,6 +828,7 @@ AM_CONDITIONAL(PLUGIN_ASPELL, test "$enable_aspell" = "yes") AM_CONDITIONAL(PLUGIN_CHARSET, test "$enable_charset" = "yes") AM_CONDITIONAL(PLUGIN_FIFO, test "$enable_fifo" = "yes") AM_CONDITIONAL(PLUGIN_TRIGGER, test "$enable_trigger" = "yes") +AM_CONDITIONAL(PLUGIN_DEMO, test "$enable_demo" = "yes") AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes") AM_CONDITIONAL(HAVE_FLOCK, test "$enable_flock" = "yes") AM_CONDITIONAL(DBLATEX_FOUND, test "$DBLATEX_FOUND" = "yes") @@ -841,6 +856,7 @@ AC_OUTPUT([Makefile src/plugins/charset/Makefile src/plugins/fifo/Makefile src/plugins/trigger/Makefile + src/plugins/demo/Makefile src/gui/Makefile src/gui/curses/Makefile src/gui/wxwidgets/Makefile @@ -901,6 +917,9 @@ fi if test "x$enable_trigger" = "xyes"; then listplugins="$listplugins trigger" fi +if test "x$enable_demo" = "xyes"; then + listplugins="$listplugins demo" +fi listoptional="" if test "x$enable_gnutls" = "xyes"; then diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 513706618..8ee79046b 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -54,3 +54,7 @@ ENDIF(NOT DISABLE_FIFO) IF(NOT DISABLE_TRIGGER) ADD_SUBDIRECTORY( trigger ) ENDIF(NOT DISABLE_TRIGGER) + +IF(ENABLE_DEMO) + ADD_SUBDIRECTORY( demo ) +ENDIF(ENABLE_TRIGGER) diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index 338552c80..cae0dbf2d 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -64,4 +64,8 @@ if PLUGIN_TRIGGER trigger_dir = trigger endif -SUBDIRS = . $(irc_dir) $(script_dir) $(aspell_dir) $(charset_dir) $(fifo_dir) $(trigger_dir) +if PLUGIN_DEMO +demo_dir = demo +endif + +SUBDIRS = . $(irc_dir) $(script_dir) $(aspell_dir) $(charset_dir) $(fifo_dir) $(trigger_dir) $(demo_dir) diff --git a/src/plugins/demo/CMakeLists.txt b/src/plugins/demo/CMakeLists.txt new file mode 100644 index 000000000..a8ed8da0a --- /dev/null +++ b/src/plugins/demo/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright (c) 2003-2007 FlashCode +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +ADD_LIBRARY(demo MODULE demo.c demo.h) +SET_TARGET_PROPERTIES(demo PROPERTIES PREFIX "") + +TARGET_LINK_LIBRARIES(demo) + +INSTALL(TARGETS demo LIBRARY DESTINATION lib/${PROJECT_NAME}/plugins) diff --git a/src/plugins/demo/Makefile.am b/src/plugins/demo/Makefile.am new file mode 100644 index 000000000..1947a77f8 --- /dev/null +++ b/src/plugins/demo/Makefile.am @@ -0,0 +1,25 @@ +# Copyright (c) 2003-2007 FlashCode +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(DEMO_CFLAGS) + +libdir = ${weechat_libdir}/plugins + +lib_LTLIBRARIES = demo.la + +demo_la_SOURCES = demo.c demo.h +demo_la_LDFLAGS = -module +demo_la_LIBADD = $(DEMO_LFLAGS) diff --git a/src/plugins/demo/demo.c b/src/plugins/demo/demo.c new file mode 100644 index 000000000..3d81d4e66 --- /dev/null +++ b/src/plugins/demo/demo.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2003-2007 by FlashCode + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* demo.c: demo plugin for WeeChat */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include "../weechat-plugin.h" +#include "demo.h" + + +static struct t_weechat_plugin *weechat_plugin = NULL; + + +/* + * weechat_plugin_init: init demo plugin + */ + +int +weechat_plugin_init (struct t_weechat_plugin *plugin) +{ + weechat_plugin = plugin; + + return PLUGIN_RC_SUCCESS; +} + +/* + * weechat_plugin_end: end demo plugin + */ + +int +weechat_plugin_end () +{ + return PLUGIN_RC_SUCCESS; +} diff --git a/src/plugins/demo/demo.h b/src/plugins/demo/demo.h new file mode 100644 index 000000000..c55ece428 --- /dev/null +++ b/src/plugins/demo/demo.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2003-2007 by FlashCode + * See README for License detail, AUTHORS for developers list. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#ifndef __WEECHAT_DEMO_H +#define __WEECHAT_DEMO_H 1 + +char plugin_name[] = "demo"; +char plugin_version[] = "0.1"; +char plugin_description[] = "Demo plugin for WeeChat"; + +#endif /* demo.h */