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
40 #ifdef HAVE_LIBDMALLOC
44 /*! a random int, used only as a place holder */
45 static int default_dummy
;
47 /*! \todo Finish function documentation!!!
49 * \par Function Description
52 void g_rc_parse_gtkrc()
57 filename
= g_build_filename (g_rc_parse_path (), "gschem-gtkrc", NULL
);
58 gtk_rc_parse (filename
);
61 home
= g_getenv ("HOME");
63 filename
= g_build_filename (home
, ".gschem-gtkrc", NULL
);
64 gtk_rc_parse (filename
);
70 /*! \todo Finish function documentation!!!
72 * \par Function Description
75 SCM
g_rc_gschem_version(SCM version
)
77 char *version_chars
, *version_chars_casefold
, *date_version_casefold
;
80 SCM_ASSERT (scm_is_string (version
), version
,
81 SCM_ARG1
, "gschem-version");
83 version_chars
= scm_to_locale_string(version
);
85 version_chars_casefold
= g_utf8_casefold(version_chars
, -1);
86 date_version_casefold
= g_utf8_casefold(DATE_VERSION
, -1);
87 if (g_utf8_collate(version_chars_casefold
, date_version_casefold
) != 0) {
89 "You are running gEDA/gaf version [%s%s.%s],\n",
90 PREPEND_VERSION_STRING
, DOTTED_VERSION
, DATE_VERSION
);
92 "but you have a version [%s] gschemrc file:\n[%s]\n",
93 version_chars
, rc_filename
);
95 "Please be sure that you have the latest rc file.\n");
102 g_free(version_chars_casefold
);
103 g_free(date_version_casefold
);
108 /*! \todo Finish function documentation!!!
109 * \brief General color setting function
110 * \par Function Description
113 static SCM
g_rc_color_general(SCM index
, SCM color
, SCM outline_color
,
114 SCM ps_color
, const char *rc_name
,
120 char *outline_color_name
;
121 char *ps_color_string
;
124 SCM_ASSERT (scm_is_integer (index
), index
, SCM_ARG1
, rc_name
);
125 SCM_ASSERT (scm_is_string (color
), color
, SCM_ARG2
, rc_name
);
126 SCM_ASSERT (scm_is_string (outline_color
),
127 outline_color
, SCM_ARG3
, rc_name
);
128 SCM_ASSERT (scm_is_string (ps_color
), ps_color
,
131 scm_dynwind_begin(0);
133 color_index
= scm_to_int (index
);
134 color_name
= scm_to_locale_string(color
);
135 outline_color_name
= scm_to_locale_string(outline_color
);
136 ps_color_string
= scm_to_locale_string(ps_color
);
137 scm_dynwind_free(color_name
);
138 scm_dynwind_free(outline_color_name
);
139 scm_dynwind_free(ps_color_string
);
141 status
= s_color_request (color_index
, color_name
, outline_color_name
,
145 printf("%d %s %s %s\n", color_index
, color_name
,
146 outline_color_name
, ps_color_string
);
152 _("Invalid color [%s] passed to %s\n"),
157 *color_var
= color_index
;
165 #define DEFINE_G_RC_COLOR(func, rc, var) \
166 SCM func(SCM index, SCM color, SCM outline_color, SCM ps_color) \
168 return g_rc_color_general(index, color, outline_color, \
169 ps_color, (rc), &(var)); \
172 DEFINE_G_RC_COLOR(g_rc_override_net_color
,
173 "override-net-color",
174 default_override_net_color
)
176 DEFINE_G_RC_COLOR(g_rc_override_bus_color
,
177 "override-bus-color",
178 default_override_bus_color
)
180 DEFINE_G_RC_COLOR(g_rc_override_pin_color
,
181 "override-pin-color",
182 default_override_pin_color
)
184 DEFINE_G_RC_COLOR(g_rc_attribute_color
,
186 default_attribute_color
)
188 DEFINE_G_RC_COLOR(g_rc_detachedattr_color
,
189 "detached-attribute-color",
190 default_detachattr_color
)
192 DEFINE_G_RC_COLOR(g_rc_text_color
,
196 DEFINE_G_RC_COLOR(g_rc_net_color
,
200 DEFINE_G_RC_COLOR(g_rc_bus_color
,
204 DEFINE_G_RC_COLOR(g_rc_pin_color
,
208 DEFINE_G_RC_COLOR(g_rc_graphic_color
,
210 default_graphic_color
)
212 DEFINE_G_RC_COLOR(g_rc_grid_color
,
216 DEFINE_G_RC_COLOR(g_rc_background_color
,
218 default_background_color
)
220 DEFINE_G_RC_COLOR(g_rc_select_color
,
222 default_select_color
)
224 DEFINE_G_RC_COLOR(g_rc_boundingbox_color
,
228 DEFINE_G_RC_COLOR(g_rc_zoom_box_color
,
230 default_zoom_box_color
)
232 DEFINE_G_RC_COLOR(g_rc_net_endpoint_color
,
233 "net-endpoint-color",
234 default_net_endpoint_color
)
236 DEFINE_G_RC_COLOR(g_rc_junction_color
,
238 default_junction_color
)
240 DEFINE_G_RC_COLOR(g_rc_logic_bubble_color
,
241 "logic-bubble-color",
242 default_logic_bubble_color
)
244 DEFINE_G_RC_COLOR(g_rc_lock_color
,
248 DEFINE_G_RC_COLOR(g_rc_output_color_background
,
249 "output-color-background",
250 default_print_color_background
)
252 DEFINE_G_RC_COLOR(g_rc_stroke_color
,
254 default_stroke_color
)
256 DEFINE_G_RC_COLOR(g_rc_freestyle_color
,
260 /*! \todo Finish function documentation!!!
262 * \par Function Description
265 SCM
g_rc_net_endpoint_mode(SCM mode
)
267 static const vstbl_entry mode_table
[] = {
268 {FILLEDBOX
, "filledbox"}
271 RETURN_G_RC_MODE("net-endpoint-mode",
272 default_net_endpoint_mode
);
275 /*! \todo Finish function documentation!!!
277 * \par Function Description
280 SCM
g_rc_net_midpoint_mode(SCM mode
)
282 static const vstbl_entry mode_table
[] = {
286 RETURN_G_RC_MODE("net-midpoint-mode",
287 default_net_midpoint_mode
);
290 /*! \todo Finish function documentation!!!
292 * \par Function Description
295 SCM
g_rc_net_direction_mode(SCM mode
)
297 static const vstbl_entry mode_table
[] = {
302 RETURN_G_RC_MODE("net-direction-mode",
303 default_net_direction_mode
);
306 /*! \todo Finish function documentation!!!
308 * \par Function Description
311 SCM
g_rc_net_selection_mode(SCM mode
)
313 static const vstbl_entry mode_table
[] = {
319 RETURN_G_RC_MODE("net-selection-mode",
320 default_net_selection_mode
);
323 /*! \todo Finish function documentation!!!
325 * \par Function Description
328 SCM
g_rc_net_style(SCM mode
)
330 static const vstbl_entry mode_table
[] = {
335 RETURN_G_RC_MODE("net-style",
339 /*! \todo Finish function documentation!!!
341 * \par Function Description
344 SCM
g_rc_bus_style(SCM mode
)
346 static const vstbl_entry mode_table
[] = {
351 RETURN_G_RC_MODE("bus-style",
355 /*! \todo Finish function documentation!!!
357 * \par Function Description
360 SCM
g_rc_pin_style(SCM mode
)
362 static const vstbl_entry mode_table
[] = {
367 RETURN_G_RC_MODE("pin-style",
371 /*! \todo Finish function documentation!!!
373 * \par Function Description
376 SCM
g_rc_line_style(SCM mode
)
378 static const vstbl_entry mode_table
[] = {
383 RETURN_G_RC_MODE("line-style",
387 /*! \todo Finish function documentation!!!
389 * \par Function Description
392 SCM
g_rc_action_feedback_mode(SCM mode
)
394 static const vstbl_entry mode_table
[] = {
395 {OUTLINE
, "outline" },
396 {BOUNDINGBOX
, "boundingbox"}
399 RETURN_G_RC_MODE("action-feedback-mode",
400 default_actionfeedback_mode
);
403 /*! \todo Finish function documentation!!!
405 * \par Function Description
408 SCM
g_rc_zoom_with_pan(SCM mode
)
410 static const vstbl_entry mode_table
[] = {
415 RETURN_G_RC_MODE("zoom-with-pan",
416 default_zoom_with_pan
);
419 /*! \todo Finish function documentation!!!
421 * \par Function Description
424 SCM
g_rc_text_feedback(SCM mode
)
426 static const vstbl_entry mode_table
[] = {
427 {ALWAYS
, "always" },
428 {ONLY_WHEN_READABLE
, "only-when-readable"}
431 RETURN_G_RC_MODE("text-feedback",
432 default_text_feedback
);
435 /*! \todo Finish function documentation!!!
437 * \par Function Description
440 SCM
g_rc_text_display_zoomfactor(SCM zoomfactor
)
444 SCM_ASSERT (scm_is_integer (zoomfactor
), zoomfactor
,
445 SCM_ARG1
, "test-display-zoom-factor");
447 val
= scm_to_int (zoomfactor
);
450 _("Invalid zoomfactor [%d] passed to %s\n"),
452 "text-display-zoom-factor");
453 val
= 10; /* absolute default */
456 default_text_display_zoomfactor
= val
;
461 /*! \todo Finish function documentation!!!
463 * \par Function Description
466 SCM
g_rc_scrollbar_update(SCM scmmode
)
468 SCM ret
= SCM_BOOL_T
;
470 SCM_ASSERT (scm_is_string (scmmode
), scmmode
,
471 SCM_ARG1
, "scrollbar-update");
476 /*! \todo Finish function documentation!!!
478 * \par Function Description
481 SCM
g_rc_logging(SCM mode
)
483 static const vstbl_entry mode_table
[] = {
488 RETURN_G_RC_MODE("logging",
492 /*! \todo Finish function documentation!!!
494 * \par Function Description
497 SCM
g_rc_embed_components(SCM mode
)
499 static const vstbl_entry mode_table
[] = {
504 RETURN_G_RC_MODE("embed-components",
505 default_embed_complex
);
508 /*! \brief read the configuration string list for the component dialog
509 * \par Function Description
510 * This function reads the string list from the component-dialog-attributes
511 * configuration parameter and converts the list into a GList.
512 * The GList is stored in the global default_component_select_attrlist variable.
514 SCM
g_rc_component_dialog_attributes(SCM stringlist
)
520 SCM_ASSERT(scm_list_p(stringlist
), stringlist
, SCM_ARG1
, "scm_is_list failed");
522 /* If the command is called multiple times, remove the old list before
524 g_list_foreach(default_component_select_attrlist
, (GFunc
)g_free
, NULL
);
525 g_list_free(default_component_select_attrlist
);
527 /* convert the scm list into a GList */
528 for (rest
= stringlist
; !scm_is_null(rest
); rest
= SCM_CDR(rest
)) {
529 SCM_ASSERT(scm_is_string(SCM_CAR(rest
)), SCM_CAR(rest
), SCM_ARG1
,
530 "list element is not a string");
531 attr
= g_strdup_scm_string(SCM_CAR(rest
));
532 list
= g_list_prepend(list
, attr
);
535 default_component_select_attrlist
= g_list_reverse(list
);
541 /*! \todo Finish function documentation!!!
543 * \par Function Description
546 SCM
g_rc_text_size(SCM size
)
550 SCM_ASSERT (scm_is_integer (size
), size
, SCM_ARG1
, "text-size");
552 val
= scm_to_int (size
);
555 _("Invalid size [%d] passed to text-size\n"),
557 val
= 10; /* absolute default */
560 default_text_size
= val
;
565 /*! \brief Sets the output font scaling factor
567 * \par Use this setting to change the scale of the output PS font
568 * characters. This allows to fine tune the font size so that it
569 * matches more closely with the screen.
571 * \return SCM_BOOL_T always.
574 SCM
g_rc_postscript_font_scale(SCM scale
)
578 SCM_ASSERT (SCM_REALP (scale
), scale
, SCM_ARG1
, "postscript-font-scale");
580 val
=(float)(SCM_REAL_VALUE (scale
));
582 fprintf(stderr
, _("Invalid size [%f] passed to postscript-font-scale\n"),
584 val
= 1.0; /* absolute default */
587 default_postscript_font_scale
= val
;
592 /*! \todo Finish function documentation!!!
594 * \par Function Description
596 * \todo inconsistent naming with keyword name and variable to hold
599 SCM
g_rc_text_caps_style(SCM mode
)
601 static const vstbl_entry mode_table
[] = {
607 RETURN_G_RC_MODE("text-caps-style",
611 /*! \todo Finish function documentation!!!
613 * \par Function Description
616 SCM
g_rc_snap_size(SCM size
)
620 SCM_ASSERT (scm_is_integer (size
), size
, SCM_ARG1
, "snap-size");
622 val
= scm_to_int (size
);
624 fprintf(stderr
, _("Invalid size [%d] passed to snap-size\n"),
626 val
= 100; /* absolute default */
629 default_snap_size
= val
;
634 /*! \todo Finish function documentation!!!
636 * \par Function Description
639 SCM
g_rc_logging_destination(SCM mode
)
641 static const vstbl_entry mode_table
[] = {
642 {LOG_WINDOW
, "log_window" },
643 {STDOUT_TTY
, "tty" },
644 {BOTH_LOGWIN_STDOUT
, "both" }
647 RETURN_G_RC_MODE("logging-destination",
651 /*! \todo Finish function documentation!!!
653 * \par Function Description
656 SCM
g_rc_attribute_name(SCM scm_path
)
661 SCM_ASSERT (scm_is_string (scm_path
), scm_path
,
662 SCM_ARG1
, "attribute-name");
664 scm_dynwind_begin(0);
666 path
= scm_to_locale_string(scm_path
);
667 scm_dynwind_free(path
);
670 if (!s_attrib_uniq(path
)) {
673 s_attrib_add_entry (path
);
681 /*! \todo Finish function documentation!!!
683 * \par Function Description
686 SCM
g_rc_scrollbars(SCM mode
)
688 static const vstbl_entry mode_table
[] = {
693 RETURN_G_RC_MODE("scrollbars",
694 default_scrollbars_flag
);
697 /*! \todo Finish function documentation!!!
699 * \par Function Description
702 SCM
g_rc_paper_size(SCM width
, SCM height
)
703 #define FUNC_NAME "paper-size"
705 SCM_ASSERT (SCM_NIMP (width
) && SCM_REALP (width
), width
,
706 SCM_ARG1
, FUNC_NAME
);
707 SCM_ASSERT (SCM_NIMP (height
) && SCM_REALP (height
), height
,
708 SCM_ARG2
, FUNC_NAME
);
710 /* yes this is legit, we are casting the resulting double to an int */
711 default_paper_width
= (int) (scm_to_double(width
) * MILS_PER_INCH
);
712 default_paper_height
= (int) (scm_to_double(height
) * MILS_PER_INCH
);
718 /*! \todo Finish function documentation!!!
720 * \par Function Description
723 SCM
g_rc_paper_sizes(SCM scm_papername
, SCM scm_width
, SCM scm_height
)
724 #define FUNC_NAME "paper-sizes"
731 SCM_ASSERT (scm_is_string (scm_papername
), scm_papername
,
732 SCM_ARG1
, FUNC_NAME
);
733 SCM_ASSERT (SCM_NIMP (scm_width
) && SCM_REALP (scm_width
), scm_width
,
734 SCM_ARG2
, FUNC_NAME
);
735 SCM_ASSERT (SCM_NIMP (scm_height
) && SCM_REALP (scm_height
), scm_height
,
736 SCM_ARG3
, FUNC_NAME
);
738 scm_dynwind_begin(0);
740 papername
= scm_to_locale_string(scm_papername
);
741 scm_dynwind_free(papername
);
743 width
= (int) (scm_to_double(scm_width
) * MILS_PER_INCH
);
744 height
= (int) (scm_to_double(scm_height
) * MILS_PER_INCH
);
746 if (!s_papersizes_uniq(papername
)) {
749 s_papersizes_add_entry(papername
, width
, height
);
758 /*! \todo Finish function documentation!!!
760 * \par Function Description
763 SCM
g_rc_output_text(SCM mode
)
765 static const vstbl_entry mode_table
[] = {
766 {VECTOR_FONTS
, "vector" },
770 RETURN_G_RC_MODE("output-text",
771 default_text_output
);
774 /*! \todo Finish function documentation!!!
776 * \par Function Description
778 * \todo this keyword needs a better name ...
780 SCM
g_rc_output_type(SCM mode
)
782 static const vstbl_entry mode_table
[] = {
783 {WINDOW
, "current window" },
784 {EXTENTS
, "limits" }, /* deprecated */
785 {EXTENTS
, "extents" },
786 {EXTENTS_NOMARGINS
, "extents no margins" },
789 RETURN_G_RC_MODE("output-type",
790 default_print_output_type
);
793 /*! \todo Finish function documentation!!!
795 * \par Function Description
798 SCM
g_rc_output_orientation(SCM mode
)
800 static const vstbl_entry mode_table
[] = {
801 {PORTRAIT
, "portrait" },
802 {LANDSCAPE
, "landscape"},
805 RETURN_G_RC_MODE("output-orientation",
806 default_print_orientation
);
809 /*! \todo Finish function documentation!!!
811 * \par Function Description
814 SCM
g_rc_image_color(SCM mode
)
816 static const vstbl_entry mode_table
[] = {
821 RETURN_G_RC_MODE("image-color",
822 default_image_color
);
825 /*! \todo Finish function documentation!!!
827 * \par Function Description
830 SCM
g_rc_image_size(SCM width
, SCM height
)
832 SCM_ASSERT (scm_is_integer (width
), width
, SCM_ARG1
, "image-size");
833 SCM_ASSERT (scm_is_integer (height
), height
, SCM_ARG2
, "image-size");
835 /* yes this is legit, we are casting the resulting double to an int */
836 default_image_width
= scm_to_int (width
);
837 default_image_height
= scm_to_int (height
);
842 /*! \todo Finish function documentation!!!
844 * \par Function Description
847 SCM
g_rc_output_color(SCM mode
)
849 static const vstbl_entry mode_table
[] = {
854 /* this variable is inconsistently named with the rest */
855 RETURN_G_RC_MODE("output-color",
856 default_print_color
);
859 /*! \todo Finish function documentation!!!
861 * \par Function Description
864 SCM
g_rc_output_capstyle(SCM mode
)
866 static const vstbl_entry mode_table
[] = {
867 {BUTT_CAP
, "butt" },
868 {ROUND_CAP
, "round" },
869 {SQUARE_CAP
, "square"},
872 RETURN_G_RC_MODE("output-capstyle",
873 default_print_output_capstyle
);
876 /*! \todo Finish function documentation!!!
878 * \par Function Description
881 SCM
g_rc_log_window(SCM mode
)
883 static const vstbl_entry mode_table
[] = {
884 {MAP_ON_STARTUP
, "startup" },
885 {MAP_LATER
, "later" },
888 RETURN_G_RC_MODE("log-window",
892 /*! \todo Finish function documentation!!!
894 * \par Function Description
897 SCM
g_rc_log_window_type(SCM mode
)
899 static const vstbl_entry mode_table
[] = {
900 {TRANSIENT
, "transient" },
901 {DECORATED
, "decorated" },
904 RETURN_G_RC_MODE("log-window-type",
905 default_log_window_type
);
908 /*! \todo Finish function documentation!!!
910 * \par Function Description
913 SCM
g_rc_third_button(SCM mode
)
915 static const vstbl_entry mode_table
[] = {
916 {POPUP_ENABLED
, "popup" },
917 {MOUSEPAN_ENABLED
, "mousepan"},
920 RETURN_G_RC_MODE("third-button",
921 default_third_button
);
924 /*! \todo Finish function documentation!!!
926 * \par Function Description
929 SCM
g_rc_middle_button(SCM mode
)
931 static const vstbl_entry mode_table
[] = {
935 {MID_MOUSEPAN_ENABLED
, "mousepan"},
938 RETURN_G_RC_MODE("middle-button",
939 default_middle_button
);
942 /*! \todo Finish function documentation!!!
944 * \par Function Description
947 SCM
g_rc_scroll_wheel(SCM mode
)
949 static const vstbl_entry mode_table
[] = {
950 {SCROLL_WHEEL_CLASSIC
, "classic"},
951 {SCROLL_WHEEL_GTK
, "gtk"},
954 RETURN_G_RC_MODE("scroll-wheel",
955 default_scroll_wheel
);
958 /*! \todo Finish function documentation!!!
960 * \par Function Description
963 SCM
g_rc_net_consolidate(SCM mode
)
965 static const vstbl_entry mode_table
[] = {
970 RETURN_G_RC_MODE("net-consolidate",
971 default_net_consolidate
);
974 /*! \todo Finish function documentation!!!
976 * \par Function Description
979 SCM
g_rc_file_preview(SCM mode
)
981 static const vstbl_entry mode_table
[] = {
986 /* this variable is inconsistently named with the rest */
987 RETURN_G_RC_MODE("file-preview",
988 default_file_preview
);
991 /*! \todo Finish function documentation!!!
993 * \par Function Description
996 SCM
g_rc_enforce_hierarchy(SCM mode
)
998 static const vstbl_entry mode_table
[] = {
1000 {FALSE
, "disabled"},
1003 RETURN_G_RC_MODE("enforce-hierarchy",
1004 default_enforce_hierarchy
);
1007 /*! \todo Finish function documentation!!!
1009 * \par Function Description
1012 SCM
g_rc_text_origin_marker(SCM mode
)
1014 static const vstbl_entry mode_table
[] = {
1015 {TRUE
, "enabled" },
1016 {FALSE
, "disabled"},
1019 RETURN_G_RC_MODE("text-origin-marker",
1020 default_text_origin_marker
);
1023 /*! \todo Finish function documentation!!!
1025 * \par Function Description
1028 SCM
g_rc_fast_mousepan(SCM mode
)
1030 static const vstbl_entry mode_table
[] = {
1031 {TRUE
, "enabled" },
1032 {FALSE
, "disabled"},
1035 RETURN_G_RC_MODE("fast-mousepan",
1036 default_fast_mousepan
);
1039 /*! \todo Finish function documentation!!!
1041 * \par Function Description
1044 SCM
g_rc_raise_dialog_boxes_on_expose(SCM mode
)
1046 static const vstbl_entry mode_table
[] = {
1047 {TRUE
, "enabled" },
1048 {FALSE
, "disabled"},
1051 RETURN_G_RC_MODE("raise-dialog-boxes-on-expose",
1052 default_raise_dialog_boxes
);
1055 /*! \todo Finish function documentation!!!
1057 * \par Function Description
1060 SCM
g_rc_continue_component_place(SCM mode
)
1062 static const vstbl_entry mode_table
[] = {
1063 {TRUE
, "enabled" },
1064 {FALSE
, "disabled"},
1067 RETURN_G_RC_MODE("continue-component-place",
1068 default_continue_component_place
);
1071 /*! \todo Finish function documentation!!!
1073 * \par Function Description
1076 SCM
g_rc_undo_levels(SCM levels
)
1080 SCM_ASSERT (scm_is_integer (levels
), levels
, SCM_ARG1
, "undo-levels");
1082 val
= scm_to_int (levels
);
1085 fprintf(stderr
, _("Invalid num levels [%d] passed to undo-levels\n"),
1087 val
= 10; /* absolute default */
1090 default_undo_levels
= val
;
1095 /*! \todo Finish function documentation!!!
1097 * \par Function Description
1100 SCM
g_rc_undo_control(SCM mode
)
1102 static const vstbl_entry mode_table
[] = {
1103 {TRUE
, "enabled" },
1104 {FALSE
, "disabled"},
1107 RETURN_G_RC_MODE("undo-control", default_undo_control
);
1110 /*! \todo Finish function documentation!!!
1112 * \par Function Description
1115 SCM
g_rc_undo_type(SCM mode
)
1120 static const vstbl_entry mode_table
[] = {
1121 {(int) UNDO_DISK
, "disk" },
1122 {(int) UNDO_MEMORY
, "memory" },
1125 retval
= g_rc_mode_general(mode
, "undo-type", &undo_type_int
, mode_table
,
1126 G_N_ELEMENTS(mode_table
));
1127 default_undo_type
= undo_type_int
;
1132 /*! \todo Finish function documentation!!!
1134 * \par Function Description
1137 SCM
g_rc_undo_panzoom(SCM mode
)
1139 static const vstbl_entry mode_table
[] = {
1140 {TRUE
, "enabled" },
1141 {FALSE
, "disabled"},
1144 RETURN_G_RC_MODE("undo-panzoom", default_undo_panzoom
);
1147 /*! \todo Finish function documentation!!!
1149 * \par Function Description
1152 SCM
g_rc_draw_grips(SCM mode
)
1154 static const vstbl_entry mode_table
[] = {
1155 {TRUE
, "enabled" },
1156 {FALSE
, "disabled"},
1159 RETURN_G_RC_MODE("draw-grips",
1160 default_draw_grips
);
1163 /*! \todo Finish function documentation!!!
1165 * \par Function Description
1168 SCM
g_rc_netconn_rubberband(SCM mode
)
1170 static const vstbl_entry mode_table
[] = {
1171 {TRUE
, "enabled" },
1172 {FALSE
, "disabled"},
1175 RETURN_G_RC_MODE("netconn-rubberband",
1176 default_netconn_rubberband
);
1180 /*! \todo Finish function documentation!!!
1182 * \par Function Description
1185 SCM
g_rc_magnetic_net_mode(SCM mode
)
1187 static const vstbl_entry mode_table
[] = {
1188 {TRUE
, "enabled" },
1189 {FALSE
, "disabled"},
1192 RETURN_G_RC_MODE("magnetic-net-mode",
1193 default_magnetic_net_mode
);
1196 /*! \todo Finish function documentation!!!
1198 * \par Function Description
1201 SCM
g_rc_sort_component_library(SCM mode
)
1203 static const vstbl_entry mode_table
[] = {
1204 {TRUE
, "enabled" },
1205 {FALSE
, "disabled"},
1208 RETURN_G_RC_MODE("sort_component_library",
1209 default_sort_component_library
);
1212 /*! \todo Finish function documentation!!!
1214 * \par Function Description
1217 SCM
g_rc_add_menu(SCM menu_name
, SCM menu_items
)
1219 char *menu_name_chars
;
1221 SCM_ASSERT (scm_is_string (menu_name
), menu_name
,
1222 SCM_ARG1
, "add-menu");
1223 /* FIXME: Assert on scm_list_p? */
1224 SCM_ASSERT (SCM_NIMP (menu_items
) && SCM_CONSP (menu_items
), menu_items
,
1225 SCM_ARG2
, "add-menu");
1227 scm_dynwind_begin(0);
1229 menu_name_chars
= scm_to_locale_string(menu_name
);
1230 scm_dynwind_free(menu_name_chars
);
1232 s_menu_add_entry(menu_name_chars
, menu_items
);
1238 /*! \todo Finish function documentation!!!
1240 * \par Function Description
1243 SCM
g_rc_window_size(SCM width
, SCM height
)
1245 SCM_ASSERT (scm_is_integer (width
), width
, SCM_ARG1
, "window-size");
1246 SCM_ASSERT (scm_is_integer (height
), height
, SCM_ARG2
, "window-size");
1248 default_width
= scm_to_int (width
);
1249 default_height
= scm_to_int (height
);
1254 /*! \todo Finish function documentation!!!
1256 * \par Function Description
1259 SCM
g_rc_warp_cursor(SCM mode
)
1261 static const vstbl_entry mode_table
[] = {
1262 {TRUE
, "enabled" },
1263 {FALSE
, "disabled"},
1266 RETURN_G_RC_MODE("warp-cursor",
1267 default_warp_cursor
);
1270 /*! \todo Finish function documentation!!!
1272 * \par Function Description
1275 SCM
g_rc_toolbars(SCM mode
)
1277 static const vstbl_entry mode_table
[] = {
1278 {TRUE
, "enabled" },
1279 {FALSE
, "disabled"},
1282 RETURN_G_RC_MODE("toolbars",
1286 /*! \todo Finish function documentation!!!
1288 * \par Function Description
1291 SCM
g_rc_handleboxes(SCM mode
)
1293 static const vstbl_entry mode_table
[] = {
1294 {TRUE
, "enabled" },
1295 {FALSE
, "disabled"},
1298 RETURN_G_RC_MODE("handleboxes",
1299 default_handleboxes
);
1302 /*! \todo Finish function documentation!!!
1304 * \par Function Description
1307 SCM
g_rc_setpagedevice_orientation(SCM mode
)
1309 static const vstbl_entry mode_table
[] = {
1310 {TRUE
, "enabled" },
1311 {FALSE
, "disabled"},
1314 RETURN_G_RC_MODE("setpagedevice-orientation",
1315 default_setpagedevice_orientation
);
1318 /*! \todo Finish function documentation!!!
1320 * \par Function Description
1323 SCM
g_rc_setpagedevice_pagesize(SCM mode
)
1325 static const vstbl_entry mode_table
[] = {
1326 {TRUE
, "enabled" },
1327 {FALSE
, "disabled"},
1330 RETURN_G_RC_MODE("setpagedevice-pagesize",
1331 default_setpagedevice_pagesize
);
1334 /*! \todo Finish function documentation!!!
1336 * \par Function Description
1339 SCM
g_rc_bus_ripper_size(SCM size
)
1343 SCM_ASSERT (scm_is_integer (size
), size
, SCM_ARG1
, "bus-ripper-size");
1345 val
= scm_to_int (size
);
1348 fprintf(stderr
, _("Invalid size [%d] passed to bus-ripper-size\n"),
1350 val
= 200; /* absolute default */
1353 default_bus_ripper_size
= val
;
1358 /*! \todo Finish function documentation!!!
1360 * \par Function Description
1363 SCM
g_rc_bus_ripper_type(SCM mode
)
1365 static const vstbl_entry mode_table
[] = {
1366 {COMP_BUS_RIPPER
, "component" },
1367 {NET_BUS_RIPPER
, "net" }
1370 RETURN_G_RC_MODE("bus-ripper-type",
1371 default_bus_ripper_type
);
1374 /*! \todo Finish function documentation!!!
1376 * \par Function Description
1379 SCM
g_rc_bus_ripper_rotation(SCM mode
)
1381 static const vstbl_entry mode_table
[] = {
1382 {SYMMETRIC
, "symmetric" },
1383 {NON_SYMMETRIC
, "non-symmetric" }
1386 RETURN_G_RC_MODE("bus-ripper-rotation",
1387 default_bus_ripper_rotation
);
1390 /*! \todo Finish function documentation!!!
1392 * \par Function Description
1395 SCM
g_rc_force_boundingbox(SCM mode
)
1397 static const vstbl_entry mode_table
[] = {
1399 {FALSE
, "disabled" }
1402 RETURN_G_RC_MODE("force-boundingbox",
1403 default_force_boundingbox
);
1406 /*! \todo Finish function documentation!!!
1408 * \par Function Description
1411 SCM
g_rc_grid_dot_size(SCM dotsize
)
1415 SCM_ASSERT (scm_is_integer (dotsize
), dotsize
, SCM_ARG1
, "grid-dot-size");
1417 val
= scm_to_int (dotsize
);
1420 fprintf(stderr
, _("Invalid dot size [%d] passed to grid-dot-size\n"),
1422 val
= 1; /* absolute default */
1425 default_grid_dot_size
= val
;
1430 /*! \todo Finish function documentation!!!
1432 * \par Function Description
1435 SCM
g_rc_grid_mode(SCM mode
)
1437 static const vstbl_entry mode_table
[] = {
1438 {GRID_VARIABLE_MODE
, "variable" },
1439 {GRID_FIXED_MODE
, "fixed" }
1442 RETURN_G_RC_MODE("grid-mode",
1446 /*! \todo Finish function documentation!!!
1448 * \par Function Description
1451 SCM
g_rc_grid_fixed_threshold(SCM spacing
)
1455 SCM_ASSERT (scm_is_integer (spacing
), spacing
, SCM_ARG1
, "grid-fixed-threshold");
1457 val
= scm_to_int (spacing
);
1460 fprintf(stderr
, _("Invalid pixel spacing [%d] passed to grid-fixed-threshold\n"),
1462 val
= 10; /* absolute default */
1465 default_grid_fixed_threshold
= val
;
1470 /*! \todo Finish function documentation!!!
1472 * \par Function Description
1475 SCM
g_rc_output_vector_threshold(SCM numlines
)
1479 SCM_ASSERT (scm_is_integer (numlines
), numlines
,
1480 SCM_ARG1
, "output-vector-threshold");
1482 val
= scm_to_int (numlines
);
1484 default_print_vector_threshold
= val
;
1489 /*! \todo Finish function documentation!!!
1491 * \par Function Description
1494 SCM
g_rc_add_attribute_offset(SCM offset
)
1498 SCM_ASSERT (scm_is_integer (offset
), offset
,
1499 SCM_ARG1
, "add-attribute-offset");
1501 val
= scm_to_int (offset
);
1504 fprintf(stderr
, _("Invalid offset [%d] passed to add-attribute-offset\n"),
1506 val
= 50; /* absolute default */
1509 default_add_attribute_offset
= val
;
1514 /*! \todo Finish function documentation!!!
1516 * \par Function Description
1519 SCM
g_rc_auto_save_interval(SCM seconds
)
1523 SCM_ASSERT (scm_is_integer (seconds
), seconds
, SCM_ARG1
, "auto-save-interval");
1525 val
= scm_to_int (seconds
);
1528 fprintf(stderr
, _("Invalid number of seconds [%d] passed to auto-save-interval\n"),
1530 val
= 120; /* absolute default */
1533 default_auto_save_interval
= val
;
1538 /*! \todo Finish function documentation!!!
1540 * \par Function Description
1543 SCM
g_rc_drag_can_move(SCM mode
)
1545 static const vstbl_entry mode_table
[] = {
1547 {FALSE
, "disabled" }
1550 RETURN_G_RC_MODE("drag-can-move",
1551 default_drag_can_move
);
1554 /*! \todo Finish function documentation!!!
1556 * \par Function Description
1559 SCM
g_rc_mousepan_gain(SCM gain
)
1563 SCM_ASSERT (scm_is_integer (gain
), gain
, SCM_ARG1
, "mousepan-gain");
1565 val
= scm_to_int (gain
);
1568 fprintf(stderr
, _("Invalid gain [%d] passed to mousepan-gain\n"),
1570 val
= 5; /* absolute default */
1573 default_mousepan_gain
= val
;
1578 /*! \brief Scheme function for setting the step for keyboard pan.
1580 * Default setting is 20.
1582 SCM
g_rc_keyboardpan_gain(SCM gain
)
1586 SCM_ASSERT (scm_is_integer (gain
), gain
, SCM_ARG1
, "keyboardpan-gain");
1588 val
= scm_to_int (gain
);
1591 fprintf(stderr
, _("Invalid gain [%d] passed to keyboardpan-gain\n"),
1593 val
= 20; /* absolute default */
1596 default_keyboardpan_gain
= val
;
1601 /*! \todo Finish function documentation!!!
1603 * \par Function Description
1606 SCM
g_rc_print_command(SCM scm_command
)
1607 #define FUNC_NAME "print-command"
1609 SCM_ASSERT (scm_is_string (scm_command
), scm_command
,
1610 SCM_ARG1
, FUNC_NAME
);
1612 g_free (default_print_command
);
1613 default_print_command
= g_strdup_scm_string(scm_command
);
1619 /*! \todo Finish function documentation!!!
1621 * \par Function Description
1624 SCM
g_rc_select_slack_pixels(SCM pixels
)
1628 SCM_ASSERT (scm_is_integer (pixels
), pixels
, SCM_ARG1
, "select-slack-pixels");
1630 val
= scm_to_int (pixels
);
1633 fprintf(stderr
, _("Invalid number of pixels [%d] passed to select-slack-pixels\n"),
1635 val
= 4; /* absolute default */
1638 default_select_slack_pixels
= val
;
1643 /*! \todo Finish function documentation!!!
1645 * \par Function Description
1648 SCM
g_rc_zoom_gain(SCM gain
)
1652 SCM_ASSERT (scm_is_integer (gain
), gain
, SCM_ARG1
, "zoom-gain");
1654 val
= scm_to_int (gain
);
1656 /* Allow -ve numbers in case the user wishes to reverse zoom direction,
1657 * but don't allow zero gain as this would disable the zoom action */
1659 fprintf(stderr
, _("Invalid gain [%d] passed to zoom-gain\n"), val
);
1660 val
= 20; /* absolute default */
1663 default_zoom_gain
= val
;
1668 /*! \todo Finish function documentation!!!
1670 * \par Function Description
1673 SCM
g_rc_scrollpan_steps(SCM steps
)
1677 SCM_ASSERT (scm_is_integer (steps
), steps
, SCM_ARG1
, "scrollpan-steps");
1679 val
= scm_to_int (steps
);
1681 /* Allow -ve numbers in case the user wishes to reverse scroll direction,
1682 * but don't allow zero steps as this would cause a division by zero error */
1684 fprintf(stderr
, _("Invalid number of steps [%d] scrollpan-steps\n"), val
);
1685 val
= 8; /* absolute default */
1688 default_scrollpan_steps
= val
;