Barrie Slaymaker > Eesh-0.3 > Eesh

Download:
Eesh-0.3.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.3   Source  

NAME ^

Eesh - Enlightenment Window Manager IPC Library

SYNOPSIS ^

  ## Long form:
  use Eesh qw( e_open e_send e_recv ) ;

  e_open() ;
  print e_recv( 'window_list' ) ;
  e_send( 'restart' ) ;

  ## Short form
  use Eesh qw( :all ) ;
  e_open() ;
  print "$_\n" for ( e_window_list ) ;

  my $win_id = (grep { /Terminal/ } e_window_list)[0] ;
  e_win_op( $win_id, 'raise' ) ;

  ## For non-blocking receives:
  my $hmmm = e_recv( { non_blocking => 1 } ) ;

DESCRIPTION ^

Eesh.pm provides simple wrappers around the routines from eesh (included).

This code is in alpha mode, please let me know of any improvements, and patches are especially welcome.

Basic Communications Functions

e_open

Opens communications with E.

e_send

Sends to E.

e_recv

Receives from E, blocking until data is received.

Can send strings first and then wait for the result:

   my @windows = split( /^/m, e_recv( 'window_list' ) ) ;

Can be called non-blocking:

   e_send( 'window_list' ) ;
    
   my $hmmm ;
   $hmmm = e_recv( { non_blocking => 1 } ) until defined $hmmmm ;
e_fileno

Returns the file number of the connection to E, useful for select loops.

High level functions

These are simple functions that wrap around E IPC commands. The really simple commands aren't wrapped, since it wouldn't save much typing (though they would provide varying levels of mispeled option detection):

   e_send( 'advanced_focus new_window_focus on' ) ;

vs.

   e_enable_advanced_focus_new_window_focus() ;
   e_advanced_focus_new_window_focus( 'on' ) ;
   e_advanced_focus( 'new_window_focus', 'on' ) ;
   e_enable( 'advanced_focus', 'new_window_focus' ) ;

Perhaps we could provide something like:

   e_enable_new_window_focus() ;

which would be a savings and allow for safer programming (since a mispelling would show up under 'use strict'). But that's only viable so long as no identifier is used more than once in the entire command set, which I can't guarantee.

If you don't see a function here that you need, ask for it or send a patch. See the eesh help command for more documentation on these.

e_backgrounds

Returns a list of all background ids, one per element.

e_delete_background

Deletes a background

e_background

Returns a hash reference to the values defined for a particular background:

   print e_background( shift e_backgrounds )->{'bg.solid'}, "\n" ;
e_set_background

Takes a background id and either a hash or a list of key/value pairs and sets them:

   e_set_background( $bg_id, 'bg.file' => $filename ) ;
e_focused

A short form of e_set_focus( '?' ) :

   my $win_id = e_focused() ;
e_internal_list

Returns the requested list:

   e_internal_list( 'menus' ) ;

might yield:

   ('1400509','14000f9')

Note that spaces and newlines are stripped, and that these are strings, not numbers.

e_list_class

Returns a list of the supplied class.

   e_list_class( 'backgrounds' ) ;

should return the same list as e_backgrounds().

e_list_themes

Returns a list of themes.

e_modules

Returns a list of modules. Don't ask me why this isn't "list_modules" or "modules_list".

e_remember

Takes a window ID and a parameter. The window ID may be the full item returned from e_window_list(), or just the ID portion.

e_set_focus

Can take a window ID, the full ID returned from window_list().

See e_focused() for a short form of e_set_focus( '?' ).

e_win_op

Takes a window ID, or one of the values returned by e_window_list() and performs a win_op on it.

If used in a non-void context, this will block and return any data received. So don't do that if you might not get anything back.

e_window_list

Returns a list of strings containing window IDs and titles:

   (
      '2400006 : Terminal',
      '3c00080 : VIM - ~/src/Eesh/Eesh.pm',
      ...
   )

The leading whitespace and trailing newlines are trimmed.

These may be passed in anywhere a window ID is needed, such as e_win_op() or e_iconify().

LICENSE ^

Copyright (C) 2000 Barrie Slaymaker, Carsten Haitzler, Geoff Harrison and various contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies of the Software, its documentation and marketing & publicity materials, and acknowledgment shall be given in the documentation, materials and software packages that this Software was used.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

AUTHORS ^

Eesh: Barrie Slaymaker <barries@slaysys.com>

eesh: Carsten Haitzler, Geoff Harrison and various contributors

SEE ALSO ^

eesh

syntax highlighting: