Global functions are provided to operate an information about the system or to create new classes.
HWND MQ_GetWindowHandle(void);
It gets a handle of the main window. It is necessary, for example, to create a dialog box.
MQObject MQ_CreateObject(void);
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);
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);
(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);
(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);
(new in Rev2.30)
It draws the view again.
The 'reserved' must be NULL.
void MQ_StationCallback(MQStationCallbackProc proc, void *option);
(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);
|
BOOL MQ_SendMessage(int message_type, MQSendMessageInfo *info);
(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.