Moved 3 rc promotion keywords from gschem into libgeda (fix for bug#1748143)
[geda-gaf/peter-b.git] / gschem / src / g_rc.c
blobb8a57061354143d4c0660dd42840d2d824457f15
1 /* gEDA - GPL Electronic Design Automation
2 * gschem - gEDA Schematic Capture
3 * Copyright (C) 1998-2007 Ales Hvezda
4 * Copyright (C) 1998-2007 gEDA Contributors (see ChangeLog for details)
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
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
14 * GNU General Public License for more details.
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., 59 Temple Place, Suite 330, Boston, MA 02111 USA
20 #include <config.h>
22 #include <stdio.h>
23 #include <sys/stat.h>
24 #include <ctype.h>
25 #ifdef HAVE_STRING_H
26 #include <string.h>
27 #endif
28 #ifdef HAVE_DIRENT_H
29 #include <dirent.h>
30 #endif
31 #ifdef HAVE_STDLIB_H
32 #include <stdlib.h>
33 #endif
34 #ifdef HAVE_UNISTD_H
35 #include <unistd.h>
36 #endif
38 #include <libgeda/libgeda.h>
40 #include "../include/i_vars.h"
41 #include "../include/globals.h"
42 #include "../include/prototype.h"
44 #ifdef HAVE_LIBDMALLOC
45 #include <dmalloc.h>
46 #endif
48 /*! a random int, used only as a place holder */
49 static int default_dummy;
51 /*! \todo Finish function documentation!!!
52 * \brief
53 * \par Function Description
56 void g_rc_parse_gtkrc()
58 gchar *filename;
59 const gchar *home;
61 filename = g_strconcat (g_rc_parse_path (),
62 G_DIR_SEPARATOR_S,
63 "gschem-gtkrc",
64 NULL);
65 gtk_rc_parse (filename);
66 g_free (filename);
68 home = g_getenv ("HOME");
69 if (home != NULL) {
70 filename = g_strconcat (home,
71 G_DIR_SEPARATOR_S,
72 ".gschem-gtkrc",
73 NULL);
74 gtk_rc_parse (filename);
75 g_free (filename);
80 /*! \todo Finish function documentation!!!
81 * \brief
82 * \par Function Description
85 SCM g_rc_gschem_version(SCM version)
87 SCM ret;
89 SCM_ASSERT (scm_is_string (version), version,
90 SCM_ARG1, "gschem-version");
92 if (g_strcasecmp (SCM_STRING_CHARS (version), DATE_VERSION) != 0) {
93 fprintf(stderr,
94 "You are running gEDA/gaf version [%s%s.%s],\n",
95 PREPEND_VERSION_STRING, DOTTED_VERSION, DATE_VERSION);
96 fprintf(stderr,
97 "but you have a version [%s] gschemrc file:\n[%s]\n",
98 SCM_STRING_CHARS (version), rc_filename);
99 fprintf(stderr,
100 "Please be sure that you have the latest rc file.\n");
101 ret = SCM_BOOL_F;
102 } else {
103 ret = SCM_BOOL_T;
106 return ret;
109 /*! \todo Finish function documentation!!!
110 * \brief General color setting function
111 * \par Function Description
114 static SCM g_rc_color_general(SCM index, SCM color, SCM outline_color,
115 SCM ps_color, SCM ir, SCM ig, SCM ib,
116 const char *rc_name, int *color_var)
118 int status;
119 int color_index;
120 char *color_name;
121 char *outline_color_name;
122 char *ps_color_string;
123 int image_red;
124 int image_green;
125 int image_blue;
126 SCM ret;
128 SCM_ASSERT (scm_is_integer (index), index, SCM_ARG1, rc_name);
129 SCM_ASSERT (scm_is_string (color), color, SCM_ARG2, rc_name);
130 SCM_ASSERT (scm_is_string (outline_color),
131 outline_color, SCM_ARG3, rc_name);
132 SCM_ASSERT (scm_is_string (ps_color), ps_color,
133 SCM_ARG4, rc_name);
134 SCM_ASSERT (scm_is_integer (ir), ir, SCM_ARG5, rc_name);
135 SCM_ASSERT (scm_is_integer (ig), ig, SCM_ARG6, rc_name);
136 SCM_ASSERT (scm_is_integer (ib), ib, SCM_ARG7, rc_name);
138 color_index = scm_to_int (index);
139 color_name = SCM_STRING_CHARS (color);
140 outline_color_name = SCM_STRING_CHARS (outline_color);
141 ps_color_string = SCM_STRING_CHARS (ps_color);
142 image_red = scm_to_int (ir);
143 image_green = scm_to_int (ig);
144 image_blue = scm_to_int (ib);
146 status = s_color_request (color_index, color_name, outline_color_name,
147 ps_color_string,
148 image_red, image_green, image_blue);
150 #if DEBUG
151 printf("%d %s %s %s %d %d %d\n", color_index, color_name,
152 outline_color_name, ps_color_string,
153 image_red, image_green, image_blue);
154 #endif
156 /* invalid color? */
157 if (status == -1) {
158 fprintf (stderr,
159 _("Invalid color [%s] passed to %s\n"),
160 color_name,
161 rc_name);
162 ret = SCM_BOOL_F;
163 } else {
164 *color_var = color_index;
165 ret = SCM_BOOL_T;
168 return ret;
171 #define DEFINE_G_RC_COLOR(func, rc, var) \
172 SCM func(SCM index, SCM color, SCM outline_color, SCM ps_color, \
173 SCM ir, SCM ig, SCM ib) \
175 return g_rc_color_general(index, color, outline_color, \
176 ps_color, ir, ig, ib, (rc), &(var)); \
179 DEFINE_G_RC_COLOR(g_rc_override_net_color,
180 "override-net-color",
181 default_override_net_color)
183 DEFINE_G_RC_COLOR(g_rc_override_bus_color,
184 "override-bus-color",
185 default_override_bus_color)
187 DEFINE_G_RC_COLOR(g_rc_override_pin_color,
188 "override-pin-color",
189 default_override_pin_color)
191 DEFINE_G_RC_COLOR(g_rc_attribute_color,
192 "attribute-color",
193 default_attribute_color)
195 DEFINE_G_RC_COLOR(g_rc_detachedattr_color,
196 "detached-attribute-color",
197 default_detachattr_color)
199 DEFINE_G_RC_COLOR(g_rc_text_color,
200 "text-color",
201 default_text_color)
203 DEFINE_G_RC_COLOR(g_rc_net_color,
204 "net-color",
205 default_net_color)
207 DEFINE_G_RC_COLOR(g_rc_bus_color,
208 "bus-color",
209 default_bus_color)
211 DEFINE_G_RC_COLOR(g_rc_pin_color,
212 "pin-color",
213 default_pin_color)
215 DEFINE_G_RC_COLOR(g_rc_graphic_color,
216 "graphic-color",
217 default_graphic_color)
219 DEFINE_G_RC_COLOR(g_rc_grid_color,
220 "grid-color",
221 default_grid_color)
223 DEFINE_G_RC_COLOR(g_rc_background_color,
224 "background-color",
225 default_background_color)
227 DEFINE_G_RC_COLOR(g_rc_select_color,
228 "select-color",
229 default_select_color)
231 DEFINE_G_RC_COLOR(g_rc_boundingbox_color,
232 "boundingbox-color",
233 default_bb_color)
235 DEFINE_G_RC_COLOR(g_rc_zoom_box_color,
236 "zoom-box-color",
237 default_zoom_box_color)
239 DEFINE_G_RC_COLOR(g_rc_net_endpoint_color,
240 "net-endpoint-color",
241 default_net_endpoint_color)
243 DEFINE_G_RC_COLOR(g_rc_junction_color,
244 "junction-color",
245 default_junction_color)
247 DEFINE_G_RC_COLOR(g_rc_logic_bubble_color,
248 "logic-bubble-color",
249 default_logic_bubble_color)
251 DEFINE_G_RC_COLOR(g_rc_lock_color,
252 "lock-color",
253 default_lock_color)
255 DEFINE_G_RC_COLOR(g_rc_output_color_background,
256 "output-color-background",
257 default_print_color_background)
259 DEFINE_G_RC_COLOR(g_rc_stroke_color,
260 "stroke-color",
261 default_stroke_color)
263 DEFINE_G_RC_COLOR(g_rc_freestyle_color,
264 "freestyle-color",
265 default_dummy)
267 /*! \todo Finish function documentation!!!
268 * \brief
269 * \par Function Description
272 SCM g_rc_net_endpoint_mode(SCM mode)
274 static const vstbl_entry mode_table[] = {
275 {FILLEDBOX, "filledbox"}
278 RETURN_G_RC_MODE("net-endpoint-mode",
279 default_net_endpoint_mode,
283 /*! \todo Finish function documentation!!!
284 * \brief
285 * \par Function Description
288 SCM g_rc_net_midpoint_mode(SCM mode)
290 static const vstbl_entry mode_table[] = {
291 {FILLED, "filled"}
294 RETURN_G_RC_MODE("net-midpoint-mode",
295 default_net_midpoint_mode,
299 /*! \todo Finish function documentation!!!
300 * \brief
301 * \par Function Description
304 SCM g_rc_net_style(SCM mode)
306 static const vstbl_entry mode_table[] = {
307 {THIN , "thin" },
308 {THICK, "thick"}
311 RETURN_G_RC_MODE("net-style",
312 default_net_style,
316 /*! \todo Finish function documentation!!!
317 * \brief
318 * \par Function Description
321 SCM g_rc_bus_style(SCM mode)
323 static const vstbl_entry mode_table[] = {
324 {THIN , "thin" },
325 {THICK, "thick"}
328 RETURN_G_RC_MODE("bus-style",
329 default_bus_style,
333 /*! \todo Finish function documentation!!!
334 * \brief
335 * \par Function Description
338 SCM g_rc_pin_style(SCM mode)
340 static const vstbl_entry mode_table[] = {
341 {THIN , "thin" },
342 {THICK, "thick"}
345 RETURN_G_RC_MODE("pin-style",
346 default_pin_style,
350 /*! \todo Finish function documentation!!!
351 * \brief
352 * \par Function Description
355 SCM g_rc_line_style(SCM mode)
357 static const vstbl_entry mode_table[] = {
358 {THIN , "thin" },
359 {THICK, "thick"}
362 RETURN_G_RC_MODE("pin-style",
363 default_line_style,
367 /*! \todo Finish function documentation!!!
368 * \brief
369 * \par Function Description
372 SCM g_rc_action_feedback_mode(SCM mode)
374 static const vstbl_entry mode_table[] = {
375 {OUTLINE , "outline" },
376 {BOUNDINGBOX, "boundingbox"}
379 RETURN_G_RC_MODE("action-feedback-mode",
380 default_actionfeedback_mode,
384 /*! \todo Finish function documentation!!!
385 * \brief
386 * \par Function Description
389 SCM g_rc_zoom_with_pan(SCM mode)
391 static const vstbl_entry mode_table[] = {
392 {TRUE, "enabled" },
393 {FALSE, "disabled"}
396 RETURN_G_RC_MODE("zoom-with-pan",
397 default_zoom_with_pan,
401 /*! \todo Finish function documentation!!!
402 * \brief
403 * \par Function Description
406 SCM g_rc_text_feedback(SCM mode)
408 static const vstbl_entry mode_table[] = {
409 {ALWAYS , "always" },
410 {ONLY_WHEN_READABLE, "only-when-readable"}
413 RETURN_G_RC_MODE("text-feedback",
414 default_text_feedback,
418 /*! \todo Finish function documentation!!!
419 * \brief
420 * \par Function Description
423 SCM g_rc_text_display_zoomfactor(SCM zoomfactor)
425 int val;
427 SCM_ASSERT (scm_is_integer (zoomfactor), zoomfactor,
428 SCM_ARG1, "test-display-zoom-factor");
430 val = scm_to_int (zoomfactor);
431 if (val == 0) {
432 fprintf(stderr,
433 _("Invalid zoomfactor [%d] passed to %s\n"),
434 val,
435 "text-display-zoom-factor");
436 val = 10; /* absolute default */
439 default_text_display_zoomfactor = val;
441 return SCM_BOOL_T;
444 /*! \todo Finish function documentation!!!
445 * \brief
446 * \par Function Description
449 SCM g_rc_scrollbar_update(SCM scmmode)
451 SCM ret = SCM_BOOL_T;
453 SCM_ASSERT (scm_is_string (scmmode), scmmode,
454 SCM_ARG1, "scrollbar-update");
456 return ret;
459 /*! \todo Finish function documentation!!!
460 * \brief
461 * \par Function Description
464 SCM g_rc_object_clipping(SCM mode)
466 static const vstbl_entry mode_table[] = {
467 {TRUE , "enabled" },
468 {FALSE, "disabled"}
471 RETURN_G_RC_MODE("object-clipping",
472 default_object_clipping,
476 /*! \todo Finish function documentation!!!
477 * \brief
478 * \par Function Description
481 SCM g_rc_logging(SCM mode)
483 static const vstbl_entry mode_table[] = {
484 {TRUE , "enabled" },
485 {FALSE, "disabled"}
488 RETURN_G_RC_MODE("logging",
489 default_do_logging,
493 /*! \todo Finish function documentation!!!
494 * \brief
495 * \par Function Description
498 SCM g_rc_embed_components(SCM mode)
500 static const vstbl_entry mode_table[] = {
501 {TRUE , "enabled" },
502 {FALSE, "disabled"}
505 RETURN_G_RC_MODE("embed-components",
506 default_embed_complex,
510 /*! \todo Finish function documentation!!!
511 * \brief
512 * \par Function Description
515 SCM g_rc_text_size(SCM size)
517 int val;
519 SCM_ASSERT (scm_is_integer (size), size, SCM_ARG1, "text-size");
521 val = scm_to_int (size);
522 if (val == 0) {
523 fprintf(stderr,
524 _("Invalid size [%d] passed to text-size\n"),
525 val);
526 val = 10; /* absolute default */
529 default_text_size = val;
531 return SCM_BOOL_T;
534 /*! \brief Sets the output font scaling factor
536 * \par Use this setting to change the scale of the output PS font
537 * characters. This allows to fine tune the font size so that it
538 * matches more closely with the screen.
540 * \return SCM_BOOL_T always.
543 SCM g_rc_postscript_font_scale(SCM scale)
545 float val;
547 SCM_ASSERT (SCM_REALP (scale), scale, SCM_ARG1, "postscript-font-scale");
549 val =(float)(SCM_REAL_VALUE (scale));
550 if (val == 0) {
551 fprintf(stderr, _("Invalid size [%f] passed to postscript-font-scale\n"),
552 val);
553 val = 1.0; /* absolute default */
556 default_postscript_font_scale = val;
558 return SCM_BOOL_T;
561 /*! \todo Finish function documentation!!!
562 * \brief
563 * \par Function Description
565 * \todo inconsistant naming with keyword name and variable to hold
566 * variable
568 SCM g_rc_text_caps_style(SCM mode)
570 static const vstbl_entry mode_table[] = {
571 {LOWER, "lower" },
572 {UPPER, "upper" },
573 {BOTH , "both" }
576 RETURN_G_RC_MODE("text-caps-style",
577 default_text_caps,
581 /*! \todo Finish function documentation!!!
582 * \brief
583 * \par Function Description
586 SCM g_rc_snap_size(SCM size)
588 int val;
590 SCM_ASSERT (scm_is_integer (size), size, SCM_ARG1, "snap-size");
592 val = scm_to_int (size);
593 if (val == 0) {
594 fprintf(stderr, _("Invalid size [%d] passed to snap-size\n"),
595 val);
596 val = 100; /* absolute default */
599 default_snap_size = val;
601 return SCM_BOOL_T;
604 /*! \todo Finish function documentation!!!
605 * \brief
606 * \par Function Description
609 SCM g_rc_logging_destination(SCM mode)
611 static const vstbl_entry mode_table[] = {
612 {LOG_WINDOW , "log_window" },
613 {STDOUT_TTY , "tty" },
614 {BOTH_LOGWIN_STDOUT , "both" }
617 RETURN_G_RC_MODE("logging-destination",
618 logging_dest,
622 /*! \todo Finish function documentation!!!
623 * \brief
624 * \par Function Description
627 SCM g_rc_attribute_name(SCM scm_path)
629 char *path;
630 SCM ret;
632 SCM_ASSERT (scm_is_string (scm_path), scm_path,
633 SCM_ARG1, "attribute-name");
635 path = SCM_STRING_CHARS (scm_path);
637 /* not unique? */
638 if (!s_attrib_uniq(path)) {
639 ret = SCM_BOOL_F;
640 } else {
641 s_attrib_add_entry (path);
642 ret = SCM_BOOL_T;
645 return ret;
648 /*! \todo Finish function documentation!!!
649 * \brief
650 * \par Function Description
653 SCM g_rc_scrollbars(SCM mode)
655 static const vstbl_entry mode_table[] = {
656 {TRUE , "enabled" },
657 {FALSE, "disabled"},
660 RETURN_G_RC_MODE("scrollbars",
661 default_scrollbars_flag,
665 /*! \todo Finish function documentation!!!
666 * \brief
667 * \par Function Description
670 SCM g_rc_paper_size(SCM width, SCM height)
671 #define FUNC_NAME "paper-size"
673 SCM_ASSERT (SCM_NIMP (width) && SCM_REALP (width), width,
674 SCM_ARG1, FUNC_NAME);
675 SCM_ASSERT (SCM_NIMP (height) && SCM_REALP (height), height,
676 SCM_ARG2, FUNC_NAME);
678 /* yes this is legit, we are casting the resulting double to an int */
679 default_paper_width = (int) (SCM_NUM2DOUBLE (0, width) * MILS_PER_INCH);
680 default_paper_height = (int) (SCM_NUM2DOUBLE (0, height) * MILS_PER_INCH);
682 return SCM_BOOL_T;
684 #undef FUNC_NAME
686 /*! \todo Finish function documentation!!!
687 * \brief
688 * \par Function Description
691 SCM g_rc_paper_sizes(SCM scm_papername, SCM scm_width, SCM scm_height)
692 #define FUNC_NAME "paper-sizes"
694 int width;
695 int height;
696 char *papername;
697 SCM ret;
699 SCM_ASSERT (scm_is_string (scm_papername), scm_papername,
700 SCM_ARG1, FUNC_NAME);
701 SCM_ASSERT (SCM_NIMP (scm_width) && SCM_REALP (scm_width), scm_width,
702 SCM_ARG2, FUNC_NAME);
703 SCM_ASSERT (SCM_NIMP (scm_height) && SCM_REALP (scm_height), scm_height,
704 SCM_ARG3, FUNC_NAME);
706 papername = SCM_STRING_CHARS (scm_papername);
707 width = (int) (SCM_NUM2DOUBLE (0, scm_width) * MILS_PER_INCH);
708 height = (int) (SCM_NUM2DOUBLE (0, scm_height) * MILS_PER_INCH);
710 if (!s_papersizes_uniq(papername)) {
711 ret = SCM_BOOL_F;
712 } else {
713 s_papersizes_add_entry(papername, width, height);
714 ret = SCM_BOOL_T;
717 return ret;
719 #undef FUNC_NAME
721 /*! \todo Finish function documentation!!!
722 * \brief
723 * \par Function Description
726 SCM g_rc_output_text(SCM mode)
728 static const vstbl_entry mode_table[] = {
729 {VECTOR_FONTS , "vector" },
730 {PS_FONTS , "ps" },
733 RETURN_G_RC_MODE("output-text",
734 default_text_output,
738 /*! \todo Finish function documentation!!!
739 * \brief
740 * \par Function Description
742 * \todo this keyword needs a better name ...
744 SCM g_rc_output_type(SCM mode)
746 static const vstbl_entry mode_table[] = {
747 {WINDOW, "current window" },
748 {EXTENTS, "limits" }, /* deprecated */
749 {EXTENTS, "extents" },
750 {EXTENTS_NOMARGINS, "extents no margins" },
753 RETURN_G_RC_MODE("output-type",
754 default_print_output_type,
758 /*! \todo Finish function documentation!!!
759 * \brief
760 * \par Function Description
763 SCM g_rc_output_orientation(SCM mode)
765 static const vstbl_entry mode_table[] = {
766 {PORTRAIT , "portrait" },
767 {LANDSCAPE, "landscape"},
770 RETURN_G_RC_MODE("output-orientation",
771 default_print_orientation,
775 /*! \todo Finish function documentation!!!
776 * \brief
777 * \par Function Description
780 SCM g_rc_image_color(SCM mode)
782 static const vstbl_entry mode_table[] = {
783 {TRUE , "enabled" },
784 {FALSE, "disabled"},
787 RETURN_G_RC_MODE("image-color",
788 default_image_color,
792 /*! \todo Finish function documentation!!!
793 * \brief
794 * \par Function Description
797 SCM g_rc_image_size(SCM width, SCM height)
799 SCM_ASSERT (scm_is_integer (width), width, SCM_ARG1, "image-size");
800 SCM_ASSERT (scm_is_integer (height), height, SCM_ARG2, "image-size");
802 /* yes this is legit, we are casting the resulting double to an int */
803 default_image_width = scm_to_int (width);
804 default_image_height = scm_to_int (height);
806 return SCM_BOOL_T;
809 /*! \todo Finish function documentation!!!
810 * \brief
811 * \par Function Description
814 SCM g_rc_output_color(SCM mode)
816 static const vstbl_entry mode_table[] = {
817 {TRUE , "enabled" },
818 {FALSE, "disabled"},
821 /* this variable is inconsistantly named with the rest */
822 RETURN_G_RC_MODE("output-color",
823 default_print_color,
827 /*! \todo Finish function documentation!!!
828 * \brief
829 * \par Function Description
832 SCM g_rc_output_capstyle(SCM mode)
834 static const vstbl_entry mode_table[] = {
835 {BUTT_CAP , "butt" },
836 {ROUND_CAP , "round" },
837 {SQUARE_CAP, "square"},
840 RETURN_G_RC_MODE("output-capstyle",
841 default_print_output_capstyle,
845 /*! \todo Finish function documentation!!!
846 * \brief
847 * \par Function Description
850 SCM g_rc_log_window(SCM mode)
852 static const vstbl_entry mode_table[] = {
853 {MAP_ON_STARTUP, "startup" },
854 {MAP_LATER , "later" },
857 RETURN_G_RC_MODE("log-window",
858 default_log_window,
862 /*! \todo Finish function documentation!!!
863 * \brief
864 * \par Function Description
867 SCM g_rc_log_window_type(SCM mode)
869 static const vstbl_entry mode_table[] = {
870 {TRANSIENT, "transient" },
871 {DECORATED, "decorated" },
874 RETURN_G_RC_MODE("log-window-type",
875 default_log_window_type,
879 /*! \todo Finish function documentation!!!
880 * \brief
881 * \par Function Description
884 SCM g_rc_third_button(SCM mode)
886 static const vstbl_entry mode_table[] = {
887 {POPUP_ENABLED , "popup" },
888 {MOUSEPAN_ENABLED, "mousepan"},
891 RETURN_G_RC_MODE("third-button",
892 default_third_button,
896 /*! \todo Finish function documentation!!!
897 * \brief
898 * \par Function Description
901 SCM g_rc_middle_button(SCM mode)
903 static const vstbl_entry mode_table[] = {
904 {STROKE, "stroke"},
905 {REPEAT, "repeat"},
906 {ACTION, "action"},
907 {MID_MOUSEPAN_ENABLED, "mousepan"},
910 RETURN_G_RC_MODE("middle-button",
911 default_middle_button,
915 /*! \todo Finish function documentation!!!
916 * \brief
917 * \par Function Description
920 SCM g_rc_net_consolidate(SCM mode)
922 static const vstbl_entry mode_table[] = {
923 {TRUE , "enabled" },
924 {FALSE, "disabled"},
927 RETURN_G_RC_MODE("net-consolidate",
928 default_net_consolidate,
932 /*! \todo Finish function documentation!!!
933 * \brief
934 * \par Function Description
937 SCM g_rc_file_preview(SCM mode)
939 static const vstbl_entry mode_table[] = {
940 {TRUE , "enabled" },
941 {FALSE, "disabled"},
944 /* this variable is inconsistantly named with the rest */
945 RETURN_G_RC_MODE("file-preview",
946 default_file_preview,
950 /*! \todo Finish function documentation!!!
951 * \brief
952 * \par Function Description
955 SCM g_rc_enforce_hierarchy(SCM mode)
957 static const vstbl_entry mode_table[] = {
958 {TRUE , "enabled" },
959 {FALSE, "disabled"},
962 RETURN_G_RC_MODE("enforce-hierarchy",
963 default_enforce_hierarchy,
967 /*! \todo Finish function documentation!!!
968 * \brief
969 * \par Function Description
972 SCM g_rc_text_origin_marker(SCM mode)
974 static const vstbl_entry mode_table[] = {
975 {TRUE , "enabled" },
976 {FALSE, "disabled"},
979 RETURN_G_RC_MODE("text-origin-marker",
980 default_text_origin_marker,
984 /*! \todo Finish function documentation!!!
985 * \brief
986 * \par Function Description
989 SCM g_rc_fast_mousepan(SCM mode)
991 static const vstbl_entry mode_table[] = {
992 {TRUE , "enabled" },
993 {FALSE, "disabled"},
996 RETURN_G_RC_MODE("fast-mousepan",
997 default_fast_mousepan,
1001 /*! \todo Finish function documentation!!!
1002 * \brief
1003 * \par Function Description
1006 SCM g_rc_raise_dialog_boxes_on_expose(SCM mode)
1008 static const vstbl_entry mode_table[] = {
1009 {TRUE , "enabled" },
1010 {FALSE, "disabled"},
1013 RETURN_G_RC_MODE("raise-dialog-boxes-on-expose",
1014 default_raise_dialog_boxes,
1018 /*! \todo Finish function documentation!!!
1019 * \brief
1020 * \par Function Description
1023 SCM g_rc_continue_component_place(SCM mode)
1025 static const vstbl_entry mode_table[] = {
1026 {TRUE , "enabled" },
1027 {FALSE, "disabled"},
1030 RETURN_G_RC_MODE("continue-component-place",
1031 default_continue_component_place,
1035 /*! \todo Finish function documentation!!!
1036 * \brief
1037 * \par Function Description
1040 SCM g_rc_undo_levels(SCM levels)
1042 int val;
1044 SCM_ASSERT (scm_is_integer (levels), levels, SCM_ARG1, "undo-levels");
1046 val = scm_to_int (levels);
1048 if (val == 0) {
1049 fprintf(stderr, _("Invalid num levels [%d] passed to undo-levels\n"),
1050 val);
1051 val = 10; /* absolute default */
1054 default_undo_levels = val;
1056 return SCM_BOOL_T;
1059 /*! \todo Finish function documentation!!!
1060 * \brief
1061 * \par Function Description
1064 SCM g_rc_undo_control(SCM mode)
1066 static const vstbl_entry mode_table[] = {
1067 {TRUE , "enabled" },
1068 {FALSE, "disabled"},
1071 RETURN_G_RC_MODE("undo-control", default_undo_control, 2);
1074 /*! \todo Finish function documentation!!!
1075 * \brief
1076 * \par Function Description
1079 SCM g_rc_undo_type(SCM mode)
1081 static const vstbl_entry mode_table[] = {
1082 {UNDO_DISK , "disk" },
1083 {UNDO_MEMORY, "memory" },
1086 RETURN_G_RC_MODE("undo-type",
1087 default_undo_type,
1091 /*! \todo Finish function documentation!!!
1092 * \brief
1093 * \par Function Description
1096 SCM g_rc_draw_grips(SCM mode)
1098 static const vstbl_entry mode_table[] = {
1099 {TRUE , "enabled" },
1100 {FALSE, "disabled"},
1103 RETURN_G_RC_MODE("draw-grips",
1104 default_draw_grips,
1108 /*! \todo Finish function documentation!!!
1109 * \brief
1110 * \par Function Description
1113 SCM g_rc_netconn_rubberband(SCM mode)
1115 static const vstbl_entry mode_table[] = {
1116 {TRUE , "enabled" },
1117 {FALSE, "disabled"},
1120 RETURN_G_RC_MODE("netconn-rubberband",
1121 default_netconn_rubberband,
1125 /*! \todo Finish function documentation!!!
1126 * \brief
1127 * \par Function Description
1130 SCM g_rc_sort_component_library(SCM mode)
1132 static const vstbl_entry mode_table[] = {
1133 {TRUE , "enabled" },
1134 {FALSE, "disabled"},
1137 RETURN_G_RC_MODE("sort_component_library",
1138 default_sort_component_library,
1142 /*! \todo Finish function documentation!!!
1143 * \brief
1144 * \par Function Description
1147 SCM g_rc_add_menu(SCM menu_name, SCM menu_items)
1149 SCM_ASSERT (scm_is_string (menu_name), menu_name,
1150 SCM_ARG1, "add-menu");
1151 SCM_ASSERT (SCM_NIMP (menu_items) && SCM_CONSP (menu_items), menu_items,
1152 SCM_ARG2, "add-menu");
1154 s_menu_add_entry(SCM_STRING_CHARS (menu_name), menu_items);
1156 return SCM_BOOL_T;
1159 /*! \todo Finish function documentation!!!
1160 * \brief
1161 * \par Function Description
1164 SCM g_rc_window_size(SCM width, SCM height)
1166 SCM_ASSERT (scm_is_integer (width), width, SCM_ARG1, "window-size");
1167 SCM_ASSERT (scm_is_integer (height), height, SCM_ARG2, "window-size");
1169 default_width = scm_to_int (width);
1170 default_height = scm_to_int (height);
1172 return SCM_BOOL_T;
1175 /*! \todo Finish function documentation!!!
1176 * \brief
1177 * \par Function Description
1180 SCM g_rc_warp_cursor(SCM mode)
1182 static const vstbl_entry mode_table[] = {
1183 {TRUE , "enabled" },
1184 {FALSE, "disabled"},
1187 RETURN_G_RC_MODE("warp-cursor",
1188 default_warp_cursor,
1192 /*! \todo Finish function documentation!!!
1193 * \brief
1194 * \par Function Description
1197 SCM g_rc_toolbars(SCM mode)
1199 static const vstbl_entry mode_table[] = {
1200 {TRUE , "enabled" },
1201 {FALSE, "disabled"},
1204 RETURN_G_RC_MODE("toolbars",
1205 default_toolbars,
1209 /*! \todo Finish function documentation!!!
1210 * \brief
1211 * \par Function Description
1214 SCM g_rc_handleboxes(SCM mode)
1216 static const vstbl_entry mode_table[] = {
1217 {TRUE , "enabled" },
1218 {FALSE, "disabled"},
1221 RETURN_G_RC_MODE("handleboxes",
1222 default_handleboxes,
1226 /*! \todo Finish function documentation!!!
1227 * \brief
1228 * \par Function Description
1231 SCM g_rc_setpagedevice_orientation(SCM mode)
1233 static const vstbl_entry mode_table[] = {
1234 {TRUE , "enabled" },
1235 {FALSE, "disabled"},
1238 RETURN_G_RC_MODE("setpagedevice-orientation",
1239 default_setpagedevice_orientation,
1243 /*! \todo Finish function documentation!!!
1244 * \brief
1245 * \par Function Description
1248 SCM g_rc_setpagedevice_pagesize(SCM mode)
1250 static const vstbl_entry mode_table[] = {
1251 {TRUE , "enabled" },
1252 {FALSE, "disabled"},
1255 RETURN_G_RC_MODE("setpagedevice-pagesize",
1256 default_setpagedevice_pagesize,
1260 /*! \todo Finish function documentation!!!
1261 * \brief
1262 * \par Function Description
1265 SCM g_rc_bus_ripper_size(SCM size)
1267 int val;
1269 SCM_ASSERT (scm_is_integer (size), size, SCM_ARG1, "bus-ripper-size");
1271 val = scm_to_int (size);
1273 if (val == 0) {
1274 fprintf(stderr, _("Invalid size [%d] passed to bus-ripper-size\n"),
1275 val);
1276 val = 200; /* absolute default */
1279 default_bus_ripper_size = val;
1281 return SCM_BOOL_T;
1284 /*! \todo Finish function documentation!!!
1285 * \brief
1286 * \par Function Description
1289 SCM g_rc_bus_ripper_type(SCM mode)
1291 static const vstbl_entry mode_table[] = {
1292 {COMP_BUS_RIPPER, "component" },
1293 {NET_BUS_RIPPER, "net" }
1296 RETURN_G_RC_MODE("bus-ripper-type",
1297 default_bus_ripper_type,
1301 /*! \todo Finish function documentation!!!
1302 * \brief
1303 * \par Function Description
1306 SCM g_rc_bus_ripper_rotation(SCM mode)
1308 static const vstbl_entry mode_table[] = {
1309 {SYMMETRIC, "symmetric" },
1310 {NON_SYMMETRIC, "non-symmetric" }
1313 RETURN_G_RC_MODE("bus-ripper-rotation",
1314 default_bus_ripper_rotation,
1318 /*! \todo Finish function documentation!!!
1319 * \brief
1320 * \par Function Description
1323 SCM g_rc_force_boundingbox(SCM mode)
1325 static const vstbl_entry mode_table[] = {
1326 {TRUE, "enabled" },
1327 {FALSE, "disabled" }
1330 RETURN_G_RC_MODE("force-boundingbox",
1331 default_force_boundingbox,
1335 /*! \todo Finish function documentation!!!
1336 * \brief
1337 * \par Function Description
1340 SCM g_rc_grid_dot_size(SCM dotsize)
1342 int val;
1344 SCM_ASSERT (scm_is_integer (dotsize), dotsize, SCM_ARG1, "grid-dot-size");
1346 val = scm_to_int (dotsize);
1348 if (val <= 0) {
1349 fprintf(stderr, _("Invalid dot size [%d] passed to grid-dot-size\n"),
1350 val);
1351 val = 1; /* absolute default */
1354 default_grid_dot_size = val;
1356 return SCM_BOOL_T;
1359 /*! \todo Finish function documentation!!!
1360 * \brief
1361 * \par Function Description
1364 SCM g_rc_grid_mode(SCM mode)
1366 static const vstbl_entry mode_table[] = {
1367 {GRID_VARIABLE_MODE, "variable" },
1368 {GRID_FIXED_MODE, "fixed" }
1371 RETURN_G_RC_MODE("grid-mode",
1372 default_grid_mode,
1376 /*! \todo Finish function documentation!!!
1377 * \brief
1378 * \par Function Description
1381 SCM g_rc_grid_fixed_threshold(SCM spacing)
1383 int val;
1385 SCM_ASSERT (scm_is_integer (spacing), spacing, SCM_ARG1, "grid-fixed-threshold");
1387 val = scm_to_int (spacing);
1389 if (val <= 0) {
1390 fprintf(stderr, _("Invalid pixel spacing [%d] passed to grid-fixed-threshold\n"),
1391 val);
1392 val = 10; /* absolute default */
1395 default_grid_fixed_threshold = val;
1397 return SCM_BOOL_T;
1400 /*! \todo Finish function documentation!!!
1401 * \brief
1402 * \par Function Description
1405 SCM g_rc_output_vector_threshold(SCM numlines)
1407 int val;
1409 SCM_ASSERT (scm_is_integer (numlines), numlines,
1410 SCM_ARG1, "output-vector-threshold");
1412 val = scm_to_int (numlines);
1414 default_print_vector_threshold = val;
1416 return SCM_BOOL_T;
1419 /*! \todo Finish function documentation!!!
1420 * \brief
1421 * \par Function Description
1424 SCM g_rc_add_attribute_offset(SCM offset)
1426 int val;
1428 SCM_ASSERT (scm_is_integer (offset), offset,
1429 SCM_ARG1, "add-attribute-offset");
1431 val = scm_to_int (offset);
1433 if (val < 0) {
1434 fprintf(stderr, _("Invalid offset [%d] passed to add-attribute-offset\n"),
1435 val);
1436 val = 50; /* absolute default */
1439 default_add_attribute_offset = val;
1441 return SCM_BOOL_T;
1444 /*! \todo Finish function documentation!!!
1445 * \brief
1446 * \par Function Description
1449 SCM g_rc_auto_save_interval(SCM seconds)
1451 int val;
1453 SCM_ASSERT (scm_is_integer (seconds), seconds, SCM_ARG1, "auto-save-interval");
1455 val = scm_to_int (seconds);
1457 if (val < 0) {
1458 fprintf(stderr, _("Invalid number of seconds [%d] passed to auto-save-interval\n"),
1459 val);
1460 val = 120; /* absolute default */
1463 default_auto_save_interval = val;
1465 return SCM_BOOL_T;
1468 /*! \todo Finish function documentation!!!
1469 * \brief
1470 * \par Function Description
1473 SCM g_rc_drag_can_move(SCM mode)
1475 static const vstbl_entry mode_table[] = {
1476 {TRUE, "enabled" },
1477 {FALSE, "disabled" }
1480 RETURN_G_RC_MODE("drag-can-move",
1481 default_drag_can_move,
1485 /*! \todo Finish function documentation!!!
1486 * \brief
1487 * \par Function Description
1490 SCM g_rc_mousepan_gain(SCM gain)
1492 int val;
1494 SCM_ASSERT (scm_is_integer (gain), gain, SCM_ARG1, "mousepan-gain");
1496 val = scm_to_int (gain);
1498 if (val <= 0) {
1499 fprintf(stderr, _("Invalid gain [%d] passed to mousepan-gain\n"),
1500 val);
1501 val = 5; /* absolute default */
1504 default_mousepan_gain = val;
1506 return SCM_BOOL_T;
1509 /*! \brief Scheme function for setting the step for keyboard pan.
1511 * Default setting is 20.
1513 SCM g_rc_keyboardpan_gain(SCM gain)
1515 int val;
1517 SCM_ASSERT (scm_is_integer (gain), gain, SCM_ARG1, "keyboardpan-gain");
1519 val = scm_to_int (gain);
1521 if (val <= 0) {
1522 fprintf(stderr, _("Invalid gain [%d] passed to keyboardpan-gain\n"),
1523 val);
1524 val = 20; /* absolute default */
1527 default_keyboardpan_gain = val;
1529 return SCM_BOOL_T;
1532 /*! \todo Finish function documentation!!!
1533 * \brief
1534 * \par Function Description
1537 SCM g_rc_print_command(SCM scm_command)
1538 #define FUNC_NAME "print-command"
1540 char *command;
1542 SCM_ASSERT (scm_is_string (scm_command), scm_command,
1543 SCM_ARG1, FUNC_NAME);
1545 command = SCM_STRING_CHARS (scm_command);
1547 g_free (default_print_command);
1548 default_print_command = g_strdup (command);
1550 return SCM_BOOL_T;
1552 #undef FUNC_NAME
1554 /*! \todo Finish function documentation!!!
1555 * \brief
1556 * \par Function Description
1559 SCM g_rc_select_slack_pixels(SCM pixels)
1561 int val;
1563 SCM_ASSERT (scm_is_integer (pixels), pixels, SCM_ARG1, "select-slack-pixels");
1565 val = scm_to_int (pixels);
1567 if (val <= 0) {
1568 fprintf(stderr, _("Invalid number of pixels [%d] passed to select-slack-pixels\n"),
1569 val);
1570 val = 4; /* absolute default */
1573 default_select_slack_pixels = val;
1575 return SCM_BOOL_T;