summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>1999-10-14 04:56:09 +0000
committerBill Spitzak <spitzak@gmail.com>1999-10-14 04:56:09 +0000
commitce249490d4ada2885c2058a5177e544be702769b (patch)
treec917a318e108be83b2bf8b4180d5cb4d3ff460ee
parent4ccf6b4b378363bc96d48e433d905d2b24250cc6 (diff)
These are some (hopefully minor) changes we keep needing to edit into
each new version of fltk for use at Digital Domain. These were found by running a diff between 1.0.6 and our inhouse version. 1. WinMain is moved to the fl_call_main.c file so that it can easily be conditionally-compiled out (code copied from fltk 2.0, not tested!) 2. Fl_win32 ignores the value of window->xclass(). This seemed to cause problems when windows had different xclass() in the same app and did not have any useful effect on windows. This value is changed to set the icon of the app on X. 3. sgi pragmas added to x.H to turn off warnings from their broken xlib header files. Please tell me if this causes any sgi compilers to complain, we should add more stuff to the #ifdef to stop that. 4. Fl_Gl_Window::ortho() changed so that text and images are not erased if the origin is off the left/bottom of the window. 5. Small change to Fl_Input so that a click that gives it the focus also selects all the text. This is more windoze-like and it seems the users really like it. Note also that we had to set USE_XDBE to zero to get things to work on the newest Irix machines. I give up, Xdbe has been nothing but an impossible and confusing mess and it is obvious that the X servers are not testing it and thus it is suffering from software rot so it is unlikely to work anywhere in the future. Not sure if we want to switch it off in the official version, though. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@774 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_Gl_Window.cxx10
-rw-r--r--src/Fl_Input.cxx13
-rw-r--r--src/Fl_win32.cxx60
-rw-r--r--src/fl_call_main.c52
-rw-r--r--src/fl_shortcut.cxx6
5 files changed, 70 insertions, 71 deletions
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx
index 5b20d60d2..f10f10f71 100644
--- a/src/Fl_Gl_Window.cxx
+++ b/src/Fl_Gl_Window.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Gl_Window.cxx,v 1.12.2.3 1999/09/16 05:34:25 bill Exp $"
+// "$Id: Fl_Gl_Window.cxx,v 1.12.2.4 1999/10/14 04:56:08 bill Exp $"
//
// OpenGL window code for the Fast Light Tool Kit (FLTK).
//
@@ -150,9 +150,11 @@ void Fl_Gl_Window::make_current() {
}
void Fl_Gl_Window::ortho() {
+ int p[2];
+ glGetIntegerv(GL_MAX_VIEWPORT_DIMS, p);
glLoadIdentity();
- glViewport(0, 0, w(), h());
- glOrtho(0, w(), 0, h(), -1, 1);
+ glViewport(w()-p[0], h()-p[1], p[0], p[1]);
+ glOrtho(w()-p[0], w(), h()-p[1], h(), -1, 1);
}
void Fl_Gl_Window::swap_buffers() {
@@ -314,5 +316,5 @@ void Fl_Gl_Window::draw_overlay() {}
#endif
//
-// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.3 1999/09/16 05:34:25 bill Exp $".
+// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.4 1999/10/14 04:56:08 bill Exp $".
//
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx
index d0e1fc8a3..70648bf6f 100644
--- a/src/Fl_Input.cxx
+++ b/src/Fl_Input.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Input.cxx,v 1.10.2.1 1999/04/20 04:43:24 bill Exp $"
+// "$Id: Fl_Input.cxx,v 1.10.2.2 1999/10/14 04:56:08 bill Exp $"
//
// Input widget for the Fast Light Tool Kit (FLTK).
//
@@ -313,11 +313,18 @@ int Fl_Input::handle(int event) {
compose = 0;
if (Fl::event_button() == 2) {
Fl::paste(*this);
- if (Fl::focus()==this) return 1; // remove line for Motif behavior
+#ifndef MOTIF // use -DMOTIF for Motif rather than Win32+Motif hybrid
+ if (Fl::focus()==this) return 1;
+#endif
}
if (Fl::focus() != this) {
Fl::focus(this);
handle(FL_FOCUS); // cause minimal update
+#ifndef MOTIF
+ position(size(),0); // select everything
+ Fl::event_is_click(0); // prevents next click from doing word-select
+ return 1;
+#endif
}
break;
@@ -337,5 +344,5 @@ Fl_Input::Fl_Input(int x, int y, int w, int h, const char *l)
}
//
-// End of "$Id: Fl_Input.cxx,v 1.10.2.1 1999/04/20 04:43:24 bill Exp $".
+// End of "$Id: Fl_Input.cxx,v 1.10.2.2 1999/10/14 04:56:08 bill Exp $".
//
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 0f857f63c..c8dc8f555 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_win32.cxx,v 1.33.2.14 1999/09/16 05:34:26 bill Exp $"
+// "$Id: Fl_win32.cxx,v 1.33.2.15 1999/10/14 04:56:08 bill Exp $"
//
// WIN32-specific code for the Fast Light Tool Kit (FLTK).
//
@@ -663,8 +663,8 @@ int fl_disable_transient_for; // secret method of removing TRANSIENT_FOR
Fl_X* Fl_X::make(Fl_Window* w) {
Fl_Group::current(0); // get rid of very common user bug: forgot end()
- const char* class_name = w->xclass();
- if (!class_name) class_name = "FLTK"; // create a "FLTK" WNDCLASS
+ const char* class_name = /*w->xclass();
+ if (!class_name) class_name =*/ "FLTK"; // create a "FLTK" WNDCLASS
WNDCLASSEX wc;
// Documentation states a device context consumes about 800 bytes
@@ -783,58 +783,6 @@ Fl_X* Fl_X::make(Fl_Window* w) {
HINSTANCE fl_display = GetModuleHandle(NULL);
-//
-// This WinMain() function can be overridden by an application and
-// is provided for compatibility with programs written for other
-// operating systems that conform to the ANSI standard entry point
-// "main()". This will allow you to build a WIN32 Application
-// without any special settings.
-//
-// Because of problems with the Microsoft Visual C++ header files
-// and/or compiler, you cannot have a WinMain function in a DLL.
-// I don't know why. Thus, this nifty feature is only available
-// if you link to the static library.
-//
-// Currently the debug version of this library will create a
-// console window for your application so you can put printf()
-// statements for debugging or informational purposes. Ultimately
-// we want to update this to always use the parent's console,
-// but at present we have not identified a function or API in
-// Microsoft(r) Windows(r) that allows for it.
-//
-
-#if !defined(FL_DLL) && !defined(__GNUC__)
-
-extern "C" int fl_call_main();
-
-int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
- LPSTR lpCmdLine, int nCmdShow) {
- // Save the current instance in the fl_display variable...
- fl_display = hInstance;
-
-#ifdef _DEBUG
- // If we are using compiling in debug mode, open a console window so
- // we can see any printf's, etc...
- //
- // While we can detect if the program was run from the command-line -
- // look at the CMDLINE environment variable, it will be "WIN" for
- // programs started from the GUI - the shell seems to run all WIN32
- // applications in the background anyways...
-
- AllocConsole();
- freopen("conin$", "r", stdin);
- freopen("conout$", "w", stdout);
- freopen("conout$", "w", stderr);
-#endif // _DEBUG
-
- // Run the standard main entry point function...
- return fl_call_main();
-}
-
-#endif /* !FL_DLL && !__GNUC__ */
-
-////////////////////////////////////////////////////////////////
-
void Fl_Window::size_range_() {
size_range_set = 1;
}
@@ -949,5 +897,5 @@ void Fl_Window::make_current() {
}
//
-// End of "$Id: Fl_win32.cxx,v 1.33.2.14 1999/09/16 05:34:26 bill Exp $".
+// End of "$Id: Fl_win32.cxx,v 1.33.2.15 1999/10/14 04:56:08 bill Exp $".
//
diff --git a/src/fl_call_main.c b/src/fl_call_main.c
index 0089f1061..9cd4b25f5 100644
--- a/src/fl_call_main.c
+++ b/src/fl_call_main.c
@@ -1,5 +1,5 @@
/*
- * "$Id: fl_call_main.c,v 1.1.2.2 1999/05/24 14:03:47 mike Exp $"
+ * "$Id: fl_call_main.c,v 1.1.2.3 1999/10/14 04:56:09 bill Exp $"
*
* Copyright 1998-1999 by Bill Spitzak and others.
*
@@ -24,17 +24,59 @@
* Please report all bugs and problems to "fltk-bugs@easysw.com".
*/
-#if defined(WIN32) && !defined(FL_DLL) && !defined(__GNUC__)
+/*
+// This WinMain() function can be overridden by an application and
+// is provided for compatibility with programs written for other
+// operating systems that conform to the ANSI standard entry point
+// "main()". This will allow you to build a WIN32 Application
+// without any special settings.
+//
+// Because of problems with the Microsoft Visual C++ header files
+// and/or compiler, you cannot have a WinMain function in a DLL.
+// I don't know why. Thus, this nifty feature is only available
+// if you link to the static library.
+//
+// Currently the debug version of this library will create a
+// console window for your application so you can put printf()
+// statements for debugging or informational purposes. Ultimately
+// we want to update this to always use the parent's console,
+// but at present we have not identified a function or API in
+// Microsoft(r) Windows(r) that allows for it.
+*/
+
+#if defined(WIN32) //&& !defined(FL_DLL)
+
+#include <windows.h>
+#include <stdio.h>
+
extern int main(int, char *[]);
extern int __argc;
extern char **__argv;
-int fl_call_main() {
+int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine, int nCmdShow) {
+#ifdef _DEBUG
+ // If we are using compiling in debug mode, open a console window so
+ // we can see any printf's, etc...
+ //
+ // While we can detect if the program was run from the command-line -
+ // look at the CMDLINE environment variable, it will be "WIN" for
+ // programs started from the GUI - the shell seems to run all WIN32
+ // applications in the background anyways...
+
+ AllocConsole();
+ freopen("conin$", "r", stdin);
+ freopen("conout$", "w", stdout);
+ freopen("conout$", "w", stderr);
+#endif // _DEBUG
+
+ // Run the standard main entry point function...
return main(__argc, __argv);
}
-#endif /* WIN32 && !FL_DLL && !__GNUC__ */
+
+#endif
/*
- * End of "$Id: fl_call_main.c,v 1.1.2.2 1999/05/24 14:03:47 mike Exp $".
+ * End of "$Id: fl_call_main.c,v 1.1.2.3 1999/10/14 04:56:09 bill Exp $".
*/
diff --git a/src/fl_shortcut.cxx b/src/fl_shortcut.cxx
index 88f3ed660..475528043 100644
--- a/src/fl_shortcut.cxx
+++ b/src/fl_shortcut.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_shortcut.cxx,v 1.4.2.1 1999/05/11 09:39:31 bill Exp $"
+// "$Id: fl_shortcut.cxx,v 1.4.2.2 1999/10/14 04:56:09 bill Exp $"
//
// Shortcut support routines for the Fast Light Tool Kit (FLTK).
//
@@ -45,7 +45,7 @@
#include <ctype.h>
#include <string.h>
#ifndef WIN32
-#include <X11/Xlib.h>
+#include <FL/x.H>
#endif
int Fl::test_shortcut(int shortcut) {
@@ -124,5 +124,5 @@ int Fl_Widget::test_shortcut() {
}
//
-// End of "$Id: fl_shortcut.cxx,v 1.4.2.1 1999/05/11 09:39:31 bill Exp $".
+// End of "$Id: fl_shortcut.cxx,v 1.4.2.2 1999/10/14 04:56:09 bill Exp $".
//