UniBible - A Multilingual Bible Reader for the Palm
UniBible Home Screenshots Downloads Developers Unbound Bible Biola University
write your own unicode app for palm with unicode-glib

Download the UniTest project (built with PODS 1.2) from SourceForge
UniTest is a simple application to show you how to use the Unicode-GLib library. It reads a Memo record that starts with UniTest\n and is followed by Unicode characters written as four digit hex values. It then lets you scroll the screen to see all the text you entered.

Download UniTest-2006-02-06.zip

Take a look at the following pieces of code once you have UniTest downloaded:
Important includes and declarations

#include "unitest.h"
#include <PalmOS.h>
#include <VFSMgr.h>
#include "UniLibDefines.h"
#include "UniLibTypes.h"
#include "UniLibFunctionsExtern.h"

#define kUniD 'UniD'
#define kCMAP 'CMAP'
#define kNbrPaths 4
Declare these important global variables:

//UniBucketType holds the initialization data for using Unicode-GLib
UniBucketType uniBucket;
UniBucketPtr uniBucketPtr = &uniBucket;

//Database Flags - these flags tell us whether we found important databases
Boolean foundUniCharDB = false;
Boolean foundMappingDB = false;
UInt8 foundVFS = false; //foundVFS means we can try to find databases on memory cards
UInt32 vfsMgrVersion = 0;

//Database Path
DmVFSPathType fontPath[kNbrPaths];

//For UniText
WinHandle bufferWinH = NULL;	//Declare a buffer window that UniText will use
UniTextPtr textData;	//pointer to the UniText gadget data
UInt16 textLength = 0;	//length of our Unicode text in UInt16
MemHandle textH;	//handle to our Unicode text
UniChar* textP;		//pointer to our Unicode text
Look at these functions, which work to set up / clean up the Unicode library:
  • StartApplication - sets up variables, calls OpenUnicode
  • OpenUnicode - sets UniBucket variables, calls UniBucketOpenUnicode which opens font databases and initializes important font and unicode structures.
  • StopApplication - deallocates memory, calls UniBucketCloseUnicode which closes all the fonts and databases we opened with UniBucketOpenUnicode
Look at these functions, which work to set up, clean up, and (re)display the UniText gadget:
  • MainFormHandleEvent - handles form open/close, UniText scrolling, calls InitializeUniText, UninitializeUniText
  • InitializeUniText - helper function to create UniText gadget data
  • UninitializeUniText - helper function to clean up UniText gadget data

Download the Unicode-GLib source files from SourceForge
Download UniLib-1_2-2006-02-06.zip

Download Core Fonts (Lo-Res or Hi-Res) from SourceForge

Questions or Comments?
© Biola University