Updated copyright text/header in most source files.
[geda-gaf/peter-b.git] / gschem / src / g_rc.c
blobcf61190c51d8369762b57f91220eae315c331649
1 /* gEDA - GPL Electronic Design Automation
2 * gschem - gEDA Schematic Capture
3 * Copyright (C) 1998-2010 Ales Hvezda
4 * Copyright (C) 1998-2010 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>
21 #include <version.h>
23 #include <stdio.h>
24 #include <sys/stat.h>
25 #include <ctype.h>
26 #ifdef HAVE_STRING_H
27 #include <string.h>
28 #endif
29 #ifdef HAVE_STDLIB_H
30 #include <stdlib.h>
31 #endif
32 #ifdef HAVE_UNISTD_H
33 #include <unistd.h>
34 #endif
36 #include "gschem.h"
38 #ifdef HAVE_LIBDMALLOC
39 #include <dmalloc.h>
40 #endif
42 /*! \todo Finish function documentation!!!
43 * \brief
44 * \par Function Description
47 void g_rc_parse_gtkrc()
49 gchar *filename;
51 filename = g_build_filename (s_path_sys_config (), "gschem-gtkrc", NULL);
52 gtk_rc_parse (filename);
53 g_free (filename);
55 filename = g_build_filename (s_path_user_config (), "gschem-gtkrc", NULL);
56 gtk_rc_parse (filename);
57 g_free (filename);
60 /*! \todo Finish function documentation!!!
61 * \brief
62 * \par Function Description
65 SCM g_rc_gschem_version(SCM version)
67 SCM ret;
69 SCM_ASSERT (scm_is_string (version), version,
70 SCM_ARG1, "gschem-version");
72 if (g_strcasecmp (SCM_STRING_CHARS (version), PACKAGE_DATE_VERSION) != 0) {
73 fprintf(stderr,
74 "You are running gEDA/gaf version [%s%s.%s],\n",
75 PREPEND_VERSION_STRING, PACKAGE_DOTTED_VERSION,
76 PACKAGE_DATE_VERSION);
77 fprintf(stderr,
78 "but you have a version [%s] gschemrc file:\n[%s]\n",
79 SCM_STRING_CHARS (version), rc_filename);
80 fprintf(stderr,
81 "Please be sure that you have the latest rc file.\n");
82 ret = SCM_BOOL_F;
83 } else {
84 ret = SCM_BOOL_T;
87 return ret;
90 /*! \todo Finish function documentation!!!
91 * \brief
92 * \par Function Description
95 SCM g_rc_net_endpoint_mode(SCM mode)
97 static const vstbl_entry mode_table[] = {
98 {FILLEDBOX, "filledbox"}
101 RETURN_G_RC_MODE("net-endpoint-mode",
102 default_net_endpoint_mode,
106 /*! \todo Finish function documentation!!!
107 * \brief
108 * \par Function Description
111 SCM g_rc_net_midpoint_mode(SCM mode)
113 static const vstbl_entry mode_table[] = {
114 {FILLED, "filled"}
117 RETURN_G_RC_MODE("net-midpoint-mode",
118 default_net_midpoint_mode,
122 /*! \todo Finish function documentation!!!
123 * \brief
124 * \par Function Description
127 SCM g_rc_net_direction_mode(SCM mode)
129 static const vstbl_entry mode_table[] = {
130 {TRUE , "enabled" },
131 {FALSE, "disabled"}
134 RETURN_G_RC_MODE("net-direction-mode",
135 default_net_direction_mode,
139 /*! \todo Finish function documentation!!!
140 * \brief
141 * \par Function Description
144 SCM g_rc_net_selection_mode(SCM mode)
146 static const vstbl_entry mode_table[] = {
147 {0, "disabled"},
148 {2, "enabled_net"},
149 {3, "enabled_all"}
152 RETURN_G_RC_MODE("net-selection-mode",
153 default_net_selection_mode,
157 /*! \todo Finish function documentation!!!
158 * \brief
159 * \par Function Description
162 SCM g_rc_net_style(SCM mode)
164 static const vstbl_entry mode_table[] = {
165 {THIN , "thin" },
166 {THICK, "thick"}
169 RETURN_G_RC_MODE("net-style",
170 default_net_style,
174 /*! \todo Finish function documentation!!!
175 * \brief
176 * \par Function Description
179 SCM g_rc_bus_style(SCM mode)
181 static const vstbl_entry mode_table[] = {
182 {THIN , "thin" },
183 {THICK, "thick"}
186 RETURN_G_RC_MODE("bus-style",
187 default_bus_style,
191 /*! \todo Finish function documentation!!!
192 * \brief
193 * \par Function Description
196 SCM g_rc_pin_style(SCM mode)
198 static const vstbl_entry mode_table[] = {
199 {THIN , "thin" },
200 {THICK, "thick"}
203 RETURN_G_RC_MODE("pin-style",
204 default_pin_style,
208 /*! \todo Finish function documentation!!!
209 * \brief
210 * \par Function Description
213 SCM g_rc_line_style(SCM mode)
215 static const vstbl_entry mode_table[] = {
216 {THIN , "thin" },
217 {THICK, "thick"}
220 RETURN_G_RC_MODE("line-style",
221 default_line_style,
225 /*! \todo Finish function documentation!!!
226 * \brief
227 * \par Function Description
230 SCM g_rc_action_feedback_mode(SCM mode)
232 static const vstbl_entry mode_table[] = {
233 {OUTLINE , "outline" },
234 {BOUNDINGBOX, "boundingbox"}
237 RETURN_G_RC_MODE("action-feedback-mode",
238 default_actionfeedback_mode,
242 /*! \todo Finish function documentation!!!
243 * \brief
244 * \par Function Description
247 SCM g_rc_zoom_with_pan(SCM mode)
249 static const vstbl_entry mode_table[] = {
250 {TRUE, "enabled" },
251 {FALSE, "disabled"}
254 RETURN_G_RC_MODE("zoom-with-pan",
255 default_zoom_with_pan,
259 /*! \todo Finish function documentation!!!
260 * \brief
261 * \par Function Description
264 SCM g_rc_text_feedback(SCM mode)
266 static const vstbl_entry mode_table[] = {
267 {ALWAYS , "always" },
268 {ONLY_WHEN_READABLE, "only-when-readable"}
271 RETURN_G_RC_MODE("text-feedback",
272 default_text_feedback,
276 /*! \todo Finish function documentation!!!
277 * \brief
278 * \par Function Description
281 SCM g_rc_text_display_zoomfactor(SCM zoomfactor)
283 int val;
285 SCM_ASSERT (scm_is_integer (zoomfactor), zoomfactor,
286 SCM_ARG1, "test-display-zoom-factor");
288 val = scm_to_int (zoomfactor);
289 if (val == 0) {
290 fprintf(stderr,
291 _("Invalid zoomfactor [%d] passed to %s\n"),
292 val,
293 "text-display-zoom-factor");
294 val = 10; /* absolute default */
297 default_text_display_zoomfactor = val;
299 return SCM_BOOL_T;
302 /*! \todo Finish function documentation!!!
303 * \brief
304 * \par Function Description
307 SCM g_rc_scrollbar_update(SCM scmmode)
309 SCM ret = SCM_BOOL_T;
311 SCM_ASSERT (scm_is_string (scmmode), scmmode,
312 SCM_ARG1, "scrollbar-update");
314 return ret;
317 /*! \todo Finish function documentation!!!
318 * \brief
319 * \par Function Description
322 SCM g_rc_object_clipping(SCM mode)
324 static const vstbl_entry mode_table[] = {
325 {TRUE , "enabled" },
326 {FALSE, "disabled"}
329 RETURN_G_RC_MODE("object-clipping",
330 default_object_clipping,
334 /*! \todo Finish function documentation!!!
335 * \brief
336 * \par Function Description
339 SCM g_rc_logging(SCM mode)
341 static const vstbl_entry mode_table[] = {
342 {TRUE , "enabled" },
343 {FALSE, "disabled"}
346 RETURN_G_RC_MODE("logging",
347 default_do_logging,
351 /*! \todo Finish function documentation!!!
352 * \brief
353 * \par Function Description
356 SCM g_rc_embed_components(SCM mode)
358 static const vstbl_entry mode_table[] = {
359 {TRUE , "enabled" },
360 {FALSE, "disabled"}
363 RETURN_G_RC_MODE("embed-components",
364 default_embed_complex,
368 /*! \brief read the configuration string list for the component dialog
369 * \par Function Description
370 * This function reads the string list from the component-dialog-attributes
371 * configuration parameter and converts the list into a GList.
372 * The GList is stored in the global default_component_select_attrlist variable.
374 SCM g_rc_component_dialog_attributes(SCM stringlist)
376 int length, i;
377 GList *list=NULL;
378 gchar *attr;
380 SCM_ASSERT(scm_list_p(stringlist), stringlist, SCM_ARG1, "scm_is_list failed");
381 length = scm_ilength(stringlist);
383 /* If the command is called multiple times, remove the old list before
384 recreating it */
385 g_list_foreach(default_component_select_attrlist, (GFunc)g_free, NULL);
386 g_list_free(default_component_select_attrlist);
388 /* convert the scm list into a GList */
389 for (i=0; i < length; i++) {
390 SCM_ASSERT(scm_is_string(scm_list_ref(stringlist, scm_from_int(i))),
391 scm_list_ref(stringlist, scm_from_int(i)), SCM_ARG1,
392 "list element is not a string");
393 attr = g_strdup(SCM_STRING_CHARS(scm_list_ref(stringlist, scm_from_int(i))));
394 list = g_list_prepend(list, attr);
397 default_component_select_attrlist = g_list_reverse(list);
399 return SCM_BOOL_T;
403 /*! \todo Finish function documentation!!!
404 * \brief
405 * \par Function Description
408 SCM g_rc_text_size(SCM size)
410 int val;
412 SCM_ASSERT (scm_is_integer (size), size, SCM_ARG1, "text-size");
414 val = scm_to_int (size);
415 if (val == 0) {
416 fprintf(stderr,
417 _("Invalid size [%d] passed to text-size\n"),
418 val);
419 val = 10; /* absolute default */
422 default_text_size = val;
424 return SCM_BOOL_T;
427 /*! \brief Catch deprecated option to set the output font scaling factor
429 * \par This setting used to change the scale of the output PS font
430 * characters. Since gEDA 1.6.0, this is fixed to match the on-screen
431 * font size.
433 * \return SCM_BOOL_T always.
436 SCM g_rc_postscript_font_scale(SCM scale)
438 g_warning (_("\n"
439 "The config option postscript-font-scale is "
440 "deprecated and will be removed in gEDA 1.8.0.\n"
441 "Printed text is fixed to match on-screen sizes. "
442 "Please remove this option from your config files.\n"
443 "\n"));
445 return SCM_BOOL_T;
448 /*! \todo Finish function documentation!!!
449 * \brief
450 * \par Function Description
452 * \todo inconsistant naming with keyword name and variable to hold
453 * variable
455 SCM g_rc_text_caps_style(SCM mode)
457 static const vstbl_entry mode_table[] = {
458 {LOWER, "lower" },
459 {UPPER, "upper" },
460 {BOTH , "both" }
463 RETURN_G_RC_MODE("text-caps-style",
464 default_text_caps,
468 /*! \todo Finish function documentation!!!
469 * \brief
470 * \par Function Description
473 SCM g_rc_snap_size(SCM size)
475 int val;
477 SCM_ASSERT (scm_is_integer (size), size, SCM_ARG1, "snap-size");
479 val = scm_to_int (size);
480 if (val == 0) {
481 fprintf(stderr, _("Invalid size [%d] passed to snap-size\n"),
482 val);
483 val = 100; /* absolute default */
486 default_snap_size = val;
488 return SCM_BOOL_T;
491 /*! \todo Finish function documentation!!!
492 * \brief
493 * \par Function Description
496 SCM g_rc_logging_destination(SCM mode)
498 static const vstbl_entry mode_table[] = {
499 {LOG_WINDOW , "log_window" },
500 {STDOUT_TTY , "tty" },
501 {BOTH_LOGWIN_STDOUT , "both" }
504 RETURN_G_RC_MODE("logging-destination",
505 logging_dest,
509 /*! \todo Finish function documentation!!!
510 * \brief
511 * \par Function Description
514 SCM g_rc_attribute_name(SCM scm_path)
516 char *path;
517 SCM ret;
519 SCM_ASSERT (scm_is_string (scm_path), scm_path,
520 SCM_ARG1, "attribute-name");
522 path = SCM_STRING_CHARS (scm_path);
524 /* not unique? */
525 if (!s_attrib_uniq(path)) {
526 ret = SCM_BOOL_F;
527 } else {
528 s_attrib_add_entry (path);
529 ret = SCM_BOOL_T;
532 return ret;
535 /*! \todo Finish function documentation!!!
536 * \brief
537 * \par Function Description
540 SCM g_rc_scrollbars(SCM mode)
542 static const vstbl_entry mode_table[] = {
543 {TRUE , "enabled" },
544 {FALSE, "disabled"},
547 RETURN_G_RC_MODE("scrollbars",
548 default_scrollbars_flag,
552 /*! \todo Finish function documentation!!!
553 * \brief
554 * \par Function Description
557 SCM g_rc_paper_size(SCM width, SCM height)
558 #define FUNC_NAME "paper-size"
560 SCM_ASSERT (SCM_NIMP (width) && SCM_REALP (width), width,
561 SCM_ARG1, FUNC_NAME);
562 SCM_ASSERT (SCM_NIMP (height) && SCM_REALP (height), height,
563 SCM_ARG2, FUNC_NAME);
565 /* yes this is legit, we are casting the resulting double to an int */
566 default_paper_width = (int) (SCM_NUM2DOUBLE (0, width) * MILS_PER_INCH);
567 default_paper_height = (int) (SCM_NUM2DOUBLE (0, height) * MILS_PER_INCH);
569 return SCM_BOOL_T;
571 #undef FUNC_NAME
573 /*! \todo Finish function documentation!!!
574 * \brief
575 * \par Function Description
578 SCM g_rc_paper_sizes(SCM scm_papername, SCM scm_width, SCM scm_height)
579 #define FUNC_NAME "paper-sizes"
581 int width;
582 int height;
583 char *papername;
584 SCM ret;
586 SCM_ASSERT (scm_is_string (scm_papername), scm_papername,
587 SCM_ARG1, FUNC_NAME);
588 SCM_ASSERT (SCM_NIMP (scm_width) && SCM_REALP (scm_width), scm_width,
589 SCM_ARG2, FUNC_NAME);
590 SCM_ASSERT (SCM_NIMP (scm_height) && SCM_REALP (scm_height), scm_height,
591 SCM_ARG3, FUNC_NAME);
593 papername = SCM_STRING_CHARS (scm_papername);
594 width = (int) (SCM_NUM2DOUBLE (0, scm_width) * MILS_PER_INCH);
595 height = (int) (SCM_NUM2DOUBLE (0, scm_height) * MILS_PER_INCH);
597 if (!s_papersizes_uniq(papername)) {
598 ret = SCM_BOOL_F;
599 } else {
600 s_papersizes_add_entry(papername, width, height);
601 ret = SCM_BOOL_T;
604 return ret;
606 #undef FUNC_NAME
608 /*! \todo Finish function documentation!!!
609 * \brief
610 * \par Function Description
612 * \todo this keyword needs a better name ...
614 SCM g_rc_output_type(SCM mode)
616 static const vstbl_entry mode_table[] = {
617 {WINDOW, "current window" },
618 {EXTENTS, "limits" }, /* deprecated */
619 {EXTENTS, "extents" },
620 {EXTENTS_NOMARGINS, "extents no margins" },
623 RETURN_G_RC_MODE("output-type",
624 default_print_output_type,
628 /*! \todo Finish function documentation!!!
629 * \brief
630 * \par Function Description
633 SCM g_rc_output_orientation(SCM mode)
635 static const vstbl_entry mode_table[] = {
636 {PORTRAIT , "portrait" },
637 {LANDSCAPE, "landscape"},
640 RETURN_G_RC_MODE("output-orientation",
641 default_print_orientation,
645 /*! \todo Finish function documentation!!!
646 * \brief
647 * \par Function Description
650 SCM g_rc_image_color(SCM mode)
652 static const vstbl_entry mode_table[] = {
653 {TRUE , "enabled" },
654 {FALSE, "disabled"},
657 RETURN_G_RC_MODE("image-color",
658 default_image_color,
662 /*! \todo Finish function documentation!!!
663 * \brief
664 * \par Function Description
667 SCM g_rc_image_size(SCM width, SCM height)
669 SCM_ASSERT (scm_is_integer (width), width, SCM_ARG1, "image-size");
670 SCM_ASSERT (scm_is_integer (height), height, SCM_ARG2, "image-size");
672 /* yes this is legit, we are casting the resulting double to an int */
673 default_image_width = scm_to_int (width);
674 default_image_height = scm_to_int (height);
676 return SCM_BOOL_T;
679 /*! \todo Finish function documentation!!!
680 * \brief
681 * \par Function Description
684 SCM g_rc_output_color(SCM mode)
686 static const vstbl_entry mode_table[] = {
687 {TRUE , "enabled" },
688 {FALSE, "disabled"},
691 /* this variable is inconsistantly named with the rest */
692 RETURN_G_RC_MODE("output-color",
693 default_print_color,
697 /*! \todo Finish function documentation!!!
698 * \brief
699 * \par Function Description
702 SCM g_rc_output_capstyle(SCM mode)
704 static const vstbl_entry mode_table[] = {
705 {BUTT_CAP , "butt" },
706 {ROUND_CAP , "round" },
707 {SQUARE_CAP, "square"},
710 RETURN_G_RC_MODE("output-capstyle",
711 default_print_output_capstyle,
715 /*! \todo Finish function documentation!!!
716 * \brief
717 * \par Function Description
720 SCM g_rc_log_window(SCM mode)
722 static const vstbl_entry mode_table[] = {
723 {MAP_ON_STARTUP, "startup" },
724 {MAP_LATER , "later" },
727 RETURN_G_RC_MODE("log-window",
728 default_log_window,
732 /*! \todo Finish function documentation!!!
733 * \brief
734 * \par Function Description
737 SCM g_rc_log_window_type(SCM mode)
739 static const vstbl_entry mode_table[] = {
740 {TRANSIENT, "transient" },
741 {DECORATED, "decorated" },
744 RETURN_G_RC_MODE("log-window-type",
745 default_log_window_type,
749 /*! \todo Finish function documentation!!!
750 * \brief
751 * \par Function Description
754 SCM g_rc_third_button(SCM mode)
756 static const vstbl_entry mode_table[] = {
757 {POPUP_ENABLED , "popup" },
758 {MOUSEPAN_ENABLED, "mousepan"},
761 RETURN_G_RC_MODE("third-button",
762 default_third_button,
766 /*! \todo Finish function documentation!!!
767 * \brief
768 * \par Function Description
771 SCM g_rc_middle_button(SCM mode)
773 static const vstbl_entry mode_table[] = {
774 {STROKE, "stroke"},
775 {REPEAT, "repeat"},
776 {ACTION, "action"},
777 {MID_MOUSEPAN_ENABLED, "mousepan"},
780 RETURN_G_RC_MODE("middle-button",
781 default_middle_button,
785 /*! \todo Finish function documentation!!!
786 * \brief
787 * \par Function Description
790 SCM g_rc_scroll_wheel(SCM mode)
792 static const vstbl_entry mode_table[] = {
793 {SCROLL_WHEEL_CLASSIC, "classic"},
794 {SCROLL_WHEEL_GTK, "gtk"},
797 RETURN_G_RC_MODE("scroll-wheel",
798 default_scroll_wheel,
802 /*! \todo Finish function documentation!!!
803 * \brief
804 * \par Function Description
807 SCM g_rc_net_consolidate(SCM mode)
809 static const vstbl_entry mode_table[] = {
810 {TRUE , "enabled" },
811 {FALSE, "disabled"},
814 RETURN_G_RC_MODE("net-consolidate",
815 default_net_consolidate,
819 /*! \todo Finish function documentation!!!
820 * \brief
821 * \par Function Description
824 SCM g_rc_file_preview(SCM mode)
826 static const vstbl_entry mode_table[] = {
827 {TRUE , "enabled" },
828 {FALSE, "disabled"},
831 /* this variable is inconsistantly named with the rest */
832 RETURN_G_RC_MODE("file-preview",
833 default_file_preview,
837 /*! \todo Finish function documentation!!!
838 * \brief
839 * \par Function Description
842 SCM g_rc_enforce_hierarchy(SCM mode)
844 static const vstbl_entry mode_table[] = {
845 {TRUE , "enabled" },
846 {FALSE, "disabled"},
849 RETURN_G_RC_MODE("enforce-hierarchy",
850 default_enforce_hierarchy,
854 /*! \todo Finish function documentation!!!
855 * \brief
856 * \par Function Description
859 SCM g_rc_text_origin_marker(SCM mode)
861 static const vstbl_entry mode_table[] = {
862 {TRUE , "enabled" },
863 {FALSE, "disabled"},
866 RETURN_G_RC_MODE("text-origin-marker",
867 default_text_origin_marker,
871 /*! \todo Finish function documentation!!!
872 * \brief
873 * \par Function Description
876 SCM g_rc_fast_mousepan(SCM mode)
878 static const vstbl_entry mode_table[] = {
879 {TRUE , "enabled" },
880 {FALSE, "disabled"},
883 RETURN_G_RC_MODE("fast-mousepan",
884 default_fast_mousepan,
888 /*! \todo Finish function documentation!!!
889 * \brief
890 * \par Function Description
893 SCM g_rc_raise_dialog_boxes_on_expose(SCM mode)
895 static const vstbl_entry mode_table[] = {
896 {TRUE , "enabled" },
897 {FALSE, "disabled"},
900 RETURN_G_RC_MODE("raise-dialog-boxes-on-expose",
901 default_raise_dialog_boxes,
905 /*! \todo Finish function documentation!!!
906 * \brief
907 * \par Function Description
910 SCM g_rc_continue_component_place(SCM mode)
912 static const vstbl_entry mode_table[] = {
913 {TRUE , "enabled" },
914 {FALSE, "disabled"},
917 RETURN_G_RC_MODE("continue-component-place",
918 default_continue_component_place,
922 /*! \todo Finish function documentation!!!
923 * \brief
924 * \par Function Description
927 SCM g_rc_undo_levels(SCM levels)
929 int val;
931 SCM_ASSERT (scm_is_integer (levels), levels, SCM_ARG1, "undo-levels");
933 val = scm_to_int (levels);
935 if (val == 0) {
936 fprintf(stderr, _("Invalid num levels [%d] passed to undo-levels\n"),
937 val);
938 val = 10; /* absolute default */
941 default_undo_levels = val;
943 return SCM_BOOL_T;
946 /*! \todo Finish function documentation!!!
947 * \brief
948 * \par Function Description
951 SCM g_rc_undo_control(SCM mode)
953 static const vstbl_entry mode_table[] = {
954 {TRUE , "enabled" },
955 {FALSE, "disabled"},
958 RETURN_G_RC_MODE("undo-control", default_undo_control, 2);
961 /*! \todo Finish function documentation!!!
962 * \brief
963 * \par Function Description
966 SCM g_rc_undo_type(SCM mode)
968 static const vstbl_entry mode_table[] = {
969 {UNDO_DISK , "disk" },
970 {UNDO_MEMORY, "memory" },
973 RETURN_G_RC_MODE("undo-type",
974 default_undo_type,
978 /*! \todo Finish function documentation!!!
979 * \brief
980 * \par Function Description
983 SCM g_rc_undo_panzoom(SCM mode)
985 static const vstbl_entry mode_table[] = {
986 {TRUE , "enabled" },
987 {FALSE, "disabled"},
990 RETURN_G_RC_MODE("undo-panzoom", default_undo_panzoom, 2);
993 /*! \todo Finish function documentation!!!
994 * \brief
995 * \par Function Description
998 SCM g_rc_draw_grips(SCM mode)
1000 static const vstbl_entry mode_table[] = {
1001 {TRUE , "enabled" },
1002 {FALSE, "disabled"},
1005 RETURN_G_RC_MODE("draw-grips",
1006 default_draw_grips,
1010 /*! \todo Finish function documentation!!!
1011 * \brief
1012 * \par Function Description
1015 SCM g_rc_netconn_rubberband(SCM mode)
1017 static const vstbl_entry mode_table[] = {
1018 {TRUE , "enabled" },
1019 {FALSE, "disabled"},
1022 RETURN_G_RC_MODE("netconn-rubberband",
1023 default_netconn_rubberband,
1028 /*! \todo Finish function documentation!!!
1029 * \brief
1030 * \par Function Description
1033 SCM g_rc_magnetic_net_mode(SCM mode)
1035 static const vstbl_entry mode_table[] = {
1036 {TRUE , "enabled" },
1037 {FALSE, "disabled"},
1040 RETURN_G_RC_MODE("magnetic-net-mode",
1041 default_magnetic_net_mode,
1045 /*! \todo Finish function documentation!!!
1046 * \brief
1047 * \par Function Description
1050 SCM g_rc_sort_component_library(SCM mode)
1052 static const vstbl_entry mode_table[] = {
1053 {TRUE , "enabled" },
1054 {FALSE, "disabled"},
1057 RETURN_G_RC_MODE("sort_component_library",
1058 default_sort_component_library,
1062 /*! \todo Finish function documentation!!!
1063 * \brief
1064 * \par Function Description
1067 SCM g_rc_add_menu(SCM menu_name, SCM menu_items)
1069 SCM_ASSERT (scm_is_string (menu_name), menu_name,
1070 SCM_ARG1, "add-menu");
1071 SCM_ASSERT (SCM_NIMP (menu_items) && SCM_CONSP (menu_items), menu_items,
1072 SCM_ARG2, "add-menu");
1074 s_menu_add_entry(SCM_STRING_CHARS (menu_name), menu_items);
1076 return SCM_BOOL_T;
1079 /*! \todo Finish function documentation!!!
1080 * \brief
1081 * \par Function Description
1084 SCM g_rc_window_size(SCM width, SCM height)
1086 SCM_ASSERT (scm_is_integer (width), width, SCM_ARG1, "window-size");
1087 SCM_ASSERT (scm_is_integer (height), height, SCM_ARG2, "window-size");
1089 default_width = scm_to_int (width);
1090 default_height = scm_to_int (height);
1092 return SCM_BOOL_T;
1095 /*! \todo Finish function documentation!!!
1096 * \brief
1097 * \par Function Description
1100 SCM g_rc_warp_cursor(SCM mode)
1102 static const vstbl_entry mode_table[] = {
1103 {TRUE , "enabled" },
1104 {FALSE, "disabled"},
1107 RETURN_G_RC_MODE("warp-cursor",
1108 default_warp_cursor,
1112 /*! \todo Finish function documentation!!!
1113 * \brief
1114 * \par Function Description
1117 SCM g_rc_toolbars(SCM mode)
1119 static const vstbl_entry mode_table[] = {
1120 {TRUE , "enabled" },
1121 {FALSE, "disabled"},
1124 RETURN_G_RC_MODE("toolbars",
1125 default_toolbars,
1129 /*! \todo Finish function documentation!!!
1130 * \brief
1131 * \par Function Description
1134 SCM g_rc_handleboxes(SCM mode)
1136 static const vstbl_entry mode_table[] = {
1137 {TRUE , "enabled" },
1138 {FALSE, "disabled"},
1141 RETURN_G_RC_MODE("handleboxes",
1142 default_handleboxes,
1146 /*! \todo Finish function documentation!!!
1147 * \brief
1148 * \par Function Description
1151 SCM g_rc_setpagedevice_orientation(SCM mode)
1153 static const vstbl_entry mode_table[] = {
1154 {TRUE , "enabled" },
1155 {FALSE, "disabled"},
1158 RETURN_G_RC_MODE("setpagedevice-orientation",
1159 default_setpagedevice_orientation,
1163 /*! \todo Finish function documentation!!!
1164 * \brief
1165 * \par Function Description
1168 SCM g_rc_setpagedevice_pagesize(SCM mode)
1170 static const vstbl_entry mode_table[] = {
1171 {TRUE , "enabled" },
1172 {FALSE, "disabled"},
1175 RETURN_G_RC_MODE("setpagedevice-pagesize",
1176 default_setpagedevice_pagesize,
1180 /*! \todo Finish function documentation!!!
1181 * \brief
1182 * \par Function Description
1185 SCM g_rc_bus_ripper_size(SCM size)
1187 int val;
1189 SCM_ASSERT (scm_is_integer (size), size, SCM_ARG1, "bus-ripper-size");
1191 val = scm_to_int (size);
1193 if (val == 0) {
1194 fprintf(stderr, _("Invalid size [%d] passed to bus-ripper-size\n"),
1195 val);
1196 val = 200; /* absolute default */
1199 default_bus_ripper_size = val;
1201 return SCM_BOOL_T;
1204 /*! \todo Finish function documentation!!!
1205 * \brief
1206 * \par Function Description
1209 SCM g_rc_bus_ripper_type(SCM mode)
1211 static const vstbl_entry mode_table[] = {
1212 {COMP_BUS_RIPPER, "component" },
1213 {NET_BUS_RIPPER, "net" }
1216 RETURN_G_RC_MODE("bus-ripper-type",
1217 default_bus_ripper_type,
1221 /*! \todo Finish function documentation!!!
1222 * \brief
1223 * \par Function Description
1226 SCM g_rc_bus_ripper_rotation(SCM mode)
1228 static const vstbl_entry mode_table[] = {
1229 {SYMMETRIC, "symmetric" },
1230 {NON_SYMMETRIC, "non-symmetric" }
1233 RETURN_G_RC_MODE("bus-ripper-rotation",
1234 default_bus_ripper_rotation,
1238 /*! \todo Finish function documentation!!!
1239 * \brief
1240 * \par Function Description
1243 SCM g_rc_force_boundingbox(SCM mode)
1245 static const vstbl_entry mode_table[] = {
1246 {TRUE, "enabled" },
1247 {FALSE, "disabled" }
1250 RETURN_G_RC_MODE("force-boundingbox",
1251 default_force_boundingbox,
1255 /*! \todo Finish function documentation!!!
1256 * \brief
1257 * \par Function Description
1260 SCM g_rc_dots_grid_dot_size (SCM dotsize)
1262 int val;
1264 SCM_ASSERT (scm_is_integer (dotsize), dotsize, SCM_ARG1, "dots-grid-dot-size");
1266 val = scm_to_int (dotsize);
1268 if (val <= 0) {
1269 fprintf(stderr, _("Invalid dot size [%d] passed to dots-grid-dot-size\n"),
1270 val);
1271 val = 1; /* absolute default */
1274 default_dots_grid_dot_size = val;
1276 return SCM_BOOL_T;
1279 /*! \todo Finish function documentation!!!
1280 * \brief
1281 * \par Function Description
1284 SCM g_rc_dots_grid_mode (SCM mode)
1286 static const vstbl_entry mode_table[] = {
1287 {DOTS_GRID_VARIABLE_MODE, "variable" },
1288 {DOTS_GRID_FIXED_MODE, "fixed" }
1291 RETURN_G_RC_MODE ("dots-grid-mode",
1292 default_dots_grid_mode,
1296 /*! \todo Finish function documentation!!!
1297 * \brief
1298 * \par Function Description
1301 SCM g_rc_dots_grid_fixed_threshold (SCM spacing)
1303 int val;
1305 SCM_ASSERT (scm_is_integer (spacing), spacing, SCM_ARG1, "dots-grid-fixed-threshold");
1307 val = scm_to_int (spacing);
1309 if (val <= 0) {
1310 fprintf(stderr, _("Invalid pixel spacing [%d] passed to dots-grid-fixed-threshold\n"),
1311 val);
1312 val = 10; /* absolute default */
1315 default_dots_grid_fixed_threshold = val;
1317 return SCM_BOOL_T;
1321 /*! \todo Finish function documentation!!!
1322 * \brief
1323 * \par Function Description
1326 SCM g_rc_mesh_grid_display_threshold (SCM spacing)
1328 int val;
1330 SCM_ASSERT (scm_is_integer (spacing), spacing, SCM_ARG1,
1331 "mesh-grid-display-threshold");
1333 val = scm_to_int (spacing);
1335 if (val <= 0) {
1336 fprintf (stderr, _("Invalid pixel spacing [%d] passed to "
1337 "mesh-grid-display-threshold\n"), val);
1338 val = 3; /* absolute default */
1341 default_mesh_grid_display_threshold = val;
1343 return SCM_BOOL_T;
1346 /*! \todo Finish function documentation!!!
1347 * \brief
1348 * \par Function Description
1351 SCM g_rc_add_attribute_offset(SCM offset)
1353 int val;
1355 SCM_ASSERT (scm_is_integer (offset), offset,
1356 SCM_ARG1, "add-attribute-offset");
1358 val = scm_to_int (offset);
1360 if (val < 0) {
1361 fprintf(stderr, _("Invalid offset [%d] passed to add-attribute-offset\n"),
1362 val);
1363 val = 50; /* absolute default */
1366 default_add_attribute_offset = val;
1368 return SCM_BOOL_T;
1371 /*! \todo Finish function documentation!!!
1372 * \brief
1373 * \par Function Description
1376 SCM g_rc_auto_save_interval(SCM seconds)
1378 int val;
1380 SCM_ASSERT (scm_is_integer (seconds), seconds, SCM_ARG1, "auto-save-interval");
1382 val = scm_to_int (seconds);
1384 if (val < 0) {
1385 fprintf(stderr, _("Invalid number of seconds [%d] passed to auto-save-interval\n"),
1386 val);
1387 val = 120; /* absolute default */
1390 default_auto_save_interval = val;
1392 return SCM_BOOL_T;
1395 /*! \todo Finish function documentation!!!
1396 * \brief
1397 * \par Function Description
1400 SCM g_rc_drag_can_move(SCM mode)
1402 static const vstbl_entry mode_table[] = {
1403 {TRUE, "enabled" },
1404 {FALSE, "disabled" }
1407 RETURN_G_RC_MODE("drag-can-move",
1408 default_drag_can_move,
1412 /*! \todo Finish function documentation!!!
1413 * \brief
1414 * \par Function Description
1417 SCM g_rc_mousepan_gain(SCM gain)
1419 int val;
1421 SCM_ASSERT (scm_is_integer (gain), gain, SCM_ARG1, "mousepan-gain");
1423 val = scm_to_int (gain);
1425 if (val <= 0) {
1426 fprintf(stderr, _("Invalid gain [%d] passed to mousepan-gain\n"),
1427 val);
1428 val = 5; /* absolute default */
1431 default_mousepan_gain = val;
1433 return SCM_BOOL_T;
1436 /*! \brief Scheme function for setting the step for keyboard pan.
1438 * Default setting is 20.
1440 SCM g_rc_keyboardpan_gain(SCM gain)
1442 int val;
1444 SCM_ASSERT (scm_is_integer (gain), gain, SCM_ARG1, "keyboardpan-gain");
1446 val = scm_to_int (gain);
1448 if (val <= 0) {
1449 fprintf(stderr, _("Invalid gain [%d] passed to keyboardpan-gain\n"),
1450 val);
1451 val = 20; /* absolute default */
1454 default_keyboardpan_gain = val;
1456 return SCM_BOOL_T;
1459 /*! \todo Finish function documentation!!!
1460 * \brief
1461 * \par Function Description
1464 SCM g_rc_print_command(SCM scm_command)
1465 #define FUNC_NAME "print-command"
1467 char *command;
1469 SCM_ASSERT (scm_is_string (scm_command), scm_command,
1470 SCM_ARG1, FUNC_NAME);
1472 command = SCM_STRING_CHARS (scm_command);
1474 g_free (default_print_command);
1475 default_print_command = g_strdup (command);
1477 return SCM_BOOL_T;
1479 #undef FUNC_NAME
1481 /*! \todo Finish function documentation!!!
1482 * \brief
1483 * \par Function Description
1486 SCM g_rc_select_slack_pixels(SCM pixels)
1488 int val;
1490 SCM_ASSERT (scm_is_integer (pixels), pixels, SCM_ARG1, "select-slack-pixels");
1492 val = scm_to_int (pixels);
1494 if (val <= 0) {
1495 fprintf(stderr, _("Invalid number of pixels [%d] passed to select-slack-pixels\n"),
1496 val);
1497 val = 4; /* absolute default */
1500 default_select_slack_pixels = val;
1502 return SCM_BOOL_T;
1505 /*! \todo Finish function documentation!!!
1506 * \brief
1507 * \par Function Description
1510 SCM g_rc_zoom_gain(SCM gain)
1512 int val;
1514 SCM_ASSERT (scm_is_integer (gain), gain, SCM_ARG1, "zoom-gain");
1516 val = scm_to_int (gain);
1518 /* Allow -ve numbers in case the user wishes to reverse zoom direction,
1519 * but don't allow zero gain as this would disable the zoom action */
1520 if (val == 0) {
1521 fprintf(stderr, _("Invalid gain [%d] passed to zoom-gain\n"), val);
1522 val = 20; /* absolute default */
1525 default_zoom_gain = val;
1527 return SCM_BOOL_T;
1530 /*! \todo Finish function documentation!!!
1531 * \brief
1532 * \par Function Description
1535 SCM g_rc_scrollpan_steps(SCM steps)
1537 int val;
1539 SCM_ASSERT (scm_is_integer (steps), steps, SCM_ARG1, "scrollpan-steps");
1541 val = scm_to_int (steps);
1543 /* Allow -ve numbers in case the user wishes to reverse scroll direction,
1544 * but don't allow zero steps as this would cause a division by zero error */
1545 if (val == 0) {
1546 fprintf(stderr, _("Invalid number of steps [%d] scrollpan-steps\n"), val);
1547 val = 8; /* absolute default */
1550 default_scrollpan_steps = val;
1552 return SCM_BOOL_T;
1556 extern COLOR display_colors[MAX_COLORS];
1557 extern COLOR display_outline_colors[MAX_COLORS];
1559 SCM g_rc_display_color_map (SCM scm_map)
1561 if (scm_map == SCM_UNDEFINED) {
1562 return s_color_map_to_scm (display_colors);
1565 SCM_ASSERT (scm_is_true (scm_list_p (scm_map)),
1566 scm_map, SCM_ARG1, "display-color-map");
1568 s_color_map_from_scm (display_colors, scm_map, "display-color-map");
1569 return SCM_BOOL_T;
1572 SCM g_rc_display_outline_color_map (SCM scm_map)
1574 if (scm_map == SCM_UNDEFINED) {
1575 return s_color_map_to_scm (display_outline_colors);
1578 SCM_ASSERT (scm_is_true (scm_list_p (scm_map)),
1579 scm_map, SCM_ARG1, "display-outline-color-map");
1581 s_color_map_from_scm (display_outline_colors, scm_map, "display-outline-color-map");
1582 return SCM_BOOL_T;