/*  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
*/
// (C) PicoPeta Simputers Pvt. Ltd. 
// Author: Santhosh N

#ifndef __PICOAPI_H
#define __PICOAPI_H

#include <picowidget.h>

typedef struct _picoapi picoapi;
typedef struct _toolbar toolbar;

typedef enum _toolbar_type {TOP_TOOLBAR, BOTTOM_TOOLBAR} toolbar_type;

// UI specification constants : Look at Wiki for an explanation :)
typedef enum _ui_constants {
	V11, V12, V13,
	V21, V22, V23,
	V31, V32, V33,
	V41, V42, V43,
	V51, V52, V53,
	NR_UI_CONSTANTS
} ui_constants;

typedef enum _theme_constants {
	BUTTON_BACKGROUND, BUTTON_FOREGROUND,
	TOOLBAR_BACKGROUND, TOOLBAR_FOREGROUND,
	FONT, TOOLBAR_RELIEF,
	BUTTON_PADDING, BUTTON_RELIEF,
	BORDER_WIDTH,
	TOP_TOOLBAR_HEIGHT, TOP_TOOLBAR_WIDTH,
	BOT_TOOLBAR_HEIGHT, BOT_TOOLBAR_WIDTH,
	IMAGES_DIR,
	ICONS_DIR,
	NR_THEME_CONSTANTS
} theme_constants;

typedef enum _store_locations {
	STOREDIR, STOREDIR2, STOREDIR3,
	NR_STORE_LOCATIONS
} store_locations;

typedef enum _lang_constants {
	LANGUAGE,
	NR_LANG_CONSTANTS
} lang_constants;

struct _picoapi
{
	int ui[NR_UI_CONSTANTS];
	char* theme[NR_THEME_CONSTANTS];
	char* stores[NR_STORE_LOCATIONS];
	char* lang[NR_LANG_CONSTANTS];

	int (*get_ui_constant)(const picoapi*, ui_constants);
	const char* (*get_theme_constant)(const picoapi*, theme_constants);
	const char* (*get_store_location)(const picoapi*, store_locations);
	const char* (*get_lang_constant)(const picoapi*, lang_constants);
};

struct _toolbar
{
	px_widget* mainframe;
	toolbar_type type;
	Bool enabled, retractable;

	void* old_callback_parameter;
	Bool (*old_client_message)(px_widget*, px_event*);
	void (*show)(toolbar*);
	void (*disable)(toolbar*);
	void (*enable)(toolbar*);	
	void (*destroy)(toolbar*);
};

picoapi* picoapi_get_picoapi();
toolbar* toolbar_create(px_widget*, toolbar_type, Bool);
Bool toolbar_toggle(px_widget* widget, px_event* event);

#endif
		
