/*
    ragmaan/ragmaan.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
*/

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

#ifndef	RAGMAAN_H
#define	RAGMAAN_H
#define BLOCK_SIZE   (10240)	/* used when reading the database     */
#define NOF_HASH2_WORDS (1)	/* used for tuning the hash2-algo     */
#define NOF_HASH2_BITS  (32)	/* this should match HASH2_KEY_T size */

#define TARGET_HISTORY_SIZE (5)	/* history size for search combo box  */

#define _(String) gettext(String)
#define N_(String) gettext_noop(String)

enum
{ SUBWORD_STATE_FINISHED, SUBWORD_STATE_DESCEND_OK,
  SUBWORD_STATE_DESCEND_UNKNOWN, SUBWORD_STATE_DEAD, SUBWORD_STATE_MAX
};

enum
{ TOOLBAR_BACK, TOOLBAR_FORWARD, TOOLBAR_FIND, TOOLBAR_COPY, TOOLBAR_NEW, 
	TOOLBAR_LOAD, TOOLBAR_SAVE, TOOLBAR_DB, TOOLBAR_MAX
};

enum
{
  COLUMN_STATUS,
  COLUMN_SUBWORD,
  COLUMN_REST,
  COLUMN_MAX
};

enum
{ ALLOW_BACK, ALLOW_FORWARD, ALLOW_FIND, ALLOW_COPY };


/* widgets that are updated by various callbacks, so they're global */
struct global_widgets_s
{
  GtkWidget *main_window, *find_window, *target_entry, *find_entry, *statusbar;
  GtkWidget *result_tree_view;
  GtkWidget *intermediate_result_label;
  GtkWidget *toolbar_button[TOOLBAR_MAX];
  GtkWidget *scratchpad;
  GList *target_history, *find_history;
  GdkPixbuf *pixbuf[SUBWORD_STATE_MAX];
  GdkCursor *busy_cursor;
  GdkCursor *default_cursor;
  gboolean is_busy;
};
extern struct global_widgets_s global_widgets;
extern HASH_TABLE_T hash_table;
extern gchar *db_name;
extern void set_busy_cursor (gboolean b);
extern gboolean action_allowed (gint action);
extern void new_file_selector (const gchar * title,
			void (handle_filename) (GtkWidget *,
						GtkFileSelection *),
			gchar * default_selection);
extern GList * history_update (GList * history, const gchar * new_entry);
extern void print_to_statusbar (const gchar * fmt, ...) G_GNUC_PRINTF (1, 2);
#endif
