Mercurial > dwindows
comparison win/dw.c @ 1856:285bf986e4fd
Get HTML support building with MinGW... some warnings need to
be fixed in browser.c but it works now.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 28 Feb 2013 13:02:25 +0000 |
parents | 4790589f52a9 |
children | 417176df4755 |
comparison
equal
deleted
inserted
replaced
1855:72a75442c51d | 1856:285bf986e4fd |
---|---|
300 | 300 |
301 HBRUSH _colors[18]; | 301 HBRUSH _colors[18]; |
302 | 302 |
303 HFONT _DefaultFont = NULL; | 303 HFONT _DefaultFont = NULL; |
304 | 304 |
305 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) && !defined(__MINGW32__) | 305 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) |
306 LRESULT CALLBACK _browserWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); | 306 LRESULT CALLBACK _browserWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); |
307 #endif | 307 #endif |
308 LRESULT CALLBACK _colorwndproc(HWND hWnd, UINT msg, WPARAM mp1, LPARAM mp2); | 308 LRESULT CALLBACK _colorwndproc(HWND hWnd, UINT msg, WPARAM mp1, LPARAM mp2); |
309 void _resize_notebook_page(HWND handle, int pageid); | 309 void _resize_notebook_page(HWND handle, int pageid); |
310 void _handle_splitbar_resize(HWND hwnd, float percent, int type, int x, int y); | 310 void _handle_splitbar_resize(HWND hwnd, float percent, int type, int x, int y); |
3867 wc.lpszMenuName = NULL; | 3867 wc.lpszMenuName = NULL; |
3868 wc.lpszClassName = StatusbarClassName; | 3868 wc.lpszClassName = StatusbarClassName; |
3869 | 3869 |
3870 RegisterClass(&wc); | 3870 RegisterClass(&wc); |
3871 | 3871 |
3872 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) && !defined(__MINGW32__) | 3872 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) |
3873 /* Register HTML renderer class */ | 3873 /* Register HTML renderer class */ |
3874 memset(&wc, 0, sizeof(WNDCLASS)); | 3874 memset(&wc, 0, sizeof(WNDCLASS)); |
3875 wc.lpfnWndProc = (WNDPROC)_browserWindowProc; | 3875 wc.lpfnWndProc = (WNDPROC)_browserWindowProc; |
3876 wc.lpszClassName = BrowserClassName; | 3876 wc.lpszClassName = BrowserClassName; |
3877 wc.style = CS_HREDRAW|CS_VREDRAW; | 3877 wc.style = CS_HREDRAW|CS_VREDRAW; |
5258 * Parameters: | 5258 * Parameters: |
5259 * id: An ID to be used with dw_window_from_id or 0L. | 5259 * id: An ID to be used with dw_window_from_id or 0L. |
5260 */ | 5260 */ |
5261 HWND API dw_html_new(unsigned long id) | 5261 HWND API dw_html_new(unsigned long id) |
5262 { | 5262 { |
5263 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) && !defined(__MINGW32__) | 5263 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) |
5264 return CreateWindow(BrowserClassName, | 5264 return CreateWindow(BrowserClassName, |
5265 NULL, | 5265 NULL, |
5266 WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS, | 5266 WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS, |
5267 0,0,0,0, | 5267 0,0,0,0, |
5268 DW_HWND_OBJECT, | 5268 DW_HWND_OBJECT, |
5273 dw_debug("HTML widget not available; Support not enabled in this build.\n"); | 5273 dw_debug("HTML widget not available; Support not enabled in this build.\n"); |
5274 return 0; | 5274 return 0; |
5275 #endif | 5275 #endif |
5276 } | 5276 } |
5277 | 5277 |
5278 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) && !defined(__MINGW32__) | 5278 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) |
5279 void _dw_html_action(HWND hwnd, int action); | 5279 void _dw_html_action(HWND hwnd, int action); |
5280 int _dw_html_raw(HWND hwnd, char *string); | 5280 int _dw_html_raw(HWND hwnd, char *string); |
5281 int _dw_html_url(HWND hwnd, char *url); | 5281 int _dw_html_url(HWND hwnd, char *url); |
5282 #endif | 5282 #endif |
5283 | 5283 |
5287 * handle: Handle to the window. | 5287 * handle: Handle to the window. |
5288 * action: One of the DW_HTML_* constants. | 5288 * action: One of the DW_HTML_* constants. |
5289 */ | 5289 */ |
5290 void API dw_html_action(HWND handle, int action) | 5290 void API dw_html_action(HWND handle, int action) |
5291 { | 5291 { |
5292 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) && !defined(__MINGW32__) | 5292 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) |
5293 _dw_html_action(handle, action); | 5293 _dw_html_action(handle, action); |
5294 #endif | 5294 #endif |
5295 } | 5295 } |
5296 | 5296 |
5297 /* | 5297 /* |
5303 * Returns: | 5303 * Returns: |
5304 * DW_ERROR_NONE (0) on success. | 5304 * DW_ERROR_NONE (0) on success. |
5305 */ | 5305 */ |
5306 int API dw_html_raw(HWND handle, char *string) | 5306 int API dw_html_raw(HWND handle, char *string) |
5307 { | 5307 { |
5308 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) && !defined(__MINGW32__) | 5308 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) |
5309 return _dw_html_raw(handle, string); | 5309 return _dw_html_raw(handle, string); |
5310 #else | 5310 #else |
5311 return DW_ERROR_GENERAL; | 5311 return DW_ERROR_GENERAL; |
5312 #endif | 5312 #endif |
5313 } | 5313 } |
5321 * Returns: | 5321 * Returns: |
5322 * DW_ERROR_NONE (0) on success. | 5322 * DW_ERROR_NONE (0) on success. |
5323 */ | 5323 */ |
5324 int API dw_html_url(HWND handle, char *url) | 5324 int API dw_html_url(HWND handle, char *url) |
5325 { | 5325 { |
5326 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) && !defined(__MINGW32__) | 5326 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) |
5327 return _dw_html_url(handle, url); | 5327 return _dw_html_url(handle, url); |
5328 #else | 5328 #else |
5329 return DW_ERROR_GENERAL; | 5329 return DW_ERROR_GENERAL; |
5330 #endif | 5330 #endif |
5331 } | 5331 } |