Global function

Global functions are provided to operate an information about the system or to create new classes.


HWND MQ_GetWindowHandle(void);

Return value
A window handle

It gets a handle of the main window. It is necessary, for example, to create a dialog box.


MQObject MQ_CreateObject(void);

Return value
A created object class

It creates a new object class. The created object must be registered to a document by MQDocument::AddObject(), or be deleted by MQObject::DeleteThis().


MQMaterial MQ_CreateMaterial(void);

Return value
A created material class

It creates a new material class. The created material must be registered to a document by MQDocument::AddMaterial(), or be deleted by MQMaterial::DeleteThis().


void MQ_ShowFileDialog(const char *title, MQFileDialogInfo *info);

It shows a file dialog with functions such as a conversion of coordinate axes.


void MQ_ImportAxis(MQFileDialogInfo *info, MQPoint *pts, int pts_count);
void MQ_ExportAxis(MQFileDialogInfo *info, MQPoint *pts, int pts_count);

It converts positions based on the axes information set by a file dialog.

The different functions are provided for importing and exporting.


BOOL MQ_LoadImage(const char *filename, LPVOID *header, LPVOID *buffer, DWORD reserved);

filename
A filename
header
A pointer to receive a header information of the DIB.
buffer
A pointer to receive a buffer of the DIB.
reserved
Reserved for the future version (must be 0)
Return value
[TRUE] Succeeded to load
[FALSE] Failed to load

(new in Rev2.10)

It loads the specified image file as a DIB (Device Independent Bitmap).

The heap memories allocated by LocalAlloc(LMEM_FIXED, uBytes) are stored to the 'header' and the 'buffer' if the loading has been succeeded. You must release the memory with LocalFree() when no longer needed.


BOOL MQ_GetSystemPath(char *buffer, int type);

buffer
A buffer to receive a path.
type
[MQFOLDER_ROOT] A folder contains Metaseq.exe (Ex: "C:\Program Files\Metaseq")
[MQFOLDER_METASEQ_EXE] A path of Metaseq.exe (Ex: "C:\Program Files\Metaseq\Metaseq.exe")
[MQFOLDER_METASEQ_INI] A path of Metaseq.ini (Ex: "C:\Program Files\Metaseq\Metaseq.ini")
[MQFOLDER_DATA] Data folder (Ex: "C:\Program Files\Metaseq\Data")
[MQFOLDER_PLUGINS] Plugins folder (Ex: "C:\Program Files\Metaseq\Plugins")
Return value
[TRUE] Succeeded
[FALSE] Failed

(new in Rev2.10)

It stores the specified path to the 'buffer'. The size of the 'buffer' must be same as or larger than.

Attention: When MQFOLDER_DATA or MQFOLDER_PLUGINS is specified for 'type', an invalid directory is returned in Ver2.1.5 or older for the bug.


void MQ_RefreshView(void *reserved);

reserved
Reserved (must be NULL)

(new in Rev2.30)

It draws the view again.

The 'reserved' must be NULL.


void MQ_StationCallback(MQStationCallbackProc proc, void *option);

proc
A callback function
option
An option to give the callback function

(new in Rev2.40)

You call this function to do with an operation from a station plug-in, and perform the operation to a document in the callback function.

A callback function is defined with the following form:

typedef BOOL (__stdcall *MQStationCallbackProc)(MQDocument doc, void *option);

doc
A document
option
An option given by MQ_StationCallback()
Return value
[TRUE] Any change made
[FALSE] No change

BOOL MQ_SendMessage(int message_type, MQSendMessageInfo *info);

message_type
A message type
[MQMESSAGE_ACTIVATE] Change an active state
[MQMESSAGE_NEW_DRAW_OBJECT] Create a drawing object
[MQMESSAGE_NEW_DRAW_MATERIAL] Create a material for a drawing object
[MQMESSAGE_GET_UNDO_STATE] Get an undo state
info
An information
Return value
[TRUE] Succeeded
[FALSE] Failed

(new in Rev2.40)

It notifies a message to the main part of Metasequoia when a station plug-in does with an operation or requires an operation.