Sack Library Documentation
ContentsIndexReferenceHome
PreviousUpNext
sack Namespace

Render provides a method to display images on a screen. It is the interface between memory images and the window desktop or frame buffer the user is viewing on a monitor. 

 

Under windows, this is implemented as an HWND and an HBITMAP used to allow the application to draw. Updates are done directly from the drawable surface to the HWND as appropriate for the type of service. This is implemented with Vidlib.dll. 

 

Under Linux, this is mounted against SDL. SDL, however, does not give multiple display surfaces, so a more direct method should be used someday, other than SDL does a good job of aliasing frame buffer and X display windows to a consistant interface. This is implemented wit DisplayLib (as yet outside of the documentation). Display lib can interface either directly, or be mounted as a service across from a shared memory message service, and host multiple applications on a single frame buffer surface.

Implement displays as direct X displays, and allow managment there under linux. 

Displaylib was a good project, and although suffers from code-rot, it is probably still mostly usable. Message services were easily transported across a network, but then location services started failing.

   
// get a render display, just a default window of some size
// extended features are available for more precision.
Render render = OpenDisplay(0);
   

 

A few methods of using this surface are available. One, you may register for events, and be called as required.

RedrawCallback MyDraw = DrawHandler;
MouseCallback MyMouse;
KeyProc MyKey;
CloseCallback MyClose;
   
// called when the surface is initially shown, or when its surface changes.
// otherwise, the image drawn by the application is static, and does
// not get an update event.
SetRedrawHandler( render, MyDraw, 0 );
   
// This will get an event every time a mouse event happens.
// If no Key handler is specified, key strokes will also be mouse events.
SetMouseHandler( render, MyMouse, 0 );
   
// If the window was closed, get an event.
SetCloseHandler( render, MyClose, 0 );
   
// specify a handler to get keyboard events...
SetKeyboardHandler( render, MyKey, 0 );
   

 

Or, if you don't really care about any events...

// load an image
Image image = LoadImageFile( "sample.jpg" );
// get the image target of render
Image display = GetDisplayImage( render );
// copy the loaded image to the display image
BlotImage( display, image );
// and update the display
UpdateDisplay( render );

 

   
void CPROC DrawHandler( PTRSZVAL psvUserData, PRENDERER render )
{
    Image display = GetDisplayImage( render );
    // the display image may change, because of an external resize
   
    // update the image to display as desired...
   
    // when done, the draw handler should call UpdateDisplay or...
    UpdateDisplayPortion( render, 0, 0, 100, 100 );
}

 

Oh! And most importantly! Have to call this to put the window on the screen.

UpdateDisplay( render );

 

Or maybe can pretend it was hidden

RestoreDisplay( render );
Name 
Description 
app 
Deadstart is support which differs per compiler, but allows applications access a C++ feature - static classes with constructors that initialize at loadtime, but, have the feature that you can create threads. Deadstart code is run after the DLL load lock under windows that prevents creation of threads; however, deadstart is run before main. Deadstart routines can have a priority. Certain features require others to be present always. This allows explicit control of priority unlink using classes with static constructors, which requires ordering of objects to provide linking order. Also provides a similar registration mechanism for atexit, but extending with... more 
This type stores data, it has a self-contained length in bytes of the data stored. Length is in characters 
File system abstractions. A few things like get current path may or may not exist on a function.

Primarily this defines functions 'pathchr' and 'pathrchr' which resemble 'strchr' and 'strrchr' but search a string for a path character. A path character is either a / or a \.

Also in this area is file monitoring functions which support methods on windows and linux to get event notifications when directories and, by filtering, files that have changed. 
Deals with images and image processing.

Image is the primary type of this.
Font is a secondary type for putting text on images.

render namespace is contained in image, because without image, there could be no render. see PRENDERER. 
 
Handles log output. Logs can be directed to UDP directed, or broadcast, or localhost, or to a file location, and under windows the debugging console log.

lprintf
SetSystemLog
SystemLogTime

there are options, when options code is enabled, which control logging output and format. Log file location can be specified generically for instance.... see Options.
This namespace contains the logging functions. The most basic thing you can do to start logging is use 'lprintf'.
 
math 
Namespace of custom math routines. Contains operators for Vectors and fractions. 
Memory namespace contains functions for allocating and releasing memory. Also contains methods for accessing shared memory (if available on the target platform).

Allocate
Release
Hold
OpenSpace 
msg 
This namespace contains an implmentation of inter process communications using a set of message queues which result from 'msgget' 'msgsnd' and 'msgrcv'. This are services available under a linux kernel. Reimplemented a version to service for windows. This is really a client/service registration and message routing system, it is not the message queue itself. See message for the queue implementation (again, under linux, does not use this custom queue). 
Event based networking interface.
 
PSI 
PSI is Panther's Slick Interface.
This is a control library which handles custom controls and regions within a form. This isn't a window manager.

PSI_CONTROL is the primary structure that this uses. It esists as a pointer to a structure, the content of which should never be accessed by the real world. For purposes of documentation these structures (in controlstruc.h) are presented, but they are inaccessable from outside of SACK itself, and will not be provided in the SDK.

A PSI_CONTROL can represent a 'Frame' which contains other controls. A Frame owns a PRENDERER which it uses to present... more 
sql 
SQL access library. This provides a simple access to ODBC connections, and to sqlite. If no database is specified, there is an internal database that can be used. These methods on the PODBC connection are NOT thread safe. Multiple threads shall never use the same PODBC; they can use seperate PODBC connections. Under linux this links to unixODBC.

DoSQLCommandf
DoSQLRecordQueryf
GetSQLRecord

ConnectToDatabase
DoSQLCommandf
DoSQLRecordQueryf
FetchSQLRecord

There is a configuration file for the default SQL connection, this is kept in a file 'sql.config' which is processed with ProcessConfigurationFile(); If this file does not exist, it will be automatically created with default... more 
This is namespace sack::system. 
task 
This is namespace sack::task. 
This namespace contains methods for working with timers and threads. Since timers are implemented in an asynchronous thread, the thread creation and control can be exposed here also.

ThreadTo
WakeThread
WakeableSleep [Example]
AddTimer
RemoveTimer
RescheduleTimer
EnterCriticalSec see Also EnterCriticalSecNoWait
LeaveCriticalSec 
Name 
Description 
The following table lists functions in this documentation. 
The following table lists types in this documentation. 
The following table lists variables in this documentation. 
The following table lists macros in this documentation. 
 
Name 
Description 
 
Define a routine to call for exit(). This triggers specific code to handle shutdown event registration 
 
a function true/false which indicates whether the root deadstart has been invoked already. If not, one should call InvokeDeadstart and MarkDeadstartComplete.
 
Name 
Description 
_32f 
32 bit unsigned decimal output printf format specifier. This would otherwise be defined in <inttypes.h> 
64 bit signed decimal output printf format specifier. This would otherwise be defined in <inttypes.h> 
32 bit hex output printf format specifier. This would otherwise be defined in <inttypes.h> 
32 bit HEX output printf format specifier. This would otherwise be defined in <inttypes.h> 
_64f 
defined( _MSC_VER ) 64 bit unsigned decimal output printf format specifier. This would otherwise be defined in <inttypes.h> as PRIu64 
64 bit signed decimal output printf format specifier. This would otherwise be defined in <inttypes.h> as PRIdFAST64 
64 bit hex output printf format specifier. This would otherwise be defined in <inttypes.h> as PRIxFAST64 
64 bit HEX output printf format specifier. This would otherwise be defined in <inttypes.h> as PRIxFAST64 
Modified WIDE wrapper that actually forces non-unicode string. 
This is macro sack::_GetMyThreadID. 
This is macro sack::_WIDE. 
This is macro sack::_WIDE__FILE__. 
format string for output _32 as unsigned decimal. Size changes by platform. Non unicode. 
format string for output _32 as unsigned decimal. Size changes by platform. Non unicode. 
format string for output _32 as unsigned hex. Size changes by platform. Non unicode. 
format string for output _32 as unsigned HEX. Size changes by platform. Non unicode. 
format string for output PTRSZVAL as unsigned hex. Size changes by platform. Non unicode. 
format string for output PTRSZVAL as unsigned hex. Size changes by platform. Non unicode. 
This is macro sack::cWIDE. 
used to specify whether debug information is being passed - can be referenced in compiled code 
in NDEBUG mode, pass nothing
in NDEBUG mode, pass nothing.

This function allows specification of DBG_RELAY or DBG_SRC under debug compilation. Otherwise, the simple AddLink macro should be used. DBG_RELAY can be used to forward file and line information which has been passed via DBG_PASS declaration in the function parameters.

This is a part of a set of macros which allow additional logging information to be passed.

These 3 are the most commonly used.

DBG_SRC - this passes the current __FILE__, __LINE__ parameters.
DBG_PASS - this is used on a function declaration, is a filename and line number from DBG_SRC... more 
in NDEBUG mode, pass nothing
in NDEBUG mode, pass nothing.

This function allows specification of DBG_RELAY or DBG_SRC under debug compilation. Otherwise, the simple AddLink macro should be used. DBG_RELAY can be used to forward file and line information which has been passed via DBG_PASS declaration in the function parameters.

This is a part of a set of macros which allow additional logging information to be passed.

These 3 are the most commonly used.

DBG_SRC - this passes the current __FILE__, __LINE__ parameters.
DBG_PASS - this is used on a function declaration, is a filename and line number from DBG_SRC... more 
in NDEBUG mode, pass nothing
in NDEBUG mode, pass nothing.

This function allows specification of DBG_RELAY or DBG_SRC under debug compilation. Otherwise, the simple AddLink macro should be used. DBG_RELAY can be used to forward file and line information which has been passed via DBG_PASS declaration in the function parameters.

This is a part of a set of macros which allow additional logging information to be passed.

These 3 are the most commonly used.

DBG_SRC - this passes the current __FILE__, __LINE__ parameters.
DBG_PASS - this is used on a function declaration, is a filename and line number from DBG_SRC... more 
in NDEBUG mode, pass nothing
in NDEBUG mode, pass nothing.

This function allows specification of DBG_RELAY or DBG_SRC under debug compilation. Otherwise, the simple AddLink macro should be used. DBG_RELAY can be used to forward file and line information which has been passed via DBG_PASS declaration in the function parameters.

This is a part of a set of macros which allow additional logging information to be passed.

These 3 are the most commonly used.

DBG_SRC - this passes the current __FILE__, __LINE__ parameters.
DBG_PASS - this is used on a function declaration, is a filename and line number from DBG_SRC... more 
in NDEBUG mode, pass nothing
in NDEBUG mode, pass nothing.

This function allows specification of DBG_RELAY or DBG_SRC under debug compilation. Otherwise, the simple AddLink macro should be used. DBG_RELAY can be used to forward file and line information which has been passed via DBG_PASS declaration in the function parameters.

This is a part of a set of macros which allow additional logging information to be passed.

These 3 are the most commonly used.

DBG_SRC - this passes the current __FILE__, __LINE__ parameters.
DBG_PASS - this is used on a function declaration, is a filename and line number from DBG_SRC... more 
in NDEBUG mode, pass nothing
in NDEBUG mode, pass nothing.

This function allows specification of DBG_RELAY or DBG_SRC under debug compilation. Otherwise, the simple AddLink macro should be used. DBG_RELAY can be used to forward file and line information which has been passed via DBG_PASS declaration in the function parameters.

This is a part of a set of macros which allow additional logging information to be passed.

These 3 are the most commonly used.

DBG_SRC - this passes the current __FILE__, __LINE__ parameters.
DBG_PASS - this is used on a function declaration, is a filename and line number from DBG_SRC... more 
in NDEBUG mode, pass nothing
in NDEBUG mode, pass nothing.

This function allows specification of DBG_RELAY or DBG_SRC under debug compilation. Otherwise, the simple AddLink macro should be used. DBG_RELAY can be used to forward file and line information which has been passed via DBG_PASS declaration in the function parameters.

This is a part of a set of macros which allow additional logging information to be passed.

These 3 are the most commonly used.

DBG_SRC - this passes the current __FILE__, __LINE__ parameters.
DBG_PASS - this is used on a function declaration, is a filename and line number from DBG_SRC... more 
in NDEBUG mode, pass nothing
in NDEBUG mode, pass nothing.

This function allows specification of DBG_RELAY or DBG_SRC under debug compilation. Otherwise, the simple AddLink macro should be used. DBG_RELAY can be used to forward file and line information which has been passed via DBG_PASS declaration in the function parameters.

This is a part of a set of macros which allow additional logging information to be passed.

These 3 are the most commonly used.

DBG_SRC - this passes the current __FILE__, __LINE__ parameters.
DBG_PASS - this is used on a function declaration, is a filename and line number from DBG_SRC... more 
#error blah general macros for linking lists using 
exit 
This is macro sack::exit. 
typedef enum { FALSE, TRUE } LOGICAL; // smallest information 
a constant text string that represents the current source filename and line... fourmated as "source.c(11) :" 
specify a consistant macro to format file and line information for printf formated strings. 
This is macro sack::FILELINE_NULL. 
#define FILELINE_LEADPASS CTEXTSTR pFile, _32 nLine, specify a consistant macro to define file and line parameters. This are appended parameters, and common usage is to only use these with _DEBUG set. 
specify a consistant macro to forward file and line parameters. This are appended parameters, and common usage is to only use these with _DEBUG set. 
specify a consistant macro to pass current file and line information. This are appended parameters, and common usage is to only use these with _DEBUG set. 
define static parameters which are the declaration's current file and line, for stubbing in where debugging is being stripped. usage FILELINE_VARSRC: // declare pFile and nLine variables. 
This is macro sack::FILELINE_VOIDNULL. 
#define FILELINE_LEADSRC (CTEXTSTR)_WIDE(__FILE__), __LINE__, specify a consistant macro to define file and line parameters, to functions with otherwise void param lists. This are appended parameters, and common usage is to only use these with _DEBUG set. 
specify a consistant macro to forward file and line parameters, to functions which have void parameter lists without this information. This are appended parameters, and common usage is to only use these with _DEBUG set. 
specify a consistant macro to pass current file and line information, to functions which void param lists. This are appended parameters, and common usage is to only use these with _DEBUG set. 
how many bits to add to make sure we round to the next greater index if even 1 bit overflows 
declare a set of flags... 
how big the flag set is in count of FLAGSETTYPEs required in a row ( size of the array of FLAGSETTYPE that contains n bits) 
the default type to use for flag sets - flag sets are arrays of bits which can be toggled on and off by an index. 
the index of the FLAGSETTYPE which contains the bit in question 
the number of bits a specific type is. 
get the value of a field 
This is macro sack::GetMyThreadID. 
This is macro sack::GetMyThreadIDNL. 
this is now always the case it's a safer solution anyhow... 
this has two expressions duplicated... but in being so safe in this expression, the self-circular link needs to be duplicated. GrabThing is used for nodes which are circularly bound 
An index which is not valid; equates to 0xFFFFFFFFUL or negative one cast as an INDEX... ((INDEX)-1). 
Link a node to the end of a list. Link thing inserts the new node as the new head of the list. 
Link a new node into the list. 
put 'Thing' after 'node 
put 'Thing' before 'node'... so (*node->me) = thing 
the mast in the dword shifted to the left to overlap the field in the word 
masks value with the mask size, then applies that mask back to the correct word indexing 
32 bits max for range on mask 
define MAX_MAX_ROUND factor based on MASKSET_READTYPE - how to read it... 
the maximum number of bits storable in a type 
the mask in the dword resulting from shift-right. (gets a mask of X bits in length) 
declare a set of flags... 
round up to the next count of types that fits 1 bit - used as a cieling round factor 
declare a mask set. 
gives a 32 bit mask possible from flagset.. 
The number of bytes the set would be. 
gives byte index... 
byte index of the start of the mask 
how many bits the type specified can hold 
Go to the next node with links declared by DeclareLink 
everything else is called a thing... should probably migrate to using this... 
try and define a way to emit comipler messages... but like no compilers support standard ways to do this accross the board. 
try and define a way to emit comipler messages... but like no compilers support standard ways to do this accross the board. 
This is macro sack::PTRSZVALf. 
format string for output PTRSZVAL as unsigned decimal. Size changes by platform. 
format string for output PTRSZVAL as unsigned hex. Size changes by platform. 
This is macro sack::RelinkThing. 
clear a single flag index 
set a single flag index 
set a field index to a value 
This is macro sack::STRSYM. 
test if a flags is set 
This is macro sack::TOCHR. 
reverse a flag from 1 to 0 and vice versa 
This is macro sack::TOSTR. 
TRUE 
Define TRUE when not previously defined in the platform. TRUE is (!FALSE) so anything not 0 is true. 
Remove a node from a list. Requires only the node. 
WIDE 
This is macro sack::WIDE. 
This is macro sack::WIDE__FILE__. 
Name 
Description 
_16 
Would be otherwise defined in stdint.h as uint16_t 
_64 
have to do this on a per structure basis - otherwise any included headers with structures to use will get FUCKED 
_8 
portability type for porting legacy 16 bit applications. Would be otherwise defined in stdint.h as uint16_t 
#endif
 

  • several compilers are rather picky about the types of data
  • used for bit field declaration, therefore this type
  • should be used instead of _32

 

This is a pointer to constant data. void const *. Compatible with things like char const *. 
constant text string content 
an unsigned type meant to index arrays. (By convention, arrays are not indexed negatively.) An index which is not valid is INVALID_INDEX, which equates to 0xFFFFFFFFUL or negative one cast as an INDEX... ((INDEX)-1). 
Meant to hold boolean and only boolean values. Should be implemented per-platform as appropriate for the bool type the compiler provides. 
P_0 
cannot declare _0 since that overloads the vector library definition for origin (0,0,0,0,...) typedef void _0; // totally unusable to declare 0 size things.
#ifdef __NO_WIN32API__ #define P_0 void* #ifdef __cplusplus_cli // long is 32, int is 64 #define _32 unsigned long #else #define _32 unsigned int #endif #define _8 unsigned char #define P_8 _8 * #define _16 unsigned short #define P_16 _16 * #define P_32 _32 * #define PC_32 const _32 * #define S_8 signed char #define PS_8 S_8 * #define S_16 signed short #define PS_16 S_16 * #define S_32 signed long #define PS_32 S_32 * #define X_8 char... more 
P_16 
Would be otherwise defined in stdint.h as uint16_t 
P_32 
An pointer to an unsigned integer type that is 32 bits long. 
P_64 
A pointer to an unsigned integer type that is 64 bits long. 
P_8 
Would be otherwise defined in stdint.h as uint8_t 
An pointer to a constant unsigned integer type that is 32 bits long. 
char const *const 
This is type sack::pid_t. 
This is a pointer. It is a void*. It is meant to point to a single thing, and cannot be used to reference arrays of bytes without recasting. 
An pointer to a signed integer type that is 16 bits long. 
A pointer to a signed integer type that is 32 bits long. 
A pointer to a signed integer type that is 64 bits long. 
PS_8 
An pointer to a signed integer type that is 8 bits long. 
see PTRSZVAL this just has more letters. 
This is an unsigned integer type that has the same length as a pointer, so that simple byte offset calculations can be performed against an integer. non-standard compiler extensions allow void* to be added with an index and increase in bytes, but void itself is of 0 size, so anything times 0 should be 0, and no offset should apply. So translation of pointers to integer types allows greater flexibility without relying on compiler features which may not exist. 
An pointer to a volatile unsigned integer type that is 32 bits long. 
An pointer to a volatile unsigned integer type that is 64 bits long. 
An pointer to a volatile pointer size type that is as long as a pointer. 
This is a pointer to wchar_t. A 16 bit value that is character data, and is not signed or unsigned. 
PX_8 
A pointer to character type, it is not signed or unsigned. 
S_16 
A signed integer type that is 16 bits long. 
S_32 
A signed integer type that is 32 bits long. 
S_64 
A signed integer type that is 64 bits long. 
S_8 
A signed integer type that is 8 bits long. 
a text 8 bit character 
A non constant array of TEXTCHAR. A pointer to TEXTCHAR. A pointer to non-constant characters. (A non-static string probably) 
This should be for several years a sufficiently large type to represent threads and processes. 
X_16 
may consider changing this to P_16 for unicode... 
X_8 
A character type, it is not signed or unsigned. 
Name 
Description 
Render provides a method to display images on a screen. It is the interface between memory images and the window desktop or frame buffer the user is viewing on a monitor.

Under windows, this is implemented as an HWND and an HBITMAP used to allow the application to draw. Updates are done directly from the drawable surface to the HWND as appropriate for the type of service. This is implemented with Vidlib.dll.

Under Linux, this is mounted against SDL. SDL, however, does not give multiple display surfaces, so a more direct method should be used someday, other than SDL does... more 
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.
Copyright (c) 2000+. All rights reserved.
What do you think about this topic? Send feedback!