BRL-CAD
Loading...
Searching...
No Matches
setup.h
Go to the documentation of this file.
1/* T C L C A D / S E T U P . H
2 * BRL-CAD
3 *
4 * Copyright (c) 2004-2025 United States Government as represented by
5 * the U.S. Army Research Laboratory.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * version 2.1 as published by the Free Software Foundation.
10 *
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this file; see the file named COPYING for more
18 * information.
19 */
20/** @addtogroup libtclcad */
21/** @{ */
22/** @file tclcad/setup.h
23 *
24 * @brief
25 * Setup header file for the BRL-CAD TclCAD Library, LIBTCLCAD.
26 *
27 */
28
29#ifndef TCLCAD_SETUP_H
30#define TCLCAD_SETUP_H
31
32#include "common.h"
33#include "bu/cmd.h"
34#include "bu/process.h"
35#include "tcl.h"
36#include "dm.h"
37#include "tclcad/defines.h"
38
40
45
46/**
47 * Allows LIBRT to be dynamically loaded to a vanilla tclsh/wish with
48 * "load /usr/brlcad/lib/libbu.so"
49 * "load /usr/brlcad/lib/libbn.so"
50 * "load /usr/brlcad/lib/librt.so"
51 */
52TCLCAD_EXPORT extern int Rt_Init(Tcl_Interp *interp);
53
54
55/* defined in cmdhist_obj.c */
56TCLCAD_EXPORT extern int Cho_Init(Tcl_Interp *interp);
57
58/**
59 * Open a command history object.
60 *
61 * USAGE:
62 * ch_open name
63 */
64TCLCAD_EXPORT extern int cho_open_tcl(ClientData clientData, Tcl_Interp *interp, int argc, const char **argv);
65
66
67/**
68 * This is a convenience routine for registering an array of commands
69 * with a Tcl interpreter. Note - this is not intended for use by
70 * commands with associated state (i.e. ClientData). The interp is
71 * passed to the bu_cmdtab function as clientdata instead of the
72 * bu_cmdtab entry.
73 *
74 * @param interp - Tcl interpreter wherein to register the commands
75 * @param cmds - commands and related function pointers
76 */
77TCLCAD_EXPORT extern void tclcad_register_cmds(Tcl_Interp *interp, struct bu_cmdtab *cmds);
78
79
80/**
81 * Set the variables "argc" and "argv" in interp.
82 */
83TCLCAD_EXPORT extern void tclcad_set_argv(Tcl_Interp *interp, int argc, const char **argv);
84
85/**
86 * This is the "all-in-one" initialization intended for use by
87 * applications that are providing a Tcl_Interp and want to initialize
88 * all of the BRL-CAD Tcl/Tk interfaces.
89 *
90 * libbu, libbn, librt, libged, and Itcl are always initialized.
91 *
92 * To initialize graphical elements (Tk/Itk), set init_gui to 1.
93 */
94TCLCAD_EXPORT extern int tclcad_init(Tcl_Interp *interp, int init_gui, struct bu_vls *tlog);
95
97
98#endif /* TCLCAD_SETUP_H */
99
100/** @} */
101/*
102 * Local Variables:
103 * mode: C
104 * tab-width: 8
105 * indent-tabs-mode: t
106 * c-file-style: "stroustrup"
107 * End:
108 * ex: shiftwidth=4 tabstop=8
109 */
Definition dvec.h:74
Header file for the BRL-CAD common definitions.
int Rt_Init(Tcl_Interp *interp)
int cho_open_tcl(ClientData clientData, Tcl_Interp *interp, int argc, const char **argv)
void tclcad_register_cmds(Tcl_Interp *interp, struct bu_cmdtab *cmds)
int tclcad_init(Tcl_Interp *interp, int init_gui, struct bu_vls *tlog)
void tclcad_bn_setup(Tcl_Interp *interp)
void tclcad_tcl_library(Tcl_Interp *interp)
int tclcad_tk_setup(Tcl_Interp *interp)
void tclcad_auto_path(Tcl_Interp *interp)
int Cho_Init(Tcl_Interp *interp)
void tclcad_set_argv(Tcl_Interp *interp, int argc, const char **argv)
Definition vls.h:53
Definitions header file for the BRL-CAD TclCAD Library, LIBTCLCAD.