/* $Revision Header *** Header built automatically - do not edit! ***********
 *
 *	(C) Copyright 1991 by Torsten Jürgeleit
 *
 *	Name .....: protos.h
 *	Created ..: Sunday 22-Dec-91 21:22:56
 *	Revision .: 0
 *
 *	Date        Author                 Comment
 *	=========   ====================   ====================
 *	22-Dec-91   Torsten Jürgeleit      Created this file!
 *
 ****************************************************************************
 *
 *	Prototypes and pragmas
 *
 * $Revision Header ********************************************************/

	/* Prototypes - editor.c */

SHORT editor_action_loop(VOID);
SHORT perform_editor_action(VOID);
VOID  change_editor_mode(USHORT gadget, LONG value);
VOID  print_template_info(VOID);
VOID  clear_template_info(VOID);
VOID  start_gadget_use_mode(VOID);
VOID  end_gadget_use_mode(VOID);

	/* Pragmas - editor.c */

#pragma regcall(change_editor_mode(d0,d1))

	/* Prototypes - edit1.c */

SHORT edit_template_data(VOID);

	/* Pragmas - edit1.c */


	/* Prototypes - edit2.c */

SHORT edit_template_data_action(struct Template  *old_tp, APTR normal_gl,
			  APTR special_gl1, APTR special_gl2, APTR edit_gl);
SHORT change_normal_template_data(APTR gl, struct Template  *tp,
						 USHORT entry, ULONG value);
SHORT change_special_template_data(APTR gl, struct Template  *tp,
						 USHORT entry, ULONG value);
	/* Pragmas - edit2.c */

#pragma regcall(edit_template_data_action(a0,a1,a2,a3,d0))
#pragma regcall(change_normal_template_data(a0,a1,d0,d1))
#pragma regcall(change_special_template_data(a0,a1,d0,d1))

	/* Prototypes - fonts.c */

struct TextAttr  *open_template_font_by_attributes(struct TemplateList  *tl,
						  BYTE *name, USHORT ysize);
struct TextAttr  *open_template_font_by_num(struct TemplateList  *tl,
								USHORT num);
USHORT get_template_font_num(struct TemplateList  *tl, struct TextAttr  *ta);
VOID   close_template_font(struct TemplateList  *tl, struct TextAttr  *ta);
VOID   free_font_list(struct TemplateList  *tl);
VOID   free_template_font(struct TemplateFont  *tf);

	/* Pragmas - fonts.c */

#pragma regcall(open_template_font_by_attributes(a0,a1,d0))
#pragma regcall(open_template_font_by_num(a0,d0))
#pragma regcall(get_template_font_num(a0,a1))
#pragma regcall(close_template_font(a0,a1))
#pragma regcall(free_font_list(a0))
#pragma regcall(free_template_font(a0))

	/* Prototypes - list.c */

APTR  build_text_list_editor(struct Template  *tp, SHORT hoffset,
							     SHORT voffset);
VOID  change_text_list_editor_mode(APTR gl, USHORT mode);
SHORT perform_text_list_editor_action(APTR gl, struct Template  *tp,
						 USHORT entry, ULONG value);
	/* Pragmas - list.c */

#pragma regcall(build_text_list_editor(a0,d0,d1))
#pragma regcall(change_text_list_editor_mode(a0,d0))
#pragma regcall(perform_text_list_editor_action(a0,a1,d0,d1))
	/* Prototypes - load.c */

SHORT  load_project(USHORT mode);
SHORT  parse_block(struct FileData  *fd, struct TemplateList  *tl,
					    USHORT block_type, USHORT mode);
SHORT  parse_item(struct TemplateList  *tl, USHORT block_type,
				     BYTE *keyword, BYTE *arg, USHORT mode);
USHORT search_keyword(BYTE *keyword, BYTE **keyword_list);
struct FileData  *open_file(BYTE *name);
SHORT  read_line(struct FileData  *fd);
BYTE   *fill_read_buffer(struct FileData  *fd);
VOID   close_file(struct FileData  *fd);

	/* Pragmas - load.c */

/* #pragma regcall(parse_block(a0,a1,d0,d1)) --- NO PRAGMA - recursive!!! */
#pragma regcall(parse_item(a0,d0,a1,a2,d1))
#pragma regcall(search_keyword(a0,a1))
#pragma regcall(open_file(a0))
#pragma regcall(read_line(a0))
#pragma regcall(fill_read_buffer(a0))
#pragma regcall(close_file(a0))

	/* Prototypes - main.c */

LONG init_resources(VOID);

	/* Pragmas - main.c */


	/* Prototypes - project.c */

SHORT perform_project_action(VOID);
VOID  end_rubber_banding(VOID);
VOID  print_project_window_title(VOID);
SHORT new_project(struct TemplateList  *tl, USHORT new_flags);
SHORT new_project_window(struct TemplateList  *tl, USHORT new_flags);
VOID  clear_project_window(USHORT flags);
VOID  change_project_name(struct TemplateList  *tl, BYTE *new_name,
								 SHORT len);
	/* Pragmas - project.c */

#pragma regcall(new_project(a0,d0))
#pragma regcall(new_project_window(a0,d0))
#pragma regcall(clear_project_window(d0))
#pragma regcall(change_project_name(a0,a1,d0))

	/* Prototypes - req.c */

SHORT show_error(SHORT status);
VOID  continue_requester(BYTE *title, BYTE *text);
VOID  intuition_error_requester(BYTE *text);
VOID  about_requester(VOID);
BOOL  ok_cancel_requester(BYTE *title, BYTE *text);

	/* Pragmas - req.c */

#pragma regcall(show_error(d0))
#pragma regcall(continue_requester(a0,a1))
#pragma regcall(intuition_error_requester(a0))
#pragma regcall(ok_cancel_requester(a0,a1))

	/* Prototypes - save.c */

SHORT save_project(VOID);
SHORT write_project_header(BPTR fh, struct TemplateList  *tl);
SHORT write_project_fonts(BPTR fh, struct TemplateList  *tl);
SHORT write_project_templates(BPTR fh, struct TemplateList  *tl);

	/* Pragmas - save.c */

#pragma regcall(write_project_header(a0,a1))
#pragma regcall(write_project_fonts(a0,a1))
#pragma regcall(write_project_templates(a0,a1))

	/* Prototypes - source.c */

SHORT save_c_source(VOID);
SHORT save_c_source_action(APTR gl, struct TemplateList  *tl);
SHORT generate_c_source(struct TemplateList  *tl);
SHORT write_project_window(BPTR fh, struct TemplateList  *tl);
SHORT write_project_borders(BPTR fh, struct TemplateList  *tl);
SHORT write_project_fonts(BPTR fh, struct TemplateList  *tl);
SHORT write_project_texts(BPTR fh, struct TemplateList  *tl);
SHORT write_project_gadgets(BPTR fh, struct TemplateList  *tl);
SHORT write_project_program(BPTR fh, struct TemplateList  *tl);
SHORT write_gadget_text_array(BPTR fh, struct TemplateList  *tl, BYTE *id,
						USHORT count, BYTE **array);
SHORT write_gadget_list(BPTR fh, struct TemplateList  *tl, BYTE *id,
					  USHORT count, struct List  *list);
SHORT write_gadget_special_data(BPTR fh, BYTE *id, USHORT count,
						    struct GadgetData  *gd);
	/* Pragmas - source.c */

#pragma regcall(save_c_source_action(a0,a1))
#pragma regcall(generate_c_source(a0))
#pragma regcall(write_project_window(a0,a1))
#pragma regcall(write_project_borders(a0,a1))
#pragma regcall(write_project_fonts(a0,a1))
#pragma regcall(write_project_texts(a0,a1))
#pragma regcall(write_project_gadgets(a0,a1))
#pragma regcall(write_project_program(a0,a1))
#pragma regcall(write_gadget_text_array(a0,a1,a2,d0,a3))
#pragma regcall(write_gadget_list(a0,a1,a2,d0,a3))
#pragma regcall(write_gadget_special_data(a0,a1,d0,a2))

	/* Prototypes - subs.c */

VOID  draw_box(struct Window  *win, struct Box  *box);
VOID  draw_box_with_border(struct Window  *win, struct Box  *box);
VOID  draw_box_with_offset(struct Window  *win, struct Box  *box,
					      SHORT xoffset, SHORT yoffset);
VOID  *get_head(struct List  *list);
VOID  *get_tail(struct List  *list);
VOID  *get_succ(struct Node  *node);
VOID  *get_pred(struct Node  *node);
VOID  *get_node(struct List  *list, USHORT num);
SHORT duplicate_string(BYTE *text, BYTE **ptr);
VOID  lower_string(BYTE *ptr, BYTE *text);
VOID  upper_string(BYTE *ptr, BYTE *text);
SHORT duplicate_text_list(struct Template  *old_tp, struct Template  *new_tp);
SHORT build_template_text_list(struct Template  *tp, BYTE **text_array);
SHORT add_template_text_list_entry(struct Template  *tp, BYTE *text);
VOID  free_template_text_list(struct Template  *tp);
VOID  free_text_list_entry(struct Node  *node);
SHORT build_template_text_array(struct Template  *tp);
struct Node  *build_text_list_entry(BYTE *text);
VOID  free_template_text_array(struct Template  *tp);

	/* Pragmas - subs.c */

#pragma regcall(draw_box(a0,a1))
#pragma regcall(draw_box_with_border(a0,a1))
#pragma regcall(draw_box_with_offset(a0,a1,d0,d1))
#pragma regcall(get_head(a0))
#pragma regcall(get_tail(a0))
#pragma regcall(get_succ(a0))
#pragma regcall(get_pred(a0))
#pragma regcall(get_node(a0,d0))
#pragma regcall(duplicate_string(a0,a1))
#pragma regcall(lower_string(a0,a1))
#pragma regcall(upper_string(a0,a1))
#pragma regcall(duplicate_text_list(a0,a1))
#pragma regcall(build_template_text_list(a0,a1))
#pragma regcall(build_text_list_entry(a0))
#pragma regcall(add_template_text_list_entry(a0,a1))
#pragma regcall(free_template_text_list(a0))
#pragma regcall(free_text_list_entry(a0))
#pragma regcall(build_template_text_array(a0))
#pragma regcall(free_template_text_array(a0))

	/* Prototypes - template.c */

struct Template  *select_template_by_num(LONG num);
struct Template  *select_template_by_pos(SHORT x, SHORT y);
struct Template  *find_template_by_pos(SHORT x, SHORT y);
VOID   fix_template_bounds(VOID);
USHORT get_modify_mode(SHORT x, SHORT y);
struct Template  *create_template(struct TemplateList  *tl);
VOID   add_template_to_list(struct TemplateList  *tl, struct Template  *tp,
							 BOOL default_name);
VOID   build_default_template_name(struct TemplateList  *tl,
						      struct Template  *tp);
SHORT  init_default_template_data(struct TemplateList  *tl,
				   struct Template  *tp, BOOL default_name);
struct Template  *clone_template(struct TemplateList  *tl,
				 struct Template  *old_tp, BOOL full_clone);
SHORT  clone_template_data(struct TemplateList  *tl,
			struct Template  *old_tp, struct Template  *new_tp);
VOID   display_template(struct Template  *tp);
VOID   refresh_all_templates(VOID);
VOID   free_template_list(struct TemplateList  *tl);
VOID   free_template(struct TemplateList  *tl, struct Template  *tp);
VOID   free_template_data(struct TemplateList  *tl, struct Template  *tp);
VOID   delete_template(struct Template  *tp);

	/* Pragmas - template.c */

#pragma regcall(select_template_by_num(d0))
#pragma regcall(select_template_by_pos(d0,d1))
#pragma regcall(find_template_by_pos(d0,d1))
#pragma regcall(get_modify_mode(d0,d1))
#pragma regcall(create_template(a0))
#pragma regcall(add_template_to_list(a0,a1,d0))
#pragma regcall(build_default_template_name(a0,a1))
#pragma regcall(init_default_template_data(a0,a1,d0))
#pragma regcall(clone_template(a0,a1,d0))
#pragma regcall(clone_template_data(a0,a1,a2))
#pragma regcall(display_template(a0))
#pragma regcall(free_template_list(a0))
#pragma regcall(free_template(a0,a1))
#pragma regcall(free_template_data(a0,a1))
#pragma regcall(delete_template(a0))

	/* Prototypes - window.c */

SHORT change_project_window(VOID);
SHORT change_project_window_action(APTR gl);

	/* Pragmas - window.c */

#pragma regcall(change_project_window_action(a0))
