robo_ed.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* $Id$
  2. * MegaZeux
  3. *
  4. * Copyright (C) 2004 Gilead Kutnick - exophase@adelphia.net
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20. #ifndef __ROBO_ED_H
  21. #define __ROBO_ED_H
  22. #include "rasm.h"
  23. #include "world.h"
  24. typedef struct _robot_line robot_line;
  25. typedef enum
  26. {
  27. valid,
  28. invalid_uncertain,
  29. invalid_discard,
  30. invalid_comment
  31. } validity_types;
  32. struct _robot_line
  33. {
  34. int line_text_length;
  35. int line_bytecode_length;
  36. char *line_text;
  37. char *line_bytecode;
  38. char arg_types[20];
  39. int num_args;
  40. validity_types validity_status;
  41. struct _robot_line *next;
  42. struct _robot_line *previous;
  43. };
  44. extern char macros[5][64];
  45. void robot_editor(World *mzx_world, Robot *cur_robot);
  46. robot_line *move_line_up(robot_line *current_rline, int count,
  47. int *current_line);
  48. robot_line *move_line_down(robot_line *current_rline, int count,
  49. int *current_line);
  50. void strip_ccodes(char *dest, char *src);
  51. int change_line(robot_line *current_rline, char *command_buffer,
  52. int include_ignores, int base, validity_types invalid_status,
  53. int *size);
  54. int add_blank_line(robot_line *next_rline, robot_line *previous_rline,
  55. int *size);
  56. void display_robot_line(robot_line *current_rline, int y,
  57. int color_code, char *color_codes);
  58. int remove_line(robot_line *current_rline);
  59. int validate_lines(World *mzx_world, robot_line *current_rline,
  60. int show_none, int *size);
  61. void insert_string(char *dest, char *string, int *position);
  62. int block_menu(World *mzx_world);
  63. int add_line(robot_line *next_rline, robot_line *previous_rline,
  64. int *size, char *command_buffer, int include_ignores, int base,
  65. validity_types invalid_status);
  66. void paste_buffer(robot_line *current_rline, int *total_lines,
  67. int *current_line, int *size, int include_ignores, int base,
  68. validity_types invalid_status);
  69. void copy_block_to_buffer(robot_line *start_rline, int num_lines);
  70. robot_line *clear_block(int first_line, robot_line *first_rline,
  71. int num_lines, int *current_line, int *total_lines, int *size,
  72. robot_line *cursor_rline);
  73. void export_block(World *mzx_world, robot_line *base,
  74. robot_line *block_start, robot_line *block_end, int region_default);
  75. void import_block(World *mzx_world, robot_line *current_rline,
  76. int *total_lines, int *current_line, int *size, int include_ignores,
  77. int base, validity_types invalid_status);
  78. void edit_settings(World *mzx_world);
  79. #endif