00001
00002
00003
00004
00005
00006 #ifndef __TURTLE_H__
00007 #define __TURTLE_H__
00008
00009 #include <gtk/gtk.h>
00010 #include <math.h>
00011 #include "config.h"
00012
00013 #define locale_t guint
00014 #define LOCALE_ENGLISH 0
00015 #define LOCALE_FRENCH 1
00016
00017
00018
00019 struct s_turtle {
00020 gdouble x,y;
00021 gdouble angle;
00022 gdouble virtual_heading;
00023
00024 gboolean trace;
00025 GdkColor pencolor;
00026
00027 int delay;
00028
00029
00030 GtkWidget *source_txt,
00031 *debug_txt,
00032 *drawing_field,
00033 *notebook,
00034 *wstatus,
00035
00036
00037 *main_app_window,
00038 *progressbar;
00039
00040 GdkPixmap *pixmap;
00041 GdkPixmap *animator;
00042 int anix, aniy;
00043
00044 GdkGC *gc;
00045
00046
00047 GSList *procedures;
00048
00049 struct s_proc *main_proc;
00050 struct s_proc *cur_proc;
00051
00052
00053
00054 GdkFont *font;
00055
00056
00057 gboolean compile;
00058 gboolean draw;
00059
00060
00061 gboolean compilation_failed;
00062
00063 GtkAdjustment *hadj, *vadj;
00064
00065 GtkWidget *boxes[3];
00066
00067 gint status;
00068 gchar *filename;
00069 locale_t locale;
00070 };
00071
00072
00073 #ifndef G_PI
00074 # define G_PI M_PI
00075 #endif
00076
00077 #define BASE_CAP (-(M_PI/2))
00078
00079 #define COLOR_BLACK 0
00080 #define COLOR_BLUE 1
00081 #define COLOR_GREEN 2
00082 #define COLOR_CYAN 3
00083 #define COLOR_RED 4
00084 #define COLOR_MAGENTA 5
00085 #define COLOR_YELLOW 6
00086 #define COLOR_WHITE 7
00087 #define COLOR_BROWN 8
00088 #define COLOR_LIGHTBROWN 9
00089 #define COLOR_MIDGREEN 10
00090 #define COLOR_BLUEGREEN 11
00091 #define COLOR_SALMON 12
00092 #define COLOR_BLUEISH 13
00093 #define COLOR_ORANGE 14
00094 #define COLOR_OR 15
00095
00096
00097 int frlex(void);
00098 int enlex(void);
00099
00100
00101 #define OPEN_PROGRAM_BOX 1
00102 #define SAVE_PROGRAM_BOX 2
00103 #define SAVE_DRAWING_BOX 3
00104
00105
00106 #include <libintl.h>
00107 #define _(String) gettext (String)
00108
00109
00110 #define STATUS_CHANGED 1
00111 #define STATUS_NAMED 2
00112
00113
00114
00115
00116 #define STATUS_IS_MODIFIED(a_turtle) (a_turtle.status & STATUS_CHANGED)
00117 #define STATUS_IS_NAMED(a_turtle) (a_turtle.status & STATUS_NAMED)
00118
00119 #define SET_STATUS_MODIFIED(a_turtle) (a_turtle.status | STATUS_CHANGED)
00120 #define SET_STATUS_NAMED(a_turtle) (a_turtle.status | STATUS_NAMED)
00121
00122 #define UNSET_STATUS_MODIFIED(a_turtle) (a_turtle.status & ~STATUS_CHANGED)
00123 #define UNSET_STATUS_NAMED(a_turtle) (a_turtle.status & ~STATUS_CHANGED)
00124 #endif