/*
 * src/workset.h - working set management
 *
 * Copyright (C) 1999, 2000 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
 *
 * This 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 2, or (at your option)
 * any later version.
 * 
 * This software 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 package; see the file COPYING.  If not, write to
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.  
 */

#ifndef __WORKSET_H__
#define __WORKSET_H__

#if HAVE_CONFIG_H
# include <config.h>
#endif 

#include <X11/Xlib.h>

#define MAX_WORKSETS 8
#define MAX_WORKSET_NAME_LEN 128

/*
 * This structure represents a working set.  Working sets are
 * collections of windows, with the current implementation they work
 * like virtual workspaces.
 */
typedef struct workset * workset_t;
struct workset
{
  char name[MAX_WORKSET_NAME_LEN]; /* Working set name. */
  Window last_focused;		/* Last window with focus on this w.set. */
};

/*
 * CURRENT_WORKSET is the number of the working set currently in use.
 * All new windows will be assigned to this working set.
 */
extern int current_workset;

/*
 * WORKSETS holds information about all available working sets.
 */
extern struct workset worksets[MAX_WORKSETS];

/*
 * WORKSET_COUNT holds the number of defined working sets in the arrat
 * WORKSETS.
 */
extern int workset_count;

/*
 * The window for displaying the working set name after a switch.
 */
extern Window workset_window;

/*
 * Draw the contents of the woking set indicator window.
 */ 
void draw_workset_window (void);

/*
 * Gets called every 10th of a second.  Delete the working set
 * indicator as soon as it times out.
 */
void workset_tick (void);

/*
 * Select the working set with number NUMBER as the current working
 * set.
 */
result_t workset_select (int number);

/*
 * Navigate to the previous working set when DIRECTION is negative and
 * navigate to the next working set if DIRECTION is positive.
 * Behaviour is undefined when DIRECTION is zero.  Working sets wrap
 * around when the first or last working set is reached.
 */
result_t workset_next (int direction);

/*
 * Append a new working set to the end of the list of already defined
 * working sets.
 */
result_t create_workset (char * name);

result_t setup_worksets (void);

#endif /* not __WORKSET_H__ */

