initial commit

This commit is contained in:
Lance Edgar 2012-02-15 19:34:31 -06:00
commit 304504bdfa
25 changed files with 5290 additions and 0 deletions

77
.cdtbuild Normal file
View file

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<?fileVersion 2.0.0?>
<ManagedProjectBuildInfo>
<target id="RattailPalm.com.palmsource.eclipse.palmos4dev.target.m68k_palmos.exe.255930048" name="Garnet OS 68K Application" parent="com.palmsource.eclipse.palmos4dev.target.m68k_palmos.exe" isAbstract="false" artifactName="RattailPalm" isTest="false">
<configuration id="target.m68k_palmos.exe.debug.249774065" name="Debug" parent="target.m68k_palmos.exe.debug">
<toolReference id="com.palmsource.eclipse.palmostools.compiler.palmrc" command="&quot;$(TOOLS_DIR)PalmRC&quot;" outputPrefix="" inputFlag="" outputFlag="-o" outputs="trc">
<optionReference id="tool.compiler.palmrc.option.otherFlags">
<listOptionValue value="-p PalmOS4" builtIn="false"/>
</optionReference>
<optionReference id="tool.compiler.palmrc.option.locale" defaultValue=" enUS"/>
<optionReference id="tool.compiler.palmrc.option.overlayFilter" defaultValue="tool.compiler.palmrc.option.overlay_filter.none"/>
<optionReference id="tool.compiler.palmrc.option.encodingTarget" defaultValue="tool.compiler.palmrc.option.encoding.latin"/>
<optionReference id="tool.compiler.palmrc.option.strictEncoding" defaultValue="true"/>
<optionReference id="tool.compiler.palmrc.option.noWarnSize" defaultValue="false"/>
</toolReference>
<toolReference id="com.palmsource.eclipse.palmos4dev.compiler.m68k_palmos" command="m68k-palmos-gcc -c" outputPrefix="" inputFlag="" outputFlag="-o" outputs="o">
<optionReference id="tool.compiler.gcc.68K.option.optLevel" defaultValue="tool.compiler.m68k_palmos_gcc.option.optimization.0"/>
<optionReference id="tool.compiler.gcc.68K.option.debugLevel" defaultValue="tool.compiler.m68k_palmos_gcc.option.debug_level.default"/>
<optionReference id="tool.compiler.gcc.68K.option.defineSymbols">
<listOptionValue value="__PALMOS__=0x05000000" builtIn="false"/>
</optionReference>
<optionReference id="tool.compiler.gcc.68K.option.includeDirs">
<listOptionValue value="&quot;$(TOOLS_DIR)include/stlport&quot;" builtIn="false"/>
</optionReference>
<optionReference id="tool.compiler.gcc.68K.option.exceptions" defaultValue="tool.compiler.m68k_palmos_gcc.option.exceptions.enable"/>
<optionReference id="tool.compiler.gcc.68K.option.assertions" defaultValue="tool.compiler.m68k_palmos_gcc.option.assertions.enable"/>
<optionReference id="tool.compiler.gcc.68K.option.warningLevel" defaultValue="tool.compiler.m68k_palmos_gcc.option.warning_level.all"/>
</toolReference>
<toolReference id="com.palmsource.eclipse.palmos4dev.linker.m68k_palmos" command="m68k-palmos-gcc" outputPrefix="" inputFlag="" outputFlag="-o" outputs="">
<optionReference id="tool.linker.gcc.68K.option.enableLinkerDebug" defaultValue="true"/>
<optionReference id="tool.linker.gcc.68K.option.additionalLibs"/>
<optionReference id="tool.linker.gcc.68K.option.userObjs"/>
<optionReference id="tool.linker.gcc.68K.option.otherFlags"/>
</toolReference>
<toolReference id="com.palmsource.eclipse.palmos4dev.builder.build-prc" command="build-prc" outputPrefix="" inputFlag="" outputFlag="-o" outputs="">
<optionReference id="tool.builder.build-prc.option.other">
<listOptionValue value="$(MULTISECTION_DEFINITIONS_FILE)" builtIn="false"/>
<listOptionValue value="-c '$(CREATOR_ID)'" builtIn="false"/>
<listOptionValue value="-n $(ARTIFACT_NAME)" builtIn="false"/>
</optionReference>
</toolReference>
</configuration>
<configuration id="target.m68k_palmos.exe.release.1467601361" name="Release" parent="target.m68k_palmos.exe.release">
<toolReference id="com.palmsource.eclipse.palmostools.compiler.palmrc" command="&quot;$(TOOLS_DIR)PalmRC&quot;" outputPrefix="" inputFlag="" outputFlag="-o" outputs="trc">
<optionReference id="tool.compiler.palmrc.option.otherFlags">
<listOptionValue value="-p PalmOS4" builtIn="false"/>
</optionReference>
<optionReference id="tool.compiler.palmrc.option.locale" defaultValue=" enUS"/>
<optionReference id="tool.compiler.palmrc.option.overlayFilter" defaultValue="None specified"/>
<optionReference id="tool.compiler.palmrc.option.encodingTarget" defaultValue="Palm OS Latin"/>
<optionReference id="tool.compiler.palmrc.option.strictEncoding" defaultValue="true"/>
<optionReference id="tool.compiler.palmrc.option.noWarnSize" defaultValue="false"/>
</toolReference>
<toolReference id="com.palmsource.eclipse.palmos4dev.compiler.m68k_palmos" command="m68k-palmos-gcc -c" outputPrefix="" inputFlag="" outputFlag="-o" outputs="o">
<optionReference id="tool.compiler.gcc.68K.option.optLevel" defaultValue="More (-O2)"/>
<optionReference id="tool.compiler.gcc.68K.option.debugLevel" defaultValue="None"/>
<optionReference id="tool.compiler.gcc.68K.option.defineSymbols">
<listOptionValue value="__PALMOS__=0x05000000" builtIn="false"/>
</optionReference>
<optionReference id="tool.compiler.gcc.68K.option.includeDirs">
<listOptionValue value="&quot;$(TOOLS_DIR)include/stlport&quot;" builtIn="false"/>
</optionReference>
<optionReference id="tool.compiler.gcc.68K.option.exceptions" defaultValue="Enable (-fexceptions)"/>
<optionReference id="tool.compiler.gcc.68K.option.assertions" defaultValue="Enable (-UNDEBUG)"/>
<optionReference id="tool.compiler.gcc.68K.option.warningLevel" defaultValue="All (-Wall)"/>
</toolReference>
<toolReference id="com.palmsource.eclipse.palmos4dev.builder.build-prc" command="build-prc" outputPrefix="" inputFlag="" outputFlag="-o" outputs="">
<optionReference id="tool.builder.build-prc.option.other">
<listOptionValue value="$(MULTISECTION_DEFINITIONS_FILE)" builtIn="false"/>
<listOptionValue value="-c '$(CREATOR_ID)'" builtIn="false"/>
<listOptionValue value="-n $(ARTIFACT_NAME)" builtIn="false"/>
</optionReference>
</toolReference>
</configuration>
</target>
</ManagedProjectBuildInfo>

18
.cdtproject Normal file
View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse-cdt version="2.0"?>
<cdtproject id="org.eclipse.cdt.managedbuilder.core.managedMake">
<extension point="org.eclipse.cdt.core.ScannerInfoProvider" id="org.eclipse.cdt.managedbuilder.core.ManagedBuildManager"/>
<extension point="org.eclipse.cdt.core.BinaryParser" id="org.eclipse.cdt.core.PE"/>
<data>
<item id="cdt_indexer">
<indexEnabled indexValue="true"/>
<indexerProblemsEnabled indexProblemsValue="0"/>
</item>
<item id="org.eclipse.cdt.core.pathentry">
<pathentry kind="src" path=""/>
<pathentry kind="out" path=""/>
<pathentry kind="con" path="org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER"/>
</item>
</data>
</cdtproject>

84
.project Normal file
View file

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>RattailPalm</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.palmsource.eclipse.palmoscore.palmOSBuildToolsVerifier</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.palmsource.eclipse.palmoscore.palmOSMakeBuilder</name>
<arguments>
<dictionary>
<key>DATABASE_RESET</key>
<value></value>
</dictionary>
<dictionary>
<key>DATABASE_BUNDLE</key>
<value></value>
</dictionary>
<dictionary>
<key>CREATOR_ID</key>
<value>RTTL</value>
</dictionary>
<dictionary>
<key>DATABASE_BACKUP</key>
<value>-b</value>
</dictionary>
<dictionary>
<key>DB_TYPE</key>
<value>appl</value>
</dictionary>
<dictionary>
<key>PROJECT_VERSION</key>
<value>10100</value>
</dictionary>
<dictionary>
<key>DATABASE_PROTECT</key>
<value></value>
</dictionary>
<dictionary>
<key>SDK</key>
<value>com.palmsource.eclipse.sdk.palmos5</value>
</dictionary>
<dictionary>
<key>DB_NAME</key>
<value>Rattail</value>
</dictionary>
<dictionary>
<key>DATABASE_HIDDEN</key>
<value></value>
</dictionary>
<dictionary>
<key>DATABASE_VERSION</key>
<value>1</value>
</dictionary>
<dictionary>
<key>OS_API</key>
<value>68K</value>
</dictionary>
<dictionary>
<key>PROJECT_TYPE</key>
<value>appl</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>com.palmsource.eclipse.palmos4dev.palmOS4GeneratedMakefileBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.palmsource.eclipse.palmos4dev.palmOS68KManagedNature</nature>
<nature>com.palmsource.eclipse.palmoscore.palmOSManagedNature</nature>
<nature>com.palmsource.eclipse.palmoscore.palmOSNature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
</natures>
</projectDescription>

72
auto-generated.mk Normal file
View file

@ -0,0 +1,72 @@
# This file auto-generated by Garnet OS Make builder. Don't modify directly!!!
# This value is unescaped. Either quote the value or escape special characters when you use it.
ifeq ($(TOOLS_DIR), )
TOOLS_DIR = C:/Program Files/ACCESS/Garnet OS Development Suite/PalmOSTools/
endif
# This value is unescaped. Either quote the value or escape special characters when you use it.
ifeq ($(SDK_LOCATION), )
SDK_LOCATION = C:/Program Files/ACCESS/Garnet OS Development Suite/sdk-5r4/
endif
ifeq ($(SDK_VERSION), )
SDK_VERSION = sdk-5r4
endif
ifeq ($(DATABASE_BUNDLE), )
DATABASE_BUNDLE =
endif
ifeq ($(DATABASE_RESET), )
DATABASE_RESET =
endif
ifeq ($(CREATOR_ID), )
CREATOR_ID = RTTL
endif
ifeq ($(DATABASE_BACKUP), )
DATABASE_BACKUP = -b
endif
ifeq ($(DB_TYPE), )
DB_TYPE = appl
endif
ifeq ($(PROJECT_VERSION), )
PROJECT_VERSION = 10100
endif
ifeq ($(SDK), )
SDK = com.palmsource.eclipse.sdk.palmos5
endif
ifeq ($(DATABASE_PROTECT), )
DATABASE_PROTECT =
endif
ifeq ($(DB_NAME), )
DB_NAME = Rattail
endif
ifeq ($(DATABASE_HIDDEN), )
DATABASE_HIDDEN =
endif
ifeq ($(DATABASE_VERSION), )
DATABASE_VERSION = 1
endif
ifeq ($(OS_API), )
OS_API = 68K
endif
ifeq ($(PROJECT_TYPE), )
PROJECT_TYPE = appl
endif
ifeq ($(ARTIFACT_NAME), )
ARTIFACT_NAME = RattailPalm
endif

14
package.psml Normal file
View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<PalmOSInstaller
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.palmsource.com/installer/psi.xsd">
<Product ID="RattailPalm"
DisplayVersion="1.0"
Version="1.0.0.0"
OTA="true"
DownloadURL="http://yourURLhere.com/RattailPalm.psi">
<Component Platform="PalmOS">
<File Filename="RattailPalm.prc" InstallToCard="OK" />
</Component>
</Product>
</PalmOSInstaller>

357
rsc/AppResources.xrd Normal file
View file

@ -0,0 +1,357 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PALMOS_RESOURCE_FILE>
<ALERT_RESOURCE RESOURCE_ID="1000">
<ALERT_TYPE> INFORMATION_ALERT </ALERT_TYPE>
<HELP_ID> 0 </HELP_ID>
<DEFAULT_BUTTON> 0 </DEFAULT_BUTTON>
<TITLE> "Testing Things" </TITLE>
<MESSAGE> "OMGWTFBBQ !!" </MESSAGE>
<BUTTONS>
<TEXT> "OK" </TEXT>
</BUTTONS>
</ALERT_RESOURCE>
<APP_ICON_BITMAP_RESOURCE RESOURCE_ID="1000" LOCALE="enUS" COMMENT="Large icons (1-2 and 8 bits)">
<BITMAPS>
<BITMAP>
<WIDTH> 22 </WIDTH>
<HEIGHT> 22 </HEIGHT>
<BIT_DEPTH> 1 </BIT_DEPTH>
<BITMAP_COMPRESSION> NONE </BITMAP_COMPRESSION>
<HAS_TRANSPARENCY> FALSE </HAS_TRANSPARENCY>
<HAS_COLOR_TABLE> FALSE </HAS_COLOR_TABLE>
<BITMAP_FILE> "./bitmaps/AppIcon_Large-1.bmp" </BITMAP_FILE>
</BITMAP>
<BITMAP>
<WIDTH> 22 </WIDTH>
<HEIGHT> 22 </HEIGHT>
<BIT_DEPTH> 2 </BIT_DEPTH>
<BITMAP_COMPRESSION> NONE </BITMAP_COMPRESSION>
<HAS_TRANSPARENCY> FALSE </HAS_TRANSPARENCY>
<HAS_COLOR_TABLE> FALSE </HAS_COLOR_TABLE>
<BITMAP_FILE> "./bitmaps/AppIcon_Large-2.bmp" </BITMAP_FILE>
</BITMAP>
<BITMAP>
<WIDTH> 22 </WIDTH>
<HEIGHT> 22 </HEIGHT>
<BIT_DEPTH> 8 </BIT_DEPTH>
<BITMAP_COMPRESSION> NONE </BITMAP_COMPRESSION>
<HAS_TRANSPARENCY> TRUE </HAS_TRANSPARENCY>
<TRANSPARENT_COLOR>
<INDEX> 0xD2 </INDEX>
</TRANSPARENT_COLOR>
<HAS_COLOR_TABLE> FALSE </HAS_COLOR_TABLE>
<BITMAP_FILE> "./bitmaps/AppIcon_Large-8.bmp" </BITMAP_FILE>
</BITMAP>
</BITMAPS>
</APP_ICON_BITMAP_RESOURCE>
<APP_ICON_BITMAP_RESOURCE RESOURCE_ID="1001" LOCALE="enUS" COMMENT="Small icons (1-2 and 8 bits)">
<BITMAPS>
<BITMAP>
<WIDTH> 15 </WIDTH>
<HEIGHT> 9 </HEIGHT>
<BIT_DEPTH> 1 </BIT_DEPTH>
<BITMAP_COMPRESSION> NONE </BITMAP_COMPRESSION>
<HAS_TRANSPARENCY> FALSE </HAS_TRANSPARENCY>
<HAS_COLOR_TABLE> FALSE </HAS_COLOR_TABLE>
<BITMAP_FILE> "./bitmaps/AppIcon_Small-1.bmp" </BITMAP_FILE>
</BITMAP>
<BITMAP>
<WIDTH> 15 </WIDTH>
<HEIGHT> 9 </HEIGHT>
<BIT_DEPTH> 2 </BIT_DEPTH>
<BITMAP_COMPRESSION> NONE </BITMAP_COMPRESSION>
<HAS_TRANSPARENCY> FALSE </HAS_TRANSPARENCY>
<HAS_COLOR_TABLE> FALSE </HAS_COLOR_TABLE>
<BITMAP_FILE> "./bitmaps/AppIcon_Small-2.bmp" </BITMAP_FILE>
</BITMAP>
<BITMAP>
<WIDTH> 15 </WIDTH>
<HEIGHT> 9 </HEIGHT>
<BIT_DEPTH> 8 </BIT_DEPTH>
<BITMAP_COMPRESSION> NONE </BITMAP_COMPRESSION>
<HAS_TRANSPARENCY> TRUE </HAS_TRANSPARENCY>
<TRANSPARENT_COLOR>
<INDEX> 0xCC </INDEX>
</TRANSPARENT_COLOR>
<HAS_COLOR_TABLE> FALSE </HAS_COLOR_TABLE>
<BITMAP_FILE> "./bitmaps/AppIcon_Small-8.bmp" </BITMAP_FILE>
</BITMAP>
</BITMAPS>
</APP_ICON_BITMAP_RESOURCE>
<APP_ICON_NAME_RESOURCE RESOURCE_ID="1000" LOCALE="enUS">
<TEXT> "Rattail" </TEXT>
</APP_ICON_NAME_RESOURCE>
<FORM_RESOURCE RESOURCE_ID="1000" LOCALE="enUS" COMMENT="Main">
<FORM_ID> 1000 </FORM_ID>
<BOUNDS>
<LEFT> 0 </LEFT>
<TOP> 0 </TOP>
<WIDTH> 160 </WIDTH>
<HEIGHT> 160 </HEIGHT>
</BOUNDS>
<USABLE> TRUE </USABLE>
<MODAL> FALSE </MODAL>
<SAVE_BEHIND> FALSE </SAVE_BEHIND>
<HELP_ID> 0 </HELP_ID>
<MENU_ID> 1000 </MENU_ID>
<DEFAULT_BUTTON> 0 </DEFAULT_BUTTON>
<TITLE_ICON> FALSE </TITLE_ICON>
<TITLE_BAR_FOCUSABLE> FALSE </TITLE_BAR_FOCUSABLE>
<FORM_OBJECTS>
<FORM_TITLE>
<TEXT> "Rattail" </TEXT>
</FORM_TITLE>
<FORM_FIELD COMMENT="Barcode">
<ID> 1000 </ID>
<BOUNDS>
<LEFT> 1 </LEFT>
<TOP> 148 </TOP>
<WIDTH> 75 </WIDTH>
<HEIGHT> 12 </HEIGHT>
</BOUNDS>
<USABLE> TRUE </USABLE>
<EDITABLE> TRUE </EDITABLE>
<SINGLE_LINE> TRUE </SINGLE_LINE>
<DYNAMIC_SIZE> FALSE </DYNAMIC_SIZE>
<UNDERLINE> SOLID_UNDERLINE </UNDERLINE>
<JUSTIFICATION> LEFT_ALIGN </JUSTIFICATION>
<AUTO_SHIFT> TRUE </AUTO_SHIFT>
<HAS_SCROLLBAR> FALSE </HAS_SCROLLBAR>
<NUMERIC> FALSE </NUMERIC>
<MAX_CHARS> 14 </MAX_CHARS>
<FONT_ID> STD_FONT </FONT_ID>
<MAX_VISIBLE_LINES> 0 </MAX_VISIBLE_LINES>
</FORM_FIELD>
<FORM_FIELD COMMENT="Units">
<ID> 1001 </ID>
<BOUNDS>
<LEFT> 140 </LEFT>
<TOP> 148 </TOP>
<WIDTH> 18 </WIDTH>
<HEIGHT> 12 </HEIGHT>
</BOUNDS>
<USABLE> TRUE </USABLE>
<EDITABLE> TRUE </EDITABLE>
<SINGLE_LINE> TRUE </SINGLE_LINE>
<DYNAMIC_SIZE> FALSE </DYNAMIC_SIZE>
<UNDERLINE> SOLID_UNDERLINE </UNDERLINE>
<JUSTIFICATION> RIGHT_ALIGN </JUSTIFICATION>
<AUTO_SHIFT> FALSE </AUTO_SHIFT>
<HAS_SCROLLBAR> FALSE </HAS_SCROLLBAR>
<NUMERIC> TRUE </NUMERIC>
<MAX_CHARS> 3 </MAX_CHARS>
<FONT_ID> STD_FONT </FONT_ID>
<MAX_VISIBLE_LINES> 0 </MAX_VISIBLE_LINES>
</FORM_FIELD>
<FORM_CHECKBOX COMMENT="StopOnUnits">
<ID> 1002 </ID>
<BOUNDS>
<LEFT> 123 </LEFT>
<TOP> 148 </TOP>
<WIDTH> 19 </WIDTH>
<HEIGHT> 12 </HEIGHT>
</BOUNDS>
<USABLE> TRUE </USABLE>
<ENABLED> TRUE </ENABLED>
<TEXT> "" </TEXT>
<FONT_ID> STD_FONT </FONT_ID>
<GROUP_ID> 0 </GROUP_ID>
<SELECTED> FALSE </SELECTED>
</FORM_CHECKBOX>
<FORM_FIELD COMMENT="Cases">
<ID> 1003 </ID>
<BOUNDS>
<LEFT> 99 </LEFT>
<TOP> 148 </TOP>
<WIDTH> 18 </WIDTH>
<HEIGHT> 12 </HEIGHT>
</BOUNDS>
<USABLE> TRUE </USABLE>
<EDITABLE> TRUE </EDITABLE>
<SINGLE_LINE> TRUE </SINGLE_LINE>
<DYNAMIC_SIZE> FALSE </DYNAMIC_SIZE>
<UNDERLINE> SOLID_UNDERLINE </UNDERLINE>
<JUSTIFICATION> RIGHT_ALIGN </JUSTIFICATION>
<AUTO_SHIFT> FALSE </AUTO_SHIFT>
<HAS_SCROLLBAR> FALSE </HAS_SCROLLBAR>
<NUMERIC> TRUE </NUMERIC>
<MAX_CHARS> 3 </MAX_CHARS>
<FONT_ID> STD_FONT </FONT_ID>
<MAX_VISIBLE_LINES> 0 </MAX_VISIBLE_LINES>
</FORM_FIELD>
<FORM_CHECKBOX COMMENT="StopOnUnits">
<ID> 1004 </ID>
<BOUNDS>
<LEFT> 82 </LEFT>
<TOP> 148 </TOP>
<WIDTH> 19 </WIDTH>
<HEIGHT> 12 </HEIGHT>
</BOUNDS>
<USABLE> TRUE </USABLE>
<ENABLED> TRUE </ENABLED>
<TEXT> "" </TEXT>
<FONT_ID> STD_FONT </FONT_ID>
<GROUP_ID> 0 </GROUP_ID>
<SELECTED> FALSE </SELECTED>
</FORM_CHECKBOX>
<FORM_TABLE COMMENT="ScanRecords">
<ID> 1005 </ID>
<BOUNDS>
<LEFT> 0 </LEFT>
<TOP> 16 </TOP>
<WIDTH> 153 </WIDTH>
<HEIGHT> 120 </HEIGHT>
</BOUNDS>
<EDITABLE> FALSE </EDITABLE>
<TABLE_COLUMNS>
<COLUMN_WIDTH> 80 </COLUMN_WIDTH>
<COLUMN_WIDTH> 30 </COLUMN_WIDTH>
<COLUMN_WIDTH> 30 </COLUMN_WIDTH>
</TABLE_COLUMNS>
<TABLE_ROWS>
<ROW_HEIGHT> 10 </ROW_HEIGHT>
<ROW_HEIGHT> 10 </ROW_HEIGHT>
<ROW_HEIGHT> 10 </ROW_HEIGHT>
<ROW_HEIGHT> 10 </ROW_HEIGHT>
<ROW_HEIGHT> 10 </ROW_HEIGHT>
<ROW_HEIGHT> 10 </ROW_HEIGHT>
<ROW_HEIGHT> 10 </ROW_HEIGHT>
<ROW_HEIGHT> 10 </ROW_HEIGHT>
<ROW_HEIGHT> 10 </ROW_HEIGHT>
<ROW_HEIGHT> 10 </ROW_HEIGHT>
<ROW_HEIGHT> 10 </ROW_HEIGHT>
<ROW_HEIGHT> 10 </ROW_HEIGHT>
</TABLE_ROWS>
</FORM_TABLE>
<FORM_SCROLLBAR COMMENT="Scroller">
<ID> 1006 </ID>
<BOUNDS>
<LEFT> 153 </LEFT>
<TOP> 16 </TOP>
<WIDTH> 7 </WIDTH>
<HEIGHT> 120 </HEIGHT>
</BOUNDS>
<USABLE> TRUE </USABLE>
<VALUE> 0 </VALUE>
<MIN_VALUE> 0 </MIN_VALUE>
<MAX_VALUE> 0 </MAX_VALUE>
<PAGE_SIZE> 11 </PAGE_SIZE>
</FORM_SCROLLBAR>
</FORM_OBJECTS>
</FORM_RESOURCE>
<FORM_RESOURCE RESOURCE_ID="1100" LOCALE="enUS" COMMENT="About">
<FORM_ID> 1100 </FORM_ID>
<BOUNDS>
<LEFT> 2 </LEFT>
<TOP> 2 </TOP>
<WIDTH> 156 </WIDTH>
<HEIGHT> 156 </HEIGHT>
</BOUNDS>
<USABLE> TRUE </USABLE>
<MODAL> TRUE </MODAL>
<SAVE_BEHIND> TRUE </SAVE_BEHIND>
<HELP_ID> 0 </HELP_ID>
<MENU_ID> 0 </MENU_ID>
<DEFAULT_BUTTON> 0 </DEFAULT_BUTTON>
<TITLE_ICON> FALSE </TITLE_ICON>
<TITLE_BAR_FOCUSABLE> FALSE </TITLE_BAR_FOCUSABLE>
<FORM_OBJECTS>
<FORM_TITLE>
<TEXT> "About Rattail" </TEXT>
</FORM_TITLE>
<FORM_LABEL COMMENT="Title">
<ID> 1102 </ID>
<LOCATION>
<X> 38 </X>
<Y> 27 </Y>
</LOCATION>
<USABLE> TRUE </USABLE>
<FONT_ID> LARGE_BOLD_FONT </FONT_ID>
<TEXT> "Rattail for Palm" </TEXT>
</FORM_LABEL>
<FORM_LABEL COMMENT="Text1">
<ID> 1103 </ID>
<LOCATION>
<X> 16 </X>
<Y> 78 </Y>
</LOCATION>
<USABLE> TRUE </USABLE>
<FONT_ID> STD_FONT </FONT_ID>
<TEXT> "Copyright © 2012 Lance Edgar" </TEXT>
</FORM_LABEL>
<FORM_LABEL COMMENT="Text2">
<ID> 1104 </ID>
<LOCATION>
<X> 50 </X>
<Y> 53 </Y>
</LOCATION>
<USABLE> TRUE </USABLE>
<FONT_ID> BOLD_FONT </FONT_ID>
<TEXT> "Version 1.0" </TEXT>
</FORM_LABEL>
<FORM_BUTTON COMMENT="OK">
<ID> 1105 </ID>
<BOUNDS>
<LEFT> 58 </LEFT>
<TOP> 139 </TOP>
<WIDTH> 40 </WIDTH>
<HEIGHT> 12 </HEIGHT>
</BOUNDS>
<USABLE> TRUE </USABLE>
<ENABLED> TRUE </ENABLED>
<TEXT> "OK" </TEXT>
<LEFT_ANCHOR> TRUE </LEFT_ANCHOR>
<FONT_ID> STD_FONT </FONT_ID>
<BUTTON_FRAME> STANDARD_BUTTON_FRAME </BUTTON_FRAME>
</FORM_BUTTON>
<FORM_LABEL>
<ID> 1000 </ID>
<LOCATION>
<X> 26 </X>
<Y> 105 </Y>
</LOCATION>
<USABLE> TRUE </USABLE>
<FONT_ID> STD_FONT </FONT_ID>
<TEXT> "http://rattail.edbob.org/" </TEXT>
</FORM_LABEL>
</FORM_OBJECTS>
</FORM_RESOURCE>
<MENU_BAR_RESOURCE RESOURCE_ID="1000" LOCALE="enUS" COMMENT="Main Form">
<VISIBLE> TRUE </VISIBLE>
<MENUS>
<MENU COMMENT="MainOptions">
<TITLE> "Options" </TITLE>
<HIDDEN> FALSE </HIDDEN>
<BOUNDS>
<LEFT> 6 </LEFT>
<TOP> 14 </TOP>
<WIDTH> 100 </WIDTH>
<HEIGHT> 11 </HEIGHT>
</BOUNDS>
<TITLE_BOUNDS>
<LEFT> 4 </LEFT>
<TOP> 0 </TOP>
<WIDTH> 47 </WIDTH>
<HEIGHT> 12 </HEIGHT>
</TITLE_BOUNDS>
<MENU_ITEMS>
<MENU_ITEM>
<ID> 1000 </ID>
<TITLE> "About Rattail" </TITLE>
<COMMAND> "" </COMMAND>
<HIDDEN> FALSE </HIDDEN>
</MENU_ITEM>
</MENU_ITEMS>
</MENU>
</MENUS>
</MENU_BAR_RESOURCE>
</PALMOS_RESOURCE_FILE>

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

962
src/AppMain.c Normal file
View file

@ -0,0 +1,962 @@
/******************************************************************************
*
* Copyright (c) 2007, ACCESS Systems Americas, Inc. All Rights Reserved.
*
* File: AppMain.c
*
*****************************************************************************/
#include <PalmOS.h>
// BCS2 Scanner
#include "BCS2ScannerLib.h"
// Janam Scanner
#include "JanamScnCompatible.h"
#include "ScanMgr.h"
// Rattail App
#include "AppResources.h"
#include "AppMain.h"
/***********************************************************************
*
* Entry Points
*
***********************************************************************/
/***********************************************************************
*
* Internal Constants
*
***********************************************************************/
#define appFileCreator 'RTTL' // register your own at http://www.palmos.com/dev/creatorid/
#define appVersionNum 0x01
#define appPrefID 0x00
#define appPrefVersionNum 0x01
#define appDbRattail "Rattail"
#define appDbRattailScan "Rattail_Scan"
#define COLUMN_BARCODE 0
#define COLUMN_CASES 1
#define COLUMN_UNITS 2
/***********************************************************************
*
* Global Variables
*
***********************************************************************/
UInt16 cardNo = 0;
UInt16 gBcs2RefNum = 0;
Boolean gBabbo = false;
//UInt16 gNumCols = 3;
//UInt16 gNumRows = 11;
//MemHandle gHandles[11][3];
Int16 gTopVisibleRecord = -1;
/***********************************************************************
*
* FUNCTION: AppHandleEvent
*
* DESCRIPTION: This routine loads form resources and set the event
* handler for the form loaded.
*
* PARAMETERS: event - a pointer to an EventType structure
*
* RETURNED: true if the event has handle and should not be passed
* to a higher level handler.
*
* REVISION HISTORY:
*
*
***********************************************************************/
static Boolean AppHandleEvent(EventType* pEvent)
{
UInt16 formId;
FormType* pForm;
Boolean handled = false;
if (pEvent->eType == frmLoadEvent) {
// Load the form resource.
formId = pEvent->data.frmLoad.formID;
pForm = FrmInitForm(formId);
FrmSetActiveForm(pForm);
// Set the event handler for the form. The handler of the currently
// active form is called by FrmHandleEvent each time is receives an
// event.
switch (formId) {
case MainForm:
FrmSetEventHandler(pForm, MainFormHandleEvent);
break;
default:
break;
}
handled = true;
}
return handled;
}
/***********************************************************************
*
* FUNCTION: AppStart
*
* DESCRIPTION: Get the current application's preferences.
*
* PARAMETERS: nothing
*
* RETURNED: Err value errNone if nothing went wrong
*
* REVISION HISTORY:
*
*
***********************************************************************/
static Err AppStart(void)
{
OpenBCS2Scanner();
//OpenBabboScanner();
FrmGotoForm(MainForm);
return errNone;
}
/***********************************************************************
*
* FUNCTION: AppStop
*
* DESCRIPTION: Save the current state of the application.
*
* PARAMETERS: nothing
*
* RETURNED: nothing
*
***********************************************************************/
static void AppStop(void)
{
CloseBCS2Scanner();
//CloseBabboScanner();
FrmCloseAllForms();
}
/***********************************************************************
*
* FUNCTION: AppEventLoop
*
* DESCRIPTION: This routine is the event loop for the application.
*
* PARAMETERS: nothing
*
* RETURNED: nothing
*
* REVISION HISTORY:
*
*
***********************************************************************/
static void AppEventLoop(void)
{
Err error;
EventType event;
do {
EvtGetEvent(&event, evtWaitForever);
if (SysHandleEvent(&event))
continue;
if (MenuHandleEvent(0, &event, &error))
continue;
if (AppHandleEvent(&event))
continue;
FrmDispatchEvent(&event);
} while (event.eType != appStopEvent);
}
/***********************************************************************
*
* FUNCTION: CloseBabboScanner
*
***********************************************************************/
/*
static void CloseBabboScanner()
{
if (! gBabbo)
return;
ScnCmdScanDisable();
ScnCloseDecoder();
gBabbo = false;
}
*/
/***********************************************************************
*
* FUNCTION: CloseBCS2Scanner
*
***********************************************************************/
static void CloseBCS2Scanner()
{
LocalID dbId;
if (! gBcs2RefNum)
return;
dbId = DmFindDatabase(cardNo, appDbRattail);
if (dbId)
SysNotifyUnregister(cardNo, dbId, BCS2BarCodeReadyNotification,
sysNotifyNormalPriority);
BCS2LibClose(gBcs2RefNum);
SysLibRemove(gBcs2RefNum);
gBcs2RefNum = 0;
}
/***********************************************************************
*
* FUNCTION: CreateScanDatabase
*
***********************************************************************/
static DmOpenRef CreateScanDatabase()
{
Err err;
LocalID dbId;
UInt16 attrs, version;
DmOpenRef db;
err = DmCreateDatabase(cardNo, appDbRattailScan, appFileCreator, 'SCAN', false);
if (err != errNone)
return NULL;
dbId = DmFindDatabase(cardNo, appDbRattailScan);
if (dbId == 0)
return NULL;
// Set backup flag, version for database.
attrs = dmHdrAttrBackup;
version = 1;
DmSetDatabaseInfo(cardNo, dbId, NULL, &attrs, &version, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL);
db = DmOpenDatabase(cardNo, dbId, dmModeWrite);
if (db == 0)
return NULL;
return db;
}
/***********************************************************************
*
* FUNCTION: DrawCustomTableItem
*
***********************************************************************/
static void DrawCustomTableItem(void* table, Int16 row, Int16 col, RectangleType* bounds)
{
Char * text;
UInt16 size;
Coord x;
text = (Char *) TblGetItemPtr(table, row, col);
if (*text != 0) {
size = StrLen(text);
if (col == 0) { // barcode
WinDrawChars(text, size, bounds->topLeft.x, bounds->topLeft.y);
} else { // cases or units
// Only draw value if nonzero.
if (StrCompareAscii(text, "0") != 0) {
// Draw value right-aligned.
x = bounds->topLeft.x + bounds->extent.x - FntCharsWidth(text, size);
WinDrawChars(text, size, x, bounds->topLeft.y);
}
}
}
}
/***********************************************************************
*
* FUNCTION: GetActiveFieldId
*
***********************************************************************/
static UInt16 GetActiveFieldId(FormPtr form)
{
FieldPtr field;
UInt16 index;
field = FrmGetActiveField(form);
if (field == NULL) {
return NULL;
}
index = FrmGetObjectIndexFromPtr(form, field);
if (index == frmInvalidObjectId) {
return NULL;
}
return FrmGetObjectId(form, index);
}
/***********************************************************************
*
* FUNCTION: GetCheckedValue
*
***********************************************************************/
static Int16 GetCheckedValue(UInt16 objId)
{
FormPtr form;
ControlPtr check;
form = FrmGetActiveForm();
check = GetObjectPtrById(form, objId);
if (check == NULL) {
return false;
}
return CtlGetValue(check);
}
/***********************************************************************
*
* FUNCTION: GetObjectPtrById
*
***********************************************************************/
static void *GetObjectPtrById(FormPtr form, UInt16 objId)
{
UInt16 index;
index = FrmGetObjectIndex(form, objId);
if (index == frmInvalidObjectId) {
return NULL;
}
return FrmGetObjectPtr(form, index);
}
/***********************************************************************
*
* FUNCTION: MainFormDoCommand
*
* DESCRIPTION: This routine performs the menu command specified.
*
* PARAMETERS: command - menu item id
*
* RETURNED: nothing
*
* REVISION HISTORY:
*
*
***********************************************************************/
static Boolean MainFormDoCommand(UInt16 command)
{
Boolean handled = false;
FormType * pForm;
switch (command) {
case MainOptionsAboutStarterApp:
pForm = FrmInitForm(AboutForm);
FrmDoDialog(pForm); // Display the About Box.
FrmDeleteForm(pForm);
handled = true;
break;
}
return handled;
}
/***********************************************************************
*
* FUNCTION: MainFormHandleEvent
*
* DESCRIPTION: This routine is the event handler for the
* "MainForm" of this application.
*
* PARAMETERS: pEvent - a pointer to an EventType structure
*
* RETURNED: true if the event has handle and should not be passed
* to a higher level handler.
*
* REVISION HISTORY:
*
*
***********************************************************************/
static Boolean MainFormHandleEvent(EventPtr event)
{
Boolean handled = false;
FormPtr form;
TablePtr table;
UInt16 objId;
switch (event->eType) {
case frmOpenEvent:
form = FrmGetActiveForm();
MainFormInit(form);
FrmDrawForm(form);
handled = true;
break;
case menuEvent:
handled = MainFormDoCommand(event->data.menu.itemID);
break;
case sclRepeatEvent:
if (event->data.sclRepeat.newValue > event->data.sclRepeat.value)
gTopVisibleRecord += (event->data.sclRepeat.newValue - event->data.sclRepeat.value);
else {
gTopVisibleRecord -= (event->data.sclRepeat.value - event->data.sclRepeat.newValue);
}
form = FrmGetActiveForm();
table = GetObjectPtrById(form, MainFormScanRecords);
MainFormLoadTable(table, false);
TblRedrawTable(table);
break;
case keyDownEvent:
form = FrmGetActiveForm();
// Pressing the ENTER (line feed) key will either advance focus
// to the next quantity field marked to be stopped upon, or else
// will validate and store the current data as a new scan record.
if (event->data.keyDown.chr == 10) { // line feed (ENTER)
objId = GetActiveFieldId(form);
if (objId == MainFormBarcode) {
ProcessScan();
} else if (objId == MainFormCases) {
if (GetCheckedValue(MainFormStopOnUnits)) {
SetFieldFocus(MainFormUnits);
} else {
StoreScanData();
}
} else if (objId == MainFormUnits) {
StoreScanData();
}
// Until I have more to go on, I'm assuming that if a handheld has
// a BCS2-capable scanner, then it is an Aceeca Meazura, and that its
// "center" navigational (hardware) key should be used as the scan
// trigger.
} else if (event->data.keyDown.chr == MzVCentreKey) {
if (gBcs2RefNum) {
if (FrmGetFocus(form) == FrmGetObjectIndex(form, MainFormBarcode))
BCS2LibTriggerOn(gBcs2RefNum);
}
/*
// Handle Babbo key
} else if ((event->data.keyDown.chr & vchrScanKey &&
(event->data.keyDown.keyCode == scanBitHard1)) ||
((event->data.keyDown.chr & vchrScanKey) &&
(event->data.keyDown.keyCode == scanBitHard2))) {
if (gBabbo) {
if (ScnCmdStartDecode() != STATUS_OK) {
SysFatalAlert("Start decode failed!");
}
handled = true;
}
*/
}
break;
/*
// This event is passed by Babbo scanners (Janam handhelds).
case scanDecodeEvent:
if (gBabbo) { // just to be sure?
if (ScnCmdBeep(One_Short_Low) != STATUS_OK) {
SysFatalAlert("Beep failed!");
}
}
break;
*/
default:
break;
}
return handled;
}
/***********************************************************************
*
* FUNCTION: MainFormInit
*
***********************************************************************/
static void MainFormInit(FormPtr form)
{
TablePtr table;
Int16 cols, col, rows, row;
UInt16 index;
ControlPtr ctrl;
table = GetObjectPtrById(form, MainFormScanRecords);
//TblHasScrollBar(table, true);
cols = TblGetNumberOfColumns(table);
rows = TblGetNumberOfRows(table);
for (col = 0; col < cols; col++) {
TblSetCustomDrawProcedure(table, col, DrawCustomTableItem);
TblSetColumnUsable(table, col, true);
for (row = 0; row < rows; row++) {
TblSetItemStyle(table, row, col, customTableItem);
TblSetRowUsable(table, row, false);
}
}
MainFormLoadTable(table, true);
TblRedrawTable(table);
index = FrmGetObjectIndex(form, MainFormCases);
ctrl = FrmGetObjectPtr(form, index);
FldInsert((FieldPtr) ctrl, "0", 1);
// Unit quantity field is "stoppable" by default, unless the scanner is
// BCS2-capable, in which case I assume the handheld is an Aceeca Meazura
// model. Since this model doesn't have numeric keys, I figure it can't
// really support counting (yet?).
if (! gBcs2RefNum) {
index = FrmGetObjectIndex(form, MainFormStopOnUnits);
ctrl = FrmGetObjectPtr(form, index);
CtlSetValue(ctrl, 1);
}
index = FrmGetObjectIndex(form, MainFormUnits);
ctrl = FrmGetObjectPtr(form, index);
FldInsert((FieldPtr) ctrl, "1", 1);
index = FrmGetObjectIndex(form, MainFormBarcode);
FrmSetFocus(form, index);
}
/***********************************************************************
*
* FUNCTION: MainFormLoadTable
*
***********************************************************************/
static void MainFormLoadTable(TablePtr table, Boolean updateScroll)
{
DmOpenRef db;
UInt16 numRecords;
MemHandle recordH;
RatScanDbRecord* recordP;
UInt16 rows, row, rowId;
FormPtr form;
ScrollBarPtr scroll;
db = OpenScanDatabase();
if (db == NULL)
return;
numRecords = DmNumRecords(db);
rows = (numRecords < 12) ? numRecords : 12;
if (gTopVisibleRecord < 0)
gTopVisibleRecord = (numRecords > 12) ? (numRecords - 12) : 0;
for (row = 0; row < rows; row++) {
rowId = gTopVisibleRecord + row;
recordH = DmGetRecord(db, rowId);
recordP = (MemPtr) MemHandleLock(recordH);
TblSetItemPtr(table, row, 0, &recordP->barcode);
if (StrCompareAscii(recordP->cases, "0") != 0)
TblSetItemPtr(table, row, 1, &recordP->cases);
else
TblSetItemPtr(table, row, 1, "");
if (StrCompareAscii(recordP->units, "0") != 0)
TblSetItemPtr(table, row, 2, &recordP->units);
else
TblSetItemPtr(table, row, 2, "");
MemHandleUnlock(recordH);
DmReleaseRecord(db, rowId, false);
TblSetRowID(table, row, rowId);
TblSetRowUsable(table, row, true);
}
DmCloseDatabase(db);
TblMarkTableInvalid(table);
if (updateScroll) {
form = FrmGetActiveForm();
scroll = GetObjectPtrById(form, MainFormScroller);
if (numRecords <= 12)
SclSetScrollBar(scroll, 0, 0, 0, 0);
else
SclSetScrollBar(scroll, gTopVisibleRecord, 0, numRecords - 12, 11);
}
}
/***********************************************************************
*
* FUNCTION: OpenBabboScanner
*
***********************************************************************/
/*
static Boolean OpenBabboScanner()
{
Err err;
if (! ScnIsJanamUnit()) {
SysFatalAlert("Not a Janam unit!");
return false;
}
err = ScnOpenDecoder();
if (err) {
SysFatalAlert("Open decoder failed!");
return false;
}
if (ScnCmdScanEnable() != STATUS_OK) {
SysFatalAlert("Enable scanner failed!");
ScnCloseDecoder();
return false;
}
gBabbo = true;
return true;
}
*/
/***********************************************************************
*
* FUNCTION: OpenBCS2Scanner
*
***********************************************************************/
static Boolean OpenBCS2Scanner()
{
Err err;
LocalID dbId;
err = SysLibLoad('libr', 'BcAp', &gBcs2RefNum);
if (err) {
/*
switch (err) {
case sysErrLibNotFound:
SysFatalAlert("BCS2 library not found!");
break;
case sysErrNoFreeRAM:
SysFatalAlert("Out of memory (RAM)!");
break;
case sysErrNoFreeLibSlots:
SysFatalAlert("No free library slots!");
break;
default:
SysFatalAlert("BCS2 library load failed!");
break;
}
*/
gBcs2RefNum = 0;
return false;
}
err = BCS2LibOpen(gBcs2RefNum);
if (err) {
/*
switch (err) {
case errBCS2MemoryError:
SysFatalAlert("BCS2 threw memory error");
break;
default:
SysFatalAlert("BCS2 library open failed!");
break;
}
*/
SysLibRemove(gBcs2RefNum);
gBcs2RefNum = 0;
return false;
}
dbId = DmFindDatabase(cardNo, appDbRattail);
if (! dbId) {
/*
SysFatalAlert("Find database failed!");
*/
SysLibRemove(gBcs2RefNum);
gBcs2RefNum = 0;
return false;
}
err = SysNotifyRegister(cardNo, dbId,
BCS2BarCodeReadyNotification, NULL,
sysNotifyNormalPriority, NULL);
if (err != errNone) {
/*
SysFatalAlert("Notify registration failed!");
*/
SysLibRemove(gBcs2RefNum);
gBcs2RefNum = 0;
return false;
}
return true;
}
/***********************************************************************
*
* FUNCTION: OpenScanDatabase
*
***********************************************************************/
static DmOpenRef OpenScanDatabase()
{
LocalID dbId;
DmOpenRef db;
dbId = DmFindDatabase(cardNo, appDbRattailScan);
if (dbId == 0)
return CreateScanDatabase();
db = DmOpenDatabase(cardNo, dbId, dmModeWrite);
if (db == 0)
return NULL;
return db;
}
/***********************************************************************
*
* FUNCTION: ProcessScan
*
***********************************************************************/
static void ProcessScan()
{
if (GetCheckedValue(MainFormStopOnCases)) {
SetFieldFocus(MainFormCases);
} else if (GetCheckedValue(MainFormStopOnUnits)) {
SetFieldFocus(MainFormUnits);
}
}
/***********************************************************************
*
* FUNCTION: SetFieldFocus
*
***********************************************************************/
static void SetFieldFocus(UInt16 objId)
{
FormPtr form;
UInt16 index;
FieldPtr field;
form = FrmGetActiveForm();
if (form == NULL) {
return;
}
index = FrmGetObjectIndex(form, objId);
if (index == frmInvalidObjectId) {
return;
}
field = FrmGetObjectPtr(form, index);
FldSetSelection(field, 0, FldGetTextLength(field));
FrmSetFocus(form, index);
}
/***********************************************************************
*
* FUNCTION: StoreScanData
*
***********************************************************************/
static Boolean StoreScanData()
{
FormPtr form;
FieldPtr barcode, cases, units;
UInt16 fieldIndex;
UInt32 size, offset;
DmOpenRef db;
UInt16 recordIndex;
MemHandle recordH;
MemPtr recordP;
TablePtr table;
UInt16 row;
// Get form and barcode field pointers.
form = FrmGetActiveForm();
barcode = GetObjectPtrById(form, MainFormBarcode);
if (barcode == NULL)
return false;
// Set focus to barcode field if empty.
size = FldGetTextLength(barcode);
if (size == 0) {
fieldIndex = FrmGetObjectIndex(form, MainFormBarcode);
if (fieldIndex != frmInvalidObjectId)
FrmSetFocus(form, fieldIndex);
return false;
}
// Get case and unit field pointers.
cases = GetObjectPtrById(form, MainFormCases);
if (cases == NULL)
return false;
units = GetObjectPtrById(form, MainFormUnits);
if (units == NULL)
return false;
// Open the database and create a new record.
db = OpenScanDatabase();
if (db == NULL)
return false;
recordIndex = dmMaxRecordIndex;
recordH = DmNewRecord(db, &recordIndex, sizeof(RatScanDbRecord));
if (recordH == 0) {
DmCloseDatabase(db);
return false;
}
// Write scan data to the record...
recordP = MemHandleLock(recordH);
offset = 0;
size = FldGetTextLength(barcode);
DmWrite(recordP, offset, FldGetTextPtr(barcode), size);
offset += size;
size = 15 - size;
DmSet(recordP, offset, size, 0);
offset += size;
size = FldGetTextLength(cases);
DmWrite(recordP, offset, FldGetTextPtr(cases), size);
offset += size;
size = 4 - size;
DmSet(recordP, offset, size, 0);
offset += size;
size = FldGetTextLength(units);
DmWrite(recordP, offset, FldGetTextPtr(units), size);
offset += size;
size = 4 - size;
DmSet(recordP, offset, size, 0);
// ...then close the record and database.
MemHandleUnlock(recordH);
DmReleaseRecord(db, recordIndex, false);
DmCloseDatabase(db);
// Redraw the table.
table = GetObjectPtrById(form, MainFormScanRecords);
row = TblGetLastUsableRow(table);
if (row == tblUnusableRow)
gTopVisibleRecord = 0;
else if (row == 11)
gTopVisibleRecord = TblGetRowID(table, 1);
MainFormLoadTable(table, true);
TblRedrawTable(table);
SetFieldFocus(MainFormBarcode);
return true;
}
/***********************************************************************
*
* FUNCTION: PilotMain
*
* DESCRIPTION: This is the main entry point for the application.
*
* PARAMETERS: cmd - word value specifying the launch code.
* cmdPB - pointer to a structure that is associated with the launch code.
* launchFlags - word value providing extra information about the launch.
* RETURNED: Result of launch
*
* REVISION HISTORY:
*
*
***********************************************************************/
UInt32 PilotMain(UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
{
Err error = errNone;
SysNotifyParamType* notifyParams = (SysNotifyParamType *) cmdPBP;
FormPtr form;
FieldPtr barcode;
MemHandle barcodeH;
MemPtr barcodeP;
Char * scancode;
switch (cmd) {
case sysAppLaunchCmdNormalLaunch:
if ((error = AppStart()) == 0) {
AppEventLoop();
AppStop();
}
break;
case sysAppLaunchCmdNotify:
if (notifyParams->notifyType == BCS2BarCodeReadyNotification) {
scancode = (Char *) notifyParams->notifyDetailsP + 1;
if (StrCompareAscii(scancode, "NO READ")) { // (means good read)
form = FrmGetActiveForm();
barcode = GetObjectPtrById(form, MainFormBarcode);
barcodeH = FldGetTextHandle(barcode);
FldSetTextHandle(barcode, NULL);
if (! barcodeH)
barcodeH = MemHandleNew(15); // ugh
barcodeP = MemHandleLock(barcodeH);
StrCopy((Char *) barcodeP, scancode);
MemHandleUnlock(barcodeH);
FldSetTextHandle(barcode, barcodeH);
FldDrawField(barcode);
if (GetCheckedValue(MainFormStopOnCases))
SetFieldFocus(MainFormCases);
else if (GetCheckedValue(MainFormStopOnUnits))
SetFieldFocus(MainFormUnits);
else {
if (StoreScanData())
SndPlaySystemSound(sndInfo);
}
}
}
break;
default:
break;
}
return error;
}

25
src/AppMain.h Normal file
View file

@ -0,0 +1,25 @@
typedef struct {
Char barcode[15];
Char cases[4];
Char units[4];
} RatScanDbRecord;
//static void CloseBabboScanner();
static void CloseBCS2Scanner();
static DmOpenRef CreateScanDatabase();
static void DrawCustomTableItem(void* table, Int16 row, Int16 col, RectangleType* bounds);
static UInt16 GetActiveFieldId(FormPtr form);
static Int16 GetCheckedValue(UInt16 objId);
static void *GetObjectPtrById(FormPtr form, UInt16 objId);
static Boolean MainFormHandleEvent(EventPtr event);
static void MainFormInit(FormPtr form);
static void MainFormLoadTable(TablePtr table, Boolean updateScroll);
//static Boolean OpenBabboScanner();
static Boolean OpenBCS2Scanner();
static DmOpenRef OpenScanDatabase();
static void ProcessScan();
static void SetFieldFocus(UInt16 objId);
static Boolean StoreScanData();

65
src/AppResources.h Normal file
View file

@ -0,0 +1,65 @@
//
// Palm App Name: "BasicApp"
//
// Palm App Version: "1.0"
// Resource: tFRM 1000
#define MainForm 1000 //(Left Origin = 0, Top Origin = 0, Width = 160, Height = 160, Usable = 1, Modal = 0, Save Behind = 0, Help ID = 0, Menu Bar ID = 1000, Default Button ID = 0)
#define MainFormScroller 1006
#define MainFormScanRecords 1005
#define MainFormBarcode 1000
#define MainFormStopOnCases 1004
#define MainFormCases 1003
#define MainFormStopOnUnits 1002
#define MainFormUnits 1001
#define AlertTest 1000
// Resource: tFRM 1100
#define AboutForm 1100 //(Left Origin = 2, Top Origin = 2, Width = 156, Height = 156, Usable = 1, Modal = 1, Save Behind = 1, Help ID = 0, Menu Bar ID = 0, Default Button ID = 0)
#define AboutOKButton 1105 //(Left Origin = 58, Top Origin = 139, Width = 40, Height = 12, Usable = 1, Anchor Left = 1, Frame = 1, Non-bold Frame = 1, Font = Standard)
#define AboutTitleLabel 1102 //(Left Origin = 54, Top Origin = 25, Usable = 1, Font = Bold 12)
#define AboutText1Label 1103 //(Left Origin = 23, Top Origin = 54, Usable = 1, Font = Standard)
#define AboutText2Label 1104 //(Left Origin = 50, Top Origin = 104, Usable = 1, Font = Bold)
// Resource: Talt 1001
#define RomIncompatibleAlert 1001
#define RomIncompatibleOK 0
// Resource: MBAR 1000
#define MainFormMenuBar 1000
// Resource: MENU 1000
#define MainOptionsMenu 1000
#define MainOptionsAboutStarterApp 1000
// Resource: PICT 1001
#define Bitmap 1001
// Resource: PICT 1002
#define Bitmap2 1002
// Resource: PICT 1008
#define Bitmap3 1008
// Resource: PICT 1011
#define Bitmap4 1011
// Resource: PICT 1012
#define Bitmap5 1012
// Resource: PICT 1018
#define Bitmap6 1018
// Resource: taif 1000
#define Largeicons12and8bitsAppIconFamily 1000
// Resource: taif 1001
#define Smallicons12and8bitsAppIconFamily 1001

526
src/BCS2ScannerLib.h Normal file
View file

@ -0,0 +1,526 @@
/*----------------------------------------------------------------------------------------------------
Copyright (c) 2003 ACEECA Limited. All rights reserved.
File: BCS2ScannerLib.h
Version: 1.4.3b
Release: 16th March 2005
Description:
Header file for the BCS2 laser barcode scanner API library. Use this file in conjunction
with your project file to incorporate the bar code functionality of an IDV-BCS2
unit from ACEECA Limited. The library checks the hardware to make sure the
Meazura features are present, an error code is returned otherwise. Below is a
summary of the functions included in the library:
BCS2LibOpen:
Opens the BarCodeScanner library, creates and initializes the globals.
This function must be called before any other BarCodeScanner Library functions,
with the exception of BCS2LibGetLibAPIVersion. This library requires at least the
MeazuraLib_V200b.prc shared library to work - an error message will
be returned if the library is of the wrong version. BCS2LibClose must be called
if this is the case.
BCS2LibClose:
Closes the BarCodeScanner libary, frees globals. If other applications still
have the library open, decrements the reference count and returns errBCS2LibStillOpen.
BCS2LibSleep:
Handles system sleep event.
BCS2LibWake:
Handles system wake event.
BCS2LibGetLibAPIVersion:
Get the BCS2 library API version.
BCS2LibTriggerOn:
Triggers the BCS2 module to start reading a barcode. When a valid barcode is received, a
BCS2BarCodeReadyNotification notification will be broadcast to whoever has registered to
receive it. The registering of the notification should be done before calling this function.
Please refer to the "Notification Manager" on page 711 of the Palm OS Programmers' API Reference
for more information on how to use notifications.
BCS2LibTriggerOff:
Tells the BCS2 module to stop triggering immediately.
BCS2LibReset:
Resets the BCS2 module. This function may be useful if the module doesn't seem to respond and may
have gone into a unknown state.
BCS2LibSetToFactoryDefaults:
Sets the BCS2 module to its ACEECA's factory defaults. This will set up the module
with the same settings as it left ACEECA Limited. It has been included for cases where the
module have been reconfigured by a third party and factory defaults are required.
BCS2LibChangeSettings:
This allows the caller to change the barcode scanner module settings eg. symbologies etc.
It accepts configuration strings that will be provided.
History:
03-dec-03 HD: Release beta version BarCodeScannerLib_V100b.prc (120303-1325)
10-dec-03 HD: Modified the library so that the triggering can be better controlled, ie trigger on,
release off. Released as BarCodeScannerLib_V110b.prc (121103-1019)
22-Jan-04 HD: Corrected issue of fatal exceptions when a barcode was received before
trigger button was pressed.
23-Jan-04 HD: Found that UART interrupts were turning off when power was turned off, this is now fixed.
23-Feb-04 HD: Added BCS2LibChangeSettings which allows developers access to configuring the
barcode scanner module using a configuration string.
HD: Also made this header file compatible with GCC compilers.
----------------------------------------------------------------------------------------------------*/
#ifndef __BCS2_LIB_H__
#define __BCS2_LIB_H__
// If we're actually compiling the library code, then we need to
// eliminate the trap glue that would otherwise be generated from
// this header file in order to prevent compiler errors in CW Pro 2.
#ifdef BUILDING_SAMPLE_LIB
#define SAMPLE_LIB_TRAP(trapNum)
#else
#define SAMPLE_LIB_TRAP(trapNum) SYS_TRAP(trapNum)
#endif
// Palm OS common definitions
#include <PalmTypes.h>
#include <SystemResources.h>
#ifdef __MWERKS__
#pragma mark Library Version
#endif
// LIBRARY VERSION
//
// The library version scheme follows the system versioning scheme.
// See sysMakeROMVersion and friends in SystemMgr.h.
//
// For reference:
//
// 0xMMmfsbbb, where MM is major version, m is minor version
// f is bug fix, s is stage: 3-release,2-beta,1-alpha,0-development,
// bbb is build number for non-releases
// V1.12b3 would be: 0x01122003
// V2.00a2 would be: 0x02001002
// V1.01 would be: 0x01013000
#define BCS2LibVersion sysMakeROMVersion(1, 4, 3, sysROMStageBeta, 1)
#ifdef __MWERKS__
#pragma mark Creator Codes
#endif
/********************************************************************
* Type and creator of BarCodeScanner Library database
********************************************************************/
#define BCS2LibCreatorID 'BcAp' // Bar Code scanner Library database creator
#define BCS2LibTypeID 'libr' // Standard library database type
/********************************************************************
* Internal library name which can be passed to SysLibFind()
********************************************************************/
#define BCS2LibName "BCS2 API Library"
#ifdef __MWERKS__
#pragma mark Notifications
#endif
/********************************************************************
* BCS2 notification
********************************************************************/
#define BCS2BarCodeReadyNotification 'BcsN' // Bar code scanner notification
#ifdef __MWERKS__
#pragma mark Error Codes
#endif
/************************************************************
* Bar Code Scanner Library error codes
*************************************************************/
#define errBCS2ParamError (appErrorClass | 0x1) // invalid parameter
#define errBCS2LibNotOpen (appErrorClass | 0x2) // returned if library is not openned
#define errBCS2LibStillOpen (appErrorClass | 0x3) // returned from MzLibClose() if the library is still open by others
#define errBCS2MemoryError (appErrorClass | 0x4) // memory error occurred
#define errBCS2HwFuncNotSupported (appErrorClass | 0x5) // the function being accessed is not available on the current hardware
#define errBCS2WrongMzLibVersion (appErrorClass | 0x6) // the wrong Meazura library version has been loaded
#define errBCS2MzLibLoadError (appErrorClass | 0x7) // an error occured opening the meazura library
#define errBCS2MzScannerError (appErrorClass | 0x8) // scanner engine comms error
/********************************************************************
* Meazura key bit definitions
********************************************************************/
#define MzLeftKeyBit keyBitHard1
#define MzCentreKeyBit keyBitHard2
#define MzRightKeyBit keyBitHard3
#define MzUpKeyBit keyBitPageUp
#define MzDownKeyBit keyBitPageDown
#define MzPowerKeyBit keyBitPower
/********************************************************************
* Meazura virtual keys definitions
********************************************************************/
#define MzVLeftKey chrLeftArrow
#define MzVCentreKey vchrHard1
#define MzVRightKey chrRightArrow
#define MzVUpKey vchrPageUp
#define MzVDownKey vchrPageDown
#define MzVPowerKey vchrAutoOff
#ifdef __MWERKS__
#pragma mark Library Traps
#endif
#define BCS2LibTrapGetLibAPIVersion (sysLibTrapCustom + 0)
#define BCS2LibTrapTriggerOn (sysLibTrapCustom + 1)
#define BCS2LibTrapTriggerOff (sysLibTrapCustom + 2)
#define BCS2LibTrapReset (sysLibTrapCustom + 3)
#define BCS2LibTrapSetToFactoryDefaults (sysLibTrapCustom + 4)
#define BCS2LibTrapChangeSettings (sysLibTrapCustom + 5)
#define BCS2LibTrapLast (sysLibTrapCustom + 6)
#ifdef __MWERKS__
#pragma mark Public Definitions
#endif
/********************************************************************
* Public Definitions
********************************************************************/
#define BCS2MaxBarCodeSize 100
/********************************************************************
* API Prototypes
********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
//--------------------------------------------------
// Standard library open, close, sleep and wake functions
//--------------------------------------------------
#ifdef __MWERKS__
#pragma mark Function Prototypes
#endif
/************************************************************
*
* FUNCTION: BCS2LibOpen
*
* DESCRIPTION: Opens the BarCodeScanner library, creates and initializes the globals.
* This function must be called before any other BarCodeScanner Library functions,
* with the exception of BCS2LibGetLibAPIVersion.
* Does not turn on module power
*
* If BCS2LibOpen fails, do not call any other BarCodeScanner library API functions.
* If BCS2LibOpen succeeds, call BCS2LibClose when you are done using
* the library to enable it to release critical system resources.
*
* LIBRARY DEVELOPER NOTES:
*
* The library's "open" and "close" functions should *not* take an excessive
* amount of time to complete. If the processing time for either of these
* is lengthy, consider creating additional library API function(s) to handle
* the time-consuming chores.
*
*
* PARAMETERS:
* refNum -- BarCodeScanner library reference number returned by SysLibLoad()
* or SysLibFind().
*
* CALLED BY: anyone who wants to use this library
*
* RETURNS: 0 -- no error
* errBCS2MemoryError -- not enough memory to initialize
*
*
* CREATED: 2-Dec-03
*
* BY: Hemon Dey
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
*
*************************************************************/
extern Err BCS2LibOpen(UInt16 refNum)
SAMPLE_LIB_TRAP(sysLibTrapOpen);
/************************************************************
*
* FUNCTION: BCS2LibClose
*
* DESCRIPTION: Closes the BarCodeScanner libary, frees globals.
* Turns off module power
*
* ***IMPORTANT***
* May be called only if BCS2LibOpen succeeded.
*
* If other applications still have the library open, decrements
* the reference count and returns errBCS2LibStillOpen.
*
* LIBRARY DEVELOPER NOTES:
*
* The library's "open" and "close" functions should *not* take an excessive
* amount of time to complete. If the processing time for either of these
* is lengthy, consider creating additional library API function(s) to handle
* the time-consuming chores.
*
* PARAMETERS:
* refNum -- BarCodeScanner library reference number returned by SysLibLoad()
* or SysLibFind().
*
* CALLED BY: Whoever wants to close the BarCodeScanner library
*
* RETURNS: errNone -- no error
* errBCS2LibStillOpen -- library is still open by others (no error)
*
* CREATED: 2-Dec-2003
*
* BY: Hemon Dey
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
*
*************************************************************/
extern Err BCS2LibClose(UInt16 refNum)
SAMPLE_LIB_TRAP(sysLibTrapClose);
/************************************************************
*
* FUNCTION: BCS2LibSleep
*
* DESCRIPTION: Handles system sleep notification.
* Turns off module power
*
* PARAMETERS: refNum -- BarCodeScanner library reference number
*
* CALLED BY: System
*
* RETURNS: errNone -- no error
*
* CREATED: 2-Dec-03
*
* BY: Hemon Dey
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
*
*************************************************************/
extern Err BCS2LibSleep(UInt16 refNum)
SAMPLE_LIB_TRAP(sysLibTrapSleep);
/************************************************************
*
* FUNCTION: BCS2LibWake
*
* DESCRIPTION: Handles system wake notification
* Does not turn on module power
*
* PARAMETERS: refNum -- BarCodeScanner library reference number
*
* CALLED BY: System
*
* RETURNS: errNone -- no error
*
* CREATED: 2-Dec-03
*
* BY: Hemon Dey
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
*
*************************************************************/
extern Err BCS2LibWake(UInt16 refNum)
SAMPLE_LIB_TRAP(sysLibTrapWake);
//--------------------------------------------------
// Custom library API functions
//--------------------------------------------------
/************************************************************
*
* FUNCTION: BCS2LibGetLibAPIVersion
*
* DESCRIPTION: Get the BCS2 library API version.
*
* PARAMETERS: refNum -- BarCodeScanner library reference number
* dwVerP -- pointer to variable for storing the version number
*
* CALLED BY: Anyone wishing to get our library API version
*
* RETURNS: errNone -- no error
*
* CREATED: 2-Dec-03
*
* BY: Hemon Dey
*
* LIBRARY VERSION
*
* The library version scheme follows the system versioning scheme.
* See sysMakeROMVersion and friends in SystemMgr.h.
*
* For reference:
*
* 0xMMmfsbbb, where MM is major version, m is minor version
* f is bug fix, s is stage: 3-release,2-beta,1-alpha,0-development,
* bbb is build number for non-releases
* V1.12b3 would be: 0x01122003
* V2.00a2 would be: 0x02001002
* V1.01 would be: 0x01013000
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
*************************************************************/
extern Err BCS2LibGetLibAPIVersion(UInt16 refNum, UInt32 * dwVerP)
SAMPLE_LIB_TRAP(BCS2LibTrapGetLibAPIVersion);
/************************************************************
*
* FUNCTION: BCS2LibTriggerOn
*
* DESCRIPTION: Trigger on the BCS2 module.
* Turns on scanner power if not already on
*
* PARAMETERS: refNum -- BarCodeScanner library reference number
*
* CALLED BY: Anyone wishing to trigger the BCS2 module to start scanning
*
* RETURNS: errNone -- no error
* errBCS2LibNotOpen -- the library is not open
*
*
* CREATED: 2-Dec-03
*
* BY: Hemon Dey
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
*
*************************************************************/
extern Err BCS2LibTriggerOn(UInt16 refNum)
SAMPLE_LIB_TRAP(BCS2LibTrapTriggerOn);
/************************************************************
*
* FUNCTION: BCS2LibTriggerOff
*
* DESCRIPTION: This function does nothing. Just here for compatibility with BCS1
*
* PARAMETERS: refNum -- BarCodeScanner library reference number
*
* CALLED BY: Anyone wishing to trigger the BCS2 module to start scanning
*
* RETURNS: errNone -- no error
* errBCS2LibNotOpen -- the library is not open
*
*
* CREATED: 2-Dec-03
*
* BY: Hemon Dey
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
*
*************************************************************/
extern Err BCS2LibTriggerOff(UInt16 refNum)
SAMPLE_LIB_TRAP(BCS2LibTrapTriggerOff);
/************************************************************
*
* FUNCTION: BCS2LibReset
*
* DESCRIPTION: Resets the BCS2 module (cycles power to scanner module)
*
* PARAMETERS: refNum -- BarCodeScanner library reference number
*
* CALLED BY: Anyone wishing to reset the BCS2 module.
*
* RETURNS: errNone -- no error
* errBCS2LibNotOpen -- the library is not open
*
* CREATED: 2-Dec-03
*
* BY: Hemon Dey
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
*
*************************************************************/
extern Err BCS2LibReset(UInt16 refNum)
SAMPLE_LIB_TRAP(BCS2LibTrapReset);
/************************************************************
*
* FUNCTION: BCS2LibSetToFactoryDefaults
*
* DESCRIPTION: Sets the BCS2 module to its ACEECA's factory defaults.
* NB. These are the same as Metrologic defaults
*
* PARAMETERS: refNum -- BarCodeScanner library reference number
*
* CALLED BY: Anyone wishing set the BCS module to its factory defaults.
*
* RETURNS: errNone -- no error
* errBCS2LibNotOpen -- the library is not open
*
* CREATED: 2-Dec-03
*
* BY: Hemon Dey
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
*
*************************************************************/
extern Err BCS2LibSetToFactoryDefaults(UInt16 refNum)
SAMPLE_LIB_TRAP(BCS2LibTrapSetToFactoryDefaults);
/************************************************************
*
* FUNCTION: BCS2LibChangeSettings
*
* DESCRIPTION: Changes the settings to the BCS2 module.
*
* PARAMETERS: refNum -> BarCodeScanner library reference number
* str -> The configuration string (one or more 3-charcter commands for IS4120)
* numBytes -> The size of the configuration string (3,6,9,...)
*
* CALLED BY: Anyone wishing to reconfigure the BCS module.
*
* RETURNS: errNone -- no error
* errBCS2LibNotOpen -- the library is not open
*
* CREATED: 2-Dec-03
*
* BY: Hemon Dey
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
*
*************************************************************/
extern Err BCS2LibChangeSettings(UInt16 refNum, UInt8* str, UInt16 numBytes)
SAMPLE_LIB_TRAP(BCS2LibTrapChangeSettings);
// For loading the library in Palm OS Mac emulation mode
extern Err BCS2LibInstall(UInt16 refNum, SysLibTblEntryPtr entryP);
#ifdef __cplusplus
}
#endif
#endif // __BCS2_LIB_H__

58
src/JanamExtended.h Normal file
View file

@ -0,0 +1,58 @@
/******************************************************************************
*
* Extended Functions header
*
* Copyright (c) 2008 Janam Partners LLC. All rights reserved.
*
* File: JanamExtended.h
*
* Release: Palm OS 5.x
*
* Description: Extended Function Supported by BABBO
*
* History:
* Version 1.0 PT, JL Oct, 2006
* Version 1.1 PT, JL May, 2007
* -Add ScnCmdGetSetExposureSettings function
* Version 1.2 PT, JL Sep, 2008
* -Add ScnCmdGetSetDecodeCenteringWindow function
*****************************************************************************/
// Extended functions supported by BABBO devices
#ifndef __JANAMEXTENDED_H__
#define __JANAMEXTENDED_H__
#include "JanamExtendedStruct.h"
//Read Write Symbology Config
Int16 ScnCmdReadSymbologyConfig(UInt8 Query, Int16 nSymId, SymFlagsRange_t *pSymStruct);
Int16 ScnCmdWriteSymbologyConfig(Int16 nSymId, SymFlagsRange_t *pvSym);
//OCR Support
Int16 ScnCmdSetupOCR(UInt8 nFont, char* pszTemplate, char* pszGroupG, char* pszGroupH, char* pszCheckChar);
Int16 ScnCmdGetSetupOCR(UInt8 QueryType, UInt8* pnFont, char* pszTemplate, char* pszGroupG, char* pszGroupH, char* pszCheckChar);
//On Off Aimer and Illum Lights
Int16 ScnCmdAimerOn(Int8 bEnable);
Int16 ScnCmdLightsOn(Int8 bEnable);
//Set the light mode during scan
Int16 ScnCmdGetSetLightsMode(Int8 Set,UInt8 QueryType, UInt8 *pLightsMode);
//ScanWedge
void ScnCmdScanWedge(Boolean state);
//Set the exposure setting of the Scanner
Int16 ScnCmdGetSetExposureMode(Int8 Set, Int8 *pExpMode);
Int16 ScnCmdGetSetExposureSettings(Int8 Set, Int32 * pArray, Int32 dwArrayLength);
//GetSet the decode options
Int16 ScnCmdGetSetDecodeOptions(Int8 Set,UInt8 QueryType, DecodeOptions_t *pDecodeOptions);
//GetSet the centering option
Int16 ScnCmdGetSetDecodeCenteringWindow(Int8 bSet, UInt8 QueryType, Int8 *pbEnabled, RECT *pInt16ersectRect);
#endif

231
src/JanamExtendedDef.h Normal file
View file

@ -0,0 +1,231 @@
/******************************************************************************
*
* Barcode Scanner Common Defines.
*
* Copyright (c) 2006 Janam Partners LLC. All rights reserved.
*
* File: JanamExtendedDef.h
*
* Release: Palm OS 5.x
*
* Description: Extended Defines for using the BABBO devices
*
* History:
* Version 1.0 PT, JL Oct, 2006
*
*****************************************************************************/
#ifndef __JANAMEXTENDEDDEF_H__
#define __JANAMEXTENDEDDEF_H__
//Type Defines
#define LONG long
#define WORD Int16
#define DWORD Int32
//The Max BarCode Length
#define MAXBARCODELENGTH 3750
//-----------------------------------------------------------------------------
//Barcode data types returned
//Added to the current library
#define BCTYPE_CODE32 0x20
#define BCTYPE_PDF417 0x11
//Extended support by BABBO
//Defined at a range of 0x31-0x3F, 0x60-0x6D
#define BCTYPE_AZTEC 0x31
#define BCTYPE_CODE11 0x32
#define BCTYPE_CODE49 0x33
#define BCTYPE_COMPOSITE 0x34
#define BCTYPE_DATAMATRIX 0x35
#define BCTYPE_MAXICODE 0x36
#define BCTYPE_MICROPDF 0x37
#define BCTYPE_POSTNET 0x38
#define BCTYPE_OCR 0x39
#define BCTYPE_QR 0x3A
#define BCTYPE_RSS 0x3B
#define BCTYPE_ISBT 0x3C
#define BCTYPE_BPO 0x3D
#define BCTYPE_CANPOST 0x3E
#define BCTYPE_AUSPOST 0x3F
#define BCTYPE_IATA25 0x60
#define BCTYPE_CODABLOCK 0x61
#define BCTYPE_JAPOST 0x62
#define BCTYPE_PLANET 0x63
#define BCTYPE_DUTCHPOST 0x64
#define BCTYPE_MATRIX25 0x65
#define BCTYPE_CHINAPOST 0x66
#define BCTYPE_KOREAPOST 0x67
#define BCTYPE_TELEPEN 0x68
#define BCTYPE_CODE16K 0x69
#define BCTYPE_POSICODE 0x6A
#define BCTYPE_COUPONCODE 0x6B
#define BCTYPE_USPS4CB 0x6C
#define BCTYPE_IDTAG 0x6D
//-----------------------------------------------------------------------------
// Decoder configuration definitions for each symbology
#define SYMBOLOGY_ENABLE 0x00000001 // Enable Symbology bit
#define SYMBOLOGY_CHECK_ENABLE 0x00000002 // Enable usage of check character
#define SYMBOLOGY_CHECK_TRANSMIT 0x00000004 // Send check character
#define SYMBOLOGY_START_STOP_XMIT 0x00000008 // Include the start and stop characters in the decoded result string
#define SYMBOLOGY_ENABLE_APPEND_MODE 0x00000010 // Code39 append mode
#define SYMBOLOGY_ENABLE_FULLASCII 0x00000020 // Enable Code39 Full ASCII
#define SYMBOLOGY_ENABLE_BASE32 0x00000040 // Code32 (PARAF) enable
#define SYMBOLOGY_NUM_SYS_TRANSMIT 0x00000040 // UPC-A/UPC-e Send Num Sys
#define SYMBOLOGY_2_DIGIT_ADDENDA 0x00000080 // Enable 2 digit Addenda (UPC & EAN)
#define SYMBOLOGY_5_DIGIT_ADDENDA 0x00000100 // Enable 5 digit Addenda (UPC & EAN)
#define SYMBOLOGY_ADDENDA_REQUIRED 0x00000200 // Only allow codes with addenda (UPC & EAN)
#define SYMBOLOGY_ADDENDA_SEPARATOR 0x00000400 // Include Addenda separator space in returned string.
#define SYMBOLOGY_EXPANDED_UPCE 0x00000800 // Extended UPC-E
#define SYMBOLOGY_ISBT_CONCATENATE 0x00000040 // C128 ISBT concatenation
#define SYMBOLOGY_COMPOSITE_UPC 0x00002000 // Enable UPC composite codes
#define SYMBOLOGY_AZTEC_RUNE 0x00004000 // Enable Aztec Run
#define SYMBOLOGY_AUSTRALIAN_BAR_WIDTH 0x00010000 // Include australian postal bar data in string
// Telepen and PosiCode
#define SYMBOLOGY_TELEPEN_OLD_STYLE 0x04000000 // Telepen Old Style mode.
#define SYMBOLOGY_POSICODE_LIMITED_1 0x08000000 // PosiCode Limited of 1
#define SYMBOLOGY_POSICODE_LIMITED_2 0x10000000 // PosiCode Limited of 2
#define SYMBOLOGY_CODABAR_CONCATENATE 0x20000000 // Codabar concatenate.
#define SYMBOLOGY_CODABAR_CONCAT_REQ 0x40000000 // Codabar concatenate required.
#define SYMBOLOGY_EAN13_ISBN_XLATE 0x00080000 // EAN 13-Bookland- ISBN
//-----------------------------------------------------------------------------
// Symbology structure set masks
#define SYM_MASK_FLAGS 0x00000001 // Flags are valid
#define SYM_MASK_MIN_LEN 0x00000002 // Min Length valid
#define SYM_MASK_MAX_LEN 0x00000004 // Max Length valid
#define SYM_MASK_ALL 0x00000007 // All fields valid
//-----------------------------------------------------------------------------
// Define aliases for each symbology structure
#define AZTEC_T SymFlagsRange_t
#define CODABAR_T SymFlagsRange_t
#define CODE11_T SymFlagsRange_t
#define CODE128_T SymFlagsRange_t
#define CODE39_T SymFlagsRange_t
#define CODE49_T SymFlagsRange_t
#define CODE93_T SymFlagsRange_t
#define COMPOSITE_T SymFlagsRange_t
#define DATAMATRIX_T SymFlagsRange_t
#define EAN8_T SymFlagsOnly_t
#define EAN13_T SymFlagsOnly_t
#define INT25_T SymFlagsRange_t
#define MAXICODE_T SymFlagsRange_t
#define MICROPDF_T SymFlagsRange_t
#define PDF417_T SymFlagsRange_t
#define POSTNET_T SymFlagsOnly_t
#define QR_T SymFlagsRange_t
#define RSS_T SymFlagsOnly_t
#define RSSLIM_T SymFlagsOnly_t
#define RSSEXP_T SymFlagsRange_t
#define UPCA_T SymFlagsOnly_t
#define UPCE_T SymFlagsOnly_t
#define UPCE1_T SymFlagsOnly_t
#define BPO_T SymFlagsOnly_t
#define CANPOST_T SymFlagsOnly_t
#define AUSPOST_T SymFlagsOnly_t
#define IATA25_T SymFlagsRange_t
#define CODABLOCK_T SymFlagsRange_t
#define JAPOST_T SymFlagsOnly_t
#define PLANET_T SymFlagsOnly_t
#define DUTCHPOST_T SymFlagsOnly_t
#define MSI_T SymFlagsRange_t
#define TLCODE39_T SymFlagsOnly_t
#define MATRIX25_T SymFlagsRange_t
#define KORPOST_T SymFlagsRange_t
#define TRIOPTIC_T SymFlagsOnly_t
#define CODE25_T SymFlagsRange_t
#define PLESSEY_T SymFlagsRange_t
#define CHINAPOST_T SymFlagsRange_t
#define TELEPEN_T SymFlagsRange_t
#define CODE16K_T SymFlagsRange_t
#define POSICODE_T SymFlagsRange_t
#define COUPONCODE_T SymFlagsOnly_t
#define USPS4STATE_T SymFlagsOnly_t
#define IDTAG_T SymFlagsOnly_t
//define for exposure settings
#define DEC_ES_EXPOSURE_METHOD 0
#define DEC_ES_TARGET_VALUE 1
#define DEC_ES_TARGET_PERCENTILE 2
#define DEC_ES_TARGET_ACCEPT_GAP 3
#define DEC_ES_MAX_EXP 4
#define DEC_ES_MAX_GAIN 5
#define DEC_ES_STARTING_EXP 6
#define DEC_ES_STARTING_GAIN 7
#define DEC_ES_FRAME_RATE 8
#define DEC_ES_CONFORM_IMAGE 9
#define DEC_ES_CONFORM_TRIES 10
#define DEC_ES_SPECULAR_EXCLUSION 11
#define DEC_ES_SPECULAR_SAT 12
#define DEC_ES_SPECULAR_LIMIT 13
#define DEC_ES_FIXED_EXP 14
#define DEC_ES_FIXED_GAIN 15
#define DEC_ES_FIXED_FRAME_RATE 16
#define DEC_ES_CENTER_SAMPLE_WINDOW_TOP 18
#define DEC_ES_CENTER_SAMPLE_WINDOW_BOT 19
#define DEC_ES_CENTER_SAMPLE_WINDOW_LFT 20
#define DEC_ES_CENTER_SAMPLE_WINDOW_RGT 21
#define DEC_ES_CENTER_SAMPLE_WINDOW_H_PER 22
#define DEC_ES_CENTER_SAMPLE_WINDOW_V_PER 23
#define DEC_ES_MIN_EXP 24
#define DEC_MIN_ES_EXPOSURE_METHOD 0
#define DEC_MAX_ES_EXPOSURE_METHOD 2
#define DEC_MIN_ES_TARGET_VALUE 1
#define DEC_MAX_ES_TARGET_VALUE 255
#define DEC_MIN_ES_TARGET_PERCENTILE 1
#define DEC_MAX_ES_TARGET_PERCENTILE 99
#define DEC_MIN_ES_TARGET_ACCEPT_GAP 1
#define DEC_MAX_ES_TARGET_ACCEPT_GAP 50
#define DEC_MIN_ES_MAX_EXP 1
#define DEC_MAX_ES_MAX_EXP 7874
#define DEC_MIN_ES_MAX_GAIN 1
#define DEC_MAX_ES_MAX_GAIN 4
#define DEC_MIN_ES_FRAME_RATE 1
#define DEC_MAX_ES_FRAME_RATE 30
#define DEC_MIN_ES_CONFORM_IMAGE 0
#define DEC_MAX_ES_CONFORM_IMAGE 1
#define DEC_MIN_ES_CONFORM_TRIES 1
#define DEC_MAX_ES_CONFORM_TRIES 8
#define DEC_MIN_ES_SPECULAR_EXCLUSION 0
#define DEC_MAX_ES_SPECULAR_EXCLUSION 4
#define DEC_MIN_ES_SPECULAR_SAT 200
#define DEC_MAX_ES_SPECULAR_SAT 255
#define DEC_MIN_ES_SPECULAR_LIMIT 1
#define DEC_MAX_ES_SPECULAR_LIMIT 5
#define DEC_MIN_ES_FIXED_EXP 1
#define DEC_MAX_ES_FIXED_EXP 7874
#define DEC_MIN_ES_FIXED_GAIN 1
#define DEC_MAX_ES_FIXED_GAIN 4
#define DEC_MIN_ES_FIXED_FRAME_RATE 1
#define DEC_MAX_ES_FIXED_FRAME_RATE 30
#define DEC_MIN_ES_CENTER_SAMPLE_WINDOW_TOP 0
#define DEC_MAX_ES_CENTER_SAMPLE_WINDOW_TOP 479
#define DEC_MIN_ES_CENTER_SAMPLE_WINDOW_BOT 0
#define DEC_MAX_ES_CENTER_SAMPLE_WINDOW_BOT 479
#define DEC_MIN_ES_CENTER_SAMPLE_WINDOW_LFT 0
#define DEC_MAX_ES_CENTER_SAMPLE_WINDOW_LFT 751
#define DEC_MIN_ES_CENTER_SAMPLE_WINDOW_RGT 0
#define DEC_MAX_ES_CENTER_SAMPLE_WINDOW_RGT 751
#define DEC_MIN_ES_CENTER_SAMPLE_WINDOW_H_PER 4
#define DEC_MAX_ES_CENTER_SAMPLE_WINDOW_H_PER 748
#define DEC_MIN_ES_CENTER_SAMPLE_WINDOW_V_PER 1
#define DEC_MAX_ES_CENTER_SAMPLE_WINDOW_V_PER 751
#define DEC_MIN_ES_MIN_EXP 1
#define DEC_MAX_ES_MIN_EXP 7874
#define DEC_AE_METHOD_UNIFORM 0
#define DEC_AE_METHOD_CENTER_ONLY 1
#define DEC_AE_METHOD_CENTER_WEIGHTED 2
//-----------------------------------------------------------------------------
#endif

342
src/JanamExtendedStruct.h Normal file
View file

@ -0,0 +1,342 @@
/******************************************************************************
*
* Barcode Scanner Extended Struct Defines.
*
* Copyright (c) 2006 Janam Partners LLC. All rights reserved.
*
* File: JanamExtendedStruct.h
*
* Release: Palm OS 5.x
*
* Description: Extended Struct and Enum for using BABBO devices
*
* History:
* Version 1.0 PT, JL Oct, 2006
*
*****************************************************************************/
#ifndef __JANAMEXTENDEDSTRUCT_H__
#define __JANAMEXTENDEDSTRUCT_H__
// Image formats Enum
typedef enum
{
IF_RAW_BINARY = 0,
IF_RAW_GRAY
} ImageFormat_t;
// OCR Mode Enum
typedef enum
{
OCR_DISABLED = 0,
OCR_A,
OCR_B,
OCR_MONEY,
OCR_MICR
}OCRMode_t;
// Query Type Enum
typedef enum
{
QT_DEFAULT = 0,
QT_CURRENT
} QueryType_t;
//-----------------------------------------------------------------------------
// Lights mode used during WaitForDecode function calls.
//-----------------------------------------------------------------------------
typedef enum
{
LM_ILLUM_AIMER_OFF=0, // Neither aimers or illumination
LM_AIMER_ONLY, // Aimer only
LM_ILLUM_ONLY, // Illum only
LM_ILLUM_AIMER // Alternating Aimer & illumination(default)
} LightsMode_t;
//-----------------------------------------------------------------------------
// Structure for symbologies with no specified min or max length.
typedef struct _tagSymFlagsOnly
{
Int32 dwStructSize; // Set to sizeof( SymFlagsOnly_t );
Int32 dwMask;
Int32 dwFlags;
} SymFlagsOnly_t, *PSymFlagsOnly_t;
// Structure for symbologies with min & max length.
typedef struct _tagSymFlagsRange
{
Int32 dwStructSize; // Set to sizeof( SymFlagsRange_t );
Int32 dwMask;
Int32 dwFlags;
Int32 dwMinLen;
Int32 dwMaxLen;
} SymFlagsRange_t, *PSymFlagsRange_t;
// Structure of structures, one for each symbology.
typedef struct _tagSymCfg
{
Int32 dwStructSize; // Set to sizeof( SymCfg_t );
// Linear Codes // Flags supported for this code
//---------------------------------------------------------------
CODABAR_T codabar; // Enable,Check,CheckSend,StartStop,Concatenate
CODE11_T code11; // Enable,Check,CheckSend
CODE128_T code128; // Enable
CODE39_T code39; // Enable,Check,CheckSend,StartStop,Append,FullAscii
CODE49_T code49; // Enable
CODE93_T code93; // Enable
COMPOSITE_T composite; // Enable,CompositeUPC
DATAMATRIX_T datamatrix; // Enable
EAN8_T ean8; // Enable,Check,Addenda2,Addenda5,AddendaReq,AddendaSep
EAN13_T ean13; // Enable,Check,Addenda2,Addenda5,AddendaReq,AddendaSep,ISBN Translate
IATA25_T iata25; // Enable
INT25_T int2of5; // Enable,Check,CheckSend
MSI_T msi; // Enable,Check
UPCA_T upcA; // Enable,check,NumSysTrans,Addenda2,Addenda5,AddendaReq,AddendaSep
UPCE_T upcE; // Enable,check,NumSysTrans,Addenda2,Addenda5,AddendaReq,AddendaSep,ExpandedE,
UPCE1_T upcE1; // Enable
// Postal Codes
AUSPOST_T australiaPost; // Enable,AustralianBar
BPO_T britishPost; // Enable
CANPOST_T canadaPost; // Enable
DUTCHPOST_T dutchPost; // Enable
JAPOST_T japanPost; // Enable
PLANET_T usPlanet; // Enable,Check
POSTNET_T usPostnet; // Enable,Check
// 2D Codes
AZTEC_T aztec; // Enable,AztecRune
CODABLOCK_T codablock; // Enable
MAXICODE_T maxicode; // Enable
MICROPDF_T microPDF; // Enable
PDF417_T pdf417; // Enable
QR_T qr; // Enable
RSS_T rss; // Enable
TLCODE39_T tlCode39; // Enable
// New codes
MATRIX25_T matrix25; // Enable,
KORPOST_T koreaPost; // Enable
TRIOPTIC_T triopticCode; // Enable
CODE25_T code2of5; // Enable
PLESSEY_T plesseyCode; // Enable
CHINAPOST_T chinaPost; // Enable
TELEPEN_T telepen; // Enable,OldStyle?
CODE16K_T code16k; // Enable
POSICODE_T posiCode; // Enable,Limited 1 and 2
COUPONCODE_T couponCode; // Enable
USPS4STATE_T usps4Post; // Enable
IDTAG_T idtagPost; // Enable
RSSLIM_T rssLim; // Enable
RSSEXP_T rssExp; // Enable
} SymCfg_t, *PSymCfg_t;
// Intell Img Structure
typedef struct
{
int AspectRatio; // ratioof barcode height to narrow elem width
int OffsetX; // offset in X direction, relative to barcode center
int OffsetY; // offset in Y direction
unsigned int width; // width of image in IntellBarcodeUnits
unsigned int height; // height of image
int resolution; // # pixels/IntellBarcodeUnits
ImageFormat_t format;
unsigned int destNaturalWidthInPixels; // (OUT) base to report native DPI
unsigned int destNaturalHeightInPixels;
unsigned int destWidthInPixels; // (IN) alternative to resolution (if resolution = 0)
unsigned int destHeightInPixels;
} IntellImgDesc_t;
// Image Properties Structure
typedef struct
{
DWORD dwSize;
DWORD dwEngineID;
DWORD dwImagerRows;
DWORD dwImagerCols;
DWORD dwBitsPerPixel;
DWORD dwRotation;
DWORD dwAimerXoffset;
DWORD dwAimerYoffset;
DWORD dwYDepth;
} ImagerProperties_t;
//Image Atributes Structure
typedef struct
{
int Size; // Size of image
int Exposure; //
int Gain; //
int IllumValue; //
int IllumMax; //
int IllumClip; //
} ImageAttributes_t;
//Decode RAW data Structure
typedef struct
{
Int8* pchMessage;
Int8 chCodeID;
Int8 chSymLetter;
Int8 chSymModifier;
Int16 nLength;
} DecodeMsgRaw_t;
//RECT structure
typedef struct _RECT {
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT, *PRECT, *LPRECT;
typedef enum
{
ES_EXPOSURE_METHOD, /* How should we do this */
ES_TARGET_VALUE, /* This is the target pixel count we shoot for */
ES_TARGET_PERCENTILE, /* This goes along with Value, the target value should be at this percentile */
ES_TARGET_ACCEPT_GAP, /* How close to the target value must we be */
ES_MAX_EXP, /* This is the maximum exposure we're allowed to use */
ES_MAX_GAIN, /* This is the maximum gain we're allowed to use */
ES_STARTING_EXP, /* When scanning starts, this is the first exposure that we try (updated when scanning stops)*/
ES_STARTING_GAIN, /* When scanning starts, this is the first gain that we try (updated when scanning stops)*/
ES_FRAME_RATE, /* This is essentially the frame rate to use, I call it divide because that's what it does */
ES_CONFORM_IMAGE, /* The image must conform to the auto-exposure requirements, if not, it's rejected. */
ES_CONFORM_TRIES, /* The number of times we'll attempt to conform. */
ES_SPECULAR_EXCLUSION, /* Do we exclude specular? to what degree? */
ES_SPECULAR_SAT, /* These next two only come into play if somebody specifies nSpecularExclusion*/
ES_SPECULAR_LIMIT, /* to be HHPSD_SPECULAR_EXCLUSION_SPECIAL. */
ES_FIXED_EXP,
ES_FIXED_GAIN,
ES_FIXED_FRAME_RATE,
ES_ADJUST_EXP_WHEN_ILLUM_OFF,
ES_CENTER_SAMPLE_WINDOW_TOP,
ES_CENTER_SAMPLE_WINDOW_BOT,
ES_CENTER_SAMPLE_WINDOW_LFT,
ES_CENTER_SAMPLE_WINDOW_RGT,
ES_CENTER_SAMPLE_WINDOW_H_PER,
ES_CENTER_SAMPLE_WINDOW_V_PER,
ES_MIN_EXP,
ES_NUM_EXPOSURE_ITEMS
} HHP_IMAGER_EXPOSURE_TAG;
typedef enum {
HHPSD_IOCTL_START_SCANNING,
HHPSD_IOCTL_STOP_SCANNING,
HHPSD_IOCTL_GET_NEW_SCAN,
HHPSD_IOCTL_UNREGISTER_SCAN_BUFFER,
HHPSD_IOCTL_REGISTER_SCAN_BUFFER,
HHPSD_IOCTL_GET_SCAN_HEIGHT,
HHPSD_IOCTL_GET_SCAN_WIDTH,
HHPSD_IOCTL_SET_ILLUMINATORS_STATE,
HHPSD_IOCTL_SET_AIMER_STATE,
HHPSD_IOCTL_SET_EXPOSURE_SETTINGS,
HHPSD_IOCTL_GET_EXPOSURE_SETTINGS,
HHPSD_IOCTL_RETURN_SCAN,
HHPSD_IOCTL_SET_SCAN_LIGHTS_MODE,
HHPSD_IOCTL_GET_ENGINE_TYPE,
HHPSD_IOCTL_SET_EXPOSURE_MODE,
HHPSD_IOCTL_SET_ILLUMINATOR_INTENSITY,
HHPSD_IOCTL_SET_AIMER_INTENSITY,
HHPSD_IOCTL_NEW_IMAGE_AVAILABLE,
HHPSD_IOCTL_PREVENT_AIMER_IN_IMAGES,
HHPSD_IOCTL_GET_IMAGE_ATTRIBUTES,
HHPSD_IOCTL_RECONFIG_ENGINE,
HHPSD_IOCTL_SINGLE_FRAME_CAPTURE,
HHPSD_IOCTL_GET_REVISION_STRING,
HHPSD_IOCTL_GET_IMAGER_PROPERTIES,
HHPSD_IOCTL_POWER_OFF_IMAGER,
HHPSD_IOCTL_SET_ENGINE_CONFIG,
HHPSD_IOCTL_GET_ENGINE_CONFIG,
HHPSD_IOCTL_WRITE_PSOC_REG,
HHPSD_IOCTL_READ_PSOC_REG,
HHPSD_IOCTL_WRITE_PSOC,
HHPSD_IOCTL_READ_PSOC
// HHPSD_IOCTL_WRITE_I2C_PSOC,
// HHPSD_IOCTL_READ_I2C_PSOC
}HHPScanDriverIOCTL_t;
typedef enum {
HHPSD_EXPOSURE_FIXED,
HHPSD_AUTOEXPOSURE_USE_ONCHIP,
HHPSD_AUTOEXPOSURE_USE_HHP
}HHPScanDriverAutoExposureMode_t;
typedef enum {
HHPSD_ILLUM_AIMER_OFF,
HHPSD_ILLUM_ONLY_ON,
HHPSD_AIMER_ONLY_ON,
HHPSD_ILLUM_AIMER_ON
} HHPScanDriverIlluminationStates_t;
typedef enum {
HHPSD_AE_METHOD_UNIFORM,
HHPSD_AE_METHOD_CENTER_ONLY,
HHPSD_AE_METHOD_CENTER_WEIGHTED
} HHPScanDriverHHPExposureMethod;
typedef enum {
HHPSD_SPECULAR_EXCLUSION_OFF,
HHPSD_SPECULAR_EXCLUSION_MINIMAL,
HHPSD_SPECULAR_EXCLUSION_MODERATE,
HHPSD_SPECULAR_EXCLUSION_AGGRESSIVE,
HHPSD_SPECULAR_EXCLUSION_SPECIAL
} HHPScanDriverHHPExposureSpecularExclusion;
typedef enum {
HHPSD_ENGINE_IMAGER_OV7120,
HHPSD_ENGINE_IMAGER_ICMEDIA,
HHPSD_ENGINE_LINEAR_IMAGER_TOSHIBA,
HHPSD_ENGINE_IMAGER_ALD_ICMEDIA,
HHPSD_ENGINE_IMAGER_MI1300,
HHPSD_ENGINE_IMAGER_STM_VC700,
HHPSD_ENGINE_IMAGER_STM_VC602,
HHPSD_ENGINE_IMAGER_MICRON_MT9V022
} HHPScanDriverEngineType_t;
typedef enum {
HHPSD_IMAGE_STAT_EXPOSURE,
HHPSD_IMAGE_STAT_GAIN,
HHPSD_IMAGE_STAT_ILLUM_VALUE,
HHPSD_IMAGE_STAT_ILLUM_MAXIMUM,
HHPSD_IMAGE_STAT_ILLUM_CLIP,
HHPSD_IMAGE_STAT_HEIGHT,
HHPSD_IMAGE_STAT_WIDTH
} HHPScanDriverImageAttributes_t;
typedef enum {
IP_SIZE,
IP_ENGINE_ID,
IP_NUM_ROWS,
IP_NUM_COLS,
IP_BITS_PER_PIXEL,
IP_ROTATION,
IP_AIMER_X_OFFSET,
IP_AIMER_Y_OFFSET,
IP_YDEPTH
} HHPScanDriverImagerProperties_t;
typedef enum {
HHPSD_ILLUMINATION_TYPE,
HHPSD_LED_CONTROL_MODE,
HHPSD_PIXEL_CLOCK_FREQUENCY,
HHPSD_ENGINE_ID,
HHPSD_ENGINE_FW_CKSUM,
HHPSD_ENGINE_FW_VERSION,
HHPSD_ENGINE_AIMER_X_CENTER,
HHPSD_ENGINE_AIMER_Y_CENTER,
HHSD_NUM_ENGINE_CFG_ITEMS
} HHPScanDriverEngineConfiguration_t;
#endif

124
src/JanamScnCompatible.h Normal file
View file

@ -0,0 +1,124 @@
/******************************************************************************
*
* Conversion between old functions to new functions
*
* Copyright (c) 2006 Janam Partners LLC. All rights reserved.
*
* File: JanamExtendedStruct.h
*
* Release: Palm OS 5.x
*
* Description: Extended Struct for using BABBO devices
*
* History:
* Version 1.0 PT, JL Oct, 2006
*
*****************************************************************************/
#define ScanOpenDecoder ScnOpenDecoder
#define ScanCloseDecoder ScnCloseDecoder
#define ScanCmdScanDisable ScnCmdScanDisable
#define ScanCmdScanEnable ScnCmdScanEnable
#define ScanCmdStartDecode ScnCmdStartDecode
#define ScanCmdStopDecode ScnCmdStopDecode
#define ScanCmdAimOn ScnCmdAimOn
#define ScanCmdAimOff ScnCmdAimOff
#define ScanCmdSendParams ScnCmdSendParams
#define ScanCmdGetAllParams ScnCmdGetAllParams
#define ScanCmdBeep ScnCmdBeep
#define ScanGetDecodedData ScnGetDecodedData
#define ScanGetExtendedDecodedData ScnGetExtendedDecodedData
#define ScanCmdParamDefaults ScnCmdParamDefaults
#define ScanGetDecoderVersion ScnGetDecoderVersion
#define ScanGetScanManagerVersion ScnGetScanManagerVersion
#define ScanGetScanPortDriverVersion ScnGetScanPortDriverVersion
#define ScanSetBarcodeEnabled ScnSetBarcodeEnabled
#define ScanGetBarcodeEnabled ScnGetBarcodeEnabled
#define ScanSetDecodeUpcEanSupplementals ScnSetDecodeUpcEanSupplementals
#define ScanGetDecodeUpcEanSupplementals ScnGetDecodeUpcEanSupplementals
#define ScanSetDecodeUpcEanRedundancy ScnSetDecodeUpcEanRedundancy
#define ScanGetDecodeUpcEanRedundancy ScnGetDecodeUpcEanRedundancy
#define ScanSetTransmitCheckDigit ScnSetTransmitCheckDigit
#define ScanGetTransmitCheckDigit ScnGetTransmitCheckDigit
#define ScanSetUpcPreamble ScnSetUpcPreamble
#define ScanGetUpcPreamble ScnGetUpcPreamble
#define ScanSetConvert ScnSetConvert
#define ScanGetConvert ScnGetConvert
#define ScanSetEanZeroExtend ScnSetEanZeroExtend
#define ScanGetEanZeroExtend ScnGetEanZeroExtend
#define ScanSetUpcEanSecurityLevel ScnSetUpcEanSecurityLevel
#define ScanGetUpcEanSecurityLevel ScnGetUpcEanSecurityLevel
#define ScanSetCode32Prefix ScnSetCode32Prefix
#define ScanGetCode32Prefix ScnGetCode32Prefix
#define ScanSetBarcodeLengths ScnSetBarcodeLengths
#define ScanGetBarcodeLengths ScnGetBarcodeLengths
#define ScanSetCode39CheckDigitVerification ScnSetCode39CheckDigitVerification
#define ScanGetCode39CheckDigitVerification ScnGetCode39CheckDigitVerification
#define ScanSetI2of5CheckDigitVerification ScnSetI2of5CheckDigitVerification
#define ScanGetI2of5CheckDigitVerification ScnGetI2of5CheckDigitVerification
#define ScanSetClsiEditing ScnSetClsiEditing
#define ScanGetClsiEditing ScnGetClsiEditing
#define ScanSetNotisEditing ScnSetNotisEditing
#define ScanGetNotisEditing ScnGetNotisEditing
#define ScanSetMsiPlesseyCheckDigits ScnSetMsiPlesseyCheckDigits
#define ScanGetMsiPlesseyCheckDigits ScnGetMsiPlesseyCheckDigits
#define ScanSetMsiPlesseyCheckDigitAlgorithm ScnSetMsiPlesseyCheckDigitAlgorithm
#define ScanGetMsiPlesseyCheckDigitAlgorithm ScnGetMsiPlesseyCheckDigitAlgorithm
#define ScanSetLaserOnTime ScnSetLaserOnTime
#define ScanGetLaserOnTime ScnGetLaserOnTime
#define ScanSetAimDuration ScnSetAimDuration
#define ScanGetAimDuration ScnGetAimDuration
#define ScanSetTriggeringModes ScnSetTriggeringModes
#define ScanGetTriggeringModes ScnGetTriggeringModes
#define ScanSetTimeOutBetweenSameSymbol ScnSetTimeOutBetweenSameSymbol
#define ScanGetTimeOutBetweenSameSymbol ScnGetTimeOutBetweenSameSymbol
#define ScanSetParameterScanning ScnSetParameterScanning
#define ScanGetParameterScanning ScnGetParameterScanning
#define ScanSetLinearCodeTypeSecurityLevel ScnSetLinearCodeTypeSecurityLevel
#define ScanGetLinearCodeTypeSecurityLevel ScnGetLinearCodeTypeSecurityLevel
#define ScanSetBidirectionalRedundancy ScnSetBidirectionalRedundancy
#define ScanGetBidirectionalRedundancy ScnGetBidirectionalRedundancy
#define ScanSetTransmitCodeIdCharacter ScnSetTransmitCodeIdCharacter
#define ScanGetTransmitCodeIdCharacter ScnGetTransmitCodeIdCharacter
#define ScanSetPrefixSuffixValues ScnSetPrefixSuffixValues
#define ScanGetPrefixSuffixValues ScnGetPrefixSuffixValues
#define ScanSetScanDataTransmissionFormat ScnSetScanDataTransmissionFormat
#define ScanSetAngle ScnSetAngle
#define ScanGetAngle ScnGetAngle
#define ScanGetScanDataTransmissionFormat ScnGetScanDataTransmissionFormat
#define ScanCmdLedOn ScnCmdLedOn
#define ScanCmdLedOff ScnCmdLedOff
#define ScanSetHostSerialResponseTimeOut ScnSetHostSerialResponseTimeOut
#define ScanGetHostSerialResponseTimeOut ScnGetHostSerialResponseTimeOut
#define ScanSetHostCharacterTimeOut ScnSetHostCharacterTimeOut
#define ScanGetHostCharacterTimeOut ScnGetHostCharacterTimeOut
#define ScanSetIntercharacterDelay ScnSetIntercharacterDelay
#define ScanGetIntercharacterDelay ScnGetIntercharacterDelay
#define ScanSetBeepAfterGoodDecode ScnSetBeepAfterGoodDecode
#define ScanGetBeepAfterGoodDecode ScnGetBeepAfterGoodDecode
#define ScanSetBeepDuration ScnSetBeepDuration
#define ScanGetBeepDuration ScnGetBeepDuration
#define ScanSetBeepFrequency ScnSetBeepFrequency
#define ScanGetBeepFrequency ScnGetBeepFrequency
#define ScanSetDecodeLedOnTime ScnSetDecodeLedOnTime
#define ScanGetDecodeLedOnTime ScnGetDecodeLedOnTime
#define ScanGetAimMode ScnGetAimMode
#define ScanGetScanEnabled ScnGetScanEnabled
#define ScanGetLedState ScnGetLedState
#define ScanIsPalmSymbolUnit ScnIsJanamUnit
#define ScanSetCode39FullAscii ScnSetCode39FullAscii
#define ScanGetCode39FullAscii ScnGetCode39FullAscii
#define ScanCmdTrigSledOn ScnCmdTrigSledOn
#define ScanCmdTrigSledOff ScnCmdTrigSledOff
#define ScanGetTrigSledMode ScnGetTrigSledMode
//The followings are extended functions supported by BABBO devices
//Define as ScanCmd<FunctionName> are only for convenience
#define ScanCmdReadSymbologyConfig ScnCmdReadSymbologyConfig
#define ScanCmdWriteSymbologyConfig ScnCmdWriteSymbologyConfig
#define ScanCmdSetupOCR ScnCmdSetupOCR
#define ScanCmdGetSetupOCR ScnCmdGetSetupOCR
#define ScanCmdAimerOn ScnCmdAimerOn
#define ScanCmdLightsOn ScnCmdLightsOn

1496
src/MeazuraLib_V305.h Normal file

File diff suppressed because it is too large Load diff

231
src/ScanMgr.h Normal file
View file

@ -0,0 +1,231 @@
/******************************************************************************
*
* Barcode Scanner Demo Application
*
* Copyright (c) 2006 Janam Partners LLC. All rights reserved.
*
* File: ScanMgr.h
*
* Release: Palm OS 5.x
*
* Description: Reserved for backward compatible
* Utility functions header
*
* History:
* Version 1.0 PT, JL Oct, 2006
*
*****************************************************************************/
//#pragma once
#ifndef __SCANMGR_H__
#define __SCANMGR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "ScanMgrStruct.h"
#include "ScanMgrDef.h"
#include "ScanWedge.h"
#include "JanamExtended.h"
//--------------------------------------------------------------------------------------------------
//Check if it is a Janam device
Int16 ScnIsJanamUnit();
//--------------------------------------------------------------------------------------------------
//Connect or disconnect the barcode scanner library
Int16 ScnOpenDecoder();
Int16 ScnCloseDecoder();
//Send or retrieve parameters
Int16 ScnCmdSendParams( BeepType beep );
Int16 ScnCmdGetAllParams( UInt8* pbParams, UInt16 max_length );
//Inquire current scanner/decoder/port driver versions
Int16 ScnGetScanManagerVersion( Char * pszVer, UInt16 max_length );
Int16 ScnGetScanPortDriverVersion( Char * pszVer, UInt16 max_length );
Int16 ScnGetDecoderVersion( Char * pszVer, UInt16 max_length);
//Get the decode and extended data
Int16 ScnGetDecodedData( MESSAGE *ptr);
Int16 ScnGetExtendedDecodedData( Int16 length, Int16 *type, UInt8 *extendedData);
//Enable or disable a barcode symbology
Int16 ScnSetBarcodeEnabled( BarType barcodeType, Boolean bEnable );
Int16 ScnGetBarcodeEnabled( BarType barcodeType );
//Set and get the barcode length of a barcode symbology
Int16 ScnSetBarcodeLengths( BarType barcodeType, UInt16 lengthType, UInt16 length1, UInt16 length2 );
Int16 ScnGetBarcodeLengths( BarType barcodeType, UInt16* pLengthType, UInt16* pLength1, UInt16* pLength2 );
//--------------------------------------------------------------------------------------------------
//UpcPreamble
Int16 ScnSetUpcPreamble( BarType barcodeType, Int16 preamble);
Int16 ScnGetUpcPreamble( BarType barcodeType);
//Prefix Suffix
Int16 ScnSetPrefixSuffixValues( Int8 prefix, Int8 suffix_1, Int8 suffix_2 );
Int16 ScnGetPrefixSuffixValues( Char * pPrefix, Char * pSuffix_1, Char * pSuffix_2 );
//Code32
Int16 ScnSetCode32Prefix( Boolean bEnable );
Int16 ScnGetCode32Prefix(void);
//Conversion
Int16 ScnSetConvert( ConvertType conversion, Boolean bEnable);
Int16 ScnGetConvert( ConvertType conversion);
//Check Digit
Int16 ScnSetTransmitCheckDigit( BarType barType, UInt16 check_digit );
Int16 ScnGetTransmitCheckDigit( BarType barType );
//Code 39 Check Digit Verification
Int16 ScnSetCode39CheckDigitVerification(UInt16 check_digit);
Int16 ScnGetCode39CheckDigitVerification(void);
//I2of5 Check Digit Verification
Int16 ScnSetI2of5CheckDigitVerification( UInt16 check_digit );
Int16 ScnGetI2of5CheckDigitVerification(void);
//Msi Plessy Check Digit
Int16 ScnSetMsiPlesseyCheckDigits( UInt16 check_digits );
Int16 ScnGetMsiPlesseyCheckDigits();
//Msi Plessy Check Algorithm
Int16 ScnSetMsiPlesseyCheckDigitAlgorithm( UInt16 algorithm );
Int16 ScnGetMsiPlesseyCheckDigitAlgorithm();
//Upc Ean Supplementals
Int16 ScnSetDecodeUpcEanSupplementals( UInt16 supplementals );
Int16 ScnGetDecodeUpcEanSupplementals();
//Upc Ean Reducdancy
Int16 ScnSetDecodeUpcEanRedundancy( UInt16 supplemental_redundancy );
Int16 ScnGetDecodeUpcEanRedundancy();
//Code 39 Full ASCII
Int16 ScnSetCode39FullAscii( Boolean bEnable );
Int16 ScnGetCode39FullAscii(void);
//CLSI Editing
Int16 ScnSetClsiEditing( Boolean bEnable );
Int16 ScnGetClsiEditing();
//Notis Editing
Int16 ScnSetNotisEditing( Boolean bEnable );
Int16 ScnGetNotisEditing();
//UPC EAN Security Level
Int16 ScnSetUpcEanSecurityLevel( UInt16 security_level );
Int16 ScnGetUpcEanSecurityLevel();
//EAN Zero Extend
Int16 ScnSetEanZeroExtend( Boolean bEnable );
Int16 ScnGetEanZeroExtend();
//Time out
Int16 ScnSetHostSerialResponseTimeOut( UInt16 time_out );
Int16 ScnGetHostSerialResponseTimeOut();
//--------------------------------------------------------------------------------------------------
//Reset to factory default
Int16 ScnCmdParamDefaults();
//Enable or disable Scanning function
Int16 ScnCmdScanEnable();
Int16 ScnCmdScanDisable();
//Start or stop decode function
Int16 ScnCmdStartDecode();
Int16 ScnCmdStopDecode();
//LED On Off
Int16 ScnCmdLedOn();
Int16 ScnCmdLedOff();
//Aimer On Off
Int16 ScnCmdAimOn();
Int16 ScnCmdAimOff();
//Get current status
Int16 ScnGetAimMode();
Int16 ScnGetScanEnabled();
Int16 ScnGetLedState();
//--------------------------------------------------------------------------------------------------
//Set Laser
Int16 ScnSetLaserOnTime( UInt16 laser_on_time);
Int16 ScnGetLaserOnTime();
//Set decode led on time
Int16 ScnSetDecodeLedOnTime( UInt16 led_on_time);
Int16 ScnGetDecodeLedOnTime();
//Set Angle
Int16 ScnSetAngle( UInt16 scan_angle );
Int16 ScnGetAngle();
//Set aim duration
Int16 ScnSetAimDuration( UInt16 aim_duration);
Int16 ScnGetAimDuration();
//Set triggering modes
Int16 ScnSetTriggeringModes( UInt16 triggering_mode);
Int16 ScnGetTriggeringModes();
//Set time out
Int16 ScnSetTimeOutBetweenSameSymbol( UInt16 time_out );
Int16 ScnGetTimeOutBetweenSameSymbol();
//Set Linear Security Level
Int16 ScnSetLinearCodeTypeSecurityLevel( UInt16 security_level );
Int16 ScnGetLinearCodeTypeSecurityLevel();
//Set Bidirectional Redundancy
Int16 ScnSetBidirectionalRedundancy( UInt16 redundancy );
Int16 ScnGetBidirectionalRedundancy();
//Set Transmit Code Id Character
Int16 ScnSetTransmitCodeIdCharacter( UInt16 code_id );
Int16 ScnGetTransmitCodeIdCharacter();
//Set Scan Data Transmission
Int16 ScnSetScanDataTransmissionFormat( UInt16 transmission_format );
Int16 ScnGetScanDataTransmissionFormat();
//--------------------------------------------------------------------------------------------------
//Beep Sound
Int16 ScnCmdBeep( BeepType beep );
//Set beep sound for decoding
Int16 ScnSetBeepAfterGoodDecode( Boolean bEnableBeep );
Int16 ScnGetBeepAfterGoodDecode();
//Set beep sound frequency
Int16 ScnSetBeepFrequency( FrequencyType type, Int16 beep_freq );
Int16 ScnGetBeepFrequency( FrequencyType type );
//Set beep duration
Int16 ScnSetBeepDuration( DurationType type, Int16 beep_duration );
Int16 ScnGetBeepDuration( DurationType type );
//--------------------------------------------------------------------------------------------------
//Set sled function
Int16 ScnCmdTrigSledOn();
Int16 ScnCmdTrigSledOff();
Int16 ScnGetTrigSledMode();
#ifdef __cplusplus
}
#endif
#endif

237
src/ScanMgrDef.h Normal file
View file

@ -0,0 +1,237 @@
/******************************************************************************
*
* Barcode Scanner Common Defines.
*
* Copyright (c) 2006 Janam Partners LLC. All rights reserved.
*
* File: ScanMgrDef.h
*
* Release: Palm OS 5.x
*
* Description: Reserved for backward compatible
* Common defines for the scanner library
* Extended defines are in JanamExtendedDef.h
* History:
* Version 1.0 PT, JL Oct, 2006
*
*****************************************************************************/
#ifndef __SCANMGRDEF_H__
#define __SCANMGRDEF_H__
//#pragma once
#include "JanamExtendedDef.h"
/*******************************************************************
* Symbol unit hardware token (checked in ScanIsPalmSymbolUnit)
*******************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#define SymbolROMToken 'scnr'
//-----------------------------------------------------------------------------
//Defines for Backward Compatible
//Beep Frequecy and Duration
#define MIN_BEEP_DURATION 0
#define MAX_BEEP_DURATION 10000
#define MIN_BEEP_FREQUENCY 0
#define MAX_BEEP_FREQUENCY 15000
#define MIN_UPCEAN_REDUNDANCY 2
#define MAX_UPCEAN_REDUNDANCY 20
#define MIN_LASER_ON_TIME 5
#define MAX_LASER_ON_TIME 99
#define MAX_AIM_DURATION 99
#define MAX_TIMEOUT_BETWEEN_SYMBOL 10
#define MAX_DECODE_LED_ON_TIME 100
//-----------------------------------------------------------------------------
//Beep and Scanner Range Values
#define SHORT_BEEP_DUR 0x20
#define MEDIUM_BEEP_DUR 0x21
#define LONG_BEEP_DUR 0x22
#define HIGH_FREQ 0x23
#define MEDIUM_FREQ 0x24
#define LOW_FREQ 0x25
#define DECODE_BEEP_DUR 0x27
#define DECODE_BEEP_FREQ 0x28
//-----------------------------------------------------------------------------
//Error Code Returns
#define STATUS_OK 0
#define NOT_SUPPORTED -2
#define COMMUNICATIONS_ERROR -3
#define BAD_PARAM -4
#define BATCH_ERROR -5
#define ERROR_UNDEFINED -6
//-----------------------------------------------------------------------------
//Triggering Modes
#define LEVEL 0x00
#define PULSE 0x02
#define HOST 0x08
//-----------------------------------------------------------------------------
//Enable or Disable
#define DISABLE 0x00
#define ENABLE 0x01
//-----------------------------------------------------------------------------
//Security Levels
#define SECURITY_LEVEL0 0x00
#define SECURITY_LEVEL1 0x01
#define SECURITY_LEVEL2 0x02
#define SECURITY_LEVEL3 0x03
#define SECURITY_LEVEL4 0x04
//-----------------------------------------------------------------------------
//Supplementals
#define IGNORE_SUPPLEMENTALS 0x00
#define DECODE_SUPPLEMENTALS 0x01
#define AUTODISCRIMINATE_SUPPLEMENTALS 0x02
//-----------------------------------------------------------------------------
//Transmit Check Digit
#define DO_NOT_TRANSMIT_CHECK_DIGIT 0x00
#define TRANSMIT_CHECK_DIGIT 0x01
//-----------------------------------------------------------------------------
//Preamble
#define NO_PREAMBLE 0x00
#define SYSTEM_CHARACTER 0x01
#define SYSTEM_CHARACTER_COUNTRY_CODE 0x02
//-----------------------------------------------------------------------------
//Discrete Length
#define ANY_LENGTH 0x00
#define ONE_DISCRETE_LENGTH 0x01
#define TWO_DISCRETE_LENGTHS 0x02
#define LENGTH_WITHIN_RANGE 0x03
//-----------------------------------------------------------------------------
//Check Digit Verification
#define DISABLE_CHECK_DIGIT 0x00
#define USS_CHECK_DIGIT 0x01
#define OPCC_CHECK_DIGIT 0x02
//-----------------------------------------------------------------------------
// MSI Plessy Check Digits
#define ONE_CHECK_DIGIT 0x00
#define TWO_CHECK_DIGITS 0x01
//-----------------------------------------------------------------------------
// MSI Plessey check digit algorithms
#define MOD10_MOD11 0x00
#define MOD10_MOD10 0x01
//-----------------------------------------------------------------------------
// Aimer Code ID
#define AIM_CODE_ID_CHARACTER 0x01
#define SYMBOL_CODE_ID_CHARACTER 0x02
//-----------------------------------------------------------------------------
// Prefix and Suffix Values
#define PREFIX_SUFFIX_VALUES_P 0x69
#define PREFIX_SUFFIX_VALUES_S1 0x68
#define PREFIX_SUFFIX_VALUES_S2 0x6A
//-----------------------------------------------------------------------------
// Scan Data Formats
#define DATA_AS_IS 0x00
#define DATA_SUFFIX1 0x01
#define DATA_SUFFIX2 0x02
#define DATA_SUFFIX1_SUFFIX2 0x03
#define PREFIX_DATA 0x04
#define PREFIX_DATA_SUFFIX1 0x05
#define PREFIX_DATA_SUFFIX2 0x06
#define PREFIX_DATA_SUFFIX1_SUFFIX2 0x07
//-----------------------------------------------------------------------------
// Scan Angles
#define SCAN_ANGLE_WIDE 0xB6
#define SCAN_ANGLE_NARROW 0xB5
//-----------------------------------------------------------------------------
// Barcode data types returned
#define BCTYPE_NOT_APPLICABLE 0x00
#define BCTYPE_CODE39 0x01
#define BCTYPE_CODABAR 0x02
#define BCTYPE_CODE128 0x03
#define BCTYPE_D2OF5 0x04
#define BCTYPE_IATA2OF5 0x05
#define BCTYPE_I2OF5 0x06
#define BCTYPE_CODE93 0x07
#define BCTYPE_UPCA 0x08
#define BCTYPE_UPCA_2SUPPLEMENTALS 0x48
#define BCTYPE_UPCA_5SUPPLEMENTALS 0x88
#define BCTYPE_UPCE0 0x09
#define BCTYPE_UPCE0_2SUPPLEMENTALS 0x49
#define BCTYPE_UPCE0_5SUPPLEMENTALS 0x89
#define BCTYPE_EAN8 0x0A
#define BCTYPE_EAN8_2SUPPLEMENTALS 0x4A
#define BCTYPE_EAN13_5SUPPLEMENTALS 0x8B
#define BCTYPE_EAN8_5SUPPLEMENTALS 0x8A
#define BCTYPE_EAN13 0x0B
#define BCTYPE_EAN13_2SUPPLEMENTALS 0x4B
#define BCTYPE_MSI_PLESSEY 0x0E
#define BCTYPE_EAN128 0x0F
#define BCTYPE_UPCE1 0x10
#define BCTYPE_UPCE1_2SUPPLEMENTALS 0x50
#define BCTYPE_UPCE1_5SUPPLEMENTALS 0x90
#define BCTYPE_CODE39_FULL_ASCII 0x13
#define BCTYPE_TRIOPTIC_CODE39 0x15
#define BCTYPE_BOOKLAND_EAN 0x16
#define BCTYPE_COUPON_CODE 0x17
#define BCTYPE_ISBT128 0x19
//-----------------------------------------------------------------------------
#define EXTENDED_DATA_FLAG 0x01
typedef enum tagSymbolEvent
{
scanDecodeEvent = 0x7fffU + 0x800, // A decode event has finished
scanBatteryErrorEvent, // Low Battery
scanTriggerEvent, // A scan attempt was initiated
s24BatteryErrorEvent,
symbolRFUA,
symbolRFUB,
symbolRFUC,
symbolRFUD,
symbolRFUE,
symbolRFUF,
symbolRFUG,
symbolRFUH,
WanLowBatteryEvent,
WanBatteryErrorEvent,
lastSymbolEvent
} SymbolEvents;
enum scanMgrErr
{
scanMgrErrParam = appErrorClass+1,
scanMgrErrNotOpen,
scanMgrErrStillOpen,
scanMgrErrMemory,
scanMgrErrLowBatt
};
#ifdef __cplusplus
}
#endif
/*******************************************************************
* end of file *
*******************************************************************/
#endif // __SCANMGRDEF_H__

299
src/ScanMgrStruct.h Normal file
View file

@ -0,0 +1,299 @@
/******************************************************************************
*
* Barcode Scanner Common Defines.
*
* Copyright (c) 2006 Janam Partners LLC. All rights reserved.
*
* File: ScanMgrStruct.h
*
* Release: Palm OS 5.x
*
* Description: Reserved for backward compatible
* Common structure for using the Scanner Library
*
* History:
* Version 1.0 PT, JL Oct, 2006
*
*****************************************************************************/
#ifndef __SCANMGRSTRUCT_H__
#define __SCANMGRSTRUCT_H__
//#pragma once on
#ifdef __cplusplus
extern "C" {
#endif
#include "ScanMgrDef.h"
//extended defines and structure
#include "JanamExtendedDef.h"
#include "JanamExtendedStruct.h"
//ScanEvent Structure
typedef struct
{
eventsEnum eType;
Boolean penDown;
Int16 screenX;
Int16 screenY;
union scanData
{
struct scanGen
{
UInt16 data1;
UInt16 data2;
UInt16 data3;
UInt16 data4;
UInt16 data5;
UInt16 data6;
UInt16 data7;
UInt16 data8;
} scanGen;
struct
{
UInt16 batteryLevel;
UInt16 batteryErrorType;
} batteryError;
} scanData; // End of union
} ScanEventType;
typedef ScanEventType *ScanEventPtr;
//-----------------------------------------------------------------------------
//Maximum Packet Length
#define MAX_PACKET_LENGTH 258
//Barcode Message Structure
typedef struct tagMESSAGE
{
Int16 length; //data length
Int16 type; //barcode type
Int16 status; //decode status
UInt8 data[MAX_PACKET_LENGTH]; //barcode data
} MESSAGE;
//-----------------------------------------------------------------------------
#define MAX_DCD_LENGTH 258
//DCD Message Structure
typedef struct tagMESSAGE_Dcd
{
Int16 length; // length of the data
Int16 type; // contains the barcode type when the msg is DecodeData
Int16 status; // should be STATUS_OK
UInt8 symLetter;
UInt8 symModifier;
UInt8 data[MAX_DCD_LENGTH]; // the message data
} MESSAGE_Dcd;
//-----------------------------------------------------------------------------
//Batch Structure
#define MAX_BATCH_PARAM 247
typedef struct tagBATCH
{
Int16 length;
Int16 data[MAX_BATCH_PARAM + 3];
} BATCH;
//-----------------------------------------------------------------------------
//Comm Structure. No longer in use
typedef struct tagCOMM_STRUCT
{
Int16 port;
Int16 baud;
Int16 parity;
Int16 stop_bits;
Int16 host_timeout;
} COMM_STRUCT;
//-----------------------------------------------------------------------------
//Beep Sound enum
typedef enum tagBeepType
{
No_Beep = 0x00,
One_Short_High,
Two_Short_High,
Three_Short_High,
Four_Short_High,
Five_Short_High,
One_Short_Low,
Two_Short_Low,
Three_Short_Low,
Four_Short_Low,
Five_Short_Low,
One_Long_High,
Two_Long_High,
Three_Long_High,
Four_Long_High,
Five_Long_High,
One_Long_Low,
Two_Long_Low,
Three_Long_Low,
Four_Long_Low,
Five_Long_Low,
Fast_Warble,
Slow_Warble,
Mix1,
Mix2,
Mix3,
Mix4,
Decode_Beep,
Bootup_Beep,
Parameter_Entry_Error_Beep,
Parameter_Defaults_Beep,
Parameter_Entered_Beep,
Host_Convert_Error_Beep,
Transmit_Error_Beep,
Parity_Error_Beep,
Last_Beep
} BeepType;
//-----------------------------------------------------------------------------
//Conversion enum
typedef enum tagConvertType
{
convertUpcEtoUpcA,
convertUpcE1toUpcA,
convertCode39toCode32,
convertEan8toEan13,
convertI2of5toEan13
} ConvertType;
//-----------------------------------------------------------------------------
//Beep Duration enum
typedef enum
{
decodeDuration = DECODE_BEEP_DUR,
shortDuration = SHORT_BEEP_DUR,
mediumDuration = MEDIUM_BEEP_DUR,
longDuration = LONG_BEEP_DUR
} DurationType;
//Beep Frequency enum
typedef enum
{
decodeFrequency = DECODE_BEEP_FREQ,
lowFrequency = LOW_FREQ,
mediumFrequency = MEDIUM_FREQ,
highFrequency = HIGH_FREQ
} FrequencyType;
//-----------------------------------------------------------------------------
//Button Type enum
typedef enum
{
buttonDateBook = 0,
buttonAddressBook,
buttonTodoList,
buttonMemoPad
} ButtonType;
//-----------------------------------------------------------------------------
//Launch Code enum
typedef enum {
myAppCmdBatteryAlert = sysAppLaunchCmdCustomBase,
myAppCmdS24BatteryAlert,
myAppCmdNotUsed
} MyAppCustomActionCodes;
//-----------------------------------------------------------------------------
//Decode Parameters
#define PACKET_CONTINUATION 0x0002
#define MAX_DECODER_PARMS 3750
//-----------------------------------------------------------------------------
//Bar Code Enum Types with Extended Codes provided by Janam
typedef enum tagBarType
{
barCODE39 = 0x00,
barUPCA = 0x01,
barUPCE = 0x02,
barEAN13 = 0x03,
barEAN8 = 0x04,
barD25 = 0x05,
barI2OF5 = 0x06,
barCODABAR = 0x07,
barCODE128 = 0x08,
barCODE93 = 0x09,
barTRIOPTIC39 = 0x0D,
barUCC_EAN128 = 0x0E,
barMSI_PLESSEY = 0x0B,
barUPCE1 = 0x0C,
barBOOKLAND_EAN = 0x53,
barISBT128 = 0x54,
barCOUPON = 0x55,
barCode32 = 0x56,
//EXTENDED Support
barAZTEC = 0xC0,
barCODE11 = 0xC1,
barCODE49 = 0xC2,
barCOMPOSITE = 0xC3,
barDATAMAXTRIX = 0xC4,
barMAXICODE = 0xC5,
barMICROPDF = 0xC6,
barOCR = 0xC7,
barPDF417 = 0xC8,
barPOSTNET = 0xC9,
barQR = 0xCA,
barRSS = 0xCB,
barBPO = 0xCC,
barCANPOST = 0xCD,
barAUSPOST = 0xCE,
barIATA25 = 0xCF,
barCODABLOCK = 0xD0,
barJAPOST = 0xD1,
barPLANET = 0xD2,
barDUTCHPOST = 0xD3,
barTLCODE39 = 0xD4,
barMATRIX25 = 0xD5,
barCHINAPOST = 0xD6,
barKOREAPOST = 0xD7,
barTELEPEN = 0xD8,
barCODE16K = 0xD9,
barPOSICODE = 0xDA,
barUSPS4CB = 0xDB,
barIDTAG = 0xDC,
barRSS_LIM = 0xDD,
barRSS_EXP = 0xDE,
barMSI = 0xA0,
barPlessey = 0xA1,
barALL = 0xFF
} BarType;
//-----------------------------------------------------------------------------
//Decode Option Structure
#define DEC_DECODE_OPTIONS_VER 0x03
typedef struct
{
Int32 Version;
Int32 PrintWeight; // Valid range is 1-7
Int32 DecodeMode; // Full Omni, Reduced Omni, ALD
Int32 LinearRange; // Valid range 1-6
Int32 VideoReverse; // 0=disabled, 1=enabled
Int32 DecAttemptLimit; // 0 = disabled, Valid range 1-10,000
Int32 SearchLimit; // 0 = disabled, Valid range 1-10,000
unsigned short AddendaDelay; // (search time for addenda in ms)
unsigned short UpcComDelay; // (search time for 2D symbol in UPC COM mode)
unsigned short ConcatDelay; // (search time for ISBT/Codabar concatenation)
unsigned short MldEnaMask; // Per symbology MLD control
Int32 Flags; // special flags
} DecodeOptions_t;
#ifdef __cplusplus
}
#endif
#endif

72
src/ScanWedge.h Normal file
View file

@ -0,0 +1,72 @@
/******************************************************************************
*
* Barcode Scanner Demo Application
*
* Copyright (c) 2006 Janam Partners LLC. All rights reserved.
*
* File: SetupDlgs.h
*
* Release: Palm OS 5.x
*
* Description: Header define for the Barcode Scanner Demo Application
*
* History:
* Version 1.0 PT, JL Oct, 2006
*
*****************************************************************************/
#ifndef __SCANWEDGE_H__
#define __SCANWEDGE_H__
#ifdef __cplusplus
extern "C" {
#endif
#define kScanWedgePanelCreator 'ScnW'
#define kScanWedgePreferencesId 1
#define kScanWedgeOpenId 2
#define ScanWedgeEnabled 0x1
#define BARCODE 0
#define CARRIGE_RETURN 1
#define LINE_FEED 2
#define TAB 3
#define PREFIX 4
#define SUFFIX 5
#define TEMINATE 9
#define MAX_INSERT_CHAR 6
#define MAX_PREFIX_CHAR 18
#define MAX_SUFFIX_CHAR 18
typedef struct
{
UInt32 ScanWedge;
UInt8 ScanWedgeInsertCharOption[MAX_INSERT_CHAR]; //current max is combination of 4 types
char ScanWedgePrefix[MAX_PREFIX_CHAR+1];
char ScanWedgeSuffix[MAX_SUFFIX_CHAR+1];
} ScanWedgePreferencesType;
#define BC_STRING "<BC>"
#define CR_STRING "<CR>"
#define LF_STRING "<LF>"
#define TAB_STRING "<TB>"
#define PREFIX_STRING "<PR>"
#define SUFFIX_STRING "<SU>"
#define OPTION_PREFIX 1
#define OPTION_SUFFIX 2
#ifdef __cplusplus
}
#endif
#endif