/*
    ragmaan/state_stack.h            (C) 2003 Raymond (zandbergen@home.nl)

    "ragmaan" is an anagram generator

    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 2 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, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#ifndef STATE_STACK_H
#define STATE_STACK_H

#include <glib.h>
#include <gtk/gtk.h>

struct idle_state_s
{
  gboolean initialised;
  gboolean running;
  gboolean done;
  gint tag;
  GtkTreeIter iter;
};

struct state_s
{
  gchar *subword;
  GtkTreeModel *model;
  GtkTreePath *selected_path;
  struct idle_state_s idle_state;
};

struct state_stack_s
{
  gchar *target;
  struct state_s *state;
  gint depth;
  gint alloc_depth;
};

extern struct state_stack_s state_stack;
extern struct state_s *state_stack_tos;

extern gint state_stack_depth (void);
extern void state_stack_init (void);
extern void state_stack_clear (const gchar * target);
extern void state_stack_store (gchar * subword);
extern void state_stack_push (void);
extern void state_stack_pop (void);
extern gchar *state_stack_rest (void);
extern gchar *state_stack_to_string (void);
#endif
