mi32/sml.h File Reference

#include <mi32/smlbase.h>
#include <mi32/elemtype.h>
#include <mi32/mcb.h>
#include <mi32/crypto.h>
#include <X11/intrinsic.h>
Include dependency graph for sml.h:

Go to the source code of this file.

Classes

class  SML::ENCODINGDATA

Namespaces

namespace  SML

Defines

#define QFLAG_AutoRun   0x0004
#define QFLAG_DispLayer   0x0040
#define QFLAG_FileExtnSML   0x8000
#define QFLAG_Filename   0x10000
#define QFLAG_Formula   0x0080
#define QFLAG_NoConsole   0x0800
#define QFLAG_NoEdit   0x0400
#define QFLAG_NonModal   0x0100
#define QFLAG_NoShell   0x0002
#define QFLAG_NoViewIcon   0x2000
#define QFLAG_NoWait   0x0008
#define QFLAG_PinMap   0x0020
#define QFLAG_ScriptNoFile   0x4000
#define QFLAG_SetExitOnQuit   0x1000
#define QFLAG_SingleTable   0x0010
#define QFLAG_SML   0x0001
#define QFLAG_SupressToolbar   0x20000
#define RVCSYSLIBEXPORT   MI_DLLIMPORT
#define SML_API_CONFORMANCE   0

Typedefs

typedef SML::EDITOR SMLEDITOR
typedef SML::ENCODINGDATA SMLENCODINGDATA

Functions

int DBQuery_DrawOptimizedLabels (SML::CONTEXT *context, ELEMTYPE ElemType, UINT8 *bitarray, INT32 NumElem)
MGD::CONTEXTDBQuery_GetCurrentMgdGC (SML::CONTEXT *context)
int DBQuery_GetMgdExtents (SML::CONTEXT *context, DRECT2D *extents)
int DBQuery_LineStyleSetGC (SML::CONTEXT *context, MGD::CONTEXT *gc, const TRANS2D_MAPGEN &tmg)
int DBQuery_LineStyleSetPoints (SML::CONTEXT *context, const DPOINT2D *pts, INT32 NumPts, int CloseMode)
void DBQuery_SetMdispLayer (SML::CONTEXT *context, void *layer, void *view, int ExtentsOnly)
void DBQuery_SetMgdDisplay (SML::CONTEXT *context, MGD::CONTEXT *ggc, const TRANS2D_MAPGEN &tmg, const RVC::OBJITEM *StyleObjItem=0)
int DBQuery_SetupStyleDraw (SML::CONTEXT *context, MGD::CONTEXT *ggc, const TRANS2D_MAPGEN &tmg, bool Is3D, SML::SYMBOL *DrawDoneSym)
int MxQueryAddCallback (SML::EDITOR *handle, McbCallbackFunc func, void *cbdata, UINT32 reason)
int MxQueryCheckSyntax (MDLGPARENT parent, SML::EDITOR *handle)
int MxQueryCloseChildren (SML::EDITOR *handle)
int MxQueryCreate (SML::EDITOR **handle, UINT32 flags)
ERRVALUE MxQueryOpenScript (SML::EDITOR *editor, const RVC::OBJITEM &ObjItem, int usage)
void MxQueryRemoveCallback (SML::EDITOR *handle, McbCallbackFunc func, void *cbdata, UINT32 reason)
int MxQuerySetContext (SML::EDITOR *handle, SML::CONTEXT *context, int segment)
void MxQuerySetScriptFilepath (SML::EDITOR *handle, const FILEPATH &filepath)
void MxQuerySetScriptObject (SML::EDITOR *handle, const RVC::OBJITEM &objitem)
void SML_AddWidgetDestroyCallback (SML::CONTEXT *context, Widget widget, XtCallbackProc func, void *cbdata)
int SML_CheckExit (MDLGPARENT parent)
ERRVALUE SML_EditScript (MDLGPARENT dlgparent, MISTRING &scriptstr, SML::CONTEXT *smlcontext, int smlsegment=0, UINT32 flags=0)
int SML_ExecuteMain (MDLGPARENT toplevel, int(*InstallDisplayFunctions)(SML::CONTEXT *), const MIUNICODE *fname, const MIUNICODE *objname, UINT32 flags, void *encdata=NULL, MIPRODUCTCODE productcode=MIPRODUCTCODE_Default)
void SML_LongToDate (INT32 date, char *dateStr)
int SML_Main (MDLGPARENT toplevel, SML::CONTEXT *context, const char **argv, int argc, UINT32 flags=0)
int SML_NoEditMain (MDLGPARENT toplevel, SML::CONTEXT *context, const MIUNICODE *fname, const MIUNICODE *objname, UINT32 flags, void *encdata=NULL)
int SML_ReadScript (RVC::OBJITEM &ObjItem, MISTRING &ScriptStr, char *encoding=0, MIUNICODE *password=0, int(*CryptoPromptPassword)(void *data, MIUNICODE *password)=0, void *PromptPasswordData=0, MCRYPTOHDR *crypto=0)
ERRVALUE SMLEdit (MDLGPARENT parent, SML::CONTEXT *context, int segment, MISTRING &query, UINT32 flags)

Define Documentation

#define QFLAG_AutoRun   0x0004
#define QFLAG_DispLayer   0x0040

Used to edit script of and Mdisp layer -- same as SML, but no Run.

#define QFLAG_FileExtnSML   0x8000

Use ".sml" for file extn instead of ".qry".

#define QFLAG_Filename   0x10000

string passed to SML_EditScript is really a filename (passed on command line)

#define QFLAG_Formula   0x0080
#define QFLAG_NoConsole   0x0800
#define QFLAG_NoEdit   0x0400
#define QFLAG_NonModal   0x0100
#define QFLAG_NoShell   0x0002
#define QFLAG_NoViewIcon   0x2000

For SML Toolbar in tntdisp.

#define QFLAG_NoWait   0x0008
#define QFLAG_PinMap   0x0020
#define QFLAG_ScriptNoFile   0x4000

Editor has no control over the file. Gets "Script" menu with open/save as/close only.

#define QFLAG_SetExitOnQuit   0x1000

So MxMainLoopUntilExitSet() will drop out.

#define QFLAG_SingleTable   0x0010
#define QFLAG_SML   0x0001
#define QFLAG_SupressToolbar   0x20000

don't create toolbar for "applidat"

#define RVCSYSLIBEXPORT   MI_DLLIMPORT
#define SML_API_CONFORMANCE   0

Typedef Documentation

typedef SML::EDITOR SMLEDITOR

SML / Query editor.

Note, the consturctor/destructor of this class are private. You have to call MxQueryCreate() to create one.

This class is just an opaque handle for now.


Function Documentation

int DBQuery_DrawOptimizedLabels ( SML::CONTEXT context,
ELEMTYPE  ElemType,
UINT8 bitarray,
INT32  NumElem 
)

Cartoscript label drawing function.

MGD::CONTEXT* DBQuery_GetCurrentMgdGC ( SML::CONTEXT context  ) 

Return the MGD::CONTEXT being used by the "Drawing" function group.

int DBQuery_GetMgdExtents ( SML::CONTEXT context,
DRECT2D extents 
)

Get the extents of the drawing.

Used by SML Layers in GRE. To find the extents of a script layer, call DBQuery_SetMgdDisplay() and give it NULL for a gc. Execute the script, then call DBQuery_GetMgdExtents()

int DBQuery_LineStyleSetGC ( SML::CONTEXT context,
MGD::CONTEXT gc,
const TRANS2D_MAPGEN tmg 
)

Cartoscript line setup function.

int DBQuery_LineStyleSetPoints ( SML::CONTEXT context,
const DPOINT2D pts,
INT32  NumPts,
int  CloseMode 
)

Cartoscript line setup function.

void DBQuery_SetMdispLayer ( SML::CONTEXT context,
void *  layer,
void *  view,
int  ExtentsOnly 
)

Set the GRE::LAYER for the context (for SML Layers).

XXX Layer and View should use actual classes, not (void*)

void DBQuery_SetMgdDisplay ( SML::CONTEXT context,
MGD::CONTEXT ggc,
const TRANS2D_MAPGEN tmg,
const RVC::OBJITEM StyleObjItem = 0 
)

Set the MgdGC to be used by the "Drawing" function group.

If the MgdGC is NULL, the drawing functions will just update the extents, which can be retrieved by calling DBQuery_GetMgdExtents()

See also:
DBQuery_GetMgdExtents
Parameters:
tmg Conversion from script provided coordinates to "display" coordinates
StyleObjItem Style Object (for drawing functions that set patterns and symbols
int DBQuery_SetupStyleDraw ( SML::CONTEXT context,
MGD::CONTEXT ggc,
const TRANS2D_MAPGEN tmg,
bool  Is3D,
SML::SYMBOL DrawDoneSym 
)

Cartoscript setup function.

Parameters:
tmg Coordinate and clipping transformation
DrawDoneSym SML symbol to indicate that drawing was done, NULL if none
int MxQueryAddCallback ( SML::EDITOR *  handle,
McbCallbackFunc  func,
void *  cbdata,
UINT32  reason 
)

Add a callback to the query editor.

Possible reasons: MsmlCR_Modified MsmlCR_Filename

See also:
MxQueryRemoveCallback()
int MxQueryCheckSyntax ( MDLGPARENT  parent,
SML::EDITOR *  handle 
)

Check the syntax of the script in the editor.

Returns 1 if syntax OK, 0 if not

int MxQueryCloseChildren ( SML::EDITOR *  handle  ) 

Close the query windows children.

Parameters:
handle The handle.
int MxQueryCreate ( SML::EDITOR **  handle,
UINT32  flags 
)

Create an SML::EDITOR instance.

Note that this function does not actually create an SML::CONTEXT or any widgets. You should not free the handle returned.

Flags:

Parameters:
handle The handle returned.
flags Just stored for later use XXX What's valid?
ERRVALUE MxQueryOpenScript ( SML::EDITOR *  editor,
const RVC::OBJITEM ObjItem,
int  usage 
)

Load an SML script into the editor.

This version will work with scripts in RVC objects.

Parameters:
usage RVC::SCRIPT::USAGE
void MxQueryRemoveCallback ( SML::EDITOR *  handle,
McbCallbackFunc  func,
void *  cbdata,
UINT32  reason 
)

Remove a callback from the query editor.

See also:
MxQueryAddCallback()
int MxQuerySetContext ( SML::EDITOR *  handle,
SML::CONTEXT context,
int  segment 
)

Set the SML::CONTEXT and segment for an SML::EDITOR.

void MxQuerySetScriptFilepath ( SML::EDITOR *  handle,
const FILEPATH filepath 
)

Tells the editor where the script came from This does NOT load the script, it just records the filename so that "Save" knows where to save to.

void MxQuerySetScriptObject ( SML::EDITOR *  handle,
const RVC::OBJITEM objitem 
)

Tells the editor where the script came from This does NOT load the script, it just records the objitem so that "Save" knows where to save to.

void SML_AddWidgetDestroyCallback ( SML::CONTEXT context,
Widget  widget,
XtCallbackProc  func,
void *  cbdata 
)

Register an XmNdestroyCallback for a Widget.

If you want to pass an SML::CONTEXT as the callback data of a widget's XmNdestroyCallback, you MUS use this function to do it. Due to the event-driven nature of X11, if you destroy the widget and the context the widget's destroy callback won't get called until after the context had been free'd. By registering the callback through this wrapper, the context will keep track of it and not free the context until the last registered destroy callback has been called.

If you're passing an SML::CONTEXT as the callback data of any other kind of callback, it's a good idea to still register a destroy callback through this function even if it does nothing.

Parameters:
func Function to call on XmNdestroy
cbdata callback data for func (usually the context)
int SML_CheckExit ( MDLGPARENT  parent  ) 

Called by TNTview when use clicks "Exit" button.

If there are SML sessions open, the user will be closed. If they have changes that need to be saved, the user will be asked if they would like to save changes. If they click "cancel" this function will return EUserCancel Will return 0 if everything is closed.

ERRVALUE SML_EditScript ( MDLGPARENT  dlgparent,
MISTRING scriptstr,
SML::CONTEXT smlcontext,
int  smlsegment = 0,
UINT32  flags = 0 
)

Popup dialog for editing SML/Query script.

FLAGS: QFLAG_SML Editor has menus and buttons of SML instead of a database query editor. QFLAG_NonModal The dialog created will be non modal QFLAG_ScriptNoFile The editor has no control over the "file" containing the script. Instead of a "File" menu, the editor will get a "Script" menu with "Open...", "Save As...", and "Close" entries only. QFLAG_Pinmap Special menu bar for Pin mapping QFLAG_DispLayer Special menu bar for SML layers in display

Parameters:
dlgparent Parent for dialog
scriptstr Script string passed/returned
smlcontext SML context to use
smlsegment SML segment number
flags Flags, see above
int SML_ExecuteMain ( MDLGPARENT  toplevel,
int(*)(SML::CONTEXT *)  InstallDisplayFunctions,
const MIUNICODE fname,
const MIUNICODE objname,
UINT32  flags,
void *  encdata = NULL,
MIPRODUCTCODE  productcode = MIPRODUCTCODE_Default 
)

Main SML Function.

This is another main entry point for SML. This variation is used by TNTDISP when an SML script is picked from a toolbar.

The InstallDisplayFunctions parameter was meant to allow you to pass in a function to initialize either Mdisp or Mxdw functions from back when we had both. Now, it is ignored.

See also:
SML_Main()
SML_NoEditMain()
Parameters:
toplevel MxToplevel()
fname See comments above Filename to run
objname Object name of script to run (NULL if plain file)
flags QFLAG_ flags
encdata Partial SML::EDITOR data for passing encoding data
productcode Product code to use
void SML_LongToDate ( INT32  date,
char *  dateStr 
)

Convert YYYYMMDD to a string.

int SML_Main ( MDLGPARENT  toplevel,
SML::CONTEXT context,
const char **  argv,
int  argc,
UINT32  flags = 0 
)

Another main entry point for SML.

See also:
SML()
SML_ExecuteMain()
int SML_NoEditMain ( MDLGPARENT  toplevel,
SML::CONTEXT context,
const MIUNICODE fname,
const MIUNICODE objname,
UINT32  flags,
void *  encdata = NULL 
)

Run an SML script without the editor window.

Parameters:
toplevel parent widget if we need to popup anything
context SMLCONTEXT to use
fname Filename of script to run
objname RVC Object name of script (NULL if plain file)
encdata Partial SMLEDITOR data for passing encoding data
int SML_ReadScript ( RVC::OBJITEM ObjItem,
MISTRING ScriptStr,
char *  encoding = 0,
MIUNICODE password = 0,
int(*)(void *data, MIUNICODE *password)  CryptoPromptPassword = 0,
void *  PromptPasswordData = 0,
MCRYPTOHDR crypto = 0 
) [inline]

Read a script into a unicode buffer.

Returns:
TRUE if script is encrypted, FALSE if not, < 0 if error.

If the script is in an RVC object, it may be encrypted, if so, one of 3 things can happen (in this order):

  • If the "password" parameter is filled in and correct, it will be used.
  • If CryptoPromptPassword is not NULL, it will be called. This function should prompt the user for a password and return it in its "password" parameter. The CryptoPromptPassword function can return EUserCancel or 0.
  • The user is just out of luck.

If the script is in a plain file, the encoding parameter should be set to an encoding string telling what kind of encoding the file is in (default of "ISO-2022" will be used if encoding is NULL). There is a special case. If encoding is "Japanese", the text will be scanned to determine if it's "JIS", "Shift-JIS", "EUC". The encoding string passed in will be modified to hold the new encoding name.

It is the caller's job to free the buffer returned

Parameters:
ScriptStr Script RETURNED
encoding Encoding, may be altered
password Default password to try before prompting, can be NULL
PromptPasswordData Data to pass to password prompt function
crypto Will be filled in if the file was encrypted
ERRVALUE SMLEdit ( MDLGPARENT  parent,
SML::CONTEXT context,
int  segment,
MISTRING query,
UINT32  flags 
)

Generated on Sun Oct 7 21:28:08 2012 for TNTsdk 2012 by  doxygen 1.6.1