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.
(in Rev4.00)
This function is deprecated now. It will be obsoleted in the future version. Please use MQWidgetBase::GetSystemWidgetID() to access widgets.
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.
'info' must be filled by 0 at the beginning, and set a size of this structure to 'dwSize'.
struct MQFileDialogInfo { enum HAND_TYPE { HAND_LEFT = 0, HAND_RIGHT = 1, }; DWORD dwSize; int type; float scale; const char *softname; int axis_x; int axis_y; int axis_z; BOOL invert_face; HAND_TYPE hand_type; void (*dialog_callback)(bool init, MQFileDialogCallbackParam *param, void *ptr); void *dialog_callback_ptr; };
|
(in Rev4.00)
The left and right directions by axis_x, axis_y and axis_z in MQFileDialogInfo have been fixed because they are reversed. You should reverse MQFILE_TYPE_LEFT and MQFILE_TYPE_RIGHT if you want to get same results with transfering codes from old versions.
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.
Each function is provided for importing and exporting.
(in Rev4.00)
The left and right directions by axis_x, axis_y and axis_z in MQFileDialogInfo have been fixed because they are reversed. You should reverse MQFILE_TYPE_LEFT and MQFILE_TYPE_RIGHT if you want to get same results with transfering codes from old versions.
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.
BITMAPINFOHEADER structure (and RGBQUAD if bpp is 8 or lesse) is contained in header.
An image data is contained in buffer. If bpp is 32, the high byte means an alpha component.
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.
(obsolete in Rev4.00)
MQFOLDER_METASEQ_INI is no longer available. Please use MQFOLDER_METASEQ_SETTING_XML to access settings.
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.
BOOL MQWidget_Value(int widget_id, int type_id, void *values);
(new in Rev4.00)
It operates widgets and events.
It is not necessary to call this function directly. It is called by MQWidgetBase class and inherited classes.