2001-11-27 20:44:08 +03:00
|
|
|
//
|
2005-02-25 00:55:12 +03:00
|
|
|
// "$Id$"
|
2001-11-27 20:44:08 +03:00
|
|
|
//
|
|
|
|
// Mac header file for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2016-01-31 07:33:54 +03:00
|
|
|
// Copyright 1998-2016 by Bill Spitzak and others.
|
2001-11-27 20:44:08 +03:00
|
|
|
//
|
2011-07-19 08:49:30 +04:00
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
|
|
// file is missing or damaged, see the license at:
|
|
|
|
//
|
|
|
|
// http://www.fltk.org/COPYING.php
|
2001-11-27 20:44:08 +03:00
|
|
|
//
|
2005-04-16 04:13:17 +04:00
|
|
|
// Please report all bugs and problems on the following page:
|
|
|
|
//
|
|
|
|
// http://www.fltk.org/str.php
|
2001-11-27 20:44:08 +03:00
|
|
|
//
|
|
|
|
|
|
|
|
// Do not directly include this file, instead use <FL/x.H>. It will
|
|
|
|
// include this file if "__APPLE__" is defined. This is to encourage
|
|
|
|
// portability of even the system-specific code...
|
2008-09-18 23:09:34 +04:00
|
|
|
#ifndef FL_DOXYGEN
|
2001-11-27 20:44:08 +03:00
|
|
|
|
2008-09-18 23:09:34 +04:00
|
|
|
#if !defined(Fl_X_H)
|
2002-06-07 19:06:32 +04:00
|
|
|
# error "Never use <FL/mac.H> directly; include <FL/x.H> instead."
|
|
|
|
#endif // !Fl_X_H
|
2001-11-27 20:44:08 +03:00
|
|
|
|
2011-11-12 17:06:54 +04:00
|
|
|
#ifdef __OBJC__
|
|
|
|
@class FLWindow; // a subclass of the NSWindow Cocoa class
|
|
|
|
typedef FLWindow *Window;
|
|
|
|
#else
|
2014-11-12 23:42:41 +03:00
|
|
|
typedef class FLWindow *Window; // pointer to the FLWindow objective-c class
|
2011-11-12 17:06:54 +04:00
|
|
|
#endif // __OBJC__
|
2011-01-10 15:42:17 +03:00
|
|
|
|
2016-02-20 00:41:02 +03:00
|
|
|
#include <FL/Fl_Device.H>
|
2016-03-26 17:36:11 +03:00
|
|
|
#include "src/drivers/Darwin/Fl_Darwin_System_Driver.H"
|
2016-02-20 00:41:02 +03:00
|
|
|
|
2011-01-18 02:52:32 +03:00
|
|
|
#if !(defined(FL_LIBRARY) || defined(FL_INTERNALS)) // this part is used when compiling an application program
|
2011-09-14 19:17:32 +04:00
|
|
|
# include <FL/Fl_Widget.H>
|
2010-12-23 17:24:29 +03:00
|
|
|
|
2011-09-14 19:17:32 +04:00
|
|
|
typedef struct CGContext* CGContextRef;
|
|
|
|
typedef struct OpaquePMPrintSettings* PMPrintSettings;
|
|
|
|
typedef struct OpaquePMPageFormat* PMPageFormat;
|
|
|
|
typedef struct OpaquePMPrintSession* PMPrintSession;
|
|
|
|
typedef struct CGImage* CGImageRef;
|
2015-11-18 18:53:46 +03:00
|
|
|
typedef struct __CFData* CFMutableDataRef; // used in Fl_Copy_Surface.H
|
2010-12-23 17:24:29 +03:00
|
|
|
|
|
|
|
#else // this part must be compiled when building the FLTK libraries
|
|
|
|
|
2011-01-03 19:50:34 +03:00
|
|
|
// Standard MacOS C/C++ includes...
|
|
|
|
#include <ApplicationServices/ApplicationServices.h>
|
2010-12-23 17:24:29 +03:00
|
|
|
#undef check // because of Fl::check()
|
|
|
|
|
2014-04-27 17:57:09 +04:00
|
|
|
#ifndef MAC_OS_X_VERSION_10_4
|
|
|
|
#define MAC_OS_X_VERSION_10_4 1040
|
|
|
|
#endif
|
|
|
|
#ifndef MAC_OS_X_VERSION_10_5
|
|
|
|
#define MAC_OS_X_VERSION_10_5 1050
|
|
|
|
#endif
|
|
|
|
#ifndef MAC_OS_X_VERSION_10_6
|
|
|
|
#define MAC_OS_X_VERSION_10_6 1060
|
|
|
|
#endif
|
|
|
|
#ifndef MAC_OS_X_VERSION_10_7
|
|
|
|
#define MAC_OS_X_VERSION_10_7 1070
|
|
|
|
#endif
|
|
|
|
#ifndef MAC_OS_X_VERSION_10_8
|
|
|
|
#define MAC_OS_X_VERSION_10_8 1080
|
|
|
|
#endif
|
2014-09-13 18:29:53 +04:00
|
|
|
#ifndef MAC_OS_X_VERSION_10_9
|
|
|
|
#define MAC_OS_X_VERSION_10_9 1090
|
|
|
|
#endif
|
|
|
|
#ifndef MAC_OS_X_VERSION_10_10
|
|
|
|
#define MAC_OS_X_VERSION_10_10 101000
|
|
|
|
#endif
|
2015-11-03 17:36:36 +03:00
|
|
|
#ifndef MAC_OS_X_VERSION_10_11
|
|
|
|
#define MAC_OS_X_VERSION_10_11 101100
|
|
|
|
#endif
|
2014-04-27 17:57:09 +04:00
|
|
|
|
2015-06-30 05:23:26 +03:00
|
|
|
#ifndef NSINTEGER_DEFINED // appears with 10.5 in NSObjCRuntime.h
|
|
|
|
#if defined(__LP64__) && __LP64__
|
|
|
|
typedef long NSInteger;
|
|
|
|
typedef unsigned long NSUInteger;
|
|
|
|
#else
|
|
|
|
typedef int NSInteger;
|
|
|
|
typedef unsigned int NSUInteger;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2014-01-07 19:31:28 +04:00
|
|
|
#ifdef __OBJC__
|
|
|
|
@class NSCursor;
|
Changed OpenGL support for the Mac OS X platform: use cocoa instead of deprecated AGL.
All changes are mac-specific, except a very minor change in file src/gl_draw.cxx
where string drawing wrongly claimed to support @symbol, not possible
because symbols are drawn using non-GL primitives.
Unchanged application code can use the new FLTK code.
In addition, the new code allows mac applications to draw OpenGL scenes
at high resolution on so-called 'retina' displays, but this requires some
support from app code. They must call, before opening GL windows,
Fl::use_high_resolution(1);
and change their glViewport() calls as follows
glViewport(0, 0, pxel_w(), pixel_h());
This uses 2 new member functions of the Fl_Gl_Window class,
pixel_w() and pixel_h() returning the window dimensions in pixel
units, that is, twice the w() and h() when the window is mapped
on a retina display.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10498 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-20 10:19:23 +03:00
|
|
|
@class NSOpenGLPixelFormat;
|
2015-02-02 16:08:51 +03:00
|
|
|
@class NSOpenGLContext;
|
2016-03-18 21:20:11 +03:00
|
|
|
@class CALayer;
|
2014-01-07 19:31:28 +04:00
|
|
|
#else
|
|
|
|
class NSCursor;
|
Changed OpenGL support for the Mac OS X platform: use cocoa instead of deprecated AGL.
All changes are mac-specific, except a very minor change in file src/gl_draw.cxx
where string drawing wrongly claimed to support @symbol, not possible
because symbols are drawn using non-GL primitives.
Unchanged application code can use the new FLTK code.
In addition, the new code allows mac applications to draw OpenGL scenes
at high resolution on so-called 'retina' displays, but this requires some
support from app code. They must call, before opening GL windows,
Fl::use_high_resolution(1);
and change their glViewport() calls as follows
glViewport(0, 0, pxel_w(), pixel_h());
This uses 2 new member functions of the Fl_Gl_Window class,
pixel_w() and pixel_h() returning the window dimensions in pixel
units, that is, twice the w() and h() when the window is mapped
on a retina display.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10498 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-20 10:19:23 +03:00
|
|
|
class NSOpenGLPixelFormat;
|
2015-02-02 16:08:51 +03:00
|
|
|
class NSOpenGLContext;
|
2016-03-18 21:20:11 +03:00
|
|
|
class CALayer;
|
2014-01-07 19:31:28 +04:00
|
|
|
#endif // __OBJC__
|
|
|
|
|
2015-08-28 17:04:21 +03:00
|
|
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4
|
|
|
|
typedef CGImageAlphaInfo CGBitmapInfo;
|
|
|
|
#endif
|
2009-12-09 02:15:30 +03:00
|
|
|
|
2016-03-26 17:36:11 +03:00
|
|
|
struct flCocoaRegion {
|
2010-12-23 17:24:29 +03:00
|
|
|
int count;
|
|
|
|
CGRect *rects;
|
2016-03-26 17:36:11 +03:00
|
|
|
}; // a region is the union of a series of rectangles
|
2010-12-23 17:24:29 +03:00
|
|
|
|
|
|
|
# include "Fl_Window.H"
|
2013-10-29 16:46:51 +04:00
|
|
|
# include "../src/Fl_Font.H"
|
2010-12-23 17:24:29 +03:00
|
|
|
|
|
|
|
// Some random X equivalents
|
|
|
|
struct XPoint { int x, y; };
|
|
|
|
struct XRectangle {int x, y, width, height;};
|
2009-12-09 02:15:30 +03:00
|
|
|
#ifndef CGFLOAT_DEFINED //appears with 10.5 in CGBase.h
|
|
|
|
#if defined(__LP64__) && __LP64__
|
|
|
|
typedef double CGFloat;
|
|
|
|
#else
|
2009-12-07 01:21:55 +03:00
|
|
|
typedef float CGFloat;
|
|
|
|
#endif
|
2010-01-30 00:16:20 +03:00
|
|
|
#endif // CGFLOAT_DEFINED
|
2009-12-09 02:15:30 +03:00
|
|
|
|
2010-03-14 21:07:24 +03:00
|
|
|
extern CGRect fl_cgrectmake_cocoa(int x, int y, int w, int h);
|
2009-12-07 01:21:55 +03:00
|
|
|
inline Fl_Region XRectangleRegion(int x, int y, int w, int h) {
|
|
|
|
Fl_Region R = (Fl_Region)malloc(sizeof(*R));
|
|
|
|
R->count = 1;
|
|
|
|
R->rects = (CGRect *)malloc(sizeof(CGRect));
|
2010-03-14 21:07:24 +03:00
|
|
|
*(R->rects) = fl_cgrectmake_cocoa(x, y, w, h);
|
2009-12-07 01:21:55 +03:00
|
|
|
return R;
|
|
|
|
}
|
|
|
|
inline void XDestroyRegion(Fl_Region r) {
|
|
|
|
if(r) {
|
2010-12-23 17:24:29 +03:00
|
|
|
free(r->rects);
|
|
|
|
free(r);
|
|
|
|
}
|
2009-12-07 01:21:55 +03:00
|
|
|
}
|
2014-01-07 19:31:28 +04:00
|
|
|
extern NSCursor *fl_default_cursor;
|
2001-11-27 20:44:08 +03:00
|
|
|
|
|
|
|
// This object contains all mac-specific stuff about a window:
|
|
|
|
// WARNING: this object is highly subject to change!
|
2016-02-25 20:56:48 +03:00
|
|
|
class Fl_X {
|
2001-11-27 20:44:08 +03:00
|
|
|
public:
|
2016-02-25 20:56:48 +03:00
|
|
|
virtual ~Fl_X() {} // very important
|
2010-12-19 01:31:01 +03:00
|
|
|
Window xid; // pointer to the Cocoa window object (FLWindow*)
|
2010-12-23 17:24:29 +03:00
|
|
|
Fl_Offscreen other_xid; // pointer for offscreen bitmaps (overlay window)
|
2002-01-03 11:08:21 +03:00
|
|
|
Fl_Window *w; // FLTK window for
|
2001-11-27 20:44:08 +03:00
|
|
|
Fl_Region region;
|
2014-12-17 12:04:01 +03:00
|
|
|
Fl_X *next; // chain of mapped windows
|
2001-11-27 20:44:08 +03:00
|
|
|
int wait_for_expose;
|
2014-01-07 19:31:28 +04:00
|
|
|
NSCursor *cursor;
|
2001-11-27 20:44:08 +03:00
|
|
|
static Fl_X* first;
|
2016-02-20 01:21:02 +03:00
|
|
|
static Fl_X* i(const Fl_Window* w) {return (Fl_X*)w->i;}
|
2001-11-27 20:44:08 +03:00
|
|
|
static int fake_X_wm(const Fl_Window*,int&,int&,int&,int&,int&);
|
|
|
|
static void make(Fl_Window*);
|
|
|
|
void flush();
|
2014-12-18 09:40:50 +03:00
|
|
|
static void set_high_resolution(bool);
|
|
|
|
CGRect* subRect() { return subRect_; } // getter
|
|
|
|
void subRect(CGRect *r) { subRect_ = r; } // setter
|
|
|
|
bool mapped_to_retina(); // is window mapped to retina display?
|
|
|
|
void mapped_to_retina(bool); // sets whether window is mapped to retina display
|
Changed OpenGL support for the Mac OS X platform: use cocoa instead of deprecated AGL.
All changes are mac-specific, except a very minor change in file src/gl_draw.cxx
where string drawing wrongly claimed to support @symbol, not possible
because symbols are drawn using non-GL primitives.
Unchanged application code can use the new FLTK code.
In addition, the new code allows mac applications to draw OpenGL scenes
at high resolution on so-called 'retina' displays, but this requires some
support from app code. They must call, before opening GL windows,
Fl::use_high_resolution(1);
and change their glViewport() calls as follows
glViewport(0, 0, pxel_w(), pixel_h());
This uses 2 new member functions of the Fl_Gl_Window class,
pixel_w() and pixel_h() returning the window dimensions in pixel
units, that is, twice the w() and h() when the window is mapped
on a retina display.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10498 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-20 10:19:23 +03:00
|
|
|
bool changed_resolution(); // did window just moved to display with another resolution?
|
|
|
|
void changed_resolution(bool);// sets whether window just moved to display with another resolution
|
2015-01-31 18:08:31 +03:00
|
|
|
bool in_windowDidResize(); // is window performing windowDidResize?
|
|
|
|
void in_windowDidResize(bool); // sets whether window is performing windowDidResize
|
2004-08-28 00:02:45 +04:00
|
|
|
// Quartz additions:
|
|
|
|
CGContextRef gc; // graphics context (NULL when using QD)
|
2016-02-18 19:21:51 +03:00
|
|
|
static void q_release_context(Fl_X *x=0); // free all resources associated with gc
|
2010-12-19 01:31:01 +03:00
|
|
|
// Cocoa additions
|
Changed OpenGL support for the Mac OS X platform: use cocoa instead of deprecated AGL.
All changes are mac-specific, except a very minor change in file src/gl_draw.cxx
where string drawing wrongly claimed to support @symbol, not possible
because symbols are drawn using non-GL primitives.
Unchanged application code can use the new FLTK code.
In addition, the new code allows mac applications to draw OpenGL scenes
at high resolution on so-called 'retina' displays, but this requires some
support from app code. They must call, before opening GL windows,
Fl::use_high_resolution(1);
and change their glViewport() calls as follows
glViewport(0, 0, pxel_w(), pixel_h());
This uses 2 new member functions of the Fl_Gl_Window class,
pixel_w() and pixel_h() returning the window dimensions in pixel
units, that is, twice the w() and h() when the window is mapped
on a retina display.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10498 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-20 10:19:23 +03:00
|
|
|
static NSOpenGLPixelFormat *mode_to_NSOpenGLPixelFormat(int mode, const int*); // computes NSOpenGLPixelFormat from Gl window's mode
|
2015-02-02 16:08:51 +03:00
|
|
|
static NSOpenGLContext* create_GLcontext_for_window(NSOpenGLPixelFormat *pixelformat, NSOpenGLContext *shared_ctx, Fl_Window *window);
|
|
|
|
static void GLcontext_update(NSOpenGLContext*);
|
|
|
|
static void GLcontext_flushbuffer(NSOpenGLContext*);
|
|
|
|
static void GLcontext_release(NSOpenGLContext*);
|
|
|
|
static void GLcontext_makecurrent(NSOpenGLContext*);
|
|
|
|
static void GL_cleardrawable(void);
|
2010-12-19 01:31:01 +03:00
|
|
|
void destroy(void);
|
2015-01-22 20:45:09 +03:00
|
|
|
WindowRef window_ref(void); // useless with cocoa GL windows
|
2010-12-19 01:31:01 +03:00
|
|
|
void set_key_window(void);
|
2014-06-16 15:39:32 +04:00
|
|
|
// OS X doesn't have per window icons
|
|
|
|
static void set_default_icons(const Fl_RGB_Image*[], int) {};
|
|
|
|
void set_icons() {};
|
2014-06-16 15:17:57 +04:00
|
|
|
int set_cursor(Fl_Cursor);
|
|
|
|
int set_cursor(const Fl_RGB_Image*, int, int);
|
2010-12-19 01:31:01 +03:00
|
|
|
static CGImageRef CGImage_from_window_rect(Fl_Window *win, int x, int y, int w, int h);
|
|
|
|
static unsigned char *bitmap_from_window_rect(Fl_Window *win, int x, int y, int w, int h, int *bytesPerPixel);
|
|
|
|
static Fl_Region intersect_region_and_rect(Fl_Region current, int x,int y,int w, int h);
|
2011-01-03 19:50:34 +03:00
|
|
|
static void *get_carbon_function(const char *name);
|
Fix STR#2695 & 2697: correct computation of work areas with multiple screens.
This introduces 3 new functions
static void Fl::screen_work_area(X,Y,W,H)
static void Fl::screen_work_area(X,Y,W,H,mx,my)
static void Fl::screen_work_area(X,Y,W,H,screen_no)
that compute screen work areas and are used by FLTK to position menu windows.
The Fl::x(),y(),w(),h() functions are made consistent across platforms: they return
the origin/size of the work area of the main screen (as far as possible, see below).
On the Mac OS platform, all screen functions reflect changes in screen number and
positions without requiring the application to restart.
On the X11 platform, I did not find an API to compute the main screen work area
in all conditions. What's used does compute the correct work area when there's
a single screen, but not when there are several, because it returns an area that
encompasses all screens. The implemented workaround is that Fl::x(),y(),w(),h()
and Fl::screen_work_area(X,Y,W,H,0) return the exact work area when there's
a single screen, and return the full screen area when there are several.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9084 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-09-29 20:04:24 +04:00
|
|
|
static void screen_work_area(int &X, int &Y, int &W, int &H, int n); // compute work area of a given screen
|
2012-12-24 15:45:07 +04:00
|
|
|
static int next_marked_length; // next length of marked text after current marked text will have been replaced
|
2013-01-13 19:25:37 +04:00
|
|
|
static int insertion_point_location(int *px, int *py, int *pheight); // computes window coordinates & height of insertion point
|
2013-10-29 16:46:51 +04:00
|
|
|
static const int CoreText_threshold; // Mac OS version from which the Core Text API is used to display text
|
|
|
|
static Fl_Fontdesc* calc_fl_fonts(void); // computes the fl_fonts global variable
|
2015-04-29 01:02:48 +03:00
|
|
|
static int calc_mac_os_version(void); // computes the fl_mac_os_version global variable
|
2015-11-19 19:33:44 +03:00
|
|
|
static void clip_to_rounded_corners(CGContextRef gc, int w, int h);
|
2016-03-01 20:20:25 +03:00
|
|
|
static void complete_copy_pdf_and_tiff(CGContextRef gc, CFMutableDataRef pdfdata);
|
2016-03-18 21:20:11 +03:00
|
|
|
static void draw_layer_to_context(CALayer *layer, CGContextRef gc, int w, int h);
|
2014-12-17 12:04:01 +03:00
|
|
|
private:
|
2014-12-18 09:40:50 +03:00
|
|
|
CGRect* subRect_; // makes sure subwindow remains inside its parent window
|
2015-08-09 15:56:24 +03:00
|
|
|
// stores 3 binary flags: whether window is mapped to retina display; whether resolution just changed;
|
|
|
|
// whether window is OpenGL and is currently being resized.
|
Changed OpenGL support for the Mac OS X platform: use cocoa instead of deprecated AGL.
All changes are mac-specific, except a very minor change in file src/gl_draw.cxx
where string drawing wrongly claimed to support @symbol, not possible
because symbols are drawn using non-GL primitives.
Unchanged application code can use the new FLTK code.
In addition, the new code allows mac applications to draw OpenGL scenes
at high resolution on so-called 'retina' displays, but this requires some
support from app code. They must call, before opening GL windows,
Fl::use_high_resolution(1);
and change their glViewport() calls as follows
glViewport(0, 0, pxel_w(), pixel_h());
This uses 2 new member functions of the Fl_Gl_Window class,
pixel_w() and pixel_h() returning the window dimensions in pixel
units, that is, twice the w() and h() when the window is mapped
on a retina display.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10498 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-20 10:19:23 +03:00
|
|
|
unsigned mapped_to_retina_;
|
2001-11-27 20:44:08 +03:00
|
|
|
};
|
|
|
|
|
2011-09-14 19:17:32 +04:00
|
|
|
extern Window fl_window;
|
2010-12-23 17:24:29 +03:00
|
|
|
|
2011-01-18 02:52:32 +03:00
|
|
|
#endif // FL_LIBRARY || FL_INTERNALS
|
2010-12-23 17:24:29 +03:00
|
|
|
|
2011-09-14 19:17:32 +04:00
|
|
|
|
|
|
|
extern CGContextRef fl_gc;
|
2001-11-27 20:44:08 +03:00
|
|
|
|
2010-12-23 17:24:29 +03:00
|
|
|
extern Window fl_xid(const Fl_Window*);
|
2011-09-02 18:42:02 +04:00
|
|
|
extern Fl_Window* fl_find(Window xid);
|
2001-11-27 20:44:08 +03:00
|
|
|
|
2011-09-14 19:17:32 +04:00
|
|
|
extern Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *data);
|
|
|
|
extern Fl_Bitmask fl_create_alphamask(int w, int h, int d, int ld, const uchar *data);
|
|
|
|
extern void fl_delete_bitmask(Fl_Bitmask bm);
|
2001-11-27 20:44:08 +03:00
|
|
|
|
2011-09-14 19:17:32 +04:00
|
|
|
extern int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b);
|
2001-11-27 20:44:08 +03:00
|
|
|
extern void fl_open_display();
|
|
|
|
|
2008-09-18 23:09:34 +04:00
|
|
|
#endif // FL_DOXYGEN
|
2012-11-13 18:45:42 +04:00
|
|
|
/** \file
|
|
|
|
Mac OS X-specific symbols.
|
|
|
|
*/
|
2010-03-16 17:47:40 +03:00
|
|
|
|
2011-02-02 00:31:57 +03:00
|
|
|
/** \defgroup group_macosx Mac OS X-specific symbols
|
|
|
|
Mac OS X-specific symbols declared in <FL/x.H> or <FL/gl.h>
|
2013-01-25 20:28:49 +04:00
|
|
|
\sa \ref osissues_macos
|
2010-03-16 17:47:40 +03:00
|
|
|
@{ */
|
|
|
|
|
2011-02-02 00:31:57 +03:00
|
|
|
/** @brief Register a function called for each file dropped onto an application icon.
|
|
|
|
\e cb will be called with a single Unix-style file name and path.
|
|
|
|
If multiple files were dropped, \e cb will be called multiple times.
|
2010-07-01 20:51:28 +04:00
|
|
|
*/
|
|
|
|
extern void fl_open_callback(void (*cb)(const char *));
|
|
|
|
|
2010-03-16 17:47:40 +03:00
|
|
|
/**
|
2010-07-01 20:51:28 +04:00
|
|
|
* \brief Attaches a callback to the "About myprog" item of the system application menu.
|
2010-03-16 17:47:40 +03:00
|
|
|
*
|
|
|
|
* \param cb a callback that will be called by "About myprog" menu item
|
|
|
|
* with NULL 1st argument.
|
|
|
|
* \param user_data a pointer transmitted as 2nd argument to the callback.
|
|
|
|
* \param shortcut optional shortcut to attach to the "About myprog" menu item (e.g., FL_META+'a')
|
|
|
|
*/
|
|
|
|
extern void fl_mac_set_about( Fl_Callback *cb, void *user_data, int shortcut = 0);
|
2010-11-25 21:21:21 +03:00
|
|
|
|
2011-03-04 20:04:43 +03:00
|
|
|
/** \brief The version number of the running Mac OS X (e.g., 100604 for 10.6.4)
|
2010-11-25 21:21:21 +03:00
|
|
|
*/
|
2011-02-02 00:31:57 +03:00
|
|
|
extern int fl_mac_os_version;
|
|
|
|
|
2013-10-05 19:06:39 +04:00
|
|
|
/** The system menu bar.
|
|
|
|
*/
|
|
|
|
extern class Fl_Sys_Menu_Bar *fl_sys_menu_bar;
|
|
|
|
|
2015-11-26 20:28:55 +03:00
|
|
|
struct Fl_Menu_Item;
|
2013-10-05 19:06:39 +04:00
|
|
|
|
2011-02-02 00:31:57 +03:00
|
|
|
class Fl_Mac_App_Menu {
|
|
|
|
public:
|
|
|
|
/** Localizable text for the "About xxx" application menu item */
|
|
|
|
static const char *about;
|
|
|
|
/** Localizable text for the "Print Front Window" application menu item.
|
|
|
|
This menu item won't be displayed if Fl_Mac_App_Menu::print
|
|
|
|
is set to an empty string.
|
|
|
|
*/
|
|
|
|
static const char *print;
|
|
|
|
/** Localizable text for the "Services" application menu item */
|
|
|
|
static const char *services;
|
|
|
|
/** Localizable text for the "Hide xxx" application menu item */
|
|
|
|
static const char *hide;
|
|
|
|
/** Localizable text for the "Hide Others" application menu item */
|
|
|
|
static const char *hide_others;
|
|
|
|
/** Localizable text for the "Show All" application menu item */
|
|
|
|
static const char *show;
|
|
|
|
/** Localizable text for the "Quit xxx" application menu item */
|
|
|
|
static const char *quit;
|
2015-11-26 19:34:58 +03:00
|
|
|
static void custom_application_menu_items(const Fl_Menu_Item *m);
|
2011-02-02 00:31:57 +03:00
|
|
|
};
|
2010-11-25 21:21:21 +03:00
|
|
|
|
2010-03-16 17:47:40 +03:00
|
|
|
/** @} */
|
|
|
|
|
2001-11-27 20:44:08 +03:00
|
|
|
//
|
2005-02-25 00:55:12 +03:00
|
|
|
// End of "$Id$".
|
2001-11-27 20:44:08 +03:00
|
|
|
//
|
|
|
|
|