WeeChat 0.2.7 roadmap

From FlashTux

Jump to: navigation, search

This page is deprecated! See WeeChat_0.2.7

Version 0.2.7 will be redesigned to have IRC as a protocol entry (task #6217), and to implement (later) other protocols. This will produce huge changes everywhere in source code, in plugins API, GUI management, and setup files.

Moreover, GUI will be separated from core (task #7282)

Multi-protocols

Protocol management

Many protocols will be possible inside WeeChat, and sources will look like :

Directory Description
src/protocols/ sources for general protocol management
src/protocols/irc/ sources for IRC protocol
src/protocols/xxx/ sources for "xxx" protocol (example of new protocols: jabber, silc, ..)

Each protocol will be a library, dynamically loaded by WeeChat with /protocol command. Of course protocols installed by default (in /usr/lib/protocols/), like IRC, will be autoloaded.

The /protocol will work like /plugin command :

    list: list loaded protocols
    load: load a protocol
autoload: autoload protocols
  unload: unload a protocol (or all)
  reload: reload a protocol (unload then load)

Protocol libraries MUST have these functions in order to be loaded by WeeChat :

Function name Return value Description
protocol_init int: PROTOCOL_RC_OK or PROTOCOL_RC_KO Protocol initialization (init variables, load config file, ..)
protocol_end int: PROTOCOL_RC_OK or PROTOCOL_RC_KO Protocol end (free memory, save config file, ..)
protocol_main - Protocol main function: read sockets, read/send data.. (called very often by weechat, should be very fast function)
protocol_can_upgrade int: 1 if upgrade is possible (now), 0 if it is not Tells whether protocol can upgrade now or not
protocol_before_upgrade int: PROTOCOL_RC_OK or PROTOCOL_RC_KO Called when user uses /upgrade command: save config file, save state in a file, ..
protocol_after_upgrade int: PROTOCOL_RC_OK or PROTOCOL_RC_KO Called after /upgrade (when WeeChat has been restarted): load config file, load state from file, ..
... ... ...

Protocol libraries MUST have these variables in order to be loaded by WeeChat :

Variable name Type Description
protocol_commands (to be defined) Commands defined by protocol (like /server, /connect, ..)
... ... ...


Plugins API

Plugins API will be rewritten to offer functions compatible with all protocols. All IRC-specific functions will be removed, renamed or replaced by new version.

Following changes in plugins/scripts API are planed:

API function New prototype (if changes)
register -
set_charset -
print print ( message, protocol, buffer )
print_server function removed
print_infobar -
remove_infobar -
log function removed ??
add_message_handler -
add_command_handler -
add_timer_handler -
add_keyboard_handler -
add_event_handler events will change
remove_handler -
remove_timer_handler -
remove_keyboard_handler -
remove_event_handler -
add_modifier -
remove_modifier -
command -
get_info get_info (name, protocol)
get_dcc_info function removed (see get_info)
get_server_info function removed (see get_info)
get_channel_info function removed (see get_info)
get_nick_info function removed (see get_info)
get_config -
set_config -
get_plugin_config -
set_plugin_config -
get_irc_color -
input_color -
get_window_info -
get_buffer_info -
get_buffer_data -


GUI management

GUI buffers will know the protocol used, but NO pointer to protocol specific structure (like server or channel). Protocol structures (server, channel, ..) will have pointer to a GUI buffer.


Setup files

IRC options will be stored in irc.rc instead of weechat.rc. Only global options will remain in weechat.rc (look options, colors and keys).


Developer TODO

TODO for developers, tasks to be done (order is important):

  1. separate IRC from GUI
  2. separate IRC from main code (in src/common)
  3. add protocol/ subdirectory and /protocol command
  4. change plugins API
  5. update existing plugins/scripts to new API
  6. create new setup files (irc.rc, .. ?)
  7. create auto-upgrader tool (or inside WeeChat ?) for migrating config files when upgrading from old version (<= 0.2.6)


Separation of GUI from core

Separation of GUI (considered as client) from core (considered as server) :


Core (1 server):

  • runs in background (no user interface)
  • manage server connections: read/write on sockets
  • manage GUI client(s): send data (buffer history, ..) to them, wait for data (user entry)


GUI (1 to N clients):

  • receive data from core (buffer history, ..)
  • send user entry to core


Many GUIs will be possible, and from different locations at same time.

Users can easily develop custom GUIs, following protocol used between core and GUI.

Sources moves

Old source location New location (if moved)
src/common/alias.c
src/common/backtrace.c
src/common/command.c
src/common/completion.c src/gui
src/common/fifo.c
src/common/history.c
src/common/hotlist.c
src/common/log.c
src/common/session.c
src/common/utf8.c
src/common/util.c
src/common/weechat.c
src/common/weeconfig.c
src/common/weelist.c
src/gui/curses/gui-curses-chat.c
src/gui/curses/gui-curses-color.c
src/gui/curses/gui-curses-infobar.c
src/gui/curses/gui-curses-input.c
src/gui/curses/gui-curses-keyboard.c
src/gui/curses/gui-curses-main.c
src/gui/curses/gui-curses-nicklist.c
src/gui/curses/gui-curses-panel.c Keep or remove ??
src/gui/curses/gui-curses-status.c
src/gui/curses/gui-curses-window.c
src/gui/gtk/gui-gtk-chat.c
src/gui/gtk/gui-gtk-color.c
src/gui/gtk/gui-gtk-infobar.c
src/gui/gtk/gui-gtk-input.c
src/gui/gtk/gui-gtk-keyboard.c
src/gui/gtk/gui-gtk-main.c
src/gui/gtk/gui-gtk-nicklist.c
src/gui/gtk/gui-gtk-panel.c Keep or remove ??
src/gui/gtk/gui-gtk-status.c
src/gui/gtk/gui-gtk-window.c
src/gui/gui-action.c
src/gui/gui-buffer.c
src/gui/gui-common.c
src/gui/gui-keyboard.c
src/gui/gui-log.c
src/gui/gui-panel.c Keep or remove ??
src/gui/gui-window.c
src/irc/irc-channel.c
src/irc/irc-commands.c
src/irc/irc-dcc.c
src/irc/irc-display.c
src/irc/irc-ignore.c
src/irc/irc-mode.c
src/irc/irc-nick.c
src/irc/irc-recv.c
src/irc/irc-send.c
src/irc/irc-send.c
src/irc/irc-send.c
src/irc/irc-send.c
src/plugins/aspell/weechat-aspell.c
src/plugins/charset/weechat-charset.c
src/plugins/plugins.c
src/plugins/plugins-config.c
src/plugins/plugins-interface.c
src/plugins/scripts/lua/weechat-lua.c
src/plugins/scripts/perl/weechat-perl.c
src/plugins/scripts/python/weechat-python.c
src/plugins/scripts/ruby/weechat-ruby.c
src/plugins/scripts/weechat-script.c
Personal tools