DocX是一个可扩展的文档撰写系统。 主要针对Reference帮助尤其方便。
WinX将采用DocX作为Reference编写的支持平台。可以预见,大量WinX的文档出现已经为时不远了。
DocX最初是一个研究项目。目前版本为0.1.02版本。这是因为我认为它仍然还不成熟。
一个示意性的函数帮助看起来是这样的:
/*
@category WINX: a C++ template GUI library - MOST SIMPLE BUT EFFECTIVE
@ */
/*
@fn ManualConvert
@brief
通过一系列的源文件,生成chm文件。
@arg [in] file
输入的源文件。
@arg [in] chm_file
要生成的chm文件。p
如果不需要生成chm,则传入NULL。
@arg [in] fHtmlLink
中文:
@val 0(假)
chm中的源文件采用xml格式。
@val 非0(真)
chm中的源文件采用html格式。
@end
In
English:
@val true
Todo
@val false
Todo
@return
成功生成chm,返回S_OK。否则返回一个错误码。
@val S_OK
调用成功。
@val E_FAIL
一般性错误。
@remark
注意点。
@see AnotherFunc
@ */
inline
HRESULT __stdcall ManualConvert(
const char * file,
const char * chm_file,
BOOL fHtmlLink
)
{
...
return S_OK;
}
@category WINX: a C++ template GUI library - MOST SIMPLE BUT EFFECTIVE
@ */
/*
@fn ManualConvert
@brief
通过一系列的源文件,生成chm文件。
@arg [in] file
输入的源文件。
@arg [in] chm_file
要生成的chm文件。p
如果不需要生成chm,则传入NULL。
@arg [in] fHtmlLink
中文:
@val 0(假)
chm中的源文件采用xml格式。
@val 非0(真)
chm中的源文件采用html格式。
@end
In
English:
@val true
Todo
@val false
Todo
@return
成功生成chm,返回S_OK。否则返回一个错误码。
@val S_OK
调用成功。
@val E_FAIL
一般性错误。
@remark
注意点。
@see AnotherFunc
@ */
inline
HRESULT __stdcall ManualConvert(
const char * file,
const char * chm_file,
BOOL fHtmlLink
)
{
...
return S_OK;
}
产生的效果图如下:
我们另外给一个类的例子:
/*
@class GpGraphics
@brief
Todo :-)
@remark
@ */
class GpGraphics : public GpBase
{
public :
/*
@fn Release
@brief
Release object.
@ */
GPAPI_( void ) Release()
{
DllExports::GdipDeleteGraphics( this );
}
/*
@fn DrawString
@brief
The DrawString method draws a string based on a font, a layout
rectangle, and a format.
@arg [in] string
Pointer to a wide-character string to be drawn.
@arg [in] length
Integer that specifies the number of characters in the string array.
The length parameter can be set to –1 if the string is null terminated.
@arg [in] font
Pointer to a Font object that specifies the font attributes (the family
name, the size, and the style of the font) to use.
@arg [in] layoutRect
Reference to a rectangle that bounds the string.
@arg [in] stringFormat
Pointer to a StringFormat object that specifies text layout information
and display manipulations to be applied to the string.
@arg [in] brush
Pointer to a Brush object that is used to fill the string.
@return
If the method succeeds, it returns Ok. see <Status>。
@ */
GPAPI
DrawString(
IN const WCHAR * string ,
IN INT length,
IN GpFont * font,
IN const RectF & layoutRect,
IN GpStringFormat * stringFormat,
IN GpBrush * brush
);
};
@class GpGraphics
@brief
Todo :-)
@remark
@ */
class GpGraphics : public GpBase
{
public :
/*
@fn Release
@brief
Release object.
@ */
GPAPI_( void ) Release()
{
DllExports::GdipDeleteGraphics( this );
}
/*
@fn DrawString
@brief
The DrawString method draws a string based on a font, a layout
rectangle, and a format.
@arg [in] string
Pointer to a wide-character string to be drawn.
@arg [in] length
Integer that specifies the number of characters in the string array.
The length parameter can be set to –1 if the string is null terminated.
@arg [in] font
Pointer to a Font object that specifies the font attributes (the family
name, the size, and the style of the font) to use.
@arg [in] layoutRect
Reference to a rectangle that bounds the string.
@arg [in] stringFormat
Pointer to a StringFormat object that specifies text layout information
and display manipulations to be applied to the string.
@arg [in] brush
Pointer to a Brush object that is used to fill the string.
@return
If the method succeeds, it returns Ok. see <Status>。
@ */
GPAPI
DrawString(
IN const WCHAR * string ,
IN INT length,
IN GpFont * font,
IN const RectF & layoutRect,
IN GpStringFormat * stringFormat,
IN GpBrush * brush
);
};
产生的效果是这样的:
图1:类的索引页
图2:DrawingString函数帮助
其实还有一个Release函数的帮助,我这里就不累赘了。