/*********************************************************************** * This file is part of SpaceChart. * Copyright (C) 2000,2001 Miguel Coca * * 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 "../include/starmap.h" #include "../include/settings.h" #include "../include/rcparser.h" extern int yylineno; char *current_file; #define YYPARSE_PARAM parser struct link_rule { double color[3]; GdkLineStyle style; int width; double max_length; struct link_rule *next; }; struct st_rcparser { key_press_t *keybindings; double lon, lat, north, view_radius, max_link; coords_3d_t center; int show_links, show_link_labels, show_star_labels; double labels_color[3]; char labels_font[256]; distance_unit_t unit; star_selection_t *selection; double default_color[3]; GdkLineStyle default_style; int default_width; struct link_rule *link_rules; star_drawing_rules_t *star_rules; char *filename; }; /* Declaration of internal interface functions */ static void add_keybinding( rcparser_t *parser, keybinding_t binding, key_press_t key_press ); static void set_user_coords( rcparser_t *parser, double lon, double lat ); static void set_north( rcparser_t *parser, double north ); static void set_center( rcparser_t *parser, coords_3d_t coords ); static void set_view_radius( rcparser_t *parser, double radius ); static void set_max_link( rcparser_t *parser, double max_link ); static void set_show_links( rcparser_t *parser, int show ); static void set_show_link_labels( rcparser_t *parser, int show ); static void set_show_star_labels( rcparser_t *parser, int show ); static void set_labels_color( rcparser_t *parser, double rgb[] ); static void set_labels_font( rcparser_t *parser, const char *string ); static void set_distance_unit( rcparser_t *parser, distance_unit_t unit ); static void set_star_selection( rcparser_t *parser, star_selection_t *sel ); static struct link_rule *new_link_rule( rcparser_t *parser, double distance, double rgb[], GdkLineStyle style, int width ); static void set_link_rules( rcparser_t *parser, struct link_rule *rules ); static void clear_link_rules( rcparser_t *parser ); static void set_link_defaults( rcparser_t *parser, double rgb[], GdkLineStyle style, int width ); static void set_star_rules( rcparser_t *parser, star_drawing_rules_t *rules ); static void set_filename( rcparser_t *parser, char *filename ); %} %union { int bool; double number; coords_3d_t coords; double rgb[3]; distance_unit_t unit; key_press_t key_press; keybinding_t key_name; char *string; GdkLineStyle style; struct { int O, B, A, F, G, K, M, W; } spectral_class_list; struct { double O[3], B[3], A[3], F[3], G[3], K[3], M[3], W[3]; } star_colors; double star_sizes[4]; star_selection_t *star_sel; struct link_rule *link_rule; } %token BOOL %token NUM %token UNIT %token KEYNAME %token KEY %token KEY_MOD %token STRING %token