comparison win/dw.c @ 1336:63e05ef4a59a

Fixes to the source on Windows so it will build standalone again. (With HTML widget disabled) Also fixes for building without GDI+. Missed a few #ifdefs.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 13 Nov 2011 14:46:30 +0000
parents c0f29ce1a879
children b23ae7d9f729
comparison
equal deleted inserted replaced
1335:44f8a846f3c1 1336:63e05ef4a59a
19 #include <stdio.h> 19 #include <stdio.h>
20 #include <process.h> 20 #include <process.h>
21 #include <time.h> 21 #include <time.h>
22 #include <math.h> 22 #include <math.h>
23 #include "dw.h" 23 #include "dw.h"
24 #ifdef BUILD_DLL
24 #include "XBrowseForFolder.h" 25 #include "XBrowseForFolder.h"
26 #endif
25 27
26 #ifdef GDIPLUS 28 #ifdef GDIPLUS
27 /* GDI+ Headers are not C compatible... so define what we need here instead */ 29 /* GDI+ Headers are not C compatible... so define what we need here instead */
28 struct GdiplusStartupInput 30 struct GdiplusStartupInput
29 { 31 {
156 HBRUSH _colors[18]; 158 HBRUSH _colors[18];
157 159
158 static int screenx, screeny; 160 static int screenx, screeny;
159 HFONT _DefaultFont = NULL; 161 HFONT _DefaultFont = NULL;
160 162
163 #ifdef BUILD_DLL
161 LRESULT CALLBACK _browserWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 164 LRESULT CALLBACK _browserWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
165 #endif
162 void _resize_notebook_page(HWND handle, int pageid); 166 void _resize_notebook_page(HWND handle, int pageid);
163 void _handle_splitbar_resize(HWND hwnd, float percent, int type, int x, int y); 167 void _handle_splitbar_resize(HWND hwnd, float percent, int type, int x, int y);
164 int _lookup_icon(HWND handle, HICON hicon, int type); 168 int _lookup_icon(HWND handle, HICON hicon, int type);
165 HFONT _acquire_font(HWND handle, char *fontname); 169 HFONT _acquire_font(HWND handle, char *fontname);
166 void _click_default(HWND handle); 170 void _click_default(HWND handle);
3625 WNDCLASS wc; 3629 WNDCLASS wc;
3626 int z; 3630 int z;
3627 INITCOMMONCONTROLSEX icc; 3631 INITCOMMONCONTROLSEX icc;
3628 char *fname, *alttmpdir; 3632 char *fname, *alttmpdir;
3629 HFONT oldfont; 3633 HFONT oldfont;
3634 #ifdef GDIPLUS
3630 struct GdiplusStartupInput si; 3635 struct GdiplusStartupInput si;
3636 #endif
3631 3637
3632 /* Initialize our thread local storage */ 3638 /* Initialize our thread local storage */
3633 _foreground = TlsAlloc(); 3639 _foreground = TlsAlloc();
3634 _background = TlsAlloc(); 3640 _background = TlsAlloc();
3635 _hPen = TlsAlloc(); 3641 _hPen = TlsAlloc();
3690 wc.lpszMenuName = NULL; 3696 wc.lpszMenuName = NULL;
3691 wc.lpszClassName = FRAMECLASSNAME; 3697 wc.lpszClassName = FRAMECLASSNAME;
3692 3698
3693 RegisterClass(&wc); 3699 RegisterClass(&wc);
3694 3700
3701 #ifdef BUILD_DLL
3695 /* Register HTML renderer class */ 3702 /* Register HTML renderer class */
3696 memset(&wc, 0, sizeof(WNDCLASS)); 3703 memset(&wc, 0, sizeof(WNDCLASS));
3697 wc.lpfnWndProc = (WNDPROC)_browserWindowProc; 3704 wc.lpfnWndProc = (WNDPROC)_browserWindowProc;
3698 wc.lpszClassName = BrowserClassName; 3705 wc.lpszClassName = BrowserClassName;
3699 wc.style = CS_HREDRAW|CS_VREDRAW; 3706 wc.style = CS_HREDRAW|CS_VREDRAW;
3700 RegisterClass(&wc); 3707 RegisterClass(&wc);
3708 #endif
3701 3709
3702 /* Create a set of brushes using the default OS/2 and DOS colors */ 3710 /* Create a set of brushes using the default OS/2 and DOS colors */
3703 for(z=0;z<18;z++) 3711 for(z=0;z<18;z++)
3704 _colors[z] = CreateSolidBrush(RGB(_red[z],_green[z],_blue[z])); 3712 _colors[z] = CreateSolidBrush(RGB(_red[z],_green[z],_blue[z]));
3705 3713