mirror of https://github.com/fltk/fltk
- Mac: greatly improved OpenGL support, some window management,
soem little bugs, better source comments git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1872 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
6642c677ca
commit
b6b4e1ec20
6
FL/mac.H
6
FL/mac.H
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: mac.H,v 1.1.2.2 2001/12/06 00:17:47 matthiaswm Exp $"
|
||||
// "$Id: mac.H,v 1.1.2.3 2001/12/18 11:00:09 matthiaswm Exp $"
|
||||
//
|
||||
// Mac header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -95,7 +95,7 @@ extern struct Fl_XMap {
|
|||
ulong pen;
|
||||
} *fl_current_xmap;
|
||||
|
||||
extern FL_EXPORT void *fl_display; //++ read yourself into multiple screen support!
|
||||
extern FL_EXPORT void *fl_display;
|
||||
extern FL_EXPORT Window fl_window;
|
||||
extern FL_EXPORT Handle fl_system_menu;
|
||||
extern FL_EXPORT class Fl_Sys_Menu_Bar *fl_sys_menu_bar;
|
||||
|
@ -120,6 +120,6 @@ extern FL_EXPORT int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b)
|
|||
#endif // !FL_MAC_H
|
||||
|
||||
//
|
||||
// End of "$Id: mac.H,v 1.1.2.2 2001/12/06 00:17:47 matthiaswm Exp $".
|
||||
// End of "$Id: mac.H,v 1.1.2.3 2001/12/18 11:00:09 matthiaswm Exp $".
|
||||
//
|
||||
|
||||
|
|
40
README.mac
40
README.mac
|
@ -15,9 +15,8 @@ CONTENTS
|
|||
INTRODUCTION
|
||||
------------
|
||||
|
||||
FLTK for Mac OS X is in pre-beta stage. Expect rapid changes to the
|
||||
source code and build environment. Expect many crashes and funny
|
||||
blinking patterns.
|
||||
FLTK for Mac OS X is in beta stage. Expect rapid changes to the
|
||||
source code and build environment.
|
||||
|
||||
FLTK currently supports the following development environment on the
|
||||
Mac OS X platform:
|
||||
|
@ -39,15 +38,12 @@ gcc (Carbon) - how to build
|
|||
|
||||
Since the Max OS X command line build environment is based on BSD
|
||||
Unix, the normal Unix build procedure as described in 'README'
|
||||
applies. Compiled applications can only be started from within
|
||||
the terminal though.
|
||||
applies.
|
||||
|
||||
A 'resource fork' needs to be attached to applications to make
|
||||
them visible to the Finder. A sample resource file is ./FL/mac.r .
|
||||
|
||||
To make 'hello' a full application, compile and link 'hello', then
|
||||
change into the test directory and type:
|
||||
A 'resource fork' will be attached to applications to make
|
||||
them visible in the Finder. Thedefault resource file is ./FL/mac.r .
|
||||
|
||||
A possible way to add a resource fork is:
|
||||
> Rez -t APPL -c Fltk ../FL/mac.r -o hello
|
||||
|
||||
|
||||
|
@ -82,14 +78,16 @@ echo "done."
|
|||
known MacFLTK bugs
|
||||
------------------
|
||||
|
||||
- OpenGL window resize
|
||||
- font support not finished
|
||||
- line styles missing
|
||||
- file handles not supported
|
||||
- timing not fully supported
|
||||
- line styles not fully supported
|
||||
- cut, copy, paste
|
||||
- mousewheel (Carbon Events)
|
||||
- sub-sub-subwindow
|
||||
- sub-sub-subwindow not tested
|
||||
- modal windows are not modal
|
||||
- makefiles supporting Rez
|
||||
- overlay not complete
|
||||
- image transparency not implemented
|
||||
- 'shiny' needs work (flush/aglFlush)
|
||||
- threads not implemented
|
||||
|
||||
|
||||
test suite status
|
||||
|
@ -99,14 +97,14 @@ OS X:
|
|||
|
||||
CubeView(++), adjuster(++), arc(++), ask(++), bitmap(++),
|
||||
boxtype(++), browser(++), button(++), buttons(++), checkers(++),
|
||||
clock(++), colbrowser(++), color_chooser(++), cube(++), cursor(+),
|
||||
clock(++), colbrowser(++), color_chooser(++), cube(++), cursor(++),
|
||||
curve(++), demo(++), doublebuffer(++), editor(++), fast_slow(++),
|
||||
file_chooser(++), fonts(++), forms(++), fractals(+), fullscreen(+),
|
||||
gl_overlay(o), glpuzzle(++), hello(++), help(++), iconize(+), image(+),
|
||||
file_chooser(++), fonts(++), forms(++), fractals(++), fullscreen(++),
|
||||
gl_overlay(-), glpuzzle(++), hello(++), help(++), iconize(++), image(+),
|
||||
inactive(++), input(++), keyboard(+), label(++), line_style(+),
|
||||
mandelbrot(++), menubar(++), message(++), minimum(++), navigation(++),
|
||||
output(++), overlay(o), pack(++), pixmap(++), pixmap_browser(++),
|
||||
radio(++), resizebox(++), scroll(++), shape(+), shiny(--), subwindow(++),
|
||||
output(++), overlay(-), pack(++), pixmap(++), pixmap_browser(++),
|
||||
radio(++), resizebox(++), scroll(++), shape(++), shiny(-), subwindow(++),
|
||||
symbols(++), tabs(++), tile(++), tiled_image(++), valuators(++),
|
||||
fluid(++)
|
||||
|
||||
|
|
13
src/Fl.cxx
13
src/Fl.cxx
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: Fl.cxx,v 1.24.2.41.2.13 2001/12/17 13:48:59 easysw Exp $"
|
||||
// "$Id: Fl.cxx,v 1.24.2.41.2.14 2001/12/18 11:00:09 matthiaswm Exp $"
|
||||
//
|
||||
// Main event handling code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -696,12 +696,19 @@ void Fl_Window::hide() {
|
|||
fl_gc = 0;
|
||||
}
|
||||
#elif defined(__APPLE__)
|
||||
//++ MacOS needs a simulation of focus events?! DONT!
|
||||
//++ Matt: I have not checked yet what we need to do here
|
||||
Fl::handle(FL_UNFOCUS, this);
|
||||
#else
|
||||
if (x->region) XDestroyRegion(x->region);
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
if ( !parent() ) // don't destroy shared windows!
|
||||
XDestroyWindow(fl_display, x->xid);
|
||||
#else
|
||||
XDestroyWindow(fl_display, x->xid);
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
// Try to stop the annoying "raise another program" behavior
|
||||
if (non_modal() && Fl::first_window() && Fl::first_window()->shown())
|
||||
|
@ -844,5 +851,5 @@ void Fl_Window::flush() {
|
|||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl.cxx,v 1.24.2.41.2.13 2001/12/17 13:48:59 easysw Exp $".
|
||||
// End of "$Id: Fl.cxx,v 1.24.2.41.2.14 2001/12/18 11:00:09 matthiaswm Exp $".
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: Fl_Gl_Choice.H,v 1.4.2.6.2.2 2001/12/06 00:17:47 matthiaswm Exp $"
|
||||
// "$Id: Fl_Gl_Choice.H,v 1.4.2.6.2.3 2001/12/18 11:00:09 matthiaswm Exp $"
|
||||
//
|
||||
// OpenGL definitions for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -76,7 +76,7 @@ public:
|
|||
int pixelformat; // the visual to use
|
||||
PIXELFORMATDESCRIPTOR pfd; // some wgl calls need this thing
|
||||
#elif defined(__APPLE__)
|
||||
//++
|
||||
AGLPixelFormat pixelformat;
|
||||
#else
|
||||
XVisualInfo *vis; // the visual to use
|
||||
Colormap colormap; // a colormap for that visual
|
||||
|
@ -115,5 +115,5 @@ void fl_delete_gl_context(GLContext);
|
|||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Gl_Choice.H,v 1.4.2.6.2.2 2001/12/06 00:17:47 matthiaswm Exp $".
|
||||
// End of "$Id: Fl_Gl_Choice.H,v 1.4.2.6.2.3 2001/12/18 11:00:09 matthiaswm Exp $".
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.4 2001/12/09 12:52:13 easysw Exp $"
|
||||
// "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.5 2001/12/18 11:00:09 matthiaswm Exp $"
|
||||
//
|
||||
// OpenGL visual selection code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -48,10 +48,51 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int mode, const int *alist) {
|
|||
return g;
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
//++ later
|
||||
|
||||
const int *blist;
|
||||
int list[32];
|
||||
|
||||
if (alist)
|
||||
blist = alist;
|
||||
else {
|
||||
int n = 0;
|
||||
if (mode & FL_INDEX) {
|
||||
list[n++] = AGL_BUFFER_SIZE;
|
||||
list[n++] = 8; // glut tries many sizes, but this should work...
|
||||
} else {
|
||||
list[n++] = AGL_RGBA;
|
||||
list[n++] = AGL_GREEN_SIZE;
|
||||
list[n++] = (mode & FL_RGB8) ? 8 : 1;
|
||||
if (mode & FL_ALPHA) {
|
||||
list[n++] = AGL_ALPHA_SIZE;
|
||||
list[n++] = 1;
|
||||
}
|
||||
if (mode & FL_ACCUM) {
|
||||
list[n++] = AGL_ACCUM_GREEN_SIZE;
|
||||
list[n++] = 1;
|
||||
if (mode & FL_ALPHA) {
|
||||
list[n++] = AGL_ACCUM_ALPHA_SIZE;
|
||||
list[n++] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mode & FL_DOUBLE) {
|
||||
list[n++] = AGL_DOUBLEBUFFER;
|
||||
}
|
||||
if (mode & FL_DEPTH) {
|
||||
list[n++] = AGL_DEPTH_SIZE; list[n++] = 16;
|
||||
}
|
||||
if (mode & FL_STENCIL) {
|
||||
list[n++] = AGL_STENCIL_SIZE; list[n++] = 1;
|
||||
}
|
||||
list[n] = AGL_NONE;
|
||||
blist = list;
|
||||
}
|
||||
fl_open_display();
|
||||
AGLPixelFormat fmt = aglChoosePixelFormat(NULL, 0, (GLint*)blist);
|
||||
if (!fmt) return 0;
|
||||
|
||||
#elif !defined(WIN32)
|
||||
|
||||
const int *blist;
|
||||
int list[32];
|
||||
|
||||
|
@ -151,7 +192,7 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int mode, const int *alist) {
|
|||
g->pixelformat = pixelformat;
|
||||
g->pfd = chosen_pfd;
|
||||
#elif defined(__APPLE__)
|
||||
//++ later
|
||||
g->pixelformat = fmt;
|
||||
#else
|
||||
g->vis = vis;
|
||||
|
||||
|
@ -193,15 +234,8 @@ GLContext fl_create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int lay
|
|||
#elif defined(__APPLE__)
|
||||
GLContext fl_create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int layer) {
|
||||
GLContext context;
|
||||
GLint attrib[5] = {AGL_RGBA, //++ replace with requested data!
|
||||
AGL_DOUBLEBUFFER,
|
||||
AGL_DEPTH_SIZE, 16,
|
||||
AGL_NONE };
|
||||
AGLPixelFormat fmt;
|
||||
fmt = aglChoosePixelFormat(NULL, 0, attrib);
|
||||
context = aglCreateContext(fmt, first_context);
|
||||
context = aglCreateContext( g->pixelformat, first_context);
|
||||
if ( !first_context ) first_context = (GLContext)context;
|
||||
aglDestroyPixelFormat( fmt );
|
||||
if ( window->parent() ) {
|
||||
Rect wrect; GetWindowPortBounds( fl_xid(window), &wrect );
|
||||
GLint rect[] = { window->x(), wrect.bottom-window->h()-window->y(), window->w(), window->h() };
|
||||
|
@ -237,7 +271,7 @@ void fl_set_gl_context(Fl_Window* w, GLContext context) {
|
|||
aglSetInteger( context, AGL_BUFFER_RECT, rect );
|
||||
aglEnable( context, AGL_BUFFER_RECT );
|
||||
}
|
||||
aglSetDrawable(context, GetWindowPort( fl_xid(w) ) ); //++ here or in Fl_Gl_Window::make_current creation part?
|
||||
aglSetDrawable(context, GetWindowPort( fl_xid(w) ) ); //++ Matt: this probably belongs only in create_gl_context
|
||||
aglSetCurrentContext(context);
|
||||
#else
|
||||
glXMakeCurrent(fl_display, fl_xid(w), context);
|
||||
|
@ -275,5 +309,5 @@ void fl_delete_gl_context(GLContext context) {
|
|||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.4 2001/12/09 12:52:13 easysw Exp $".
|
||||
// End of "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.5 2001/12/18 11:00:09 matthiaswm Exp $".
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.4 2001/12/11 16:03:12 easysw Exp $"
|
||||
// "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.5 2001/12/18 11:00:09 matthiaswm Exp $"
|
||||
//
|
||||
// OpenGL window code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -85,21 +85,22 @@ void Fl_Gl_Window::invalidate() {
|
|||
|
||||
int Fl_Gl_Window::mode(int m, const int *a) {
|
||||
if (m == mode_ && a == alist) return 0;
|
||||
#if !defined(__APPLE__)
|
||||
#ifndef __APPLE__
|
||||
int oldmode = mode_;
|
||||
Fl_Gl_Choice* oldg = g;
|
||||
#endif
|
||||
context(0);
|
||||
mode_ = m; alist = a;
|
||||
if (shown()) {
|
||||
g = Fl_Gl_Choice::find(m, a);
|
||||
#ifdef WIN32
|
||||
if (!g || (oldmode^m)&FL_DOUBLE) {
|
||||
hide();
|
||||
show();
|
||||
}
|
||||
#endif
|
||||
#if !defined(WIN32) && !defined(__APPLE__)
|
||||
g = Fl_Gl_Choice::find(m, a);
|
||||
#if defined(WIN32)
|
||||
if (!g || (oldmode^m)&FL_DOUBLE) {
|
||||
hide();
|
||||
show();
|
||||
}
|
||||
#elif defined(__APPLE__)
|
||||
redraw();
|
||||
#else
|
||||
// under X, if the visual changes we must make a new X window (yuck!):
|
||||
if (!g || g->vis->visualid!=oldg->vis->visualid || (oldmode^m)&FL_DOUBLE) {
|
||||
hide();
|
||||
|
@ -170,6 +171,24 @@ int fl_overlay_depth = 0;
|
|||
void Fl_Gl_Window::flush() {
|
||||
uchar save_valid = valid_;
|
||||
|
||||
#ifdef __APPLE__
|
||||
// matt: I have no idea hw expensive the following code is, but we need to reset the buffer rect after
|
||||
// every window-reconfiguration, especially after window resizes.
|
||||
if ( parent() ) { //: resize our GL buffer rectangle
|
||||
Rect wrect; GetWindowPortBounds( fl_xid(this), &wrect );
|
||||
GLint rect[] = { x(), wrect.bottom-h()-y(), w(), h() };
|
||||
aglSetInteger( context_, AGL_BUFFER_RECT, rect );
|
||||
aglEnable( context_, AGL_BUFFER_RECT );
|
||||
}
|
||||
//: clear previous clipping in this shared port
|
||||
GrafPtr port = GetWindowPort( fl_xid(this) );
|
||||
Rect rect; SetRect( &rect, 0, 0, 0x7fff, 0x7fff );
|
||||
GrafPtr old; GetPort( &old );
|
||||
SetPort( port );
|
||||
ClipRect( &rect );
|
||||
SetPort( old );
|
||||
#endif
|
||||
|
||||
#if HAVE_GL_OVERLAY && defined(WIN32)
|
||||
|
||||
bool fixcursor = false; // for fixing the SGI 320 bug
|
||||
|
@ -200,16 +219,6 @@ void Fl_Gl_Window::flush() {
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
//: clear previous clipping in this shared port
|
||||
GrafPtr port = GetWindowPort( fl_xid(this) );
|
||||
Rect rect; SetRect( &rect, 0, 0, 0x7fff, 0x7fff );
|
||||
GrafPtr old; GetPort( &old );
|
||||
SetPort( port );
|
||||
ClipRect( &rect );
|
||||
SetPort( old );
|
||||
#endif
|
||||
|
||||
make_current();
|
||||
|
||||
if (mode_ & FL_DOUBLE) {
|
||||
|
@ -354,5 +363,5 @@ void Fl_Gl_Window::draw_overlay() {}
|
|||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.4 2001/12/11 16:03:12 easysw Exp $".
|
||||
// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.5 2001/12/18 11:00:09 matthiaswm Exp $".
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: Fl_Window_fullscreen.cxx,v 1.5.2.3.2.1 2001/11/27 17:44:06 easysw Exp $"
|
||||
// "$Id: Fl_Window_fullscreen.cxx,v 1.5.2.3.2.2 2001/12/18 11:00:09 matthiaswm Exp $"
|
||||
//
|
||||
// Fullscreen window support for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -48,7 +48,7 @@ void Fl_Window::border(int b) {
|
|||
// not yet implemented, but it's possible
|
||||
// for full fullscreen we have to make the window topmost as well
|
||||
#elif defined(__APPLE__)
|
||||
//++
|
||||
//++ Matt: I have not looked into this yet
|
||||
#else
|
||||
if (shown()) Fl_X::i(this)->sendxjunk();
|
||||
#endif
|
||||
|
@ -73,5 +73,5 @@ void Fl_Window::fullscreen_off(int X,int Y,int W,int H) {
|
|||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Window_fullscreen.cxx,v 1.5.2.3.2.1 2001/11/27 17:44:06 easysw Exp $".
|
||||
// End of "$Id: Fl_Window_fullscreen.cxx,v 1.5.2.3.2.2 2001/12/18 11:00:09 matthiaswm Exp $".
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: Fl_Window_iconize.cxx,v 1.5.2.3.2.2 2001/11/27 17:44:06 easysw Exp $"
|
||||
// "$Id: Fl_Window_iconize.cxx,v 1.5.2.3.2.3 2001/12/18 11:00:09 matthiaswm Exp $"
|
||||
//
|
||||
// Window minification code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -35,9 +35,7 @@ void Fl_Window::iconize() {
|
|||
#ifdef WIN32
|
||||
ShowWindow(i->xid, SW_SHOWMINNOACTIVE);
|
||||
#elif defined(__APPLE__)
|
||||
//: http://developer.apple.com/techpubs/mac/Toolbox/Toolbox-254.html#HEADING254-0
|
||||
//++ see iconize, above is the WRONG CALL
|
||||
//++ call "hide all" ZoomWindow(i->xid, inZoomIn, 0);
|
||||
CollapseWindow( i->xid, true );
|
||||
#else
|
||||
XIconifyWindow(fl_display, i->xid, fl_screen);
|
||||
#endif
|
||||
|
@ -45,5 +43,5 @@ void Fl_Window::iconize() {
|
|||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Window_iconize.cxx,v 1.5.2.3.2.2 2001/11/27 17:44:06 easysw Exp $".
|
||||
// End of "$Id: Fl_Window_iconize.cxx,v 1.5.2.3.2.3 2001/12/18 11:00:09 matthiaswm Exp $".
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: Fl_mac.cxx,v 1.1.2.5 2001/12/14 19:34:30 easysw Exp $"
|
||||
// "$Id: Fl_mac.cxx,v 1.1.2.6 2001/12/18 11:00:09 matthiaswm Exp $"
|
||||
//
|
||||
// MacOS specific code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -397,7 +397,17 @@ OSStatus carbonMouseHandler( EventHandlerCallRef nextHandler, EventRef event, vo
|
|||
case kEventMouseDown:
|
||||
if ( btn==kEventMouseButtonPrimary && FindWindow( pos, &xid )!=inContent )
|
||||
return CallNextEventHandler( nextHandler, event ); // we won't handle this. The OS should do that.
|
||||
if (xid!=FrontWindow()) SelectWindow( xid ); //{ SelectWindow(xid); return 1; } // do we want to keep this?!
|
||||
//-- Matt: hmm, the following lines do not work the way I want: 'BringToFront' changes the window order only
|
||||
// WITHIN the application, but not on the desktop, whereas 'SetFrontProcess' pulls ALL windows in this
|
||||
// application to the front. Wanted: put only the clicked window in the front.
|
||||
//if (xid!=FrontWindow()) {
|
||||
SelectWindow( xid ); // <-- click througgh vs. classic Mac--> { SelectWindow(xid); return 1; }
|
||||
BringToFront( xid ); // (but behind modal windows!!!)
|
||||
//}
|
||||
ProcessSerialNumber psn;
|
||||
GetCurrentProcess( &psn );
|
||||
SetFrontProcess( &psn );
|
||||
// normal handling of mouse-down follows
|
||||
sendEvent = FL_PUSH;
|
||||
Fl::e_is_click = 1; px = pos.h; py = pos.v;
|
||||
Fl::e_clicks = clickCount;
|
||||
|
@ -666,7 +676,7 @@ static void set_shift_states(const EventRecord &macevent)
|
|||
if (macevent.modifiers&optionKey) state |= FL_ALT;
|
||||
if (macevent.modifiers&cmdKey) state |= FL_CTRL;
|
||||
if (macevent.modifiers&alphaLock) state |= FL_CAPS_LOCK;
|
||||
state |= FL_NUM_LOCK; //++ always num keypad on Mac?
|
||||
state |= FL_NUM_LOCK; //++ always num keypad on Mac? - No, use Fn-F5 on iBooks and NumLock on regular keyboards
|
||||
Fl::e_state = state;
|
||||
}
|
||||
|
||||
|
@ -1277,7 +1287,7 @@ void Fl_X::make(Fl_Window* w)
|
|||
//++ hmmm, this should maybe set by the activate event?!
|
||||
Fl::handle(FL_FOCUS, w);
|
||||
//++ if (w->modal()) { Fl::modal_ = w; fl_fix_focus(); }
|
||||
if ( ! Fl_X::first->next ) // if this is the first window, we need to bring the application to the front
|
||||
if ( ! Fl_X::first->next ) // if this is the first window, we need to bring the application to the front //++ this fails if the first window is a child window...
|
||||
{
|
||||
ProcessSerialNumber psn;
|
||||
OSErr err = GetCurrentProcess( &psn );
|
||||
|
@ -1352,8 +1362,13 @@ void Fl_Window::show() {
|
|||
if (!shown() || !i) {
|
||||
Fl_X::make(this);
|
||||
} else {
|
||||
//++ do we need to do grab and icon handling here?
|
||||
/*if (!fl_capture)*/ BringToFront(i->xid);
|
||||
if ( !parent() )
|
||||
{
|
||||
if ( IsWindowCollapsed( i->xid ) ) CollapseWindow( i->xid, false );
|
||||
//++ do we need to do grab and icon handling here?
|
||||
/*if (!fl_capture)*/
|
||||
BringToFront(i->xid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1509,6 +1524,6 @@ elapsedNanoseconds = AbsoluteToNanoseconds(elapsedTime);
|
|||
*/
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_mac.cxx,v 1.1.2.5 2001/12/14 19:34:30 easysw Exp $".
|
||||
// End of "$Id: Fl_mac.cxx,v 1.1.2.6 2001/12/18 11:00:09 matthiaswm Exp $".
|
||||
//
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: Fl_visual.cxx,v 1.7.2.4.2.1 2001/11/27 17:44:06 easysw Exp $"
|
||||
// "$Id: Fl_visual.cxx,v 1.7.2.4.2.2 2001/12/18 11:00:09 matthiaswm Exp $"
|
||||
//
|
||||
// Visual support for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -40,7 +40,7 @@ int Fl::visual(int flags) {
|
|||
}
|
||||
#elif defined(__APPLE__)
|
||||
|
||||
//++ later
|
||||
//++ Matt: add support for visual flags
|
||||
int Fl::visual(int flags) {
|
||||
(void)flags;
|
||||
return 1;
|
||||
|
@ -115,5 +115,5 @@ int Fl::visual(int flags) {
|
|||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_visual.cxx,v 1.7.2.4.2.1 2001/11/27 17:44:06 easysw Exp $".
|
||||
// End of "$Id: Fl_visual.cxx,v 1.7.2.4.2.2 2001/12/18 11:00:09 matthiaswm Exp $".
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: fl_shortcut.cxx,v 1.4.2.9.2.1 2001/11/27 17:44:08 easysw Exp $"
|
||||
// "$Id: fl_shortcut.cxx,v 1.4.2.9.2.2 2001/12/18 11:00:09 matthiaswm Exp $"
|
||||
//
|
||||
// Shortcut support routines for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -116,10 +116,10 @@ const char * fl_shortcut_label(int shortcut) {
|
|||
char *p = buf;
|
||||
if (!shortcut) {*p = 0; return buf;}
|
||||
#ifdef __APPLE__
|
||||
//++ to avoid getting stoned and feathered by mac users we should replace the text with the correct symbols
|
||||
//++ we might want to change the symbols for mAc users
|
||||
if (shortcut & FL_SHIFT) {strcpy(p,"shift+"); p += 6;} //: Mac hollow up arrow
|
||||
if (shortcut & FL_META) {strcpy(p,"ctrl+"); p += 6;} //: Mac 'cotrol'
|
||||
if (shortcut & FL_ALT) {strcpy(p,"option+"); p += 4;} //: Mac 'Option' or fancy switch symbol
|
||||
if (shortcut & FL_META) {strcpy(p,"ctrl+"); p += 5;} //: Mac 'cotrol'
|
||||
if (shortcut & FL_ALT) {strcpy(p,"option+"); p += 7;} //: Mac 'Option' or fancy switch symbol
|
||||
if (shortcut & FL_CTRL) {strcpy(p,"cmd+"); p += 4;} //: Mac Apple or Curlyflour
|
||||
#else
|
||||
if (shortcut & FL_META) {strcpy(p,"Meta+"); p += 5;}
|
||||
|
@ -200,5 +200,5 @@ int Fl_Widget::test_shortcut() {
|
|||
}
|
||||
|
||||
//
|
||||
// End of "$Id: fl_shortcut.cxx,v 1.4.2.9.2.1 2001/11/27 17:44:08 easysw Exp $".
|
||||
// End of "$Id: fl_shortcut.cxx,v 1.4.2.9.2.2 2001/12/18 11:00:09 matthiaswm Exp $".
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: gl_draw.cxx,v 1.7.2.5.2.2 2001/11/27 17:44:08 easysw Exp $"
|
||||
// "$Id: gl_draw.cxx,v 1.7.2.5.2.3 2001/12/18 11:00:09 matthiaswm Exp $"
|
||||
//
|
||||
// OpenGL drawing support routines for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -54,7 +54,7 @@ void gl_font(int fontid, int size) {
|
|||
wglUseFontBitmaps(fl_gc, base, size, fl_fontsize->listbase+base);
|
||||
SelectObject(fl_gc, oldFid);
|
||||
#elif defined(__APPLE__)
|
||||
//++
|
||||
//++ Matt: Insert MacOS/AGL font handling here
|
||||
#else
|
||||
int base = fl_xfont->min_char_or_byte2;
|
||||
int size = fl_xfont->max_char_or_byte2-base+1;
|
||||
|
@ -157,5 +157,5 @@ void gl_draw_image(const uchar* b, int x, int y, int w, int h, int d, int ld) {
|
|||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: gl_draw.cxx,v 1.7.2.5.2.2 2001/11/27 17:44:08 easysw Exp $".
|
||||
// End of "$Id: gl_draw.cxx,v 1.7.2.5.2.3 2001/12/18 11:00:09 matthiaswm Exp $".
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: gl_start.cxx,v 1.6.2.5.2.4 2001/12/09 12:52:13 easysw Exp $"
|
||||
// "$Id: gl_start.cxx,v 1.6.2.5.2.5 2001/12/18 11:00:09 matthiaswm Exp $"
|
||||
//
|
||||
// OpenGL context routines for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -54,6 +54,10 @@ static int pw, ph;
|
|||
static Fl_Gl_Choice* gl_choice;
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
static Fl_Gl_Choice* gl_choice;
|
||||
#endif
|
||||
|
||||
Fl_Region XRectangleRegion(int x, int y, int w, int h); // in fl_rect.cxx
|
||||
|
||||
void gl_start() {
|
||||
|
@ -62,7 +66,8 @@ void gl_start() {
|
|||
if (!gl_choice) Fl::gl_visual(0);
|
||||
context = fl_create_gl_context(Fl_Window::current(), gl_choice);
|
||||
#elif defined(__APPLE__)
|
||||
//++
|
||||
//++ Matt: We need to check the code and verify it with Apple Sample code. 'shiny' give some output...
|
||||
context = fl_create_gl_context(Fl_Window::current(), gl_choice);
|
||||
#else
|
||||
context = fl_create_gl_context(fl_visual);
|
||||
#endif
|
||||
|
@ -106,7 +111,7 @@ int Fl::gl_visual(int mode, int *alist) {
|
|||
#ifdef WIN32
|
||||
gl_choice = c;
|
||||
#elif defined(__APPLE__)
|
||||
//++
|
||||
gl_choice = c;
|
||||
#else
|
||||
fl_visual = c->vis;
|
||||
fl_colormap = c->colormap;
|
||||
|
@ -117,5 +122,5 @@ int Fl::gl_visual(int mode, int *alist) {
|
|||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: gl_start.cxx,v 1.6.2.5.2.4 2001/12/09 12:52:13 easysw Exp $".
|
||||
// End of "$Id: gl_start.cxx,v 1.6.2.5.2.5 2001/12/18 11:00:09 matthiaswm Exp $".
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue