###############################################################################
#
#
#     @(#)dtbuilder.dt	1.3 23 Mar 1994
#
#     DataType Definitions for the Application Builder
#
#     Common Desktop Environment 1.0 
#
#    (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company
#    (c) Copyright 1993, 1994, 1995 International Business Machines Corp.
#    (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
#    (c) Copyright 1993, 1994, 1995 Novell, Inc.
#
#     $TOG: dtbuilder.dt /main/5 1999/02/23 13:26:42 mgreess $
#
###############################################################################
set DtDbVersion=1.0

###############################################################################
#
# WARNING:  This file may be overwritten in subsequent installations of
#     the Common Desktop Environment (CDE).  Consequently, any system wide
#     changes should be made to an equivalent database file in
#     /usr/pkg/etc/dt/types and not in this file.
#
###############################################################################

###################################################################
#
# Data Attributes
#
###################################################################
DATA_ATTRIBUTES BIP
{
	ACTIONS		Open
	ICON		DtABbip
	NAME_TEMPLATE	%s.bip
        MIME_TYPE	text/plain
        DESCRIPTION     This file contains project data for the \
                        desktop Application Builder.  Its data type is \
                        named BIP.  BIP files have named ending with '.bip'.
}
DATA_CRITERIA BIP1
{
	DATA_ATTRIBUTES_NAME BIP
	MODE		f
	NAME_PATTERN	*.bip
}
ACTION Open
{
        LABEL           Open
	ARG_TYPE	BIP
	TYPE		COMMAND
	WINDOW_TYPE	NO_STDIO
	EXEC_STRING	dtbuilder "%(File)Arg_1%"
        DESCRIPTION     This action opens an Application Builder project \
                        file (*.bip) by running the Application Builder \
                        and loading that file.
}
ACTION Print
{
        LABEL           Print
        ARG_TYPE        BIP
        TYPE            MAP
        MAP_ACTION      NoPrint
}

###################################################################

DATA_ATTRIBUTES BIL
{
	ACTIONS		Open
	ICON		DtABbil
	NAME_TEMPLATE	%s.bil
        MIME_TYPE	text/plain
        DESCRIPTION     This file contains module data for the desktop \
                        Application Builder.  Its data type is named BIL. \
                        BIL files have names ending with '.bil'.
}
DATA_CRITERIA BIL1
{
	DATA_ATTRIBUTES_NAME BIL
	MODE		f
	NAME_PATTERN	*.bil
}
ACTION Open
{
        LABEL           Open
	ARG_TYPE	BIL
	TYPE		COMMAND
	WINDOW_TYPE	NO_STDIO
	EXEC_STRING	dtbuilder "%(File)Arg_1%"
        DESCRIPTION     This action opens an Application Builder module \
                        file (*.bil) by running the Application Builder \
                        and loading that file.
}
ACTION Print
{
        LABEL           Print
        ARG_TYPE        BIL
        TYPE            MAP
        MAP_ACTION      NoPrint
}

###################################################################

DATA_ATTRIBUTES BIX
{
	ACTIONS	        Open
	ICON	        DtABbix
	NAME_TEMPLATE	%s.bix
        MIME_TYPE	text/plain
        DESCRIPTION     This file contains all the project (BIP) and \
                        module (BIL) file data for a desktop Application \
                        Builder project.  Its data type is named BIX.  \
                        BIX files have names ending with .'bix'.
}
DATA_CRITERIA BIX1
{
	DATA_ATTRIBUTES_NAME BIX
	MODE		f
	NAME_PATTERN	*.bix
}
ACTION Open
{
        LABEL           Open
	ARG_TYPE	BIX
	TYPE		COMMAND
	WINDOW_TYPE	NO_STDIO
	EXEC_STRING	dtbuilder "%(File)Arg_1%"
        DESCRIPTION     This action opens an Application Builder encapsulated \
                        project file (*.bix) by running the Application \
                        Builder and loading that file.
}
ACTION Print
{
        LABEL           Print
        ARG_TYPE        BIX
        TYPE            MAP
        MAP_ACTION      NoPrint
}

###################################################################
###################################################################
#
# Actions
#
###################################################################
ACTION Dtappbuild
{
        LABEL           Application Builder
        TYPE            COMMAND
        EXEC_STRING     dtbuilder
        ICON            DtBldr
        WINDOW_TYPE     NO_STDIO
        DESCRIPTION     The Application Builder (Dtappbuild) action runs \
                        the desktop Application Builder.
}

######

ACTION CodeGen
{
        LABEL           Code Generator
        TYPE            COMMAND
        ARG_COUNT       0
        EXEC_STRING     /bin/sh -c 'dtaction CodeGen \
	   %(File)Arg_1"Project file (*.bip):"%'
        ICON            DtBldr
        WINDOW_TYPE     NO_STDIO
        DESCRIPTION     The Code Generator (CodeGen) action runs the code generator \
                        for the desktop Application Builder.
}

ACTION CodeGen
{
        LABEL           Code Generator
        TYPE            COMMAND
        ARG_TYPE        BIP
        ARG_COUNT       >0
        EXEC_STRING     /bin/sh -c ' \
           DIR_NAME=`dirname %(File)Arg_1"Project file (*.bip):"%` ; \
	   if [ ! -d "\$DIR_NAME" ] ; then \
	       echo "ERROR: \$DIR_NAME is not a folder."; \
	   else \
	       BIP_FILE=`basename "%(File)Arg_1%"` ; \
	       ( cd \$DIR_NAME; dtcodegen -p \$BIP_FILE 2>&1; ) | \${PAGER:-more}; \
	       echo "\\n*** Select Close or Exit from the window menu to close this window ***"; \
	   fi '
        ICON            DtBldr
        WINDOW_TYPE     PERM_TERMINAL
        DESCRIPTION     The Code Generator (CodeGen) action runs the code generator \
                        for the desktop Application Builder.
}
########################### EOF ##############################################
