Class p.u.v.v.communication_window(gtk.Window):

Part of pida.utils.vim.vimcom View In Hierarchy

A GTK window that can communicate with any number Vim instances.

This is an actual GTK window (which it must be to accurately detect property events inside the GTK main loop) but has its GDK window correctly set to receive such events. This is notably the "Vim" property which must be present and set to a version string, in this case "6.0" is used.

Line # Kind Name Docs
205 Method __init__ Constructor.
243 Method fetch_serverlist Fetch the serverlist, and if it has changed, feed it to the client.
273 Method stop_fetching_serverlist Undocumented
276 Method get_rootwindow_serverlist Get the X root window's version of the current Vim serverlist.
313 Method get_shell_serverlist DEPRACATED: WE NEVER NEED A SERVERLIST
329 Method get_hidden_serverlist DEPRACATED: WE NEVER NEED A SERVERLIST
365 Method get_server_wid Get the X Window id for a named Vim server.
387 Method get_server_window Create and return a GDK window for a given window ID.
399 Method feed_serverlist Feed the given list of servers to the client.
413 Method fetch_cwd Fetch the working directory for a named server and store the result.
426 Method get_cwd Undocumented
430 Method abspath Return the absolute path of a buffer name in the context of the named
448 Method generate_message Generate a message.
465 Method parse_message Parse a received message and return the message atributes as a
484 Method send_message Undocumented
497 Method send_expr Undocumented
500 Method send_keys Undocumented
503 Method send_esc Undocumented
506 Method send_ret Undocumented
509 Method send_ex Undocumented
514 Method send_ex_via_tempfile For really long ugly messages
524 Method get_option Undocumented
527 Method foreground Undocumented
532 Method change_buffer Undocumented
535 Method change_buffer_number Undocumented
538 Method close_buffer Undocumented
541 Method close_current_buffer Undocumented
544 Method change_cursor Undocumented
548 Method save_session Undocumented
551 Method load_session Undocumented
554 Method escape_filename Undocumented
559 Method open_file Undocumented
562 Method new_file Undocumented
567 Method goto_line Undocumented
573 Method revert Undocumented
576 Method load_script Undocumented
579 Method preview_file Undocumented
584 Method get_bufferlist Undocumented
596 Method get_current_buffer Undocumented
604 Method save Undocumented
607 Method save_as Undocumented
611 Method undo Undocumented
615 Method redo Undocumented
619 Method cut Undocumented
622 Method copy Undocumented
625 Method paste Undocumented
629 Method set_colorscheme Undocumented
632 Method set_menu_visible Undocumented
639 Method quit Undocumented
642 Method define_sign Undocumented
651 Method undefine_sign Undocumented
654 Method show_sign Undocumented
658 Method hide_sign Undocumented
661 Method get_cword Undocumented
664 Method get_selection Undocumented
667 Method set_path Undocumented
670 Method cb_notify Undocumented
679 Method cb_reply Undocumented
688 Method cb_reply_async Undocumented
699 Method vim_event Undocumented
def __init__(self, cb):
Constructor.

The Window is instantiated, the properties are correctly set, the event mask is modified, and the instance variables are initialized.

@param cb: An instance of the main Application class. @type cb: pida.main.Application.

def fetch_serverlist(self):
Fetch the serverlist, and if it has changed, feed it to the client.

The serverlist is requested asynchrnously, and passed the gotservers function as a callback. The gotservers function is then called with the server list, gets the appropriate working directory (if required) and feeds the new server list to the client if it has changed.

def stop_fetching_serverlist(self):
Undocumented
def get_rootwindow_serverlist(self):
Get the X root window's version of the current Vim serverlist.

On starting with the client-server feature, GVim or Vim with the --servername option registers its server name and X window id as part of the "VimRegistry" parameter on the X root window.

This method extracts and parses that property, and returns the server list.

Note: Vim does not actually unregister itself with the root window on dying, so the presence of a server in the root window list is no gurantee that it is alive.

@return: servers @rtype servers: dict of ("server", "window id") key, value

def get_shell_serverlist(self):
DEPRACATED: WE NEVER NEED A SERVERLIST (This is here for educative purposes)

Get the server list by starting console Vim on a Pipe.

This blocks, so we don't use it. It is one of the alternative methods of retrieving an accurate serverlist. It is slow, and expensive.

def get_hidden_serverlist(self, callbackfunc):
DEPRACATED: WE NEVER NEED A SERVERLIST
(This is here for educative purposes)

Get the serverlist from the hidden Vim instance and call the callback
function with the results.

This method checks first whther the Vim instance is alive, and then
evaluates the serverlist() function remotely in it, with a local call
back function which parses the result and calls the user-provided
callback function.

@param callbackfunc: The call back function to be called with the
    server list.
@type callbackfunc: callable
def get_server_wid(self, servername):
Get the X Window id for a named Vim server.

This function returns the id from the root window server list, if it exists, or None if it does not.

@param servername: The name of the server @type servername: str

@return: wid @rtype wid: long

def get_server_window(self, wid):
Create and return a GDK window for a given window ID.

This method simply calls gdk.window_foreign_new, which should return None if the window has been destroyed, but does not, in some cases.

@param wid: The window ID. @type wid: long

def feed_serverlist(self, serverlist):
Feed the given list of servers to the client.

This is achieved by calling the clients serverlist event. In Pida, this event is passed on to all the plugins.

@param serverlist: The list of servers. @type serverlist: list

def fetch_cwd(self, servername):
Fetch the working directory for a named server and store the result.
def get_cwd(self, server):
Undocumented
def abspath(self, servername, filename):
Return the absolute path of a buffer name in the context of the named server.
def generate_message(self, server, cork, message, sourceid):
Generate a message.
def parse_message(self, message):
Parse a received message and return the message atributes as a dictionary.
def send_message(self, servername, message, asexpr, callback):
Undocumented
def send_expr(self, server, message, callback):
Undocumented
def send_keys(self, server, message):
Undocumented
def send_esc(self, server):
Undocumented
def send_ret(self, server):
Undocumented
def send_ex(self, server, message):
Undocumented
def send_ex_via_tempfile(self, server, message):
For really long ugly messages
def get_option(self, server, option, callbackfunc):
Undocumented
def foreground(self, server):
Undocumented
def change_buffer(self, server, filename):
Undocumented
def change_buffer_number(self, server, number):
Undocumented
def close_buffer(self, server, buffername):
Undocumented
def close_current_buffer(self, server):
Undocumented
def change_cursor(self, server, x, y):
Undocumented
def save_session(self, server, file_name):
Undocumented
def load_session(self, server, file_name):
Undocumented
def escape_filename(self, name):
Undocumented
def open_file(self, server, name):
Undocumented
def new_file(self, server):
Undocumented
def goto_line(self, server, linenumber):
Undocumented
def revert(self, server):
Undocumented
def load_script(self, server, scriptpath):
Undocumented
def preview_file(self, server, fn):
Undocumented
def get_bufferlist(self, server):
Undocumented
def get_current_buffer(self, server):
Undocumented
def save(self, server):
Undocumented
def save_as(self, server, filename):
Undocumented
def undo(self, server):
Undocumented
def redo(self, server):
Undocumented
def cut(self, server):
Undocumented
def copy(self, server):
Undocumented
def paste(self, server):
Undocumented
def set_colorscheme(self, server, colorscheme):
Undocumented
def set_menu_visible(self, server, visible):
Undocumented
def quit(self, server):
Undocumented
def define_sign(self, server, name, icon, linehl, text, texthl, direct=False):
Undocumented
def undefine_sign(self, server, name):
Undocumented
def show_sign(self, server, index, type, filename, line):
Undocumented
def hide_sign(self, server, index, filename):
Undocumented
def get_cword(self, server, callback):
Undocumented
def get_selection(self, server, callback):
Undocumented
def set_path(self, server, path):
Undocumented
def cb_notify(self, *a):
Undocumented
def cb_reply(self, data):
Undocumented
def cb_reply_async(self, data):
Undocumented
def vim_event(self, server, evt, d):
Undocumented
API Documentation for PIDA, generated by pydoctor.