summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2010-01-16 16:51:22 +0000
committerGreg Ercolano <erco@seriss.com>2010-01-16 16:51:22 +0000
commit7221382917ce840ecf37e9102445e5191dcff08d (patch)
tree62346e4026675eee162ee50b4de27dbaa23c50ab
parent177f45fe98e4c7575f7817a61e91be98162d29d2 (diff)
Checked in Manolo's 'diff.patch' mods from STR #2307
for building FLTK with 64bit on Snow Leopard. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7014 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--FL/Fl_Native_File_Chooser_MAC.H5
-rw-r--r--src/Fl_Native_File_Chooser_MAC.cxx21
2 files changed, 18 insertions, 8 deletions
diff --git a/FL/Fl_Native_File_Chooser_MAC.H b/FL/Fl_Native_File_Chooser_MAC.H
index 015e20d21..a127c184f 100644
--- a/FL/Fl_Native_File_Chooser_MAC.H
+++ b/FL/Fl_Native_File_Chooser_MAC.H
@@ -68,9 +68,9 @@ private:
void *_panel;
#else
NavDialogRef _ref; // file navigation reference
-#endif
NavActionState _keepstate; // holds button permissions
NavMenuItemSpec _tempitem; // Popup menu selection
+#endif
char **_pathnames; // array of pathnames
int _tpathnames; // total pathnames
char *_directory; // default pathname to use
@@ -116,11 +116,10 @@ private:
int get_saveas_basename(void);
#else
int get_saveas_basename(NavDialogRef& ref);
-#endif
int get_pathnames(NavDialogRef& ref);
static void event_handler(NavEventCallbackMessage callBackSelector,
NavCBRecPtr cbparm, void *data);
-
+#endif
void clear_filters();
void add_filter(const char *, const char *);
void parse_filter(const char *from);
diff --git a/src/Fl_Native_File_Chooser_MAC.cxx b/src/Fl_Native_File_Chooser_MAC.cxx
index 28d689bb9..5110d5fbc 100644
--- a/src/Fl_Native_File_Chooser_MAC.cxx
+++ b/src/Fl_Native_File_Chooser_MAC.cxx
@@ -389,9 +389,10 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) {
NavGetDefaultDialogCreationOptions(&_opts);
_opts.optionFlags |= kNavDontConfirmReplacement; // no confirms for "save as"
_ref = NULL;
+ _keepstate = kNavNormalState;
+ memset(&_tempitem, 0, sizeof(_tempitem));
#endif
_options = NO_OPTIONS;
- memset(&_tempitem, 0, sizeof(_tempitem));
_pathnames = NULL;
_tpathnames = 0;
_title = NULL;
@@ -403,7 +404,6 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) {
_directory = NULL;
_preset_file = NULL;
_errmsg = NULL;
- _keepstate = kNavNormalState;
}
// DESTRUCTOR
@@ -461,8 +461,8 @@ int Fl_Native_File_Chooser::show() {
// Make sure fltk interface updates before posting our dialog
Fl::flush();
- _keepstate = kNavNormalState;
#ifndef __APPLE_COCOA__
+ _keepstate = kNavNormalState;
// BROWSER TITLE
CFStringRef cfs_title;
cfs_title = CFStringCreateWithCString(NULL,
@@ -853,6 +853,9 @@ const char* Fl_Native_File_Chooser::preset_file() {
#ifdef __APPLE_COCOA__
#import <Cocoa/Cocoa.h>
#define UNLIKELYPREFIX "___fl_very_unlikely_prefix_"
+#ifndef MAC_OS_X_VERSION_10_6
+#define MAC_OS_X_VERSION_10_6 1060
+#endif
int Fl_Native_File_Chooser::get_saveas_basename(void) {
char *q = strdup( [[(NSSavePanel*)_panel filename] fileSystemRepresentation] );
@@ -886,7 +889,11 @@ void Fl_Native_File_Chooser::type(int val) {
}
}
-@interface FLopenDelegate : NSObject {
+@interface FLopenDelegate : NSObject
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
+<NSOpenSavePanelDelegate>
+#endif
+{
NSPopUpButton *nspopup;
char **filter_pattern;
}
@@ -910,7 +917,11 @@ void Fl_Native_File_Chooser::type(int val) {
}
@end
-@interface FLsaveDelegate : NSObject {
+@interface FLsaveDelegate : NSObject
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
+<NSOpenSavePanelDelegate>
+#endif
+{
}
- (NSString *)panel:(id)sender userEnteredFilename:(NSString *)filename confirmed:(BOOL)okFlag;
@end