Revision: 77228
          http://sourceforge.net/p/brlcad/code/77228
Author:   starseeker
Date:     2020-09-25 16:28:34 +0000 (Fri, 25 Sep 2020)
Log Message:
-----------
Port the dplot logic from tclcad_obj.c to the new setup.

Modified Paths:
--------------
    brlcad/branches/brep-debug/src/libtclcad/commands.c

Removed Paths:
-------------
    brlcad/branches/brep-debug/src/libtclcad/tclcad_obj.c

Modified: brlcad/branches/brep-debug/src/libtclcad/commands.c
===================================================================
--- brlcad/branches/brep-debug/src/libtclcad/commands.c 2020-09-25 15:57:21 UTC 
(rev 77227)
+++ brlcad/branches/brep-debug/src/libtclcad/commands.c 2020-09-25 16:28:34 UTC 
(rev 77228)
@@ -180,6 +180,12 @@
                      ged_func_ptr func,
                      const char *usage,
                      int maxargs);
+HIDDEN int to_dplot(struct ged *gedp,
+                      int argc,
+                      const char *argv[],
+                      ged_func_ptr func,
+                      const char *usage,
+                      int maxargs);
 HIDDEN int to_dlist_on(struct ged *gedp,
                       int argc,
                       const char *argv[],
@@ -604,6 +610,7 @@
     {"debugnmg",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_debugnmg},
     {"decompose",      (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_decompose},
     {"delay",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_delay},
+    {"dplot",  "dplot_logfile", 1, to_dplot, ged_dplot},
     {"metaball_delete_pnt",    (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_metaball_delete_pnt},
     {"pipe_delete_pnt",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_pipe_delete_pnt},
     {"dir2ae", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_dir2ae},
@@ -3217,7 +3224,145 @@
     return GED_OK;
 }
 
+HIDDEN int
+to_dplot(struct ged *gedp,
+           int argc,
+           const char *argv[],
+           ged_func_ptr func,
+           const char *UNUSED(usage),
+           int UNUSED(maxargs))
+{
+    int ac;
+    int ret;
+    char *av[256];
+    struct bu_vls callback_cmd = BU_VLS_INIT_ZERO;
+    struct bu_vls temp = BU_VLS_INIT_ZERO;
+    struct bu_vls result_copy = BU_VLS_INIT_ZERO;
+    struct bview *gdvp;
+    struct tclcad_ged_data *tgd = (struct tclcad_ged_data 
*)current_top->to_gedp->u_data;
+    char *who_av[3] = {"who", "b", NULL};
+    int first = 1;
+    int aflag = 0;
 
+    /* copy all args */
+    ac = argc;
+    for (int i = 0; i < ac; ++i)
+       av[i] = bu_strdup((char *)argv[i]);
+    av[ac] = (char *)0;
+
+    /* check for displayed objects */
+    ret = ged_who(gedp, 2, (const char **)who_av);
+    if (ret == GED_OK && strlen(bu_vls_addr(gedp->ged_result_str)) == 0)
+       aflag = 1;
+    bu_vls_trunc(gedp->ged_result_str, 0);
+
+    while ((ret = (*func)(gedp, ac, (const char **)av)) & GED_MORE) {
+       int ac_more;
+       const char **avmp;
+       const char **av_more = NULL;
+
+       /* save result string */
+       bu_vls_substr(&result_copy, gedp->ged_result_str, 0, 
bu_vls_strlen(gedp->ged_result_str));
+       bu_vls_trunc(gedp->ged_result_str, 0);
+
+       ret = ged_who(gedp, 1, (const char **)who_av);
+       if (ret == GED_OK && strlen(bu_vls_addr(gedp->ged_result_str)) == 0)
+           aflag = 1;
+
+       bu_vls_trunc(gedp->ged_result_str, 0);
+
+       for (size_t i = 0; i < BU_PTBL_LEN(&current_top->to_gedp->ged_views); 
i++) {
+           gdvp = (struct bview 
*)BU_PTBL_GET(&current_top->to_gedp->ged_views, i);
+           if (to_is_viewable(gdvp)) {
+               gedp->ged_gvp->gv_x_samples = dm_get_width((struct dm 
*)gdvp->dmp);
+               gedp->ged_gvp->gv_y_samples = dm_get_height((struct dm 
*)gdvp->dmp);
+           }
+       }
+
+       if (first && aflag) {
+           first = 0;
+           to_autoview_all_views(current_top);
+       } else {
+           to_refresh_all_views(current_top);
+       }
+       /* restore result string */
+       bu_vls_substr(gedp->ged_result_str, &result_copy, 0, 
bu_vls_strlen(&result_copy));
+       bu_vls_free(&result_copy);
+
+       if (0 < bu_vls_strlen(&tgd->go_more_args_callback)) {
+           bu_vls_trunc(&callback_cmd, 0);
+           bu_vls_printf(&callback_cmd, "%s [string range {%s} 0 end]",
+                         bu_vls_addr(&tgd->go_more_args_callback),
+                         bu_vls_addr(gedp->ged_result_str));
+
+           if (Tcl_Eval(current_top->to_interp, bu_vls_addr(&callback_cmd)) != 
TCL_OK) {
+               bu_vls_trunc(gedp->ged_result_str, 0);
+               bu_vls_printf(gedp->ged_result_str, "%s", 
Tcl_GetStringResult(current_top->to_interp));
+               Tcl_ResetResult(current_top->to_interp);
+               return GED_ERROR;
+           }
+
+           bu_vls_trunc(&temp, 0);
+           bu_vls_printf(&temp, "%s", 
Tcl_GetStringResult(current_top->to_interp));
+           Tcl_ResetResult(current_top->to_interp);
+       } else {
+           bu_log("\r%s", bu_vls_addr(gedp->ged_result_str));
+           bu_vls_trunc(&temp, 0);
+           if (bu_vls_gets(&temp, stdin) < 0) {
+               break;
+           }
+       }
+
+       if (Tcl_SplitList(current_top->to_interp, bu_vls_addr(&temp), &ac_more, 
&av_more) != TCL_OK) {
+           continue;
+       }
+
+       if (ac_more < 1) {
+           /* space has still been allocated */
+           Tcl_Free((char *)av_more);
+
+           continue;
+       }
+
+       /* skip first element if empty */
+       avmp = av_more;
+       if (*avmp[0] == '\0') {
+           --ac_more;
+           ++avmp;
+       }
+
+       /* ignore last element if empty */
+       if (*avmp[ac_more-1] == '\0')
+           --ac_more;
+
+       /* copy additional args */
+       for (int i = 0; i < ac_more; ++i)
+           av[ac++] = bu_strdup(avmp[i]);
+       av[ac+1] = (char *)0;
+
+       Tcl_Free((char *)av_more);
+    }
+
+    for (size_t i = 0; i < BU_PTBL_LEN(&current_top->to_gedp->ged_views); i++) 
{
+       gdvp = (struct bview *)BU_PTBL_GET(&current_top->to_gedp->ged_views, i);
+       if (to_is_viewable(gdvp)) {
+           gedp->ged_gvp->gv_x_samples = dm_get_width((struct dm *)gdvp->dmp);
+           gedp->ged_gvp->gv_y_samples = dm_get_height((struct dm *)gdvp->dmp);
+       }
+    }
+    to_refresh_all_views(current_top);
+
+    bu_vls_free(&callback_cmd);
+    bu_vls_free(&temp);
+
+    bu_vls_printf(gedp->ged_result_str, "BUILT_BY_MORE_ARGS");
+    for (int i = 0; i < ac; ++i) {
+       bu_vls_printf(gedp->ged_result_str, "%s ", av[i]);
+       bu_free((void *)av[i], "to_more_args_func");
+    }
+    return GED_OK;
+}
+
 HIDDEN int
 to_fontsize(struct ged *gedp,
            int argc,

Deleted: brlcad/branches/brep-debug/src/libtclcad/tclcad_obj.c
===================================================================
--- brlcad/branches/brep-debug/src/libtclcad/tclcad_obj.c       2020-09-25 
15:57:21 UTC (rev 77227)
+++ brlcad/branches/brep-debug/src/libtclcad/tclcad_obj.c       2020-09-25 
16:28:34 UTC (rev 77228)
@@ -1,16205 +0,0 @@
-/*                       T C L C A D _ O B J . C
- * BRL-CAD
- *
- * Copyright (c) 2000-2020 United States Government as represented by
- * the U.S. Army Research Laboratory.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this file; see the file named COPYING for more
- * information.
- */
-/** @addtogroup libtclcad */
-/** @{ */
-/** @file libtclcad/tclcad_obj.c
- *
- * A quasi-object-oriented database interface.
- *
- * A GED object contains the attributes and methods for controlling a
- * BRL-CAD geometry edit object.
- *
- */
-/** @} */
-
-#include "common.h"
-
-
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <math.h>
-#include <errno.h>
-#include <assert.h>
-
-#include "png.h"
-
-#include "tcl.h"
-
-#include "bio.h"
-
-#include "bn.h"
-#include "bu/cmd.h"
-#include "bu/path.h"
-#include "bu/units.h"
-#include "vmath.h"
-#include "rt/db4.h"
-#include "rt/geom.h"
-#include "wdb.h"
-#include "raytrace.h"
-#include "ged.h"
-#include "tclcad.h"
-
-#include "rt/solid.h"
-#include "dm.h"
-#include "dm/bview.h"
-
-#include "icv/io.h"
-#include "icv/ops.h"
-#include "icv/crop.h"
-#include "fb.h"
-
-#include "dm/dm_xvars.h"
-
-#ifdef DM_X
-#  ifdef WITH_TK
-#    include "tk.h"
-#endif
-#  include <X11/Xutil.h>
-#  include "dm/dm_xvars.h"
-#endif /* DM_X */
-
-#ifdef DM_TK
-#  ifdef WITH_TK
-#    include "tk.h"
-#  endif
-#  include "dm/dm_xvars.h"
-#endif /* DM_TK */
-
-#ifdef DM_OGL
-#  include "fb/fb_ogl.h"
-#endif /* DM_OGL */
-
-#ifdef DM_OSG
-#  include "dm/dm_xvars.h"
-#endif /* DM_OSG */
-
-#ifdef DM_OSGL
-#  include "dm/dm_xvars.h"
-#endif /* DM_OSGL */
-
-#ifdef DM_WGL
-#  include <tkwinport.h>
-#  include "fb/fb_wgl.h"
-#  include "dm/dm_xvars.h"
-#endif /* DM_WGL */
-
-#ifdef DM_QT
-#  include "dm/dm_xvars.h"
-#endif /* DM_QT */
-
-/* Private headers */
-#include "tclcad_private.h"
-
-#include "brlcad_version.h"
-
-
-#define TO_UNLIMITED -1
-
-/*
- * Weird upper limit from clipper ---> sqrt(2^63 -1)/2
- * Probably should be sqrt(2^63 -1)
- */
-#define CLIPPER_MAX 1518500249
-
-HIDDEN int to_autoview(struct ged *gedp,
-                      int argc,
-                      const char *argv[],
-                      ged_func_ptr func,
-                      const char *usage,
-                      int maxargs);
-HIDDEN int to_axes(struct ged *gedp,
-                  struct ged_dm_view *gdvp,
-                  struct bview_axes_state *gasp,
-                  int argc,
-                  const char *argv[],
-                  const char *usage);
-HIDDEN int to_base2local(struct ged *gedp,
-                        int argc,
-                        const char *argv[],
-                        ged_func_ptr func,
-                        const char *usage,
-                        int maxargs);
-HIDDEN int to_bg(struct ged *gedp,
-                int argc,
-                const char *argv[],
-                ged_func_ptr func,
-                const char *usage,
-                int maxargs);
-HIDDEN int to_blast(struct ged *gedp,
-                   int argc,
-                   const char *argv[],
-                   ged_func_ptr func,
-                   const char *usage,
-                   int maxargs);
-HIDDEN int to_bounds(struct ged *gedp,
-                    int argc,
-                    const char *argv[],
-                    ged_func_ptr func,
-                    const char *usage,
-                    int maxargs);
-HIDDEN int to_configure(struct ged *gedp,
-                       int argc,
-                       const char *argv[],
-                       ged_func_ptr func,
-                       const char *usage,
-                       int maxargs);
-HIDDEN int to_constrain_rmode(struct ged *gedp,
-                             int argc,
-                             const char *argv[],
-                             ged_func_ptr func,
-                             const char *usage,
-                             int maxargs);
-HIDDEN int to_constrain_tmode(struct ged *gedp,
-                             int argc,
-                             const char *argv[],
-                             ged_func_ptr func,
-                             const char *usage,
-                             int maxargs);
-HIDDEN int to_copy(struct ged *gedp,
-                  int argc,
-                  const char *argv[],
-                  ged_func_ptr func,
-                  const char *usage,
-                  int maxargs);
-HIDDEN int to_data_arrows(struct ged *gedp,
-                         int argc,
-                         const char *argv[],
-                         ged_func_ptr func,
-                         const char *usage,
-                         int maxargs);
-HIDDEN int to_data_arrows_func(Tcl_Interp *interp,
-                              struct ged *gedp,
-                              struct ged_dm_view *gdvp,
-                              int argc,
-                              const char *argv[]);
-HIDDEN int to_data_axes(struct ged *gedp,
-                       int argc,
-                       const char *argv[],
-                       ged_func_ptr func,
-                       const char *usage,
-                       int maxargs);
-HIDDEN int to_data_axes_func(Tcl_Interp *interp,
-                            struct ged *gedp,
-                            struct ged_dm_view *gdvp,
-                            int argc,
-                            const char *argv[]);
-HIDDEN int to_data_labels(struct ged *gedp,
-                         int argc,
-                         const char *argv[],
-                         ged_func_ptr func,
-                         const char *usage,
-                         int maxargs);
-HIDDEN int to_data_labels_func(Tcl_Interp *interp,
-                              struct ged *gedp,
-                              struct ged_dm_view *gdvp,
-                              int argc,
-                              const char *argv[]);
-HIDDEN int to_data_lines(struct ged *gedp,
-                        int argc,
-                        const char *argv[],
-                        ged_func_ptr func,
-                        const char *usage,
-                        int maxargs);
-HIDDEN int to_data_lines_func(Tcl_Interp *interp,
-                             struct ged *gedp,
-                             struct ged_dm_view *gdvp,
-                             int argc,
-                             const char *argv[]);
-HIDDEN int to_data_polygons(struct ged *gedp,
-                           int argc,
-                           const char *argv[],
-                           ged_func_ptr func,
-                           const char *usage,
-                           int maxargs);
-HIDDEN int to_data_polygons_func(Tcl_Interp *interp,
-                                struct ged *gedp,
-                                struct ged_dm_view *gdvp,
-                                int argc,
-                                const char *argv[]);
-HIDDEN int to_data_move(struct ged *gedp,
-                       int argc,
-                       const char *argv[],
-                       ged_func_ptr func,
-                       const char *usage,
-                       int maxargs);
-HIDDEN int to_data_move_func(struct ged *gedp,
-                            struct ged_dm_view *gdvp,
-                            int argc,
-                            const char *argv[],
-                            const char *usage);
-HIDDEN int to_data_move_object_mode(struct ged *gedp,
-                                   int argc,
-                                   const char *argv[],
-                                   ged_func_ptr func,
-                                   const char *usage,
-                                   int maxargs);
-HIDDEN int to_data_move_object_mode_func(struct ged *gedp,
-                                        struct ged_dm_view *gdvp,
-                                        int argc,
-                                        const char *argv[],
-                                        const char *usage);
-HIDDEN int to_data_move_point_mode(struct ged *gedp,
-                                  int argc,
-                                  const char *argv[],
-                                  ged_func_ptr func,
-                                  const char *usage,
-                                  int maxargs);
-HIDDEN int to_data_move_point_mode_func(struct ged *gedp,
-                                       struct ged_dm_view *gdvp,
-                                       int argc,
-                                       const char *argv[],
-                                       const char *usage);
-HIDDEN int to_data_pick(struct ged *gedp,
-                       int argc,
-                       const char *argv[],
-                       ged_func_ptr func,
-                       const char *usage,
-                       int maxargs);
-HIDDEN int
-to_data_pick_func(struct ged *gedp,
-                 struct ged_dm_view *gdvp,
-                 int argc,
-                 const char *argv[],
-                 const char *usage);
-HIDDEN int to_data_vZ(struct ged *gedp,
-                     int argc,
-                     const char *argv[],
-                     ged_func_ptr func,
-                     const char *usage,
-                     int maxargs);
-HIDDEN int to_dlist_on(struct ged *gedp,
-                      int argc,
-                      const char *argv[],
-                      ged_func_ptr func,
-                      const char *usage,
-                      int maxargs);
-HIDDEN int to_dplot(struct ged *gedp,
-                      int argc,
-                      const char *argv[],
-                      ged_func_ptr func,
-                      const char *usage,
-                      int maxargs);
-HIDDEN int to_bot_edge_split(struct ged *gedp,
-                            int argc,
-                            const char *argv[],
-                            ged_func_ptr func,
-                            const char *usage,
-                            int maxargs);
-HIDDEN int to_bot_face_split(struct ged *gedp,
-                            int argc,
-                            const char *argv[],
-                            ged_func_ptr func,
-                            const char *usage,
-                            int maxargs);
-HIDDEN int to_fontsize(struct ged *gedp,
-                      int argc,
-                      const char *argv[],
-                      ged_func_ptr func,
-                      const char *usage,
-                      int maxargs);
-HIDDEN int to_get_prev_mouse(struct ged *gedp,
-                            int argc,
-                            const char *argv[],
-                            ged_func_ptr func,
-                            const char *usage,
-                            int maxargs);
-HIDDEN int to_fit_png_image(struct ged *gedp,
-                           int argc,
-                           const char *argv[],
-                           ged_func_ptr func,
-                           const char *usage,
-                           int maxargs);
-HIDDEN int to_init_view_bindings(struct ged *gedp,
-                                int argc,
-                                const char *argv[],
-                                ged_func_ptr func,
-                                const char *usage,
-                                int maxargs);
-HIDDEN int to_delete_view(struct ged *gedp,
-                         int argc,
-                         const char *argv[],
-                         ged_func_ptr func,
-                         const char *usage,
-                         int maxargs);
-HIDDEN int to_faceplate(struct ged *gedp,
-                       int argc,
-                       const char *argv[],
-                       ged_func_ptr func,
-                       const char *usage,
-                       int maxargs);
-HIDDEN int to_handle_expose(struct ged *gedp,
-                           int argc,
-                           const char *argv[],
-                           ged_func_ptr func,
-                           const char *usage,
-                           int maxargs);
-HIDDEN int to_handle_refresh(struct ged *gedp,
-                            const char *name);
-HIDDEN int to_hide_view(struct ged *gedp,
-                       int argc,
-                       const char *argv[],
-                       ged_func_ptr func,
-                       const char *usage,
-                       int maxargs);
-HIDDEN int to_idle_mode(struct ged *gedp,
-                       int argc,
-                       const char *argv[],
-                       ged_func_ptr func,
-                       const char *usage,
-                       int maxargs);
-HIDDEN int to_is_viewable(struct ged_dm_view *gdvp);
-HIDDEN int to_light(struct ged *gedp,
-                   int argc,
-                   const char *argv[],
-                   ged_func_ptr func,
-                   const char *usage,
-                   int maxargs);
-HIDDEN int to_list_views(struct ged *gedp,
-                        int argc,
-                        const char *argv[],
-                        ged_func_ptr func,
-                        const char *usage,
-                        int maxargs);
-HIDDEN int to_listen(struct ged *gedp,
-                    int argc,
-                    const char *argv[],
-                    ged_func_ptr func,
-                    const char *usage,
-                    int maxargs);
-HIDDEN int to_local2base(struct ged *gedp,
-                        int argc,
-                        const char *argv[],
-                        ged_func_ptr func,
-                        const char *usage,
-                        int maxargs);
-HIDDEN int to_lod(struct ged *gedp,
-                 int argc,
-                 const char *argv[],
-                 ged_func_ptr func,
-                 const char *usage,
-                 int maxargs);
-HIDDEN int to_make(struct ged *gedp,
-                  int argc,
-                  const char *argv[],
-                  ged_func_ptr func,
-                  const char *usage,
-                  int maxargs);
-HIDDEN int to_mirror(struct ged *gedp,
-                    int argc,
-                    const char *argv[],
-                    ged_func_ptr func,
-                    const char *usage,
-                    int maxargs);
-HIDDEN int to_model_axes(struct ged *gedp,
-                        int argc,
-                        const char *argv[],
-                        ged_func_ptr func,
-                        const char *usage,
-                        int maxargs);
-HIDDEN int to_edit_motion_delta_callback(struct ged *gedp,
-                                        int argc,
-                                        const char *argv[],
-                                        ged_func_ptr func,
-                                        const char *usage,
-                                        int maxargs);
-HIDDEN int to_more_args_callback(struct ged *gedp,
-                                int argc,
-                                const char *argv[],
-                                ged_func_ptr func,
-                                const char *usage,
-                                int maxargs);
-HIDDEN int to_mouse_append_pnt_common(struct ged *gedp,
-                                     int argc,
-                                     const char *argv[],
-                                     ged_func_ptr func,
-                                     const char *usage,
-                                     int maxargs);
-HIDDEN int to_mouse_brep_selection_append(struct ged *gedp,
-                                         int argc,
-                                         const char *argv[],
-                                         ged_func_ptr func,
-                                         const char *usage,
-                                         int maxargs);
-HIDDEN int to_mouse_brep_selection_translate(struct ged *gedp,
-                                            int argc,
-                                            const char *argv[],
-                                            ged_func_ptr func,
-                                            const char *usage,
-                                            int maxargs);
-HIDDEN int to_mouse_constrain_rot(struct ged *gedp,
-                                 int argc,
-                                 const char *argv[],
-                                 ged_func_ptr func,
-                                 const char *usage,
-                                 int maxargs);
-HIDDEN int to_mouse_constrain_trans(struct ged *gedp,
-                                   int argc,
-                                   const char *argv[],
-                                   ged_func_ptr func,
-                                   const char *usage,
-                                   int maxargs);
-HIDDEN int to_mouse_find_arb_edge(struct ged *gedp,
-                                 int argc,
-                                 const char *argv[],
-                                 ged_func_ptr func,
-                                 const char *usage,
-                                 int maxargs);
-HIDDEN int to_mouse_find_bot_edge(struct ged *gedp,
-                                 int argc,
-                                 const char *argv[],
-                                 ged_func_ptr func,
-                                 const char *usage,
-                                 int maxargs);
-HIDDEN int to_mouse_find_bot_pnt(struct ged *gedp,
-                                int argc,
-                                const char *argv[],
-                                ged_func_ptr func,
-                                const char *usage,
-                                int maxargs);
-HIDDEN int to_mouse_find_metaball_pnt(struct ged *gedp,
-                                     int argc,
-                                     const char *argv[],
-                                     ged_func_ptr func,
-                                     const char *usage,
-                                     int maxargs);
-HIDDEN int to_mouse_find_pipe_pnt(struct ged *gedp,
-                                 int argc,
-                                 const char *argv[],
-                                 ged_func_ptr func,
-                                 const char *usage,
-                                 int maxargs);
-HIDDEN int to_mouse_joint_select(struct ged *gedp,
-                                int argc,
-                                const char *argv[],
-                                ged_func_ptr func,
-                                const char *usage,
-                                int maxargs);
-HIDDEN int to_mouse_joint_selection_translate(struct ged *gedp,
-                                             int argc,
-                                             const char *argv[],
-                                             ged_func_ptr func,
-                                             const char *usage,
-                                             int maxargs);
-HIDDEN int to_mouse_move_arb_edge(struct ged *gedp,
-                                 int argc,
-                                 const char *argv[],
-                                 ged_func_ptr func,
-                                 const char *usage,
-                                 int maxargs);
-HIDDEN int to_mouse_move_arb_face(struct ged *gedp,
-                                 int argc,
-                                 const char *argv[],
-                                 ged_func_ptr func,
-                                 const char *usage,
-                                 int maxargs);
-HIDDEN int to_mouse_move_bot_pnt(struct ged *gedp,
-                                int argc,
-                                const char *argv[],
-                                ged_func_ptr func,
-                                const char *usage,
-                                int maxargs);
-HIDDEN int to_mouse_move_bot_pnts(struct ged *gedp,
-                                 int argc,
-                                 const char *argv[],
-                                 ged_func_ptr func,
-                                 const char *usage,
-                                 int maxargs);
-HIDDEN int to_mouse_move_pnt_common(struct ged *gedp,
-                                   int argc,
-                                   const char *argv[],
-                                   ged_func_ptr func,
-                                   const char *usage,
-                                   int maxargs);
-HIDDEN int to_mouse_orotate(struct ged *gedp,
-                           int argc,
-                           const char *argv[],
-                           ged_func_ptr func,
-                           const char *usage,
-                           int maxargs);
-HIDDEN int to_mouse_oscale(struct ged *gedp,
-                          int argc,
-                          const char *argv[],
-                          ged_func_ptr func,
-                          const char *usage,
-                          int maxargs);
-HIDDEN int to_mouse_otranslate(struct ged *gedp,
-                              int argc,
-                              const char *argv[],
-                              ged_func_ptr func,
-                              const char *usage,
-                              int maxargs);
-HIDDEN int to_mouse_poly_circ(struct ged *gedp,
-                             int argc,
-                             const char *argv[],
-                             ged_func_ptr func,
-                             const char *usage,
-                             int maxargs);
-HIDDEN int to_mouse_poly_circ_func(Tcl_Interp *interp,
-                                  struct ged *gedp,
-                                  struct ged_dm_view *gdvp,
-                                  int argc,
-                                  const char *argv[],
-                                  const char *usage);
-HIDDEN int to_mouse_poly_cont(struct ged *gedp,
-                             int argc,
-                             const char *argv[],
-                             ged_func_ptr func,
-                             const char *usage,
-                             int maxargs);
-HIDDEN int to_mouse_poly_cont_func(Tcl_Interp *interp,
-                                  struct ged *gedp,
-                                  struct ged_dm_view *gdvp,
-                                  int argc,
-                                  const char *argv[],
-                                  const char *usage);
-HIDDEN int to_mouse_poly_ell(struct ged *gedp,
-                            int argc,
-                            const char *argv[],
-                            ged_func_ptr func,
-                            const char *usage,
-                            int maxargs);
-HIDDEN int to_mouse_poly_ell_func(Tcl_Interp *interp,
-                                 struct ged *gedp,
-                                 struct ged_dm_view *gdvp,
-                                 int argc,
-                                 const char *argv[],
-                                 const char *usage);
-HIDDEN int to_mouse_poly_rect(struct ged *gedp,
-                             int argc,
-                             const char *argv[],
-                             ged_func_ptr func,
-                             const char *usage,
-                             int maxargs);
-HIDDEN int to_mouse_poly_rect_func(Tcl_Interp *interp,
-                                  struct ged *gedp,
-                                  struct ged_dm_view *gdvp,
-                                  int argc,
-                                  const char *argv[],
-                                  const char *usage);
-HIDDEN int to_mouse_ray(struct ged *gedp,
-                       int argc,
-                       const char *argv[],
-                       ged_func_ptr func,
-                       const char *usage,
-                       int maxargs);
-HIDDEN int to_mouse_rect(struct ged *gedp,
-                        int argc,
-                        const char *argv[],
-                        ged_func_ptr func,
-                        const char *usage,
-                        int maxargs);
-HIDDEN int to_mouse_rot(struct ged *gedp,
-                       int argc,
-                       const char *argv[],
-                       ged_func_ptr func,
-                       const char *usage,
-                       int maxargs);
-HIDDEN int to_mouse_rotate_arb_face(struct ged *gedp,
-                                   int argc,
-                                   const char *argv[],
-                                   ged_func_ptr func,
-                                   const char *usage,
-                                   int maxargs);
-HIDDEN int to_mouse_data_scale(struct ged *gedp,
-                              int argc,
-                              const char *argv[],
-                              ged_func_ptr func,
-                              const char *usage,
-                              int maxargs);
-HIDDEN int to_mouse_scale(struct ged *gedp,
-                         int argc,
-                         const char *argv[],
-                         ged_func_ptr func,
-                         const char *usage,
-                         int maxargs);
-HIDDEN int to_mouse_protate(struct ged *gedp,
-                           int argc,
-                           const char *argv[],
-                           ged_func_ptr func,
-                           const char *usage,
-                           int maxargs);
-HIDDEN int to_mouse_pscale(struct ged *gedp,
-                          int argc,
-                          const char *argv[],
-                          ged_func_ptr func,
-                          const char *usage,
-                          int maxargs);
-HIDDEN int to_mouse_ptranslate(struct ged *gedp,
-                              int argc,
-                              const char *argv[],
-                              ged_func_ptr func,
-                              const char *usage,
-                              int maxargs);
-HIDDEN int to_mouse_trans(struct ged *gedp,
-                         int argc,
-                         const char *argv[],
-                         ged_func_ptr func,
-                         const char *usage,
-                         int maxargs);
-HIDDEN int to_move_arb_edge_mode(struct ged *gedp,
-                                int argc,
-                                const char *argv[],
-                                ged_func_ptr func,
-                                const char *usage,
-                                int maxargs);
-HIDDEN int to_move_arb_face_mode(struct ged *gedp,
-                                int argc,
-                                const char *argv[],
-                                ged_func_ptr func,
-                                const char *usage,
-                                int maxargs);
-HIDDEN int to_bot_move_pnt(struct ged *gedp,
-                          int argc,
-                          const char *argv[],
-                          ged_func_ptr func,
-                          const char *usage,
-                          int maxargs);
-HIDDEN int to_bot_move_pnts(struct ged *gedp,
-                           int argc,
-                           const char *argv[],
-                           ged_func_ptr func,
-                           const char *usage,
-                           int maxargs);
-HIDDEN int to_bot_move_pnt_mode(struct ged *gedp,
-                               int argc,
-                               const char *argv[],
-                               ged_func_ptr func,
-                               const char *usage,
-                               int maxargs);
-HIDDEN int to_bot_move_pnts_mode(struct ged *gedp,
-                                int argc,
-                                const char *argv[],
-                                ged_func_ptr func,
-                                const char *usage,
-                                int maxargs);
-HIDDEN int to_metaball_move_pnt_mode(struct ged *gedp,
-                                    int argc,
-                                    const char *argv[],
-                                    ged_func_ptr func,
-                                    const char *usage,
-                                    int maxargs);
-HIDDEN int to_pipe_move_pnt_mode(struct ged *gedp,
-                                int argc,
-                                const char *argv[],
-                                ged_func_ptr func,
-                                const char *usage,
-                                int maxargs);
-HIDDEN int to_move_pnt_common(struct ged *gedp,
-                             int argc,
-                             const char *argv[],
-                             ged_func_ptr func,
-                             const char *usage,
-                             int maxargs);
-HIDDEN int to_new_view(struct ged *gedp,
-                      int argc,
-                      const char *argv[],
-                      ged_func_ptr func,
-                      const char *usage,
-                      int maxargs);
-HIDDEN int to_orotate_mode(struct ged *gedp,
-                          int argc,
-                          const char *argv[],
-                          ged_func_ptr func,
-                          const char *usage,
-                          int maxargs);
-HIDDEN int to_oscale_mode(struct ged *gedp,
-                         int argc,
-                         const char *argv[],
-                         ged_func_ptr func,
-                         const char *usage,
-                         int maxargs);
-HIDDEN int to_otranslate_mode(struct ged *gedp,
-                             int argc,
-                             const char *argv[],
-                             ged_func_ptr func,
-                             const char *usage,
-                             int maxargs);
-HIDDEN int to_paint_rect_area(struct ged *gedp,
-                             int argc,
-                             const char *argv[],
-                             ged_func_ptr func,
-                             const char *usage,
-                             int maxargs);
-#if defined(DM_OGL) || defined(DM_WGL)
-HIDDEN int to_pix(struct ged *gedp,
-                 int argc,
-                 const char *argv[],
-                 ged_func_ptr func,
-                 const char *usage,
-                 int maxargs);
-HIDDEN int to_png(struct ged *gedp,
-                 int argc,
-                 const char *argv[],
-                 ged_func_ptr func,
-                 const char *usage,
-                 int maxargs);
-#endif
-
-HIDDEN int to_poly_circ_mode(struct ged *gedp,
-                            int argc,
-                            const char *argv[],
-                            ged_func_ptr func,
-                            const char *usage,
-                            int maxargs);
-HIDDEN int to_poly_circ_mode_func(Tcl_Interp *interp,
-                                 struct ged *gedp,
-                                 struct ged_dm_view *gdvp,
-                                 int argc,
-                                 const char *argv[],
-                                 const char *usage);
-HIDDEN int to_poly_cont_build(struct ged *gedp,
-                             int argc,
-                             const char *argv[],
-                             ged_func_ptr func,
-                             const char *usage,
-                             int maxargs);
-HIDDEN int to_poly_cont_build_func(Tcl_Interp *interp,
-                                  struct ged *gedp,
-                                  struct ged_dm_view *gdvp,
-                                  int argc,
-                                  const char *argv[],
-                                  const char *usage,
-                                  int doBind);
-HIDDEN int to_poly_cont_build_end(struct ged *gedp,
-                                 int argc,
-                                 const char *argv[],
-                                 ged_func_ptr func,
-                                 const char *usage,
-                                 int maxargs);
-HIDDEN int to_poly_cont_build_end_func(struct ged_dm_view *gdvp,
-                                      int argc,
-                                      const char *argv[]);
-HIDDEN int to_poly_ell_mode(struct ged *gedp,
-                           int argc,
-                           const char *argv[],
-                           ged_func_ptr func,
-                           const char *usage,
-                           int maxargs);
-HIDDEN int to_poly_ell_mode_func(Tcl_Interp *interp,
-                                struct ged *gedp,
-                                struct ged_dm_view *gdvp,
-                                int argc,
-                                const char *argv[],
-                                const char *usage);
-HIDDEN int to_poly_rect_mode(struct ged *gedp,
-                            int argc,
-                            const char *argv[],
-                            ged_func_ptr func,
-                            const char *usage,
-                            int maxargs);
-HIDDEN int to_poly_rect_mode_func(Tcl_Interp *interp,
-                                 struct ged *gedp,
-                                 struct ged_dm_view *gdvp,
-                                 int argc,
-                                 const char *argv[],
-                                 const char *usage);
-HIDDEN int to_prim_label(struct ged *gedp,
-                        int argc,
-                        const char *argv[],
-                        ged_func_ptr func,
-                        const char *usage,
-                        int maxargs);
-HIDDEN int to_redraw(struct ged *gedp,
-                    int argc,
-                    const char *argv[],
-                    ged_func_ptr func,
-                    const char *usage,
-                    int maxargs);
-HIDDEN int to_rect_mode(struct ged *gedp,
-                       int argc,
-                       const char *argv[],
-                       ged_func_ptr func,
-                       const char *usage,
-                       int maxargs);
-HIDDEN int to_refresh(struct ged *gedp,
-                     int argc,
-                     const char *argv[],
-                     ged_func_ptr func,
-                     const char *usage,
-                     int maxargs);
-HIDDEN int to_refresh_all(struct ged *gedp,
-                         int argc,
-                         const char *argv[],
-                         ged_func_ptr func,
-                         const char *usage,
-                         int maxargs);
-HIDDEN int to_refresh_on(struct ged *gedp,
-                        int argc,
-                        const char *argv[],
-                        ged_func_ptr func,
-                        const char *usage,
-                        int maxargs);
-HIDDEN int to_rotate_arb_face_mode(struct ged *gedp,
-                                  int argc,
-                                  const char *argv[],
-                                  ged_func_ptr func,
-                                  const char *usage,
-                                  int maxargs);
-HIDDEN int to_rotate_mode(struct ged *gedp,
-                         int argc,
-                         const char *argv[],
-                         ged_func_ptr func,
-                         const char *usage,
-                         int maxargs);
-HIDDEN int to_rt_end_callback(struct ged *gedp,
-                             int argc,
-                             const char *argv[],
-                             ged_func_ptr func,
-                             const char *usage,
-                             int maxargs);
-HIDDEN int to_rt_gettrees(struct ged *gedp,
-                         int argc,
-                         const char *argv[],
-                         ged_func_ptr func,
-                         const char *usage,
-                         int maxargs);
-HIDDEN int to_protate_mode(struct ged *gedp,
-                          int argc,
-                          const char *argv[],
-                          ged_func_ptr func,
-                          const char *usage,
-                          int maxargs);
-HIDDEN int to_pscale_mode(struct ged *gedp,
-                         int argc,
-                         const char *argv[],
-                         ged_func_ptr func,
-                         const char *usage,
-                         int maxargs);
-HIDDEN int to_ptranslate_mode(struct ged *gedp,
-                             int argc,
-                             const char *argv[],
-                             ged_func_ptr func,
-                             const char *usage,
-                             int maxargs);
-HIDDEN int to_data_scale_mode(struct ged *gedp,
-                             int argc,
-                             const char *argv[],
-                             ged_func_ptr func,
-                             const char *usage,
-                             int maxargs);
-HIDDEN int to_scale_mode(struct ged *gedp,
-                        int argc,
-                        const char *argv[],
-                        ged_func_ptr func,
-                        const char *usage,
-                        int maxargs);
-HIDDEN int to_screen2model(struct ged *gedp,
-                          int argc,
-                          const char *argv[],
-                          ged_func_ptr func,
-                          const char *usage,
-                          int maxargs);
-HIDDEN int to_screen2view(struct ged *gedp,
-                         int argc,
-                         const char *argv[],
-                         ged_func_ptr func,
-                         const char *usage,
-                         int maxargs);
-HIDDEN int to_set_coord(struct ged *gedp,
-                       int argc,
-                       const char *argv[],
-                       ged_func_ptr func,
-                       const char *usage,
-                       int maxargs);
-HIDDEN int to_set_fb_mode(struct ged *gedp,
-                         int argc,
-                         const char *argv[],
-                         ged_func_ptr func,
-                         const char *usage,
-                         int maxargs);
-HIDDEN int to_snap_view(struct ged *gedp,
-                       int argc,
-                       const char *argv[],
-                       ged_func_ptr func,
-                       const char *usage,
-                       int maxargs);
-HIDDEN int to_translate_mode(struct ged *gedp,
-                            int argc,
-                            const char *argv[],
-                            ged_func_ptr func,
-                            const char *usage,
-                            int maxargs);
-HIDDEN int to_transparency(struct ged *gedp,
-                          int argc,
-                          const char *argv[],
-                          ged_func_ptr func,
-                          const char *usage,
-                          int maxargs);
-HIDDEN int to_view_axes(struct ged *gedp,
-                       int argc,
-                       const char *argv[],
-                       ged_func_ptr func,
-                       const char *usage,
-                       int maxargs);
-HIDDEN int to_view_callback(struct ged *gedp,
-                           int argc,
-                           const char *argv[],
-                           ged_func_ptr func,
-                           const char *usage,
-                           int maxargs);
-HIDDEN int to_view_win_size(struct ged *gedp,
-                           int argc,
-                           const char *argv[],
-                           ged_func_ptr func,
-                           const char *usage,
-                           int maxargs);
-HIDDEN int to_view2screen(struct ged *gedp,
-                         int argc,
-                         const char *argv[],
-                         ged_func_ptr func,
-                         const char *usage,
-                         int maxargs);
-HIDDEN int to_vmake(struct ged *gedp,
-                   int argc,
-                   const char *argv[],
-                   ged_func_ptr func,
-                   const char *usage,
-                   int maxargs);
-HIDDEN int to_vslew(struct ged *gedp,
-                   int argc,
-                   const char *argv[],
-                   ged_func_ptr func,
-                   const char *usage,
-                   int maxargs);
-HIDDEN int to_zbuffer(struct ged *gedp,
-                     int argc,
-                     const char *argv[],
-                     ged_func_ptr func,
-                     const char *usage,
-                     int maxargs);
-HIDDEN int to_zclip(struct ged *gedp,
-                   int argc,
-                   const char *argv[],
-                   ged_func_ptr func,
-                   const char *usage,
-                   int maxargs);
-
-/* Wrapper Functions */
-
-HIDDEN int to_autoview_func(struct ged *gedp,
-                           int argc,
-                           const char *argv[],
-                           ged_func_ptr func,
-                           const char *usage,
-                           int maxargs);
-HIDDEN int to_more_args_func(struct ged *gedp,
-                            int argc,
-                            const char *argv[],
-                            ged_func_ptr func,
-                            const char *usage,
-                            int maxargs);
-HIDDEN int to_pass_through_func(struct ged *gedp,
-                               int argc,
-                               const char *argv[],
-                               ged_func_ptr func,
-                               const char *usage,
-                               int maxargs);
-HIDDEN int to_pass_through_and_refresh_func(struct ged *gedp,
-                                           int argc,
-                                           const char *argv[],
-                                           ged_func_ptr func,
-                                           const char *usage,
-                                           int maxargs);
-HIDDEN int to_view_func(struct ged *gedp,
-                       int argc,
-                       const char *argv[],
-                       ged_func_ptr func,
-                       const char *usage,
-                       int maxargs);
-HIDDEN int to_view_func_common(struct ged *gedp,
-                              int argc,
-                              const char *argv[],
-                              ged_func_ptr func,
-                              const char *usage,
-                              int maxargs,
-                              int cflag,
-                              int rflag);
-HIDDEN int to_view_func_less(struct ged *gedp,
-                            int argc,
-                            const char *argv[],
-                            ged_func_ptr func,
-                            const char *usage,
-                            int maxargs);
-HIDDEN int to_view_func_plus(struct ged *gedp,
-                            int argc,
-                            const char *argv[],
-                            ged_func_ptr func,
-                            const char *usage,
-                            int maxargs);
-HIDDEN int to_dm_func(struct ged *gedp,
-                     int argc,
-                     const char *argv[],
-                     ged_func_ptr func,
-                     const char *usage,
-                     int maxargs);
-
-/* Utility Functions */
-HIDDEN int to_close_fbs(struct ged_dm_view *gdvp);
-HIDDEN void to_dm_get_display_image(struct ged *gedp, unsigned char **idata);
-HIDDEN void to_fbs_callback();
-HIDDEN int to_open_fbs(struct ged_dm_view *gdvp, Tcl_Interp *interp);
-
-HIDDEN void to_create_vlist_callback_solid(struct solid *gdlp);
-HIDDEN void to_create_vlist_callback(struct display_list *gdlp);
-HIDDEN void to_free_vlist_callback(unsigned int dlist, int range);
-HIDDEN void to_refresh_all_views(struct tclcad_obj *top);
-HIDDEN void to_refresh_view(struct ged_dm_view *gdvp);
-HIDDEN void to_refresh_handler(void *clientdata);
-HIDDEN void to_autoview_view(struct ged_dm_view *gdvp, const char *scale);
-HIDDEN void to_autoview_all_views(struct tclcad_obj *top);
-HIDDEN void to_rt_end_callback_internal(int aborted);
-
-HIDDEN void to_output_handler(struct ged *gedp, char *line);
-
-HIDDEN int to_edit_redraw(struct ged *gedp, int argc, const char *argv[]);
-
-typedef int (*to_wrapper_func_ptr)(struct ged *, int, const char *[], 
ged_func_ptr, const char *, int);
-#define TO_WRAPPER_FUNC_PTR_NULL (to_wrapper_func_ptr)0
-
-static struct tclcad_obj HeadTclcadObj;
-static struct tclcad_obj *current_top = TCLCAD_OBJ_NULL;
-
-struct path_edit_params {
-    int edit_mode;
-    double dx;
-    double dy;
-    mat_t edit_mat;
-};
-
-
-struct to_cmdtab {
-    char *to_name;
-    char *to_usage;
-    int to_maxargs;
-    to_wrapper_func_ptr to_wrapper_func;
-    ged_func_ptr to_func;
-};
-
-
-static struct to_cmdtab to_cmds[] = {
-    {"3ptarb", (char *)0, TO_UNLIMITED, to_more_args_func, ged_3ptarb},
-    {"adc",    "args", 7, to_view_func, ged_adc},
-    {"adjust", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_adjust},
-    {"ae2dir", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_ae2dir},
-    {"aet",    "[[-i] az el [tw]]", 6, to_view_func_plus, ged_aet},
-    {"analyze",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_analyze},
-    {"annotate", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_annotate},
-    {"pipe_append_pnt",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_pipe_append_pnt},
-    {"arb",    (char *)0, TO_UNLIMITED, to_pass_through_func, ged_arb},
-    {"arced",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_arced},
-    {"arot",   "x y z angle", 6, to_view_func_plus, ged_arot},
-    {"attr",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_attr},
-    {"autoview",       "vname", TO_UNLIMITED, to_autoview, GED_FUNC_PTR_NULL},
-    {"bb",     (char *)0, TO_UNLIMITED, to_pass_through_func, ged_bb},
-    {"bev",    (char *)0, TO_UNLIMITED, to_pass_through_func, ged_bev},
-    {"base2local",     (char *)0, TO_UNLIMITED, to_base2local, 
GED_FUNC_PTR_NULL},
-    {"bg",     "[r g b]", TO_UNLIMITED, to_bg, GED_FUNC_PTR_NULL},
-    {"blast",  (char *)0, TO_UNLIMITED, to_blast, GED_FUNC_PTR_NULL},
-    {"bo",     (char *)0, TO_UNLIMITED, to_pass_through_func, ged_bo},
-    {"bot",    (char *)0, TO_UNLIMITED, to_pass_through_func, ged_bot},
-    {"bot_condense",   (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_bot_condense},
-    {"bot_decimate",   (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_bot_decimate},
-    {"bot_dump",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_bot_dump},
-    {"bot_face_fuse",  (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_bot_face_fuse},
-    {"bot_face_sort",  (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_bot_face_sort},
-    {"bot_edge_split", "bot face", TO_UNLIMITED, to_bot_edge_split, 
GED_FUNC_PTR_NULL},
-    {"bot_face_split", "bot face", TO_UNLIMITED, to_bot_face_split, 
GED_FUNC_PTR_NULL},
-    {"bot_flip",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_bot_flip},
-    {"bot_fuse",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_bot_fuse},
-    {"bot_merge",      (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_bot_merge},
-    {"bot_smooth",     (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_bot_smooth},
-    {"bot_split",      (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_bot_split},
-    {"bot_sync",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_bot_sync},
-    {"bot_vertex_fuse",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_bot_vertex_fuse},
-    {"bounds", "[\"minX maxX minY maxY minZ maxZ\"]", TO_UNLIMITED, to_bounds, 
GED_FUNC_PTR_NULL},
-    {"brep",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_brep},
-    {"c",      (char *)0, TO_UNLIMITED, to_pass_through_func, ged_comb_std},
-    {"cat",    (char *)0, TO_UNLIMITED, to_pass_through_func, ged_cat},
-    {"center", "[x y z]", 5, to_view_func_plus, ged_center},
-    {"check",  (char *)0, TO_UNLIMITED, to_view_func, ged_check},
-    {"clear",  (char *)0, TO_UNLIMITED, to_pass_through_and_refresh_func, 
ged_zap},
-    {"clone",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_clone},
-    {"coil",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_coil},
-    {"color",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_color},
-    {"comb",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_comb},
-    {"comb_color",     (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_comb_color},
-    {"combmem",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_combmem},
-    {"configure",      "vname", TO_UNLIMITED, to_configure, GED_FUNC_PTR_NULL},
-    {"constrain_rmode",        "x|y|z x y", TO_UNLIMITED, to_constrain_rmode, 
GED_FUNC_PTR_NULL},
-    {"constrain_tmode",        "x|y|z x y", TO_UNLIMITED, to_constrain_tmode, 
GED_FUNC_PTR_NULL},
-    {"constraint", (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_constraint},
-    {"copyeval",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_copyeval},
-    {"copymat",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_copymat},
-    {"cp",     "[-f] from to", TO_UNLIMITED, to_copy, GED_FUNC_PTR_NULL},
-    {"cpi",    (char *)0, TO_UNLIMITED, to_pass_through_func, ged_cpi},
-    {"d",      (char *)0, TO_UNLIMITED, to_pass_through_and_refresh_func, 
ged_erase},
-    {"data_arrows",    "???", TO_UNLIMITED, to_data_arrows, GED_FUNC_PTR_NULL},
-    {"data_axes",      "???", TO_UNLIMITED, to_data_axes, GED_FUNC_PTR_NULL},
-    {"data_labels",    "???", TO_UNLIMITED, to_data_labels, GED_FUNC_PTR_NULL},
-    {"data_lines",     "???", TO_UNLIMITED, to_data_lines, GED_FUNC_PTR_NULL},
-    {"data_polygons",  "???", TO_UNLIMITED, to_data_polygons, 
GED_FUNC_PTR_NULL},
-    {"data_move",      "???", TO_UNLIMITED, to_data_move, GED_FUNC_PTR_NULL},
-    {"data_move_object_mode",  "x y", TO_UNLIMITED, to_data_move_object_mode, 
GED_FUNC_PTR_NULL},
-    {"data_move_point_mode",   "x y", TO_UNLIMITED, to_data_move_point_mode, 
GED_FUNC_PTR_NULL},
-    {"data_pick",      "???", TO_UNLIMITED, to_data_pick, GED_FUNC_PTR_NULL},
-    {"data_scale_mode",        "x y", TO_UNLIMITED, to_data_scale_mode, 
GED_FUNC_PTR_NULL},
-    {"data_vZ",        "[z]", TO_UNLIMITED, to_data_vZ, GED_FUNC_PTR_NULL},
-    {"dbconcat",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_concat},
-    {"dbfind", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_find},
-    {"dbip",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_dbip},
-    {"dbot_dump",      (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_dbot_dump},
-    {"debug",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_debug},
-    {"debugbu",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_debugbu},
-    {"debugdir",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_debugdir},
-    {"debuglib",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_debuglib},
-    {"debugnmg",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_debugnmg},
-    {"decompose",      (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_decompose},
-    {"delay",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_delay},
-    {"metaball_delete_pnt",    (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_metaball_delete_pnt},
-    {"pipe_delete_pnt",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_pipe_delete_pnt},
-    {"delete_view",    "vname", TO_UNLIMITED, to_delete_view, 
GED_FUNC_PTR_NULL},
-    {"dir2ae", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_dir2ae},
-    {"dlist_on",       "[0|1]", TO_UNLIMITED, to_dlist_on, GED_FUNC_PTR_NULL},
-    {"dplot",  "dplot_logfile", 1, to_dplot, ged_dplot},
-    {"draw",   (char *)0, TO_UNLIMITED, to_autoview_func, ged_draw},
-    {"dump",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_dump},
-    {"dup",    (char *)0, TO_UNLIMITED, to_pass_through_func, ged_dup},
-    {"E",      (char *)0, TO_UNLIMITED, to_autoview_func, ged_E},
-    {"e",      (char *)0, TO_UNLIMITED, to_autoview_func, ged_draw},
-    {"eac",    (char *)0, TO_UNLIMITED, to_autoview_func, ged_eac},
-    {"echo",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_echo},
-    {"edarb",  (char *)0, TO_UNLIMITED, to_more_args_func, ged_edarb},
-    {"edcodes",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_edcodes},
-    {"edcolor",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_edcolor},
-    {"edcomb", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_edcomb},
-    {"edit",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_edit},
-    {"edmater",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_edmater},
-    {"env",    (char *)0, TO_UNLIMITED, to_pass_through_func, ged_env},
-    {"erase",  (char *)0, TO_UNLIMITED, to_pass_through_and_refresh_func, 
ged_erase},
-    {"ev",     (char *)0, TO_UNLIMITED, to_autoview_func, ged_ev},
-    {"expand", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_expand},
-    {"eye",    "[x y z]", 5, to_view_func_plus, ged_eye},
-    {"eye_pos",        "[x y z]", 5, to_view_func_plus, ged_eye_pos},
-    {"eye_pt", "[x y z]", 5, to_view_func_plus, ged_eye},
-    {"exists", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_exists},
-    {"faceplate",      "center_dot|prim_labels|view_params|view_scale 
color|draw [val(s)]", TO_UNLIMITED, to_faceplate, GED_FUNC_PTR_NULL},
-    {"facetize",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_facetize},
-    {"voxelize",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_voxelize},
-    {"fb2pix",         "[-h -i -c] [-s squaresize] [-w width] [-n height] 
[file.pix]", TO_UNLIMITED, to_view_func, ged_fb2pix},
-    {"fbclear",        "[r g b]", TO_UNLIMITED, to_view_func, ged_fbclear},
-    {"find_arb_edge",  "arb vx vy ptol", 5, to_view_func, 
ged_find_arb_edge_nearest_pnt},
-    {"find_bot_edge",  "bot vx vy", 5, to_view_func, 
ged_find_bot_edge_nearest_pnt},
-    {"find_bot_pnt",   "bot vx vy", 5, to_view_func, 
ged_find_bot_pnt_nearest_pnt},
-    {"find_pipe_pnt",  "pipe x y z", 6, to_view_func, 
ged_find_pipe_pnt_nearest_pnt},
-    {"fit_png_image",  "image_file_in req_width req_height scale 
image_file_out", 6, to_fit_png_image, GED_FUNC_PTR_NULL},
-    {"fontsize",       "[fontsize]", 3, to_fontsize, GED_FUNC_PTR_NULL},
-    {"form",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_form},
-    {"fracture",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_fracture},
-    {"g",      (char *)0, TO_UNLIMITED, to_pass_through_func, ged_group},
-    {"gdiff",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_gdiff},
-    {"get",    (char *)0, TO_UNLIMITED, to_pass_through_func, ged_get},
-    {"get_autoview",   (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_get_autoview},
-    {"get_bot_edges",  (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_get_bot_edges},
-    {"get_comb",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_get_comb},
-    {"get_eyemodel",   "vname", 2, to_view_func, ged_get_eyemodel},
-    {"get_prev_mouse", "vname", TO_UNLIMITED, to_get_prev_mouse, 
GED_FUNC_PTR_NULL},
-    {"get_type",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_get_type},
-    {"glob",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_glob},
-    {"gqa",    (char *)0, TO_UNLIMITED, to_pass_through_func, ged_gqa},
-    {"graph",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_graph},
-    {"grid",   "args", 6, to_view_func, ged_grid},
-    {"grid2model_lu",  "x y", 4, to_view_func_less, ged_grid2model_lu},
-    {"grid2view_lu",   "x y", 4, to_view_func_less, ged_grid2view_lu},
-    {"handle_expose",  "vname count", TO_UNLIMITED, to_handle_expose, 
GED_FUNC_PTR_NULL},
-    {"heal",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_heal},
-    {"hide",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_hide},
-    {"hide_view",      "vname [0|1]", 3, to_hide_view, GED_FUNC_PTR_NULL},
-    {"how",    (char *)0, TO_UNLIMITED, to_pass_through_func, ged_how},
-    {"human",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_human},
-    {"i",      (char *)0, TO_UNLIMITED, to_pass_through_func, ged_instance},
-    {"idents", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_tables},
-    {"idle_mode",      "vname", TO_UNLIMITED, to_idle_mode, GED_FUNC_PTR_NULL},
-    {"illum",  (char *)0, TO_UNLIMITED, to_pass_through_and_refresh_func, 
ged_illum},
-    {"importFg4Section",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_importFg4Section},
-    {"in",     (char *)0, TO_UNLIMITED, to_more_args_func, ged_in},
-    {"init_view_bindings",     "vname", TO_UNLIMITED, to_init_view_bindings, 
GED_FUNC_PTR_NULL},
-    {"inside", (char *)0, TO_UNLIMITED, to_more_args_func, ged_inside},
-    {"isize",  "vname", 2, to_view_func, ged_isize},
-    {"item",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_item},
-    {"joint",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_joint},
-    {"joint2", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_joint2},
-    {"keep",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_keep},
-    {"keypoint",       "[x y z]", 5, to_view_func, ged_keypoint},
-    {"kill",   (char *)0, TO_UNLIMITED, to_pass_through_and_refresh_func, 
ged_kill},
-    {"killall",        (char *)0, TO_UNLIMITED, 
to_pass_through_and_refresh_func, ged_killall},
-    {"killrefs",       (char *)0, TO_UNLIMITED, 
to_pass_through_and_refresh_func, ged_killrefs},
-    {"killtree",       (char *)0, TO_UNLIMITED, 
to_pass_through_and_refresh_func, ged_killtree},
-    {"l",      (char *)0, TO_UNLIMITED, to_pass_through_func, ged_list},
-    {"lc",      "[-d|-s|-r] [-z] [-0|-1|-2|-3|-4|-5] [-f {FileName}] 
{GroupName}", TO_UNLIMITED, to_pass_through_func, ged_lc},
-    {"light",  "[0|1]", TO_UNLIMITED, to_light, GED_FUNC_PTR_NULL},
-    {"list_views",     (char *)0, TO_UNLIMITED, to_list_views, 
GED_FUNC_PTR_NULL},
-    {"listen", "[port]", TO_UNLIMITED, to_listen, GED_FUNC_PTR_NULL},
-    {"listeval",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_pathsum},
-    {"loadview",       "filename", 3, to_view_func, ged_loadview},
-    {"local2base",     (char *)0, TO_UNLIMITED, to_local2base, 
GED_FUNC_PTR_NULL},
-    {"lod",    (char *)0, TO_UNLIMITED, to_lod, ged_lod},
-    {"log",    (char *)0, TO_UNLIMITED, to_pass_through_func, ged_log},
-    {"lookat", "x y z", 5, to_view_func_plus, ged_lookat},
-    {"ls",     (char *)0, TO_UNLIMITED, to_pass_through_func, ged_ls},
-    {"lt",     (char *)0, TO_UNLIMITED, to_pass_through_func, ged_lt},
-    {"m2v_point",      "x y z", 5, to_view_func, ged_m2v_point},
-    {"make",   (char *)0, TO_UNLIMITED, to_make, GED_FUNC_PTR_NULL},
-    {"make_name",      (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_make_name},
-    {"make_pnts",      (char *)0, TO_UNLIMITED, to_more_args_func, 
ged_make_pnts},
-    {"match",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_match},
-    {"mater",  (char *)0, TO_UNLIMITED, to_more_args_func, ged_mater},
-    {"mirror", (char *)0, TO_UNLIMITED, to_mirror, GED_FUNC_PTR_NULL},
-    {"model2grid_lu",  "x y z", 5, to_view_func_less, ged_model2grid_lu},
-    {"model2view",     "vname", 2, to_view_func, ged_model2view},
-    {"model2view_lu",  "x y z", 5, to_view_func_less, ged_model2view_lu},
-    {"model_axes",     "???", TO_UNLIMITED, to_model_axes, GED_FUNC_PTR_NULL},
-    {"edit_motion_delta_callback",     "vname [args]", TO_UNLIMITED, 
to_edit_motion_delta_callback, GED_FUNC_PTR_NULL},
-    {"more_args_callback",     "set/get the \"more args\" callback", 
TO_UNLIMITED, to_more_args_callback, GED_FUNC_PTR_NULL},
-    {"move_arb_edge",  (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_move_arb_edge},
-    {"move_arb_edge_mode",     "obj edge x y", TO_UNLIMITED, 
to_move_arb_edge_mode, GED_FUNC_PTR_NULL},
-    {"move_arb_face",  (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_move_arb_face},
-    {"move_arb_face_mode",     "obj face x y", TO_UNLIMITED, 
to_move_arb_face_mode, GED_FUNC_PTR_NULL},
-    {"bot_move_pnt",   (char *)0, TO_UNLIMITED, to_bot_move_pnt, 
GED_FUNC_PTR_NULL},
-    {"bot_move_pnts",  (char *)0, TO_UNLIMITED, to_bot_move_pnts, 
GED_FUNC_PTR_NULL},
-    {"bot_move_pnt_mode",      "obj i mx my", TO_UNLIMITED, 
to_bot_move_pnt_mode, GED_FUNC_PTR_NULL},
-    {"bot_move_pnts_mode",     "mx my obj i1 [i2 ... iN]", TO_UNLIMITED, 
to_bot_move_pnts_mode, GED_FUNC_PTR_NULL},
-    {"metaball_move_pnt",      (char *)0, TO_UNLIMITED, to_move_pnt_common, 
ged_metaball_move_pnt},
-    {"metaball_move_pnt_mode", "obj pt_i mx my", TO_UNLIMITED, 
to_metaball_move_pnt_mode, GED_FUNC_PTR_NULL},
-    {"pipe_move_pnt",  (char *)0, TO_UNLIMITED, to_move_pnt_common, 
ged_pipe_move_pnt},
-    {"pipe_pnt_mode",  "obj seg_i mx my", TO_UNLIMITED, to_pipe_move_pnt_mode, 
GED_FUNC_PTR_NULL},
-    {"mouse_add_metaball_pnt", "obj mx my", TO_UNLIMITED, 
to_mouse_append_pnt_common, ged_metaball_add_pnt},
-    {"mouse_append_pipe_pnt",  "obj mx my", TO_UNLIMITED, 
to_mouse_append_pnt_common, ged_pipe_append_pnt},
-    {"mouse_brep_selection_append", "obj mx my", 5, 
to_mouse_brep_selection_append, GED_FUNC_PTR_NULL},
-    {"mouse_brep_selection_translate", "obj mx my", 5, 
to_mouse_brep_selection_translate, GED_FUNC_PTR_NULL},
-    {"mouse_constrain_rot",    "coord mx my", TO_UNLIMITED, 
to_mouse_constrain_rot, GED_FUNC_PTR_NULL},
-    {"mouse_constrain_trans",  "coord mx my", TO_UNLIMITED, 
to_mouse_constrain_trans, GED_FUNC_PTR_NULL},
-    {"mouse_data_scale",       "mx my", TO_UNLIMITED, to_mouse_data_scale, 
GED_FUNC_PTR_NULL},
-    {"mouse_find_arb_edge",    "obj mx my ptol", TO_UNLIMITED, 
to_mouse_find_arb_edge, GED_FUNC_PTR_NULL},
-    {"mouse_find_bot_edge",    "obj mx my", TO_UNLIMITED, 
to_mouse_find_bot_edge, GED_FUNC_PTR_NULL},
-    {"mouse_find_bot_pnt",     "obj mx my", TO_UNLIMITED, 
to_mouse_find_bot_pnt, GED_FUNC_PTR_NULL},
-    {"mouse_find_metaball_pnt",        "obj mx my", TO_UNLIMITED, 
to_mouse_find_metaball_pnt, GED_FUNC_PTR_NULL},
-    {"mouse_find_pipe_pnt",    "obj mx my", TO_UNLIMITED, 
to_mouse_find_pipe_pnt, GED_FUNC_PTR_NULL},
-    {"mouse_joint_select", "obj mx my", 5, to_mouse_joint_select, 
GED_FUNC_PTR_NULL},
-    {"mouse_joint_selection_translate", "obj mx my", 5, 
to_mouse_joint_selection_translate, GED_FUNC_PTR_NULL},
-    {"mouse_move_arb_edge",    "obj edge mx my", TO_UNLIMITED, 
to_mouse_move_arb_edge, GED_FUNC_PTR_NULL},
-    {"mouse_move_arb_face",    "obj face mx my", TO_UNLIMITED, 
to_mouse_move_arb_face, GED_FUNC_PTR_NULL},
-    {"mouse_move_bot_pnt",     "[-r] obj i mx my", TO_UNLIMITED, 
to_mouse_move_bot_pnt, GED_FUNC_PTR_NULL},
-    {"mouse_move_bot_pnts",    "mx my obj i1 [i2 ... iN]", TO_UNLIMITED, 
to_mouse_move_bot_pnts, GED_FUNC_PTR_NULL},
-    {"mouse_move_metaball_pnt",        "obj i mx my", TO_UNLIMITED, 
to_mouse_move_pnt_common, ged_metaball_move_pnt},
-    {"mouse_move_pipe_pnt",    "obj i mx my", TO_UNLIMITED, 
to_mouse_move_pnt_common, ged_pipe_move_pnt},
-    {"mouse_orotate",  "obj mx my", TO_UNLIMITED, to_mouse_orotate, 
GED_FUNC_PTR_NULL},
-    {"mouse_oscale",   "obj mx my", TO_UNLIMITED, to_mouse_oscale, 
GED_FUNC_PTR_NULL},
-    {"mouse_otranslate",       "obj mx my", TO_UNLIMITED, to_mouse_otranslate, 
GED_FUNC_PTR_NULL},
-    {"mouse_poly_circ",        "mx my", TO_UNLIMITED, to_mouse_poly_circ, 
GED_FUNC_PTR_NULL},
-    {"mouse_poly_cont",        "mx my", TO_UNLIMITED, to_mouse_poly_cont, 
GED_FUNC_PTR_NULL},
-    {"mouse_poly_ell", "mx my", TO_UNLIMITED, to_mouse_poly_ell, 
GED_FUNC_PTR_NULL},
-    {"mouse_poly_rect",        "mx my", TO_UNLIMITED, to_mouse_poly_rect, 
GED_FUNC_PTR_NULL},
-    {"mouse_prepend_pipe_pnt", "obj mx my", TO_UNLIMITED, 
to_mouse_append_pnt_common, ged_pipe_prepend_pnt},
-    {"mouse_ray",      "mx my", TO_UNLIMITED, to_mouse_ray, GED_FUNC_PTR_NULL},
-    {"mouse_rect",     "mx my", TO_UNLIMITED, to_mouse_rect, 
GED_FUNC_PTR_NULL},
-    {"mouse_rot",      "mx my", TO_UNLIMITED, to_mouse_rot, GED_FUNC_PTR_NULL},
-    {"mouse_rotate_arb_face",  "obj face v mx my", TO_UNLIMITED, 
to_mouse_rotate_arb_face, GED_FUNC_PTR_NULL},
-    {"mouse_scale",    "mx my", TO_UNLIMITED, to_mouse_scale, 
GED_FUNC_PTR_NULL},
-    {"mouse_protate",  "obj attribute mx my", TO_UNLIMITED, to_mouse_protate, 
GED_FUNC_PTR_NULL},
-    {"mouse_pscale",   "obj attribute mx my", TO_UNLIMITED, to_mouse_pscale, 
GED_FUNC_PTR_NULL},
-    {"mouse_ptranslate",       "obj attribute mx my", TO_UNLIMITED, 
to_mouse_ptranslate, GED_FUNC_PTR_NULL},
-    {"mouse_trans",    "mx my", TO_UNLIMITED, to_mouse_trans, 
GED_FUNC_PTR_NULL},
-    {"mv",     (char *)0, TO_UNLIMITED, to_pass_through_func, ged_move},
-    {"mvall",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_move_all},
-    {"new_view",       "vname type [args]", TO_UNLIMITED, to_new_view, 
GED_FUNC_PTR_NULL},
-    {"nirt",   "[args]", TO_UNLIMITED, to_view_func, ged_nirt},
-    {"nmg_collapse",   (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_nmg_collapse},
-    {"nmg_fix_normals",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_nmg_fix_normals},
-    {"nmg_simplify",   (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_nmg_simplify},
-    {"ocenter",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_ocenter},
-    {"open",   (char *)0, TO_UNLIMITED, to_pass_through_and_refresh_func, 
ged_reopen},
-    {"orient", "quat", 6, to_view_func_plus, ged_orient},
-    {"orientation",    "quat", 6, to_view_func_plus, ged_orient},
-    {"orotate",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_orotate},
-    {"orotate_mode",   "obj x y", TO_UNLIMITED, to_orotate_mode, 
GED_FUNC_PTR_NULL},
-    {"oscale", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_oscale},
-    {"oscale_mode",    "obj x y", TO_UNLIMITED, to_oscale_mode, 
GED_FUNC_PTR_NULL},
-    {"otranslate",     (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_otranslate},
-    {"otranslate_mode",        "obj x y", TO_UNLIMITED, to_otranslate_mode, 
GED_FUNC_PTR_NULL},
-    {"overlay",        (char *)0, TO_UNLIMITED, to_autoview_func, ged_overlay},
-    {"paint_rect_area",        "vname", TO_UNLIMITED, to_paint_rect_area, 
GED_FUNC_PTR_NULL},
-    {"pathlist",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_pathlist},
-    {"paths",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_pathsum},
-    {"perspective",    "[angle]", 3, to_view_func_plus, ged_perspective},
-    {"pix2fb",         "[options] [file.pix]", TO_UNLIMITED, to_view_func, 
ged_pix2fb},
-    {"plot",   "[options] file.pl", 16, to_view_func, ged_plot},
-    {"pmat",   "[mat]", 3, to_view_func, ged_pmat},
-    {"pmodel2view",    "vname", 2, to_view_func, ged_pmodel2view},
-#if defined(DM_OGL) || defined(DM_WGL)
-    {"pix",    "file", TO_UNLIMITED, to_pix, GED_FUNC_PTR_NULL},
-    {"png",    "file", TO_UNLIMITED, to_png, GED_FUNC_PTR_NULL},
-#endif
-    {"png2fb",         "[options] [file.png]", TO_UNLIMITED, to_view_func, 
ged_png2fb},
-    {"pngwf",  "[options] file.png", 16, to_view_func, ged_png},
-    {"poly_circ_mode", "x y", TO_UNLIMITED, to_poly_circ_mode, 
GED_FUNC_PTR_NULL},
-    {"poly_cont_build",        "x y", TO_UNLIMITED, to_poly_cont_build, 
GED_FUNC_PTR_NULL},
-    {"poly_cont_build_end",    "y", TO_UNLIMITED, to_poly_cont_build_end, 
GED_FUNC_PTR_NULL},
-    {"poly_ell_mode",  "x y", TO_UNLIMITED, to_poly_ell_mode, 
GED_FUNC_PTR_NULL},
-    {"poly_rect_mode", "x y [s]", TO_UNLIMITED, to_poly_rect_mode, 
GED_FUNC_PTR_NULL},
-    {"prcolor",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_prcolor},
-    {"prefix", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_prefix},
-    {"pipe_prepend_pnt",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_pipe_prepend_pnt},
-    {"preview",        "[options] script", TO_UNLIMITED, to_dm_func, 
ged_preview},
-    {"prim_label",     "[prim_1 prim_2 ... prim_N]", TO_UNLIMITED, 
to_prim_label, GED_FUNC_PTR_NULL},
-    {"protate",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_protate},
-    {"protate_mode",   "obj attribute x y", TO_UNLIMITED, to_protate_mode, 
GED_FUNC_PTR_NULL},
-    {"postscript", "[options] file.ps", 16, to_view_func, ged_ps},
-    {"pscale", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_pscale},
-    {"pscale_mode",    "obj attribute x y", TO_UNLIMITED, to_pscale_mode, 
GED_FUNC_PTR_NULL},
-    {"pset",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_pset},
-    {"ptranslate",     (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_ptranslate},
-    {"ptranslate_mode",        "obj attribute x y", TO_UNLIMITED, 
to_ptranslate_mode, GED_FUNC_PTR_NULL},
-    {"push",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_push},
-    {"put",    (char *)0, TO_UNLIMITED, to_pass_through_func, ged_put},
-    {"put_comb",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_put_comb},
-    {"putmat", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_putmat},
-    {"qray",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_qray},
-    {"quat",   "a b c d", 6, to_view_func_plus, ged_quat},
-    {"qvrot",  "x y z angle", 6, to_view_func_plus, ged_qvrot},
-    {"r",      (char *)0, TO_UNLIMITED, to_pass_through_func, ged_region},
-    {"rcodes", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_rcodes},
-    {"rect",   "args", 6, to_view_func, ged_rect},
-    {"rect_mode",      "x y", TO_UNLIMITED, to_rect_mode, GED_FUNC_PTR_NULL},
-    {"red",    (char *)0, TO_UNLIMITED, to_pass_through_func, ged_red},
-    {"redraw", "obj", 2, to_redraw, GED_FUNC_PTR_NULL},
-    {"refresh",        "vname", TO_UNLIMITED, to_refresh, GED_FUNC_PTR_NULL},
-    {"refresh_all",    (char *)0, TO_UNLIMITED, to_refresh_all, 
GED_FUNC_PTR_NULL},
-    {"refresh_on",     "[0|1]", TO_UNLIMITED, to_refresh_on, 
GED_FUNC_PTR_NULL},
-    {"regdef", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_regdef},
-    {"regions",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_tables},
-    {"solid_report",   (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_solid_report},
-    {"rfarb",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_rfarb},
-    {"rm",     (char *)0, TO_UNLIMITED, to_pass_through_and_refresh_func, 
ged_remove},
-    {"rmap",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_rmap},
-    {"rmat",   "[mat]", 3, to_view_func, ged_rmat},
-    {"rmater", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_rmater},
-    {"rot",    "[-m|-v] x y z", 6, to_view_func_plus, ged_rot},
-    {"rot_about",      "[e|k|m|v]", 3, to_view_func, ged_rotate_about},
-    {"rot_point",      "x y z", 5, to_view_func, ged_rot_point},
-    {"rotate_arb_face",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_rotate_arb_face},
-    {"rotate_arb_face_mode",   "obj face v x y", TO_UNLIMITED, 
to_rotate_arb_face_mode, GED_FUNC_PTR_NULL},
-    {"rotate_mode",    "x y", TO_UNLIMITED, to_rotate_mode, GED_FUNC_PTR_NULL},
-    {"rrt",    "[args]", TO_UNLIMITED, to_view_func, ged_rrt},
-    {"rselect",                (char *)0, TO_UNLIMITED, to_view_func, 
ged_rselect},
-    {"rt",     "[args]", TO_UNLIMITED, to_view_func, ged_rt},
-    {"rt_end_callback",        "[args]", TO_UNLIMITED, to_rt_end_callback, 
GED_FUNC_PTR_NULL},
-    {"rt_gettrees",    "[-i] [-u] pname object", TO_UNLIMITED, to_rt_gettrees, 
GED_FUNC_PTR_NULL},
-    {"rtabort",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_rtabort},
-    {"rtarea", "[args]", TO_UNLIMITED, to_view_func, ged_rt},
-    {"rtcheck",        "[args]", TO_UNLIMITED, to_view_func, ged_rtcheck},
-    {"rtedge", "[args]", TO_UNLIMITED, to_view_func, ged_rt},
-    {"rtweight", "[args]", TO_UNLIMITED, to_view_func, ged_rt},
-    {"rtwizard", "[args]", TO_UNLIMITED, to_view_func, ged_rtwizard},
-    {"savekey",        "filename", 3, to_view_func, ged_savekey},
-    {"saveview", (char *)0, TO_UNLIMITED, to_view_func, ged_saveview},
-    {"sca",    "sf", 3, to_view_func_plus, ged_scale},
-    {"scale_mode",     "x y", TO_UNLIMITED, to_scale_mode, GED_FUNC_PTR_NULL},
-    {"screen2model",   "x y", TO_UNLIMITED, to_screen2model, 
GED_FUNC_PTR_NULL},
-    {"screen2view",    "x y", TO_UNLIMITED, to_screen2view, GED_FUNC_PTR_NULL},
-    {"screengrab",     "imagename.ext", TO_UNLIMITED, to_dm_func, 
ged_screen_grab},
-    {"sdata_arrows",   "???", TO_UNLIMITED, to_data_arrows, GED_FUNC_PTR_NULL},
-    {"sdata_axes",     "???", TO_UNLIMITED, to_data_axes, GED_FUNC_PTR_NULL},
-    {"sdata_labels",   "???", TO_UNLIMITED, to_data_labels, GED_FUNC_PTR_NULL},
-    {"sdata_lines",    "???", TO_UNLIMITED, to_data_lines, GED_FUNC_PTR_NULL},
-    {"sdata_polygons", "???", TO_UNLIMITED, to_data_polygons, 
GED_FUNC_PTR_NULL},
-    {"search",         (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_search},
-    {"select",         (char *)0, TO_UNLIMITED, to_view_func, ged_select},
-    {"set_coord",      "[m|v]", TO_UNLIMITED, to_set_coord, GED_FUNC_PTR_NULL},
-    {"set_fb_mode",    "[mode]", TO_UNLIMITED, to_set_fb_mode, 
GED_FUNC_PTR_NULL},
-    {"set_output_script",      "[script]", TO_UNLIMITED, to_pass_through_func, 
ged_set_output_script},
-    {"set_transparency",       (char *)0, TO_UNLIMITED, 
to_pass_through_and_refresh_func, ged_set_transparency},
-    {"set_uplotOutputMode",    (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_set_uplotOutputMode},
-    {"setview",        "x y z", 5, to_view_func_plus, ged_setview},
-    {"shaded_mode",    (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_shaded_mode},
-    {"shader", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_shader},
-    {"shells", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_shells},
-    {"showmats",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_showmats},
-    {"size",   "[size]", 3, to_view_func_plus, ged_size},
-    {"slew",   "x y [z]", 5, to_view_func_plus, ged_slew},
-    {"snap_view",      "vx vy", 4, to_snap_view, GED_FUNC_PTR_NULL},
-    {"solids", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_tables},
-    {"solids_on_ray",  (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_solids_on_ray},
-    {"summary",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_summary},
-    {"sv",     "x y [z]", 5, to_view_func_plus, ged_slew},
-    {"sync",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_sync},
-    {"t",      (char *)0, TO_UNLIMITED, to_pass_through_func, ged_ls},
-    {"tire",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_tire},
-    {"title",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_title},
-    {"tol",    (char *)0, TO_UNLIMITED, to_pass_through_func, ged_tol},
-    {"tops",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_tops},
-    {"tra",    "[-m|-v] x y z", 6, to_view_func_plus, ged_tra},
-    {"track",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_track},
-    {"translate_mode", "x y", TO_UNLIMITED, to_translate_mode, 
GED_FUNC_PTR_NULL},
-    {"transparency",   "[val]", TO_UNLIMITED, to_transparency, 
GED_FUNC_PTR_NULL},
-    {"tree",   (char *)0, TO_UNLIMITED, to_pass_through_func, ged_tree},
-    {"unhide", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_unhide},
-    {"units",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_units},
-    {"v2m_point",      "x y z", 5, to_view_func, ged_v2m_point},
-    {"vdraw",  (char *)0, TO_UNLIMITED, to_pass_through_and_refresh_func, 
ged_vdraw},
-    {"version",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_version},
-    {"view",   "quat|ypr|aet|center|eye|size [args]", 7, to_view_func_plus, 
ged_view_func},
-    {"view_axes",      "vname [args]", TO_UNLIMITED, to_view_axes, 
GED_FUNC_PTR_NULL},
-    {"view_callback",  "vname [args]", TO_UNLIMITED, to_view_callback, 
GED_FUNC_PTR_NULL},
-    {"view_win_size",  "[s] | [x y]", 4, to_view_win_size, GED_FUNC_PTR_NULL},
-    {"view2grid_lu",   "x y z", 5, to_view_func_less, ged_view2grid_lu},
-    {"view2model",     "", 2, to_view_func_less, ged_view2model},
-    {"view2model_lu",  "x y z", 5, to_view_func_less, ged_view2model_lu},
-    {"view2model_vec", "x y z", 5, to_view_func_less, ged_view2model_vec},
-    {"view2screen",    "", 2, to_view2screen, GED_FUNC_PTR_NULL},
-    {"viewdir",        "[-i]", 3, to_view_func_less, ged_viewdir},
-    {"vmake",  "pname ptype", TO_UNLIMITED, to_vmake, GED_FUNC_PTR_NULL},
-    {"vnirt",  "[args]", TO_UNLIMITED, to_view_func, ged_vnirt},
-    {"vslew",  "x y", TO_UNLIMITED, to_vslew, GED_FUNC_PTR_NULL},
-    {"wcodes", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_wcodes},
-    {"whatid", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_whatid},
-    {"which_shader",   (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_which_shader},
-    {"whichair",       (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_which},
-    {"whichid",        (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_which},
-    {"who",    (char *)0, TO_UNLIMITED, to_pass_through_func, ged_who},
-    {"wmater", (char *)0, TO_UNLIMITED, to_pass_through_func, ged_wmater},
-    {"x",      (char *)0, TO_UNLIMITED, to_pass_through_func, 
ged_solid_report},
-    {"xpush",  (char *)0, TO_UNLIMITED, to_pass_through_func, ged_xpush},
-    {"ypr",    "yaw pitch roll", 5, to_view_func_plus, ged_ypr},
-    {"zap",    (char *)0, TO_UNLIMITED, to_pass_through_and_refresh_func, 
ged_zap},
-    {"zbuffer",        "[0|1]", TO_UNLIMITED, to_zbuffer, GED_FUNC_PTR_NULL},
-    {"zclip",  "[0|1]", TO_UNLIMITED, to_zclip, GED_FUNC_PTR_NULL},
-    {"zoom",   "sf", 3, to_view_func_plus, ged_zoom},
-    {(char *)0,        (char *)0, 0, TO_WRAPPER_FUNC_PTR_NULL, 
GED_FUNC_PTR_NULL}
-};
-
-
-static fastf_t
-screen_to_view_x(dm *dmp, fastf_t x)
-{
-    int width = dm_get_width(dmp);
-    return x / (fastf_t)width * 2.0 - 1.0;
-}
-
-
-static fastf_t
-screen_to_view_y(dm *dmp, fastf_t y)
-{
-    int height = dm_get_height(dmp);
-    return (y / (fastf_t)height * -2.0 + 1.0) / dm_get_aspect(dmp);
-}
-
-
-/**
- * @brief
- * A TCL interface to dm_list_types()).
- *
- * @return a list of available dm types.
- */
-int
-dm_list_tcl(ClientData UNUSED(clientData),
-           Tcl_Interp *interp,
-           int UNUSED(argc),
-           const char **UNUSED(argv))
-{
-    struct bu_vls *list = dm_list_types(',');
-    Tcl_SetResult(interp, bu_vls_addr(list), TCL_VOLATILE);
-    bu_vls_free(list);
-    BU_PUT(list, struct bu_vls);
-    return TCL_OK;
-}
-
-/**
- * @brief create the Tcl command for to_open
- *
- */
-int
-Go_Init(Tcl_Interp *interp)
-{
-
-    if (library_initialized(0))
-       return TCL_OK;
-
-    {
-       const char *version_str = brlcad_version();
-       tclcad_eval_noresult(interp, "set brlcad_version", 1, &version_str);
-    }
-
-    BU_LIST_INIT(&HeadTclcadObj.l);
-    (void)Tcl_CreateCommand(interp, (const char *)"go_open", to_open_tcl,
-                           (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
-
-    (void)Tcl_CreateCommand(interp, (const char *)"dm_list", dm_list_tcl,
-                           (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
-
-    (void)library_initialized(1);
-
-    return TCL_OK;
-}
-
-
-/**
- * @brief
- * Generic interface for database commands.
- *
- * @par Usage:
- * procname cmd ?args?
- *
- * @return result of ged command.
- */
-HIDDEN int
-to_cmd(ClientData clientData,
-       Tcl_Interp *interp,
-       int argc,
-       char **argv)
-{
-    register struct to_cmdtab *ctp;
-    struct tclcad_obj *top = (struct tclcad_obj *)clientData;
-    Tcl_DString ds;
-    int ret = GED_ERROR;
-
-    Tcl_DStringInit(&ds);
-
-    if (argc < 2) {
-       Tcl_DStringAppend(&ds, "subcommand not specified; must be one of: ", 
-1);
-       for (ctp = to_cmds; ctp->to_name != (char *)NULL; ctp++) {
-           Tcl_DStringAppend(&ds, " ", -1);
-           Tcl_DStringAppend(&ds, ctp->to_name, -1);
-       }
-       Tcl_DStringAppend(&ds, "\n", -1);
-       Tcl_DStringResult(interp, &ds);
-
-       return TCL_ERROR;
-    }
-
-    current_top = top;
-
-    for (ctp = to_cmds; ctp->to_name != (char *)0; ctp++) {
-       if (BU_STR_EQUAL(ctp->to_name, argv[1])) {
-           struct ged *gedp = top->to_gop->go_gedp;
-           ret = (*ctp->to_wrapper_func)(gedp, argc-1, (const char **)argv+1, 
ctp->to_func, ctp->to_usage, ctp->to_maxargs);
-           break;
-       }
-    }
-
-    /* Command not found. */
-    if (ctp->to_name == (char *)0) {
-       Tcl_DStringAppend(&ds, "unknown subcommand: ", -1);
-       Tcl_DStringAppend(&ds, argv[1], -1);
-       Tcl_DStringAppend(&ds, "; must be one of: ", -1);
-
-       for (ctp = to_cmds; ctp->to_name != (char *)NULL; ctp++) {
-           Tcl_DStringAppend(&ds, " ", -1);
-           Tcl_DStringAppend(&ds, ctp->to_name, -1);
-       }
-       Tcl_DStringAppend(&ds, "\n", -1);
-       Tcl_DStringResult(interp, &ds);
-
-       return TCL_ERROR;
-    }
-
-    Tcl_DStringAppend(&ds, bu_vls_addr(top->to_gop->go_gedp->ged_result_str), 
-1);
-    Tcl_DStringResult(interp, &ds);
-
-    if (ret & GED_ERROR)
-       return TCL_ERROR;
-
-    return TCL_OK;
-}
-
-
-HIDDEN void
-free_path_edit_params(struct bu_hash_tbl *t)
-{
-    struct bu_hash_entry *entry = bu_hash_next(t, NULL);
-    while (entry) {
-       struct path_edit_params *pp = (struct path_edit_params 
*)bu_hash_value(entry, NULL);
-       BU_PUT(pp, struct path_edit_params);
-       entry = bu_hash_next(t, entry);
-    }
-}
-
-
-/**
- * @brief
- * Called by Tcl when the object is destroyed.
- */
-void
-to_deleteProc(ClientData clientData)
-{
-    struct tclcad_obj *top = (struct tclcad_obj *)clientData;
-    struct ged_dm_view *gdvp;
-
-    if (current_top == top)
-       current_top = TCLCAD_OBJ_NULL;
-
-    BU_LIST_DEQUEUE(&top->l);
-    bu_vls_free(&top->to_gop->go_name);
-    ged_close(top->to_gop->go_gedp);
-    if (top->to_gop->go_gedp)
-       BU_PUT(top->to_gop->go_gedp, struct ged);
-
-    free_path_edit_params(top->to_gop->go_edited_paths);
-    bu_hash_destroy(top->to_gop->go_edited_paths);
-
-    while (BU_LIST_WHILE(gdvp, ged_dm_view, &top->to_gop->go_head_views.l)) {
-       /* This removes the view related command and results in a call
-        * to to_deleteViewProc to release resources.
-        */
-       Tcl_DeleteCommand(top->to_interp, 
bu_vls_addr(dm_get_pathname(gdvp->gdv_dmp)));
-    }
-
-    bu_free((void *)top, "struct ged_obj");
-}
-
-
-/**
- * @brief
- * Create a command named "oname" in "interp" using "gedp" as its state.
- *
- */
-int
-to_create_cmd(Tcl_Interp *interp,
-             struct tclcad_obj *top,   /* pointer to object */
-             const char *oname)        /* object name */
-{
-    if (top == TCLCAD_OBJ_NULL) {
-       Tcl_AppendResult(interp, "to_create_cmd ", oname, " failed", NULL);
-       return TCL_ERROR;
-    }
-
-    /* Instantiate the newprocname, with clientData of top */
-    /* Beware, returns a "token", not TCL_OK. */
-    (void)Tcl_CreateCommand(interp, oname, (Tcl_CmdProc *)to_cmd,
-                           (ClientData)top, to_deleteProc);
-
-    /* Return new function name as result */
-    Tcl_AppendResult(interp, oname, (char *)NULL);
-
-    return TCL_OK;
-}
-
-
-/* Wrappers for setting up/tearing down IO handler */
-#ifndef _WIN32
-void
-tclcad_create_io_handler(void **UNUSED(chan), struct bu_process *p, int fd, 
int mode, void *data, ged_io_handler_callback_t callback)
-{
-    int *fdp;
-    if (!p) return;
-    fdp = (int *)bu_process_fd(p, fd);
-    Tcl_CreateFileHandler(*fdp, mode, callback, (ClientData)data);
-}
-
-void
-tclcad_delete_io_handler(void *UNUSED(interp), void *UNUSED(chan), struct 
bu_process *p, int fd, void *UNUSED(data), ged_io_handler_callback_t 
UNUSED(callback))
-{
-    int *fdp;
-    if (!p) return;
-    fdp = (int *)bu_process_fd(p, fd);
-    Tcl_DeleteFileHandler(*fdp);
-    close(*fdp);
-}
-
-#else
-void
-tclcad_create_io_handler(void **chan, struct bu_process *p, int fd, int mode, 
void *data, ged_io_handler_callback_t callback)
-{
-    HANDLE *fdp;
-    if (!chan || !p) return;
-    fdp = (HANDLE *)bu_process_fd(p, fd);
-    (*chan) = (void *)Tcl_MakeFileChannel(*fdp, mode);
-    Tcl_CreateChannelHandler((Tcl_Channel)(*chan), mode, callback, 
(ClientData)data);
-}
-
-void
-tclcad_delete_io_handler(void *interp, void *chan, struct bu_process *p, int 
fd, void *data, ged_io_handler_callback_t callback)
-{
-    HANDLE *fdp;
-    Tcl_Interp *tcl_interp;
-    if (!chan || !p) return;
-    tcl_interp = (Tcl_Interp *)interp;
-    fdp = (HANDLE *)bu_process_fd(p, fd);
-    Tcl_DeleteChannelHandler((Tcl_Channel)chan, callback, (ClientData)data);
-    Tcl_Close(tcl_interp, (Tcl_Channel)chan);
-}
-#endif
-
-
-/**
- * @brief
- * A TCL interface to wdb_fopen() and wdb_dbopen().
- *
- * @par Implicit return -
- * Creates a new TCL proc which responds to get/put/etc. arguments
- * when invoked.  clientData of that proc will be ged_obj pointer for
- * this instance of the database.  Easily allows keeping track of
- * multiple databases.
- *
- * @return wdb pointer, for more traditional C-style interfacing.
- *
- * @par Example -
- * set top [go_open .inmem inmem $dbip]
- *@n   .inmem get box.s
- *@n   .inmem close
- *
- *@n go_open db file "bob.g"
- *@n db get white.r
- *@n db close
- */
-int
-to_open_tcl(ClientData UNUSED(clientData),
-           Tcl_Interp *interp,
-           int argc,
-           const char **argv)
-{
-    struct tclcad_obj *top = NULL;
-    struct ged *gedp = NULL;
-    const char *dbname = NULL;
-
-    if (argc == 1) {
-       /* get list of database objects */
-       for (BU_LIST_FOR(top, tclcad_obj, &HeadTclcadObj.l))
-           Tcl_AppendResult(interp, bu_vls_addr(&top->to_gop->go_name), " ", 
(char *)NULL);
-
-       return TCL_OK;
-    }
-
-    if (argc < 3 || 4 < argc) {
-       Tcl_AppendResult(interp, "\
-Usage: go_open\n\
-       go_open newprocname file filename\n\
-       go_open newprocname disk $dbip\n\
-       go_open newprocname disk_append $dbip\n\
-       go_open newprocname inmem $dbip\n\
-       go_open newprocname inmem_append $dbip\n\
-       go_open newprocname db filename\n\
-       go_open newprocname filename\n",
-                        NULL);
-       return TCL_ERROR;
-    }
-
-    /* Delete previous proc (if any) to release all that memory, first */
-    (void)Tcl_DeleteCommand(interp, argv[1]);
-
-    if (argc == 3 || BU_STR_EQUAL(argv[2], "db")) {
-       if (argc == 3) {
-           dbname = argv[2];
-           gedp = ged_open("filename", dbname, 0);
-       } else {
-           dbname = argv[3];
-           gedp = ged_open("db", dbname, 0);
-       }
-    } else {
-       dbname = argv[3];
-       gedp = ged_open(argv[2], dbname, 0);
-    }
-
-    if (gedp == GED_NULL) {
-       Tcl_AppendResult(interp, "Unable to open geometry database: ", dbname, 
(char *)NULL);
-       return TCL_ERROR;
-    }
-    gedp->ged_interp = (void *)interp;
-
-    /* Set the Tcl specific I/O handlers for asynchronous subprocess I/O */
-    gedp->ged_create_io_handler = &tclcad_create_io_handler;
-    gedp->ged_delete_io_handler = &tclcad_delete_io_handler;
-    gedp->io_mode = TCL_READABLE;
-
-    /* initialize tclcad_obj */
-    BU_ALLOC(top, struct tclcad_obj);
-    top->to_interp = interp;
-
-    /* initialize ged_obj */
-    BU_ALLOC(top->to_gop, struct ged_obj);
-
-    BU_ASSERT(gedp != NULL);
-    top->to_gop->go_gedp = gedp;
-
-    top->to_gop->go_gedp->ged_output_handler = to_output_handler;
-    top->to_gop->go_gedp->ged_refresh_handler = to_refresh_handler;
-    top->to_gop->go_gedp->ged_create_vlist_solid_callback = 
to_create_vlist_callback_solid;
-    top->to_gop->go_gedp->ged_create_vlist_callback = to_create_vlist_callback;
-    top->to_gop->go_gedp->ged_free_vlist_callback = to_free_vlist_callback;
-
-    BU_ASSERT(gedp->ged_gdp != NULL);
-    top->to_gop->go_gedp->ged_gdp->gd_rtCmdNotify = 
to_rt_end_callback_internal;
-
-    bu_vls_init(&top->to_gop->go_name);
-    bu_vls_strcpy(&top->to_gop->go_name, argv[1]);
-    bu_vls_init(&top->to_gop->go_more_args_callback);
-    bu_vls_init(&top->to_gop->go_rt_end_callback);
-    top->to_gop->go_refresh_on = 1;
-    top->to_gop->go_edited_paths = bu_hash_create(0);
-
-    BU_LIST_INIT(&top->to_gop->go_head_views.l);
-
-    /* append to list of tclcad_obj */
-    BU_LIST_APPEND(&HeadTclcadObj.l, &top->l);
-
-    return to_create_cmd(interp, top, argv[1]);
-}
-
-
-/*************************** Local Command Functions 
***************************/
-
-HIDDEN int
-to_autoview(struct ged *gedp,
-           int argc,
-           const char *argv[],
-           ged_func_ptr UNUSED(func),
-           const char *usage,
-           int UNUSED(maxargs))
-{
-    struct ged_dm_view *gdvp;
-
-    /* initialize result */
-    bu_vls_trunc(gedp->ged_result_str, 0);
-
-    if (argc > 3) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s [scale]", argv[0], 
usage);
-       return GED_ERROR;
-    }
-
-    for (BU_LIST_FOR(gdvp, ged_dm_view, 
&current_top->to_gop->go_head_views.l)) {
-       if (BU_STR_EQUAL(bu_vls_addr(&gdvp->gdv_name), argv[1]))
-           break;
-    }
-
-    if (BU_LIST_IS_HEAD(&gdvp->l, &current_top->to_gop->go_head_views.l)) {
-       bu_vls_printf(gedp->ged_result_str, "View not found - %s", argv[1]);
-       return GED_ERROR;
-    }
-
-    if (argc > 2)
-       to_autoview_view(gdvp, argv[2]);
-    else
-       to_autoview_view(gdvp, NULL);
-
-    return GED_OK;
-}
-
-
-HIDDEN int
-to_axes(struct ged *gedp,
-       struct ged_dm_view *gdvp,
-       struct bview_axes_state *gasp,
-       int argc,
-       const char *argv[],
-       const char *usage)
-{
-
-    if (BU_STR_EQUAL(argv[2], "draw")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%d", gasp->draw);
-           return GED_OK;
-       }
-
-       if (argc == 4) {
-           int i;
-
-           if (bu_sscanf(argv[3], "%d", &i) != 1)
-               goto bad;
-
-           if (i)
-               gasp->draw = 1;
-           else
-               gasp->draw = 0;
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[2], "axes_size")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%lf", gasp->axes_size);
-           return GED_OK;
-       }
-
-       if (argc == 4) {
-           double size; /* must be double for scanf */
-
-           if (bu_sscanf(argv[3], "%lf", &size) != 1)
-               goto bad;
-
-           gasp->axes_size = size;
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[2], "axes_pos")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%lf %lf %lf",
-                         V3ARGS(gasp->axes_pos));
-           return GED_OK;
-       }
-
-       if (argc == 6) {
-           double x, y, z; /* must be double for scanf */
-
-           if (bu_sscanf(argv[3], "%lf", &x) != 1 ||
-               bu_sscanf(argv[4], "%lf", &y) != 1 ||
-               bu_sscanf(argv[5], "%lf", &z) != 1)
-               goto bad;
-
-           VSET(gasp->axes_pos, x, y, z);
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[2], "axes_color")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%d %d %d",
-                         V3ARGS(gasp->axes_color));
-           return GED_OK;
-       }
-
-       if (argc == 6) {
-           int r, g, b;
-
-           /* set background color */
-           if (bu_sscanf(argv[3], "%d", &r) != 1 ||
-               bu_sscanf(argv[4], "%d", &g) != 1 ||
-               bu_sscanf(argv[5], "%d", &b) != 1)
-               goto bad;
-
-           /* validate color */
-           if (r < 0 || 255 < r ||
-               g < 0 || 255 < g ||
-               b < 0 || 255 < b)
-               goto bad;
-
-           VSET(gasp->axes_color, r, g, b);
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[2], "label_color")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%d %d %d",
-                         V3ARGS(gasp->label_color));
-           return GED_OK;
-       }
-
-       if (argc == 6) {
-           int r, g, b;
-
-           /* set background color */
-           if (bu_sscanf(argv[3], "%d", &r) != 1 ||
-               bu_sscanf(argv[4], "%d", &g) != 1 ||
-               bu_sscanf(argv[5], "%d", &b) != 1)
-               goto bad;
-
-           /* validate color */
-           if (r < 0 || 255 < r ||
-               g < 0 || 255 < g ||
-               b < 0 || 255 < b)
-               goto bad;
-
-           VSET(gasp->label_color, r, g, b);
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[2], "line_width")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%d", gasp->line_width);
-           return GED_OK;
-       }
-
-       if (argc == 4) {
-           int line_width;
-
-           if (bu_sscanf(argv[3], "%d", &line_width) != 1)
-               goto bad;
-
-           gasp->line_width = line_width;
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[2], "pos_only")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%d", gasp->pos_only);
-           return GED_OK;
-       }
-
-       if (argc == 4) {
-           int i;
-
-           if (bu_sscanf(argv[3], "%d", &i) != 1)
-               goto bad;
-
-           if (i)
-               gasp->pos_only = 1;
-           else
-               gasp->pos_only = 0;
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[2], "tick_color")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%d %d %d",
-                         V3ARGS(gasp->tick_color));
-           return GED_OK;
-       }
-
-       if (argc == 6) {
-           int r, g, b;
-
-           /* set background color */
-           if (bu_sscanf(argv[3], "%d", &r) != 1 ||
-               bu_sscanf(argv[4], "%d", &g) != 1 ||
-               bu_sscanf(argv[5], "%d", &b) != 1)
-               goto bad;
-
-           /* validate color */
-           if (r < 0 || 255 < r ||
-               g < 0 || 255 < g ||
-               b < 0 || 255 < b)
-               goto bad;
-
-           VSET(gasp->tick_color, r, g, b);
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[2], "tick_enable")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%d", gasp->tick_enabled);
-           return GED_OK;
-       }
-
-       if (argc == 4) {
-           int i;
-
-           if (bu_sscanf(argv[3], "%d", &i) != 1)
-               goto bad;
-
-           if (i)
-               gasp->tick_enabled = 1;
-           else
-               gasp->tick_enabled = 0;
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[2], "tick_interval")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%f", gasp->tick_interval);
-           return GED_OK;
-       }
-
-       if (argc == 4) {
-           int tick_interval;
-
-           if (bu_sscanf(argv[3], "%d", &tick_interval) != 1)
-               goto bad;
-
-           gasp->tick_interval = tick_interval;
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[2], "tick_length")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%d", gasp->tick_length);
-           return GED_OK;
-       }
-
-       if (argc == 4) {
-           int tick_length;
-
-           if (bu_sscanf(argv[3], "%d", &tick_length) != 1)
-               goto bad;
-
-           gasp->tick_length = tick_length;
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[2], "tick_major_color")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%d %d %d",
-                         V3ARGS(gasp->tick_major_color));
-           return GED_OK;
-       }
-
-       if (argc == 6) {
-           int r, g, b;
-
-           /* set background color */
-           if (bu_sscanf(argv[3], "%d", &r) != 1 ||
-               bu_sscanf(argv[4], "%d", &g) != 1 ||
-               bu_sscanf(argv[5], "%d", &b) != 1)
-               goto bad;
-
-           /* validate color */
-           if (r < 0 || 255 < r ||
-               g < 0 || 255 < g ||
-               b < 0 || 255 < b)
-               goto bad;
-
-           VSET(gasp->tick_major_color, r, g, b);
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[2], "tick_major_length")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%d", gasp->tick_major_length);
-           return GED_OK;
-       }
-
-       if (argc == 4) {
-           int tick_major_length;
-
-           if (bu_sscanf(argv[3], "%d", &tick_major_length) != 1)
-               goto bad;
-
-           gasp->tick_major_length = tick_major_length;
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[2], "ticks_per_major")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%d", gasp->ticks_per_major);
-           return GED_OK;
-       }
-
-       if (argc == 4) {
-           int ticks_per_major;
-
-           if (bu_sscanf(argv[3], "%d", &ticks_per_major) != 1)
-               goto bad;
-
-           gasp->ticks_per_major = ticks_per_major;
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[2], "tick_threshold")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%d", gasp->tick_threshold);
-           return GED_OK;
-       }
-
-       if (argc == 4) {
-           int tick_threshold;
-
-           if (bu_sscanf(argv[3], "%d", &tick_threshold) != 1)
-               goto bad;
-
-           if (tick_threshold < 1)
-               tick_threshold = 1;
-
-           gasp->tick_threshold = tick_threshold;
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[2], "triple_color")) {
-       if (argc == 3) {
-           bu_vls_printf(gedp->ged_result_str, "%d", gasp->triple_color);
-           return GED_OK;
-       }
-
-       if (argc == 4) {
-           int i;
-
-           if (bu_sscanf(argv[3], "%d", &i) != 1)
-               goto bad;
-
-           if (i)
-               gasp->triple_color = 1;
-           else
-               gasp->triple_color = 0;
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-bad:
-    bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-    return GED_ERROR;
-}
-
-
-HIDDEN int
-to_base2local(struct ged *gedp,
-             int UNUSED(argc),
-             const char *UNUSED(argv[]),
-             ged_func_ptr UNUSED(func),
-             const char *UNUSED(usage),
-             int UNUSED(maxargs))
-{
-    /* initialize result */
-    bu_vls_trunc(gedp->ged_result_str, 0);
-
-    bu_vls_printf(gedp->ged_result_str, "%lf", 
current_top->to_gop->go_gedp->ged_wdbp->dbip->dbi_base2local);
-
-    return GED_OK;
-}
-
-
-HIDDEN int
-to_bg(struct ged *gedp,
-      int argc,
-      const char *argv[],
-      ged_func_ptr UNUSED(func),
-      const char *usage,
-      int UNUSED(maxargs))
-{
-    int r, g, b;
-    struct ged_dm_view *gdvp;
-
-    /* initialize result */
-    bu_vls_trunc(gedp->ged_result_str, 0);
-
-    /* must be wanting help */
-    if (argc == 1) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_HELP;
-    }
-
-    if (argc != 2 && argc != 5) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_ERROR;
-    }
-
-    for (BU_LIST_FOR(gdvp, ged_dm_view, 
&current_top->to_gop->go_head_views.l)) {
-       if (BU_STR_EQUAL(bu_vls_addr(&gdvp->gdv_name), argv[1]))
-           break;
-    }
-
-    if (BU_LIST_IS_HEAD(&gdvp->l, &current_top->to_gop->go_head_views.l)) {
-       bu_vls_printf(gedp->ged_result_str, "View not found - %s", argv[1]);
-       return GED_ERROR;
-    }
-
-    /* get background color */
-    if (argc == 2) {
-       unsigned char *dm_bg = dm_get_bg(gdvp->gdv_dmp);
-       if (dm_bg) {
-           bu_vls_printf(gedp->ged_result_str, "%d %d %d",
-                         dm_bg[0],
-                         dm_bg[1],
-                         dm_bg[2]);
-       }
-       return GED_OK;
-    }
-
-    /* set background color */
-    if (bu_sscanf(argv[2], "%d", &r) != 1 ||
-       bu_sscanf(argv[3], "%d", &g) != 1 ||
-       bu_sscanf(argv[4], "%d", &b) != 1)
-       goto bad_color;
-
-    /* validate color */
-    if (r < 0 || 255 < r ||
-       g < 0 || 255 < g ||
-       b < 0 || 255 < b)
-       goto bad_color;
-
-    (void)dm_make_current(gdvp->gdv_dmp);
-    (void)dm_set_bg(gdvp->gdv_dmp, (unsigned char)r, (unsigned char)g, 
(unsigned char)b);
-
-    to_refresh_view(gdvp);
-
-    return GED_OK;
-
-bad_color:
-    bu_vls_printf(gedp->ged_result_str, "%s: %s %s %s", argv[0], argv[2], 
argv[3], argv[4]);
-    return GED_ERROR;
-}
-
-
-HIDDEN int
-to_blast(struct ged *gedp,
-        int argc,
-        const char *argv[],
-        ged_func_ptr UNUSED(func),
-        const char *UNUSED(usage),
-        int UNUSED(maxargs))
-{
-    int ret;
-
-    ret = ged_blast(gedp, argc, argv);
-
-    if (ret != GED_OK)
-       return ret;
-
-    to_autoview_all_views(current_top);
-
-    return ret;
-}
-
-
-HIDDEN int
-to_bounds(struct ged *gedp,
-         int argc,
-         const char *argv[],
-         ged_func_ptr UNUSED(func),
-         const char *usage,
-         int UNUSED(maxargs))
-{
-    struct ged_dm_view *gdvp;
-    fastf_t bounds[6];
-
-    /* must be double for scanf */
-    double scan[6];
-
-    /* initialize result */
-    bu_vls_trunc(gedp->ged_result_str, 0);
-
-    /* must be wanting help */
-    if (argc == 1) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_HELP;
-    }
-
-    if (argc != 2 && argc != 3) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_ERROR;
-    }
-
-    for (BU_LIST_FOR(gdvp, ged_dm_view, 
&current_top->to_gop->go_head_views.l)) {
-       if (BU_STR_EQUAL(bu_vls_addr(&gdvp->gdv_name), argv[1]))
-           break;
-    }
-
-    if (BU_LIST_IS_HEAD(&gdvp->l, &current_top->to_gop->go_head_views.l)) {
-       bu_vls_printf(gedp->ged_result_str, "View not found - %s", argv[1]);
-       return GED_ERROR;
-    }
-
-    /* get window bounds */
-    if (argc == 2) {
-       vect_t *cmin = dm_get_clipmin(gdvp->gdv_dmp);
-       vect_t *cmax = dm_get_clipmax(gdvp->gdv_dmp);
-       if (cmin && cmax) {
-           bu_vls_printf(gedp->ged_result_str, "%g %g %g %g %g %g",
-                         (*cmin)[X], (*cmax)[X], (*cmin)[Y], (*cmax)[Y], 
(*cmin)[Z], (*cmax)[Z]);
-       }
-       return GED_OK;
-    }
-
-    /* set window bounds */
-    if (bu_sscanf(argv[2], "%lf %lf %lf %lf %lf %lf",
-                 &scan[0], &scan[1],
-                 &scan[2], &scan[3],
-                 &scan[4], &scan[5]) != 6) {
-       bu_vls_printf(gedp->ged_result_str, "%s: invalid bounds - %s", argv[0], 
argv[2]);
-       return GED_ERROR;
-    }
-    /* convert double to fastf_t */
-    VMOVE(bounds, scan);         /* first point */
-    VMOVE(&bounds[3], &scan[3]); /* second point */
-
-    /*
-     * Since dm_bound doesn't appear to be used anywhere, I'm going to
-     * use it for controlling the location of the zclipping plane in
-     * dm-ogl.c. dm-X.c uses dm_clipmin and dm_clipmax.
-     */
-    if (dm_get_clipmax(gdvp->gdv_dmp) && (*dm_get_clipmax(gdvp->gdv_dmp))[2] 
<= GED_MAX)
-       dm_set_bound(gdvp->gdv_dmp, 1.0);
-    else
-       dm_set_bound(gdvp->gdv_dmp, 
GED_MAX/((*dm_get_clipmax(gdvp->gdv_dmp))[2]));
-
-    (void)dm_make_current(gdvp->gdv_dmp);
-    (void)dm_set_win_bounds(gdvp->gdv_dmp, bounds);
-
-    return GED_OK;
-}
-
-
-HIDDEN int
-to_configure(struct ged *gedp,
-            int argc,
-            const char *argv[],
-            ged_func_ptr UNUSED(func),
-            const char *usage,
-            int UNUSED(maxargs))
-{
-    struct ged_dm_view *gdvp;
-    int status;
-
-    /* initialize result */
-    bu_vls_trunc(gedp->ged_result_str, 0);
-
-    if (argc != 2) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_ERROR;
-    }
-
-    for (BU_LIST_FOR(gdvp, ged_dm_view, 
&current_top->to_gop->go_head_views.l)) {
-       if (BU_STR_EQUAL(bu_vls_addr(&gdvp->gdv_name), argv[1]))
-           break;
-    }
-
-    if (BU_LIST_IS_HEAD(&gdvp->l, &current_top->to_gop->go_head_views.l)) {
-       bu_vls_printf(gedp->ged_result_str, "View not found - %s", argv[1]);
-       return GED_ERROR;
-    }
-
-    /* configure the display manager window */
-    status = dm_configure_win(gdvp->gdv_dmp, 0);
-
-    /* configure the framebuffer window */
-    if (gdvp->gdv_fbs.fbs_fbp != FB_NULL)
-       (void)fb_configure_window(gdvp->gdv_fbs.fbs_fbp, 
dm_get_width(gdvp->gdv_dmp), dm_get_height(gdvp->gdv_dmp));
-
-    {
-       char cdimX[32];
-       char cdimY[32];
-       char *av[5];
-
-       snprintf(cdimX, 32, "%d", dm_get_width(gdvp->gdv_dmp));
-       snprintf(cdimY, 32, "%d", dm_get_height(gdvp->gdv_dmp));
-
-       av[0] = "rect";
-       av[1] = "cdim";
-       av[2] = cdimX;
-       av[3] = cdimY;
-       av[4] = NULL;
-
-       gedp->ged_gvp = gdvp->gdv_view;
-       (void)ged_rect(gedp, 4, (const char **)av);
-    }
-
-    if (status == TCL_OK) {
-       to_refresh_view(gdvp);
-       return GED_OK;
-    }
-
-    return GED_ERROR;
-}
-
-
-HIDDEN int
-to_constrain_rmode(struct ged *gedp,
-                  int argc,
-                  const char *argv[],
-                  ged_func_ptr UNUSED(func),
-                  const char *usage,
-                  int UNUSED(maxargs))
-{
-    struct bu_vls bindings = BU_VLS_INIT_ZERO;
-    struct ged_dm_view *gdvp;
-
-    /* must be double for scanf */
-    double x, y;
-
-    /* initialize result */
-    bu_vls_trunc(gedp->ged_result_str, 0);
-
-    /* must be wanting help */
-    if (argc == 1) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_HELP;
-    }
-
-    if (argc != 5) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_ERROR;
-    }
-
-    for (BU_LIST_FOR(gdvp, ged_dm_view, 
&current_top->to_gop->go_head_views.l)) {
-       if (BU_STR_EQUAL(bu_vls_addr(&gdvp->gdv_name), argv[1]))
-           break;
-    }
-
-    if (BU_LIST_IS_HEAD(&gdvp->l, &current_top->to_gop->go_head_views.l)) {
-       bu_vls_printf(gedp->ged_result_str, "View not found - %s", argv[1]);
-       return GED_ERROR;
-    }
-
-    if ((argv[2][0] != 'x' &&
-        argv[2][0] != 'y' &&
-        argv[2][0] != 'z') || argv[2][1] != '\0') {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_OK;
-    }
-
-    if (bu_sscanf(argv[3], "%lf", &x) != 1 ||
-       bu_sscanf(argv[4], "%lf", &y) != 1) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_ERROR;
-    }
-
-    gdvp->gdv_view->gv_prevMouseX = x;
-    gdvp->gdv_view->gv_prevMouseY = y;
-    gdvp->gdv_view->gv_mode = TCLCAD_CONSTRAINED_ROTATE_MODE;
-
-    if (dm_get_pathname(gdvp->gdv_dmp)) {
-       bu_vls_printf(&bindings, "bind %s <Motion> {%s mouse_constrain_rot %s 
%s %%x %%y}; break",
-                     bu_vls_addr(dm_get_pathname(gdvp->gdv_dmp)),
-                     bu_vls_addr(&current_top->to_gop->go_name),
-                     bu_vls_addr(&gdvp->gdv_name),
-                     argv[2]);
-       Tcl_Eval(current_top->to_interp, bu_vls_addr(&bindings));
-    }
-    bu_vls_free(&bindings);
-
-    return GED_OK;
-}
-
-
-HIDDEN int
-to_constrain_tmode(struct ged *gedp,
-                  int argc,
-                  const char *argv[],
-                  ged_func_ptr UNUSED(func),
-                  const char *usage,
-                  int UNUSED(maxargs))
-{
-    struct bu_vls bindings = BU_VLS_INIT_ZERO;
-    struct ged_dm_view *gdvp;
-
-    /* must be double for scanf */
-    double x, y;
-
-    /* initialize result */
-    bu_vls_trunc(gedp->ged_result_str, 0);
-
-    /* must be wanting help */
-    if (argc == 1) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_HELP;
-    }
-
-    if (argc != 5) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_ERROR;
-    }
-
-    for (BU_LIST_FOR(gdvp, ged_dm_view, 
&current_top->to_gop->go_head_views.l)) {
-       if (BU_STR_EQUAL(bu_vls_addr(&gdvp->gdv_name), argv[1]))
-           break;
-    }
-
-    if (BU_LIST_IS_HEAD(&gdvp->l, &current_top->to_gop->go_head_views.l)) {
-       bu_vls_printf(gedp->ged_result_str, "View not found - %s", argv[1]);
-       return GED_ERROR;
-    }
-
-    if ((argv[2][0] != 'x' &&
-        argv[2][0] != 'y' &&
-        argv[2][0] != 'z') || argv[2][1] != '\0') {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_OK;
-    }
-
-    if (bu_sscanf(argv[3], "%lf", &x) != 1 ||
-       bu_sscanf(argv[4], "%lf", &y) != 1) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_ERROR;
-    }
-
-    gdvp->gdv_view->gv_prevMouseX = x;
-    gdvp->gdv_view->gv_prevMouseY = y;
-    gdvp->gdv_view->gv_mode = TCLCAD_CONSTRAINED_TRANSLATE_MODE;
-
-    if (dm_get_pathname(gdvp->gdv_dmp)) {
-       bu_vls_printf(&bindings, "bind %s <Motion> {%s mouse_constrain_trans %s 
%s %%x %%y}; break",
-                     bu_vls_addr(dm_get_pathname(gdvp->gdv_dmp)),
-                     bu_vls_addr(&current_top->to_gop->go_name),
-                     bu_vls_addr(&gdvp->gdv_name),
-                     argv[2]);
-       Tcl_Eval(current_top->to_interp, bu_vls_addr(&bindings));
-    }
-    bu_vls_free(&bindings);
-
-    return GED_OK;
-}
-
-
-HIDDEN int
-to_copy(struct ged *gedp,
-       int argc,
-       const char *argv[],
-       ged_func_ptr UNUSED(func),
-       const char *usage,
-       int UNUSED(maxargs))
-{
-    struct ged *from_gedp = GED_NULL;
-    struct ged *to_gedp = GED_NULL;
-    int ret;
-    char *cp;
-    struct tclcad_obj *top;
-    struct bu_vls db_vls = BU_VLS_INIT_ZERO;
-    struct bu_vls from_vls = BU_VLS_INIT_ZERO;
-    struct bu_vls to_vls = BU_VLS_INIT_ZERO;
-    int fflag;
-
-    /* initialize result */
-    bu_vls_trunc(gedp->ged_result_str, 0);
-
-    /* must be wanting help */
-    if (argc == 1) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_HELP;
-    }
-
-    if (argc < 3 || 4 < argc) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_ERROR;
-    }
-
-    if (argc == 4) {
-       if (argv[1][0] != '-' || argv[1][1] != 'f' ||  argv[1][2] != '\0') {
-           bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-           return GED_ERROR;
-       }
-
-       fflag = 1;
-
-       /* Advance past the -f option */
-       --argc;
-       ++argv;
-    } else
-       fflag = 0;
-
-    cp = strchr(argv[1], ':');
-    if (cp) {
-       bu_vls_strncpy(&db_vls, argv[1], cp-argv[1]);
-       bu_vls_strcpy(&from_vls, cp+1);
-
-       for (BU_LIST_FOR(top, tclcad_obj, &HeadTclcadObj.l)) {
-           if (BU_STR_EQUAL(bu_vls_addr(&top->to_gop->go_name), 
bu_vls_addr(&db_vls))) {
-               from_gedp = top->to_gop->go_gedp;
-               break;
-           }
-       }
-
-       bu_vls_free(&db_vls);
-
-       if (from_gedp == GED_NULL) {
-           bu_vls_free(&from_vls);
-           bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-           return GED_ERROR;
-       }
-    } else {
-       bu_vls_strcpy(&from_vls, argv[1]);
-       from_gedp = gedp;
-    }
-
-    cp = strchr(argv[2], ':');
-    if (cp) {
-       bu_vls_trunc(&db_vls, 0);
-       bu_vls_strncpy(&db_vls, argv[2], cp-argv[2]);
-       bu_vls_strcpy(&to_vls, cp+1);
-
-       for (BU_LIST_FOR(top, tclcad_obj, &HeadTclcadObj.l)) {
-           if (BU_STR_EQUAL(bu_vls_addr(&top->to_gop->go_name), 
bu_vls_addr(&db_vls))) {
-               to_gedp = top->to_gop->go_gedp;
-               break;
-           }
-       }
-
-       bu_vls_free(&db_vls);
-
-       if (to_gedp == GED_NULL) {
-           bu_vls_free(&from_vls);
-           bu_vls_free(&to_vls);
-           bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-           return GED_ERROR;
-       }
-    } else {
-       bu_vls_strcpy(&to_vls, argv[2]);
-       to_gedp = gedp;
-    }
-
-    if (from_gedp == to_gedp) {
-       ret = ged_dbcopy(from_gedp, to_gedp,
-                        bu_vls_addr(&from_vls),
-                        bu_vls_addr(&to_vls),
-                        fflag);
-
-       if (ret != GED_OK && from_gedp != gedp)
-           bu_vls_strcpy(gedp->ged_result_str, 
bu_vls_addr(from_gedp->ged_result_str));
-    } else {
-       ret = ged_dbcopy(from_gedp, to_gedp,
-                        bu_vls_addr(&from_vls),
-                        bu_vls_addr(&to_vls),
-                        fflag);
-
-       if (ret != GED_OK) {
-           if (bu_vls_strlen(from_gedp->ged_result_str)) {
-               if (from_gedp != gedp)
-                   bu_vls_strcpy(gedp->ged_result_str, 
bu_vls_addr(from_gedp->ged_result_str));
-           } else if (to_gedp != gedp && 
bu_vls_strlen(to_gedp->ged_result_str))
-               bu_vls_strcpy(gedp->ged_result_str, 
bu_vls_addr(to_gedp->ged_result_str));
-       }
-    }
-
-    bu_vls_free(&from_vls);
-    bu_vls_free(&to_vls);
-
-    return ret;
-}
-
-
-int
-go_data_arrows(Tcl_Interp *interp,
-              struct ged *gedp,
-              struct ged_dm_view *gdvp,
-              int argc,
-              const char *argv[],
-              const char *usage)
-{
-    int ret;
-
-    /* initialize result */
-    bu_vls_trunc(gedp->ged_result_str, 0);
-
-    /* must be wanting help */
-    if (argc == 1) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_HELP;
-    }
-
-    if (argc < 2 || 5 < argc) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_ERROR;
-    }
-
-    /* Don't allow go_refresh() to be called */
-    if (current_top != NULL)
-       current_top->to_gop->go_refresh_on = 0;
-
-    ret = to_data_arrows_func(interp, gedp, gdvp, argc, argv);
-    if (ret == GED_ERROR)
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-
-    return ret;
-}
-
-
-HIDDEN int
-to_data_arrows(struct ged *gedp,
-              int argc,
-              const char *argv[],
-              ged_func_ptr UNUSED(func),
-              const char *usage,
-              int UNUSED(maxargs))
-{
-    struct ged_dm_view *gdvp;
-    int ret;
-
-    /* initialize result */
-    bu_vls_trunc(gedp->ged_result_str, 0);
-
-    /* must be wanting help */
-    if (argc == 1) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_HELP;
-    }
-
-    if (argc < 3 || 6 < argc) {
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-       return GED_ERROR;
-    }
-
-    for (BU_LIST_FOR(gdvp, ged_dm_view, 
&current_top->to_gop->go_head_views.l)) {
-       if (BU_STR_EQUAL(bu_vls_addr(&gdvp->gdv_name), argv[1]))
-           break;
-    }
-
-    if (BU_LIST_IS_HEAD(&gdvp->l, &current_top->to_gop->go_head_views.l)) {
-       bu_vls_printf(gedp->ged_result_str, "View not found - %s", argv[1]);
-       return GED_ERROR;
-    }
-
-    /* shift the command name to argv[1] before calling to_data_arrows_func */
-    argv[1] = argv[0];
-    ret = to_data_arrows_func(current_top->to_interp, gedp, gdvp, argc-1, 
argv+1);
-    if (ret == GED_ERROR)
-       bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
-
-    return ret;
-}
-
-
-HIDDEN int
-to_data_arrows_func(Tcl_Interp *interp,
-                   struct ged *gedp,
-                   struct ged_dm_view *gdvp,
-                   int argc,
-                   const char *argv[])
-{
-    struct bview_data_arrow_state *gdasp;
-
-    if (argv[0][0] == 's')
-       gdasp = &gdvp->gdv_view->gv_sdata_arrows;
-    else
-       gdasp = &gdvp->gdv_view->gv_data_arrows;
-
-    if (BU_STR_EQUAL(argv[1], "draw")) {
-       if (argc == 2) {
-           bu_vls_printf(gedp->ged_result_str, "%d", gdasp->gdas_draw);
-           return GED_OK;
-       }
-
-       if (argc == 3) {
-           int i;
-
-           if (bu_sscanf(argv[2], "%d", &i) != 1)
-               goto bad;
-
-           if (i)
-               gdasp->gdas_draw = 1;
-           else
-               gdasp->gdas_draw = 0;
-
-           to_refresh_view(gdvp);
-           return GED_OK;
-       }
-
-       goto bad;
-    }
-
-    if (BU_STR_EQUAL(argv[1], "color")) {
-       if (argc == 2) {
-           bu_vls_printf(gedp->ged_result_str, "%d %d %d",
-                         V3ARGS(gdasp->gdas_color));
-           return GED_OK;
-       }
-
-       if (argc == 5) {
-           int r, g, b;
-
-           /* set background color */
-           if (bu_sscanf(argv[2], "%d", &r) != 1 ||
-               bu_sscanf(argv[3], "%d", &g) != 1 ||

@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to