MSWindows fixes for previous commits.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11644 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2016-04-17 17:45:44 +00:00
parent cdf85352c4
commit e2495a760a
7 changed files with 32 additions and 17 deletions

View File

@ -3,7 +3,9 @@ This documentation will explain how to quickly port FLTK to a new
platform using the Pico driver system. For now, only the sample platform using the Pico driver system. For now, only the sample
SDL Pico driver on OS X compiles and barely runs. SDL Pico driver on OS X compiles and barely runs.
cmake -G Xcode -d OPTION_APPLE_SDL=ON ... > mkdir build
> mkdir XcodeSDL
> cmake -G Xcode -D OPTION_APPLE_SDL=ON ../..
tl;dr - the recent commit should be transparent to all developers tl;dr - the recent commit should be transparent to all developers
on other platforms. On OS X, the CMake setup add the option OPTION_APPLE_SDL=ON on other platforms. On OS X, the CMake setup add the option OPTION_APPLE_SDL=ON

View File

@ -419,15 +419,15 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) {
const float downf = yfract; const float downf = yfract;
for (i = 0; i < d(); i++) { for (i = 0; i < d(); i++) {
new_ptr[i] = (left[i] * leftf + new_ptr[i] = (uchar)((left[i] * leftf +
right[i] * rightf) * upf + right[i] * rightf) * upf +
(downleft[i] * leftf + (downleft[i] * leftf +
downright[i] * rightf) * downf; downright[i] * rightf) * downf);
} }
if (d() == 4 && new_ptr[3]) { if (d() == 4 && new_ptr[3]) {
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
new_ptr[i] /= new_ptr[3] / 255.0f; new_ptr[i] = (uchar)(new_ptr[i] / (new_ptr[3] / 255.0f));
} }
} }
} }

View File

@ -316,7 +316,7 @@ int Fl_Input::handle_key() {
Fl::compose_reset(); // ignore any foreign letters... Fl::compose_reset(); // ignore any foreign letters...
// initialize the list of legal characters inside a floating point number // initialize the list of legal characters inside a floating point number
#ifdef HAVE_LOCALECONV #if defined(HAVE_LOCALECONV) && defined(HAVE_LOCALE_H)
if (!legal_fp_chars) { if (!legal_fp_chars) {
size_t len = strlen(standard_fp_chars); size_t len = strlen(standard_fp_chars);
struct lconv *lc = localeconv(); struct lconv *lc = localeconv();

View File

@ -775,11 +775,12 @@ int menuwindow::handle_part1(int e) {
} }
} }
break; break;
case FL_MOVE: case FL_MOVE: {
static int use_part1_extra = Fl::system_driver()->need_menu_handle_part1_extra(); static int use_part1_extra = Fl::system_driver()->need_menu_handle_part1_extra();
if (use_part1_extra && pp.state == DONE_STATE) { if (use_part1_extra && pp.state == DONE_STATE) {
return 1; // Fix for STR #2619 return 1; // Fix for STR #2619
} }
}
/* FALLTHROUGH */ /* FALLTHROUGH */
case FL_ENTER: case FL_ENTER:
case FL_PUSH: case FL_PUSH:

View File

@ -163,13 +163,13 @@ static HMODULE get_wsock_mod() {
*/ */
static HMODULE s_imm_module = 0; static HMODULE s_imm_module = 0;
typedef BOOL (WINAPI* flTypeImmAssociateContextEx)(HWND, HIMC, DWORD); typedef BOOL (WINAPI* flTypeImmAssociateContextEx)(HWND, HIMC, DWORD);
static flTypeImmAssociateContextEx flImmAssociateContextEx = 0; flTypeImmAssociateContextEx flImmAssociateContextEx = 0;
typedef HIMC (WINAPI* flTypeImmGetContext)(HWND); typedef HIMC (WINAPI* flTypeImmGetContext)(HWND);
static flTypeImmGetContext flImmGetContext = 0; flTypeImmGetContext flImmGetContext = 0;
typedef BOOL (WINAPI* flTypeImmSetCompositionWindow)(HIMC, LPCOMPOSITIONFORM); typedef BOOL (WINAPI* flTypeImmSetCompositionWindow)(HIMC, LPCOMPOSITIONFORM);
static flTypeImmSetCompositionWindow flImmSetCompositionWindow = 0; flTypeImmSetCompositionWindow flImmSetCompositionWindow = 0;
typedef BOOL (WINAPI* flTypeImmReleaseContext)(HWND, HIMC); typedef BOOL (WINAPI* flTypeImmReleaseContext)(HWND, HIMC);
static flTypeImmReleaseContext flImmReleaseContext = 0; flTypeImmReleaseContext flImmReleaseContext = 0;
static void get_imm_module() { static void get_imm_module() {
s_imm_module = LoadLibrary("IMM32.DLL"); s_imm_module = LoadLibrary("IMM32.DLL");
@ -1095,14 +1095,14 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
R = CreateRectRgn(0,0,0,0); R = CreateRectRgn(0,0,0,0);
int r = GetUpdateRgn(hWnd,R,0); int r = GetUpdateRgn(hWnd,R,0);
if (r==NULLREGION && !redraw_whole_window) { if (r==NULLREGION && !redraw_whole_window) {
Fl_Graphics_Driver::XDestroyRegion(R); Fl_Graphics_Driver::default_driver().XDestroyRegion(R);
break; break;
} }
if (i->region) { if (i->region) {
// Also tell WIN32 that we are drawing someplace else as well... // Also tell WIN32 that we are drawing someplace else as well...
CombineRgn(i->region, i->region, R, RGN_OR); CombineRgn(i->region, i->region, R, RGN_OR);
Fl_Graphics_Driver::XDestroyRegion(R); Fl_Graphics_Driver::default_driver().XDestroyRegion(R);
} else { } else {
i->region = R; i->region = R;
} }
@ -2502,6 +2502,8 @@ void preparePrintFront(void)
} }
#endif // USE_PRINT_BUTTON #endif // USE_PRINT_BUTTON
#endif // defined(WIN32) and !defined(FL_DOXYGEN) #endif // defined(WIN32) and !defined(FL_DOXYGEN)
// //

View File

@ -179,6 +179,16 @@ void Fl_GDI_Graphics_Driver::XDestroyRegion(Fl_Region r) {
} }
typedef BOOL(WINAPI* flTypeImmAssociateContextEx)(HWND, HIMC, DWORD);
extern flTypeImmAssociateContextEx flImmAssociateContextEx;
typedef HIMC(WINAPI* flTypeImmGetContext)(HWND);
extern flTypeImmGetContext flImmGetContext;
typedef BOOL(WINAPI* flTypeImmSetCompositionWindow)(HIMC, LPCOMPOSITIONFORM);
extern flTypeImmSetCompositionWindow flImmSetCompositionWindow;
typedef BOOL(WINAPI* flTypeImmReleaseContext)(HWND, HIMC);
extern flTypeImmReleaseContext flImmReleaseContext;
void Fl_GDI_Graphics_Driver::reset_spot() void Fl_GDI_Graphics_Driver::reset_spot()
{ {
} }

View File

@ -450,7 +450,7 @@ void Fl_WinAPI_Window_Driver::hide() {
# endif # endif
} }
if (ip->region) Fl_Graphics_Driver::XDestroyRegion(ip->region); if (ip->region) Fl_Graphics_Driver::default_driver().XDestroyRegion(ip->region);
// this little trickery seems to avoid the popup window stacking problem // this little trickery seems to avoid the popup window stacking problem
HWND p = GetForegroundWindow(); HWND p = GetForegroundWindow();