AminetAminet
Search:
82086 packages online
About
Recent
Browse
Search
Upload
Setup
Services

dev/src/avd_template.lha

Mirror:Random
Showing:m68k-amigaosppc-amigaosppc-morphosi386-arosi386-amithlonppc-warpupppc-powerupgeneric
No screenshot available
Short:AVD Template Project - Skeleton OS4 application
Author:BITbyBIT Software Group LLC
Uploader:jamie bitbybitsoftwaregroup com (Jamie Krueger)
Type:dev/src
Version:1.2.0.0
Requires:AmigaOS4 SDK, GCC Native or cross-compiler
Architecture:ppc-amigaos >= 4.0.0
Date:2005-11-23
Download:http://aminet.net/dev/src/avd_template.lha - View contents
Readme:http://aminet.net/dev/src/avd_template.readme
Downloads:2507
**********************************************
* The AVD Template Project v1.2.0.0 (11/18/2005)
*
* Copyright (c)2005 by BITbyBIT Software Group LLC,
* All Rights Reserved.
*
**********************************************

LICENSE TO USE:
---------------
See the LICENSE.txt file distributed with this archive.

INSTALLING The Source
---------------------
Simply unpack the archive to any directory or path.

The contents of the archive should unpack as follows:

include          (Global includes for every project based on the Template)
AVD_Template     (The Actual application source tree)
README_FIRST.txt
increment_version.amigaos4-ppc
increment_version.linux-i386

First, copy the version of the "increment_version" program
you need for this system to somewhere in your path and rename
it to simply "increment_version". So, if you are compiling
on the AmigaONE directory, you need the "increment_version.amigaos4-ppc"
version. In this case SDK:Local/C in a good place for this file:

copy increment_version.amigaos4-ppc TO SDK:Local/C/increment_version

Once you have unpacked the archive, you should make
a duplicate copy of the AVD_Template directory in the
same path like this:

copy AVD_Template TO MyFirstProject CLONE ALL

Your working directory should now look like this:

include
AVD_Template
MyFirstProject
README_FIRST.txt

Now you are ready to build your first working AmigaOS4 application.

cd MyFirstProject/amigaos4/make
make

If all went well you should now have a bunch of object files (*.o)
and an executable program called "avd_template".

You can go ahead and run the program now like so:

avd_template

or

avd_template --help


RENAMING your project
---------------------
Once you've run this basic app, you'll probably want
to change the name being displayed in title bar and
such and make this project your own. This is as easy
as a couple of renamed files are some quick search and
replace of "avd_template" for your project name:

First off (still assuming we are working in the new project dir -
MyFirstProject),
rename the two main project files like so:

cd MyFirstProject/common
rename avd_template.c TO myfirstproject.c
rename avd_template.h TO myfirstproject.h


Now edit your newly renamed "myfirstproject.c" and change the
include of it's main header file (now myfirstproject.h):

MyFirstProject/common/myfirstproject.c (BEFORE)
-----------------------------------------------
/* Include project header file */
#include "avd_template.h"   <----- HERE

MyFirstProject/common/myfirstproject.c (AFTER)
----------------------------------------------
/* Include project header file */
#include "myfirstproject.h"   <----- HERE


Next edit the Makefile under amigaos4/make/ and replace all instances
of "avd_template" with "myfirstproject". You should find 4 cases right
in the top of the file:

MyFirstProject/amigaos4/make/Makefile (BEFORE)
----------------------------------------------
all: avd_template   <----- HERE

#-------------------------------------------------------------------
# Define the Project name and objects to be built here
#
PROJECTNAME       = avd_template   <----- HERE
PROJECTNAME_DEBUG = $(PROJECTNAME)_debug
PROJECT_SRC       = $(CMN_PROJECTSRC)avd_template.c   <----- HERE
PROJECT_H         = $(CMN_PROJECTSRC)avd_template.h   <----- HERE

MyFirstProject/amigaos4/make/Makefile (AFTER)
---------------------------------------------
all: myfirstproject   <----- HERE

#-------------------------------------------------------------------
# Define the Project name and objects to be built here
#
PROJECTNAME       = myfirstproject   <----- HERE
PROJECTNAME_DEBUG = $(PROJECTNAME)_debug
PROJECT_SRC       = $(CMN_PROJECTSRC)myfirstproject.c   <----- HERE
PROJECT_H         = $(CMN_PROJECTSRC)myfirstproject.h   <----- HERE


Now, with the source files renamed and the Makefile fixed up to match,
you can go into the avd_ver.h file and update the version defines:

NOTE: The AVD Template now provides automatic version number updating,
      So it is no longer necessary to manually edit the version numbers
      in this file (avd_ver.h) when making your builds. The version
      numbers are bumped automatically every time the Make file runs
      the "increment_version" tool on this file. Increment_Version
      reads in and then rewrites the bottom of this file. So it's
      important not to make editing changes below the marked section.

MyFirstProject/common/include/avd_ver.h (BEFORE)
------------------------------------------------
#define COMPANY_NAME "BITbyBIT Software Group"   <----- EDIT HERE
#define PRODUCT_NAME "avd_template"              <----- EDIT HERE
#define PRODUCT_TITLE "AVD Template"             <----- EDIT HERE
#define PRODUCT_DESCRIPTION "AVD_TEMPLATE provides a standardized rapid
development path for writing applications."    <----- EDIT HERE
#define COPYRIGHT "Copyright 2005 BITbyBIT Software Group"    <----- EDIT HERE

/*
 * This section of the file is automatically read and updated at build time,
 * do not touch or put anything else at the end of this file.
 */
#define PRODUCT_VER "0.0.0.0"
#define VER_MAJOR 0
#define VER_MINOR 0
#define VER_MAINTENANCE 0
#define VER_BUILD 0


MyFirstProject/common/include/avd_ver.h (AFTER)
-----------------------------------------------
#define COMPANY_NAME "My Cool Software Company!" <----- AFTER YOUR EDITS
#define PRODUCT_NAME "myfirstproject"            <----- AFTER YOUR EDITS
#define PRODUCT_TITLE "My First Project"         <----- AFTER YOUR EDITS
#define PRODUCT_DESCRIPTION "MY FIRST PROJECT Lets me have fun programming
quickly! :)."   <----- AFTER YOUR EDITS
#define COPYRIGHT "Copyright 2005 My Cool Software"   <----- AFTER YOUR EDITS

/*
 * This section of the file is automatically read and updated at build time,
 * do not touch or put anything else at the end of this file.
 */
#define PRODUCT_VER "0.0.0.0"
#define VER_MAJOR 0
#define VER_MINOR 0
#define VER_MAINTENANCE 0
#define VER_BUILD 0


Finally, we edit the Operating Specific main header file (os_main.h).
Here we find such strings as the title from our window and icon:

NOTE that WINTITLE and VERSION_STRING are constructed using defines
picked up from avd_ver.h. This is also part of the automatic versioning
system.

MyFirstProject/amigaos4/include/os_main.h (BEFORE)
--------------------------------------------------
/* Window Title String (Constant and Global Pointer) */ #define WINTITLE "AVD
Template v" PRODUCT_VER " ©2005 BITbyBIT Software Group LLC"   <----- EDIT HERE
#define VERSION_STRING ":" WINTITLE #define MAX_WINTITLE_LENGTH 80 #define
MAX_POPKEY_LENGTH 128 #define MAX_HIDEKEY_LENGTH 128 #define
DEFAULT_ICONTITLE_STR "AVD_Template"   <----- EDIT HERE #define
DEFAULT_POPKEY_STR    "f1" #define DEFAULT_HIDEKEY_STR   "esc"

MyFirstProject/amigaos4/include/os_main.h (AFTER)
-------------------------------------------------
/* Window Title String (Constant and Global Pointer) */ #define WINTITLE "My
First Project v" PRODUCT_VER " ©2005 My Cool Software"  <----- AFTER YOUR EDITS
#define VERSION_STRING ":" WINTITLE #define MAX_WINTITLE_LENGTH 80 #define
MAX_POPKEY_LENGTH 128 #define MAX_HIDEKEY_LENGTH 128 #define
DEFAULT_ICONTITLE_STR "My_First_Project"   <----- AFTER YOUR EDITS #define
DEFAULT_POPKEY_STR    "f1"   (Could change the default show/hide keys right now
as well) #define DEFAULT_HIDEKEY_STR   "esc"


AVD Template File Structure
---------------------------
 (Your Working directory)
 |
 +--AVD_Template
 |   |
 |   +--amigaos4
 |   |   |
 |   |   +--bin
 |   |   |   |
 |   |   |   +--avd_template
 |   |   |   |   (final executable is copied here on "make install")
 |   |   +--include
 |   |   |   |
 |   |   |   +--os_main.h
 |   |   |   +--os_types.h
 |   |   +--lib
 |   |   |   (This is where you can place libraries you need to link to)
 |   |   +--make
 |   |   |   |
 |   |   |   +--Makefile
 |   |   +--source
 |   |       |
 |   |       +--functions
 |   |       |   |
 |   |       |   +--os_allocobjs.c
 |   |       |   +--os_closelibs.c
 |   |       |   +--os_creategui.c
 |   |       |   +--os_displaygui.c
 |   |       |   +--os_freeobjs.c
 |   |       |   +--os_functions.h
 |   |       |   +--os_hidegui.c
 |   |       |   +--os_openlibs.c
 |   |       |   +--os_processevents.c
 |   |       |   +--os_returnallsigmasks.c
 |   |       |   +--os_returnlist.c
 |   |       +--os_dispapp.c
 |   |       +--os_initapp.c
 |   |       +--os_initargs.c
 |   |       +--os_init.c
 |   |       +--os_main.c (This is the actual entry point for the C compiler)
 |   |       +--os_outputstr.c
 |   |       +--os_returnerr.c
 |   |       +--os_usage.c
 |   +--common
 |   |   |
 |   |   +--avd_template.c (This is the virtual "main()" for your application)
 |   |   +--avd_template.h
 |   |   +--include
 |   |   |   |
 |   |   |   +--avd_ver.h
 |   |   |   +--common.h
 |   |   +--source
 |   |       |
 |   |       +--dispapp.c
 |   |       +--initapp.c
 |   |       +--initargs.c
 |   |       +--usage.c
 |   +--documents
 |       |
 |       +--html
 |       |   (AVD Template Documentation - HTML Supporting files)
 |       +--index.html
 |       |   (Starting page for AVD Template Docs)
 |       +--AVDTemplate.xml(Click here to view "as XML")
 |           (The source XML file created by AVD's GUI Builder,
 |            which was used to generate the ReAction
 |            GUI for this project)
 +--include
     |
     +-- avd_types.h
     +-- debug.h

Above is the file tree of the source code for the AVD Template.
As you can see it is not just a simple "hello world" program,
but rather a well structured program designed to address several
problems that arise later on as your program grows in size
and complexity by setting things up properly right from the start.

Open the AVD_Template/documents/amigaos4/index.html in your favorite
browser to browse the source tree in a nice context-sensitive format.
(Unfortunately you can't see the colors in IBrowse2) :( however,
it is still a nicely readable way to browse the source code.




Contents of dev/src/avd_template.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO     CRC       STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[generic]                 1303    1655  78.7% -lh5- 7407 Nov 22 13:55 AVD_Template.info
[generic]                 1300    1655  78.5% -lh5- d3f2 Nov 22 19:14 AVD_Template/amigaos4.info
[generic]                 1629    3997  40.8% -lh5- d8f7 Nov 22 15:08 AVD_Template/amigaos4/include/os_gui.h
[generic]                 3802   10740  35.4% -lh5- d7ce Nov 18 09:04 AVD_Template/amigaos4/include/os_main.h
[generic]                  704    1455  48.4% -lh5- 7a7a Apr  3  2005 AVD_Template/amigaos4/include/os_types.h
[generic]                 2281   11687  19.5% -lh5- cb5d Nov 17 13:51 AVD_Template/amigaos4/make/Makefile
[generic]                 1194    2663  44.8% -lh5- dfcc Nov 22 15:08 AVD_Template/amigaos4/source/functions/os_allocobjs.c
[generic]                 1217    4845  25.1% -lh5- 2665 Nov 22 22:09 AVD_Template/amigaos4/source/functions/os_closelibs.c
[generic]                 2892    7960  36.3% -lh5- 66cb Nov 22 15:08 AVD_Template/amigaos4/source/functions/os_creategui.c
[generic]                 1869    4945  37.8% -lh5- 5e84 Oct 25 16:30 AVD_Template/amigaos4/source/functions/os_displaygui.c
[generic]                 1409    4076  34.6% -lh5- e4ce Nov 17 19:18 AVD_Template/amigaos4/source/functions/os_freeobjs.c
[generic]                  879    1967  44.7% -lh5- 1e59 Nov 17 13:46 AVD_Template/amigaos4/source/functions/os_functions.h
[generic]                 1553    4072  38.1% -lh5- 4f67 Oct 25 16:31 AVD_Template/amigaos4/source/functions/os_hidegui.c
[generic]                 1542    5178  29.8% -lh5- b434 Nov  5 02:11 AVD_Template/amigaos4/source/functions/os_openlibs.c
[generic]                 3033    9847  30.8% -lh5- d1da Nov 22 15:13 AVD_Template/amigaos4/source/functions/os_processevents.c
[generic]                 1130    2584  43.7% -lh5- 9407 Oct 25 07:16 AVD_Template/amigaos4/source/functions/os_returnallsigmasks.c
[generic]                 1089    2513  43.3% -lh5- db37 Nov 17 13:49 AVD_Template/amigaos4/source/functions/os_returnlist.c
[generic]                 1736    4275  40.6% -lh5- 7d8f Nov 17 12:09 AVD_Template/amigaos4/source/os_dispapp.c
[generic]                 1415    3190  44.4% -lh5- f625 Oct 25 09:28 AVD_Template/amigaos4/source/os_init.c
[generic]                 2756   13446  20.5% -lh5- 3efd Nov 17 11:41 AVD_Template/amigaos4/source/os_initapp.c
[generic]                 2260    8073  28.0% -lh5- 5918 Oct 25 16:58 AVD_Template/amigaos4/source/os_initargs.c
[generic]                 1610    3812  42.2% -lh5- db35 Apr  3  2005 AVD_Template/amigaos4/source/os_main.c
[generic]                  844    1745  48.4% -lh5- b2cc Apr  3  2005 AVD_Template/amigaos4/source/os_outputstr.c
[generic]                 1190    2903  41.0% -lh5- 145b Apr  3  2005 AVD_Template/amigaos4/source/os_returnerr.c
[generic]                 1214    2995  40.5% -lh5- 861a Apr 13  2005 AVD_Template/amigaos4/source/os_usage.c
[generic]                 1299    1655  78.5% -lh5- 5433 Nov 22 19:14 AVD_Template/common.info
[generic]                  964    2121  45.5% -lh5- 6786 Apr 13  2005 AVD_Template/common/avd_template.c
[generic]                  815    1711  47.6% -lh5- a921 Nov 19 05:07 AVD_Template/common/avd_template.h
[generic]                  852    1790  47.6% -lh5- 3254 Nov 22 21:53 AVD_Template/common/include/avd_ver.h
[generic]                 1631    4056  40.2% -lh5- 0d45 Oct 30 22:30 AVD_Template/common/include/common.h
[generic]                  920    1917  48.0% -lh5- ec71 Apr  3  2005 AVD_Template/common/source/dispapp.c
[generic]                 1010    2138  47.2% -lh5- d546 Apr  3  2005 AVD_Template/common/source/initapp.c
[generic]                 1914    6623  28.9% -lh5- f4ec Apr  3  2005 AVD_Template/common/source/initargs.c
[generic]                 1254    3004  41.7% -lh5- 6af7 Sep 10 10:49 AVD_Template/common/source/usage.c
[generic]                 1297    1655  78.4% -lh5- 2c2b Nov 22 19:14 AVD_Template/documents.info
[generic]                 1297    1655  78.4% -lh5- a660 Nov 22 19:14 AVD_Template/documents/amigaos4.info
[generic]                  987    3558  27.7% -lh5- cb60 Nov 22 15:08 AVD_Template/documents/amigaos4/AVDTemplate.xml
[generic]                 1615    1922  84.0% -lh5- dc46 Nov 22 19:16 AVD_Template/documents/amigaos4/AVDTemplate.xml.info
[generic]                 1205    6002  20.1% -lh5- 73ca Nov 22 22:30 AVD_Template/documents/amigaos4/html/AVDTemplate.xml.html
[generic]                 1337    4817  27.8% -lh5- 804b Nov 22 22:00 AVD_Template/documents/amigaos4/html/avd_template.c.html
[generic]                 1076    2739  39.3% -lh5- 3712 Nov 22 22:01 AVD_Template/documents/amigaos4/html/avd_template.h.html
[generic]                 1293    5460  23.7% -lh5- 6cae Nov 22 22:37 AVD_Template/documents/amigaos4/html/avd_types.h.html
[generic]                 1091    2905  37.6% -lh5- 5b02 Nov 22 22:03 AVD_Template/documents/amigaos4/html/avd_ver.h.html
[generic]                 2184   13232  16.5% -lh5- eb9b Nov 22 22:02 AVD_Template/documents/amigaos4/html/common.h.html
[generic]                 1154    4539  25.4% -lh5- 8ced Nov 22 22:42 AVD_Template/documents/amigaos4/html/debug.h.html
[generic]                 1256    3979  31.6% -lh5- f788 Nov 22 22:04 AVD_Template/documents/amigaos4/html/dispapp.c.html
[generic]                 1419    5798  24.5% -lh5- a708 Nov 22 22:04 AVD_Template/documents/amigaos4/html/initapp.c.html
[generic]                 2714   27124  10.0% -lh5- f148 Nov 22 22:05 AVD_Template/documents/amigaos4/html/initargs.c.html
[generic]                 2884   29785   9.7% -lh5- 011d Nov 22 22:06 AVD_Template/documents/amigaos4/html/Makefile.html
[generic]                 1522    4118  37.0% -lh5- 2798 Nov 22 22:11 AVD_Template/documents/amigaos4/html/os_allocobjs.c.html
[generic]                 1680   19801   8.5% -lh5- f9b0 Nov 22 22:19 AVD_Template/documents/amigaos4/html/os_closelibs.c.html
[generic]                 3862   25518  15.1% -lh5- 8912 Nov 22 22:12 AVD_Template/documents/amigaos4/html/os_creategui.c.html
[generic]                 2350   15737  14.9% -lh5- 0cb6 Nov 22 22:08 AVD_Template/documents/amigaos4/html/os_dispapp.c.html
[generic]                 2534   18864  13.4% -lh5- d01f Nov 22 22:20 AVD_Template/documents/amigaos4/html/os_displaygui.c.html
[generic]                 1951   14929  13.1% -lh5- 6249 Nov 22 22:11 AVD_Template/documents/amigaos4/html/os_freeobjs.c.html
[generic]                 1227    5395  22.7% -lh5- 8abd Nov 22 22:12 AVD_Template/documents/amigaos4/html/os_functions.h.html
[generic]                 1972    8467  23.3% -lh5- 53b6 Nov 22 22:05 AVD_Template/documents/amigaos4/html/os_gui.h.html
[generic]                 2126   13839  15.4% -lh5- 15c0 Nov 22 22:22 AVD_Template/documents/amigaos4/html/os_hidegui.c.html
[generic]                 1964   11059  17.8% -lh5- 327a Nov 22 22:07 AVD_Template/documents/amigaos4/html/os_init.c.html
[generic]                 3598   51165   7.0% -lh5- 9d03 Nov 22 22:07 AVD_Template/documents/amigaos4/html/os_initapp.c.html
[generic]                 3405   40619   8.4% -lh5- 3bcc Nov 22 22:10 AVD_Template/documents/amigaos4/html/os_initargs.c.html
[generic]                 2197   13691  16.0% -lh5- 9e92 Nov 22 22:10 AVD_Template/documents/amigaos4/html/os_main.c.html
[generic]                 4626   28068  16.5% -lh5- dcde Nov 22 22:06 AVD_Template/documents/amigaos4/html/os_main.h.html
[generic]                 2158   24547   8.8% -lh5- 459c Nov 22 22:11 AVD_Template/documents/amigaos4/html/os_openlibs.c.html
[generic]                 1164    3252  35.8% -lh5- 2776 Nov 22 22:07 AVD_Template/documents/amigaos4/html/os_outputstr.c.html
[generic]                 4285   41129  10.4% -lh5- ddfe Nov 22 22:12 AVD_Template/documents/amigaos4/html/os_processevents.c.html
[generic]                 1584    7826  20.2% -lh5- 88c5 Nov 22 22:23 AVD_Template/documents/amigaos4/html/os_returnallsigmasks.c.html
[generic]                 1616    6737  24.0% -lh5- 28f3 Nov 22 22:10 AVD_Template/documents/amigaos4/html/os_returnerr.c.html
[generic]                 1538    7064  21.8% -lh5- cf2a Nov 22 22:12 AVD_Template/documents/amigaos4/html/os_returnlist.c.html
[generic]                  925    2010  46.0% -lh5- e015 Nov 22 22:06 AVD_Template/documents/amigaos4/html/os_types.h.html
[generic]                 1570    7336  21.4% -lh5- ba97 Nov 22 22:08 AVD_Template/documents/amigaos4/html/os_usage.c.html
[generic]                 1713    8956  19.1% -lh5- 2fe5 Nov 22 22:05 AVD_Template/documents/amigaos4/html/usage.c.html
[generic]                 1191    4043  29.5% -lh5- 7b05 Nov 22 22:25 AVD_Template/documents/amigaos4/index.html
[generic]                 1852    2069  89.5% -lh5- e53d Nov 22 19:21 AVD_Template/documents/amigaos4/index.html.info
[generic]                  538    1074  50.1% -lh5- 4ddb Nov 19 05:49 AVD_Template/documents/LICENSE.txt
[generic]                 1852    2069  89.5% -lh5- 2dac Nov 22 19:14 AVD_Template/documents/LICENSE.txt.info
[generic]                 3149    9976  31.6% -lh5- 4bcd Nov 22 22:35 AVD_Template/documents/README.txt
[generic]                 1974    2431  81.2% -lh5- 4782 Nov 22 19:14 AVD_Template/documents/README.txt.info
[generic]                 1302    1655  78.7% -lh5- bbb8 Nov 22 13:55 include.info
[generic]                  984    2392  41.1% -lh5- 3459 Apr 16  2005 include/avd_types.h
[generic]                  888    2504  35.5% -lh5- 9fe8 Nov 22 22:30 include/debug.h
[generic]                43676  100828  43.3% -lh5- 0f30 Nov 22 19:42 increment_version.amigaos4-ppc
[generic]                 6242   12400  50.3% -lh5- 3aec May  5  2005 increment_version.linux-i386
[generic]                  669    1383  48.4% -lh5- d5ac Nov 19 05:50 README_FIRST.txt
[generic]                 1974    2431  81.2% -lh5- 4fdb Nov 22 19:13 README_FIRST.txt.info
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total        85 files  193177  787845  24.5%            Nov 23 13:41

Aminet © 1992-2017 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>