summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2016-04-17 17:45:44 +0000
committerMatthias Melcher <fltk@matthiasm.com>2016-04-17 17:45:44 +0000
commite2495a760a7c5987724467923b9beb57c50ccfeb (patch)
treeea46433ed29b0f33199080e199f6fafcd2fb2913
parentcdf85352c42dd2f3b43703897148e8fa513c9cdc (diff)
MSWindows fixes for previous commits.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11644 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--README.Pico.txt4
-rw-r--r--src/Fl_Image.cxx6
-rw-r--r--src/Fl_Input.cxx2
-rw-r--r--src/Fl_Menu.cxx11
-rw-r--r--src/Fl_win32.cxx14
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx10
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx2
7 files changed, 32 insertions, 17 deletions
diff --git a/README.Pico.txt b/README.Pico.txt
index aad00911b..f5f907c0b 100644
--- a/README.Pico.txt
+++ b/README.Pico.txt
@@ -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
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
on other platforms. On OS X, the CMake setup add the option OPTION_APPLE_SDL=ON
diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx
index fdaf0bfdb..c048d57c3 100644
--- a/src/Fl_Image.cxx
+++ b/src/Fl_Image.cxx
@@ -419,15 +419,15 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) {
const float downf = yfract;
for (i = 0; i < d(); i++) {
- new_ptr[i] = (left[i] * leftf +
+ new_ptr[i] = (uchar)((left[i] * leftf +
right[i] * rightf) * upf +
(downleft[i] * leftf +
- downright[i] * rightf) * downf;
+ downright[i] * rightf) * downf);
}
if (d() == 4 && new_ptr[3]) {
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));
}
}
}
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx
index d6b8b3886..205babaf3 100644
--- a/src/Fl_Input.cxx
+++ b/src/Fl_Input.cxx
@@ -316,7 +316,7 @@ int Fl_Input::handle_key() {
Fl::compose_reset(); // ignore any foreign letters...
// 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) {
size_t len = strlen(standard_fp_chars);
struct lconv *lc = localeconv();
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index 39ab67072..1d56a1ebd 100644
--- a/src/Fl_Menu.cxx
+++ b/src/Fl_Menu.cxx
@@ -775,11 +775,12 @@ int menuwindow::handle_part1(int e) {
}
}
break;
- case FL_MOVE:
- static int use_part1_extra = Fl::system_driver()->need_menu_handle_part1_extra();
- if (use_part1_extra && pp.state == DONE_STATE) {
- return 1; // Fix for STR #2619
- }
+ case FL_MOVE: {
+ static int use_part1_extra = Fl::system_driver()->need_menu_handle_part1_extra();
+ if (use_part1_extra && pp.state == DONE_STATE) {
+ return 1; // Fix for STR #2619
+ }
+ }
/* FALLTHROUGH */
case FL_ENTER:
case FL_PUSH:
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index c3ea187bf..3bf114404 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -163,13 +163,13 @@ static HMODULE get_wsock_mod() {
*/
static HMODULE s_imm_module = 0;
typedef BOOL (WINAPI* flTypeImmAssociateContextEx)(HWND, HIMC, DWORD);
-static flTypeImmAssociateContextEx flImmAssociateContextEx = 0;
+flTypeImmAssociateContextEx flImmAssociateContextEx = 0;
typedef HIMC (WINAPI* flTypeImmGetContext)(HWND);
-static flTypeImmGetContext flImmGetContext = 0;
+flTypeImmGetContext flImmGetContext = 0;
typedef BOOL (WINAPI* flTypeImmSetCompositionWindow)(HIMC, LPCOMPOSITIONFORM);
-static flTypeImmSetCompositionWindow flImmSetCompositionWindow = 0;
+flTypeImmSetCompositionWindow flImmSetCompositionWindow = 0;
typedef BOOL (WINAPI* flTypeImmReleaseContext)(HWND, HIMC);
-static flTypeImmReleaseContext flImmReleaseContext = 0;
+flTypeImmReleaseContext flImmReleaseContext = 0;
static void get_imm_module() {
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);
int r = GetUpdateRgn(hWnd,R,0);
if (r==NULLREGION && !redraw_whole_window) {
- Fl_Graphics_Driver::XDestroyRegion(R);
+ Fl_Graphics_Driver::default_driver().XDestroyRegion(R);
break;
}
if (i->region) {
// Also tell WIN32 that we are drawing someplace else as well...
CombineRgn(i->region, i->region, R, RGN_OR);
- Fl_Graphics_Driver::XDestroyRegion(R);
+ Fl_Graphics_Driver::default_driver().XDestroyRegion(R);
} else {
i->region = R;
}
@@ -2502,6 +2502,8 @@ void preparePrintFront(void)
}
#endif // USE_PRINT_BUTTON
+
+
#endif // defined(WIN32) and !defined(FL_DOXYGEN)
//
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
index 47cc9383c..e10191ec2 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
@@ -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()
{
}
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
index 89bd68fee..a7b068e69 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
@@ -450,7 +450,7 @@ void Fl_WinAPI_Window_Driver::hide() {
# 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
HWND p = GetForegroundWindow();