##

##

##

##

##

##

    ________________________________________________________________________
    Plugins:

      Plugins are load modules, compiled (Language C or other).
      Plugins can use all internal functions.
      System-neutral user interfaces can be created with the GUI-Tool "C-Kit-GUI".

      Plugins do not have specific commands (like processors).
      Plugins can be unloaded, recompiled and reloaded at run time.

    Activate a plugin: "Plugin/Select-Start" (oder Ctrl-P).

      Installing the Linux development kit
      Installing the development package for MS-Windows
      Customizing the development environment
      Creation of new plugins - Linux
      Development - Documentation

    See also DevDoc / Introduction

    ________________________________________________________________________

    Installing Linux development kit:

    Prerequistes:

    Required software packages:

      for modifications of gCAD3D:
        gcc, ctags, build-essential.
        (eg sudo apt-get install build-essential)

      for modifications of the gui-system C-KIT-GUI-GTK:
        Gtk-development-files (libgtk-3-dev and/or libgtk2.0-dev),
          OpenGL-development-files (eg mesa-common-dev, libglu1-mesa-dev).
          Installation of gtk3-development-files; eg for debian-os:
            sudo apt-get install libgtk-3-dev
            Optional:
            sudo apt-get install libgtk-3-doc
            sudo apt-get install gtk-3-examples
          Installation of gtk2-development-files; eg for debian-os:
            sudo apt-get install libgtk2.0-dev
            Optional:
            sudo apt-get install libgtk2.0-doc
            sudo apt-get install gtk2.0-examples

      for modification of the documentation:
        doxygen

      for building debian-package:
        fakeroot, lintian

    Linux Install from git-repository:
    # If possible: prefer installation from git-repository.
    # start commandline (eg gnome-terminal)
    cd
    mkdir devel
    cd devel
    # get all files into ~/devel/gcad3d/*
    git clone https://github.com/gcad3d/gcad3d

    Linux Install from zipfile:

    # start commandline (eg gnome-terminal)
    cd
    mkdir devel
    cd devel

    # get all files into ~/devel/gcad3d/*
    cp xxx/gCAD3D_x.xx-src.zip .
    unzip gCAD3D_x.xx-src.zip

    cd gcad3d
    mkdir -p binLinux32/plugins
    mkdir -p binLinux64/plugins

    ________________________________________________________________________

    Installing the development package for MS-Windows:
     Package name is gCAD3D-devel-1.26.zip.

    Required software packages:
      a compiler, such as Visual Studio Express.

     The package contains - -
      - all necessary Gtk+ include files and libs,
      - GTK toolbox with examples (sources and makefiles)
      - some gCAD3D-demo -plugins (sources and makefiles)
      - all include files gCAD3D

     You have to copy it into the gCAD3D basic installation directory,

     the base directory is normally "C:\Program Files\gCAD3D"
       or "C:\Program Files\gCAD3D"
       Unpack the zipfile.

     You will need a command shell with the correct compiler environment
      For VC8 you can use the Visual Studio Command Window or cmd.exe plus:
       "C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"

      For VC9 (Visual Studio 2008) you can use:
       "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
       test it with "cl /?".

     Test link of a test program or add-on library:
      open command shell (CMD.EXE )
      cd C:\Program Files\gCAD3D\gtk
      nmake-f tst_gtk0.nmak

     Runtime link:
      start gCAD3D from command shell (CMD.EXE) to see messages
      activate checkbox Options / compile_DLL 's in gCAD3D,
      activate a DDL (select "DemoXX" in upper right)
      the selected DLL will be compiled, linked, started
      (see text window for errors)

    ________________________________________________________________________

    Development - Documentation:

    Linux:
      Display from a command shell:
      firefox ~/devel/gcad3d/doc/gcad/index.htm

    MS-Windows:
      Start from a command shell:
       cd C:\Program Files\gCAD3D\xa
       hh ..\devdoc\index.htm

    ________________________________________________________________________

    Creation of new plug-ins - Linux

     A source program ({progname}.c) and a Link job ({progname}.mak) are required
      (MS-Win: {progname}.nmak).

     Examples: Demo*.c, Demo*.mak  (MS: Demo*.nmak).

     With "Options/compile_DLLs" on, a plugin is unloaded at runtime,
     recompiled, relinked and reloaded.

     Documentation:
     pag_pd1.htm
     or doc/gcad/pag_pd1.htm in the development-package.

    Example:
    cd ~/devel/gcad3d/src/APP
    cp Demo_toolbar1.c myTest1.c
    cp Demo_toolbar1.mak myTest1.mak
    # change "Demo_toolbar1" in myTest1.c and in myTest1.mak into "myTest1"
    # link for the first time:
    make -f myTest1.mak

    # start gcad with "Options/compile_DLLs" on
    ./do comp
    # select "Plugin / select plugin .. / myTest1"
    # keep gcad running; exit plugin; change code, save code;
    # restart plugin with "Ctrl+P" makes automatic recompile and start ..

    ________________________________________________________________________

    Customizing the development environment

    The installed program gCAD3D uses system-directories,
    - normal users cannot write to system-directories.
    The development environment is using different directories,
    - the program must be rebuilt (with ./do setup).

    # goto APP-directory; normaly:
    cd ~/devel/gcad3d/src/APP

    # Script "do" has predefined functions; get infos with:
    ./do help

    # first customize (create some directories, rebuild gCAD3D)
    ./do setup

    # test it (start gcad)
    ./do

    # optional:
    # test to rebuild a plugin:
    ./do Demo_gui1.mak

    # change gtk-version (sets VGUI in ../options.mak):
    ./do guiinit

    # ReCreate development-documentation (doygen must be installed):
    cd ~/devel/gcad3d/doc
    ./gcad_doxygen.sh

    # view development-documentation:
    xdg-open ~/devel/gcad3d/doc/gcad/index.htm

    # after modification of sourcefiles, rebuild gcad:
    ./do c

    #---------------------------------------------------------
    # Create new gcad-Version:
    # Modifys gcad_version, gcad_date; create xa/gcad_version.h:
    cd ~/devel/gcad3d/src
    ./NEW_VERSION1.sh

    # create debian-package (binary, gCAD3D-#.##-bin-xxxxx.deb):
    cd ~/devel/gcad3d/debian
    ./pack_deb.sh

    # create source-package (gCAD3D-#.##-src.zip):
    cd ~/devel/gcad3d
    ./pack_src.sh

    #---------------------------------------------------------
    # DEVELOPMENT-TOOLS-TAGFILES:
    # If you are using vim: jump into functions with tagfiles:
    # in directory APP_tests tagfiles can be used with vim.

    # Add in .vimrc:
      let tagfiles = system("ls -m *.tag |sed \"s/ //g\"")
      "echo tagfiles
      let &tags = substitute(tagfiles, "\n", "", "g")

    # Using tagfiles:
      cd ~/devel/gcad3d/src/APP
      vi -t UME_init
    # or use "Ctr-R" inside vim with cursor over function, Ctrl-O = back.

    #---------------------------------------------------------
    # DEVELOPMENT-TOOLS-CSCOPE:
    # Use cscope with:
      cd ~/devel/gcad3d/src/APP
      ./ed
        update EDITOR in file ~/devel/gcad3d/src/APP/ed.

    ________________________________________________________________________
     Send bug reports, suggestions for improvements to
    support@gcad3d.org