~ubuntu-branches/ubuntu/raring/lmms/raring-proposed

« back to all changes in this revision

Viewing changes to plugins/zynaddsubfx/fltk/FL/mac.H

  • Committer: Charlie Smotherman
  • Date: 2012-12-05 22:08:38 UTC
  • mfrom: (33.1.7 lmms_0.4.13)
  • Revision ID: cjsmo@cableone.net-20121205220838-09pjfzew9m5023hr
* New  Upstream release.
  - Minor tweaking to ZynAddSubFX, CALF, SWH plugins  and Stefan Fendt's RC
    filters.
  - Added UI fixes: Magnentic effect of knobs and Piano-roll fixes
  - Updated German localization and copyright year
* debian/lmms-common.install:
  - added /usr/share/applications so the lmms.desktop file will correctly
    install (LP: #863366)
  - This should also fix the Software Center not displaying lmms in sound
    and video (LP: #824231)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
 
// "$Id: mac.H 7663 2010-07-01 16:51:28Z manolo $"
 
2
// "$Id: mac.H 8657 2011-05-12 11:50:43Z manolo $"
3
3
//
4
4
// Mac header file for the Fast Light Tool Kit (FLTK).
5
5
//
6
 
// Copyright 1998-2009 by Bill Spitzak and others.
 
6
// Copyright 1998-2011 by Bill Spitzak and others.
7
7
//
8
8
// This library is free software; you can redistribute it and/or
9
9
// modify it under the terms of the GNU Library General Public
33
33
#if !defined(Fl_X_H)
34
34
#  error "Never use <FL/mac.H> directly; include <FL/x.H> instead."
35
35
#endif // !Fl_X_H
36
 
 
37
 
// Standard MacOS Carbon API includes...
38
 
#include <Carbon/Carbon.h>
39
 
#include <config.h>
40
 
 
 
36
#include <FL/Fl_Widget.H>
 
37
 
 
38
typedef void* Window;       // this is really a pointer to the subclass FLWindow of NSWindow
 
39
typedef void* Fl_Offscreen; // this is really a CGContextRef
 
40
typedef void* Fl_Bitmask;   // this is really a CGImageRef
 
41
 
 
42
#include <AvailabilityMacros.h>
41
43
#ifndef MAC_OS_X_VERSION_10_3
42
44
#define MAC_OS_X_VERSION_10_3 1030
43
45
#endif
50
52
#ifndef MAC_OS_X_VERSION_10_6
51
53
#define MAC_OS_X_VERSION_10_6 1060
52
54
#endif
53
 
#ifndef MAC_OS_X_VERSION_MAX_ALLOWED
54
 
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_3
55
 
#endif
56
 
 
 
55
 
 
56
#if !(defined(FL_LIBRARY) || defined(FL_INTERNALS)) // this part is used when compiling an application program
 
57
 
 
58
typedef void* Fl_Region;
 
59
typedef void* Fl_CGContextRef;
 
60
typedef void* Fl_PMPrintSettings;
 
61
typedef void* Fl_PMPageFormat;
 
62
typedef void* Fl_PMPrintSession;
 
63
 
 
64
#else // this part must be compiled when building the FLTK libraries
 
65
 
 
66
// Standard MacOS C/C++ includes...
 
67
#include <ApplicationServices/ApplicationServices.h>
 
68
#undef check // because of Fl::check()
 
69
 
 
70
typedef CGContextRef    Fl_CGContextRef;
 
71
typedef PMPrintSettings Fl_PMPrintSettings;
 
72
typedef PMPageFormat    Fl_PMPageFormat;
 
73
typedef PMPrintSession  Fl_PMPrintSession;
 
74
 
 
75
typedef struct flCocoaRegion {
 
76
  int count;
 
77
  CGRect *rects;
 
78
} *Fl_Region;  // a region is the union of a series of rectangles
 
79
 
 
80
#  include "Fl_Window.H"
 
81
 
 
82
// Some random X equivalents
 
83
struct XPoint { int x, y; };
 
84
struct XRectangle {int x, y, width, height;};
57
85
#ifndef CGFLOAT_DEFINED //appears with 10.5 in CGBase.h
58
86
#if defined(__LP64__) && __LP64__
59
87
typedef double CGFloat;
62
90
#endif
63
91
#endif // CGFLOAT_DEFINED
64
92
 
65
 
 
66
 
// Now make some fixes to the headers...
67
 
#undef check                    // Dunno where this comes from...
68
 
 
69
 
// Some random X equivalents
70
 
struct XPoint { int x, y; };
71
 
struct XRectangle {int x, y, width, height;};
72
 
 
73
 
typedef void *Window; // this is really a pter to the subclass FLWindow of NSWindow
74
 
typedef struct flCocoaRegion {
75
 
  int count;
76
 
  CGRect *rects;
77
 
} *Fl_Region;  // a region is the union of a series of rectangles
78
93
extern CGRect fl_cgrectmake_cocoa(int x, int y, int w, int h);
79
 
 
80
94
inline Fl_Region XRectangleRegion(int x, int y, int w, int h) {
81
95
  Fl_Region R = (Fl_Region)malloc(sizeof(*R));
82
96
  R->count = 1;
86
100
}
87
101
inline void XDestroyRegion(Fl_Region r) {
88
102
  if(r) {
89
 
        free(r->rects);
90
 
        free(r);
91
 
        }
 
103
    free(r->rects);
 
104
    free(r);
 
105
  }
92
106
}
 
107
extern void *fl_system_menu;
93
108
extern void *fl_default_cursor;
94
 
extern void *fl_system_menu;
95
 
typedef CGContextRef Fl_Offscreen;
96
 
typedef CGImageRef Fl_Bitmask;
97
 
 
98
 
void fl_clip_region(Fl_Region);
99
 
 
100
 
#  include "Fl_Window.H"
101
109
 
102
110
// This object contains all mac-specific stuff about a window:
103
111
// WARNING: this object is highly subject to change!
104
 
class Fl_X 
105
 
{
 
112
class Fl_X {
 
113
  
106
114
public:
107
 
  Window xid;              // Cocoa: FLWindow* ; Carbon: WindowRef
108
 
  Fl_Offscreen other_xid;  // pointer for offscreen bitmaps (doublebuffer)
 
115
  Window xid;              // pointer to the Cocoa window object (FLWindow*)
 
116
  Fl_Offscreen other_xid;  // pointer for offscreen bitmaps (overlay window)
109
117
  Fl_Window *w;            // FLTK window for 
110
118
  Fl_Region region;
111
119
  Fl_Region subRegion;     // region for this specific subwindow
112
120
  Fl_X *next;              // linked tree to support subwindows
113
121
  Fl_X *xidChildren, *xidNext; // more subwindow tree
114
122
  int wait_for_expose;
115
 
  void *cursor;                   // is really NSCursor*
 
123
  void *cursor;            // is really NSCursor*
116
124
  static Fl_X* first;
117
125
  static Fl_X* i(const Fl_Window* w) {return w->i;}
118
126
  static int fake_X_wm(const Fl_Window*,int&,int&,int&,int&,int&);
125
133
  static void q_release_context(Fl_X *x=0); // free all resources associated with fl_gc
126
134
  static void q_begin_image(CGRect&, int x, int y, int w, int h);
127
135
  static void q_end_image();
 
136
  // Cocoa additions
 
137
  void destroy(void);
 
138
  void map(void);
 
139
  void unmap(void);
 
140
  int unlink(Fl_X* start = NULL);
 
141
  void collapse(void);
 
142
  WindowRef window_ref(void);
 
143
  void set_key_window(void);
 
144
  void set_cursor(Fl_Cursor);
 
145
  static CGImageRef CGImage_from_window_rect(Fl_Window *win, int x, int y, int w, int h);
 
146
  static unsigned char *bitmap_from_window_rect(Fl_Window *win, int x, int y, int w, int h, int *bytesPerPixel);
 
147
  static Fl_Region intersect_region_and_rect(Fl_Region current, int x,int y,int w, int h);
 
148
  static CGContextRef watch_cursor_image(void);
 
149
  static CGContextRef help_cursor_image(void);
 
150
  static CGContextRef nesw_cursor_image(void);
 
151
  static CGContextRef nwse_cursor_image(void);
 
152
  static CGContextRef none_cursor_image(void);
 
153
  static void *get_carbon_function(const char *name);
 
154
private:
 
155
  static void relink(Fl_Window*, Fl_Window*);
 
156
  bool subwindow;
128
157
};
129
158
 
130
 
extern void MacDestroyWindow(Fl_Window*,void *);
131
 
extern void MacMapWindow(Fl_Window*,void *);
132
 
extern void MacUnmapWindow(Fl_Window*,void *);
133
 
extern WindowRef MACwindowRef(Fl_Window *w);
134
 
extern Fl_Region MacRectRegionIntersect(Fl_Region current, int x,int y,int w, int h);
135
 
extern void MacCollapseWindow(Window w);
136
 
 
137
 
extern int MacUnlinkWindow(Fl_X*,Fl_X*start=0L);
138
 
 
139
 
inline Window fl_xid(const Fl_Window*w) 
140
 
{
141
 
  return Fl_X::i(w)->xid;
142
 
}
143
 
 
144
159
extern struct Fl_XMap {
145
160
  RGBColor rgb;
146
161
  ulong pen;
147
162
} *fl_current_xmap;
148
 
 
149
 
extern FL_EXPORT void *fl_display;
150
163
extern FL_EXPORT Window fl_window;
151
 
extern FL_EXPORT CGContextRef fl_gc;
 
164
 
 
165
#endif // FL_LIBRARY || FL_INTERNALS
 
166
 
 
167
extern FL_EXPORT Fl_CGContextRef fl_gc;
152
168
extern FL_EXPORT class Fl_Sys_Menu_Bar *fl_sys_menu_bar;
153
169
 
 
170
extern Window fl_xid(const Fl_Window*);
 
171
void fl_clip_region(Fl_Region);
154
172
 
 
173
extern FL_EXPORT Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *data);
 
174
extern FL_EXPORT Fl_Bitmask fl_create_alphamask(int w, int h, int d, int ld, const uchar *data);
 
175
extern FL_EXPORT void fl_delete_bitmask(Fl_Bitmask bm);
155
176
extern Fl_Offscreen fl_create_offscreen(int w, int h);
156
177
extern void fl_copy_offscreen(int x,int y,int w,int h, Fl_Offscreen gWorld, int srcx,int srcy);
157
178
extern void fl_delete_offscreen(Fl_Offscreen gWorld);
158
179
extern void fl_begin_offscreen(Fl_Offscreen gWorld);
159
180
extern void fl_end_offscreen();
160
181
 
161
 
 
162
 
extern FL_EXPORT Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *data);
163
 
extern FL_EXPORT Fl_Bitmask fl_create_alphamask(int w, int h, int d, int ld, const uchar *data);
164
 
extern FL_EXPORT void fl_delete_bitmask(Fl_Bitmask bm);
165
 
 
 
182
extern FL_EXPORT int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b);
166
183
extern void fl_open_display();
167
184
 
168
 
extern FL_EXPORT int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b);
169
185
#endif // FL_DOXYGEN
170
186
 
171
 
/** \defgroup group_macosx Mac OS X-specific functions
 
187
/** \defgroup group_macosx Mac OS X-specific symbols
 
188
 Mac OS X-specific symbols declared in <FL/x.H> or <FL/gl.h>
172
189
 @{ */
173
190
 
174
 
/** @brief Register a function called for each file dropped onto an application icon 
175
 
 * \note  \#include <FL/x.H>
 
191
/** @brief Register a function called for each file dropped onto an application icon.
 
192
 \e cb will be called with a single Unix-style file name and path.
 
193
 If multiple files were dropped, \e cb will be called multiple times.
176
194
 */
177
195
extern void fl_open_callback(void (*cb)(const char *));
178
196
 
179
197
/** 
180
198
 * \brief Attaches a callback to the "About myprog" item of the system application menu.
181
 
 * \note  \#include <FL/x.H>
182
199
 *
183
200
 * \param cb   a callback that will be called by "About myprog" menu item
184
201
 *                 with NULL 1st argument.
186
203
 * \param shortcut    optional shortcut to attach to the "About myprog" menu item (e.g., FL_META+'a')
187
204
 */
188
205
extern void fl_mac_set_about( Fl_Callback *cb, void *user_data, int shortcut = 0);
 
206
 
 
207
/** \brief The version number of the running Mac OS X (e.g., 100604 for 10.6.4)
 
208
 */
 
209
extern int fl_mac_os_version;
 
210
 
 
211
class Fl_Mac_App_Menu {
 
212
public:
 
213
  /** Localizable text for the "About xxx" application menu item */
 
214
  static const char *about;
 
215
  /** Localizable text for the "Print Front Window" application menu item.
 
216
   This menu item won't be displayed if Fl_Mac_App_Menu::print 
 
217
   is set to an empty string.
 
218
   */
 
219
  static const char *print;
 
220
  /** Localizable text for the "Services" application menu item */
 
221
  static const char *services;
 
222
  /** Localizable text for the "Hide xxx" application menu item */
 
223
  static const char *hide;
 
224
  /** Localizable text for the "Hide Others" application menu item */
 
225
  static const char *hide_others;
 
226
  /** Localizable text for the "Show All" application menu item */
 
227
  static const char *show;
 
228
  /** Localizable text for the "Quit xxx" application menu item */
 
229
  static const char *quit;
 
230
};
 
231
 
189
232
/** @} */
190
233
 
191
234
//
192
 
// End of "$Id: mac.H 7663 2010-07-01 16:51:28Z manolo $".
 
235
// End of "$Id: mac.H 8657 2011-05-12 11:50:43Z manolo $".
193
236
//
194
237