aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfilepicker.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llfilepicker.h
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llfilepicker.h')
-rw-r--r--linden/indra/newview/llfilepicker.h45
1 files changed, 18 insertions, 27 deletions
diff --git a/linden/indra/newview/llfilepicker.h b/linden/indra/newview/llfilepicker.h
index c6a11a4..1f7239e 100644
--- a/linden/indra/newview/llfilepicker.h
+++ b/linden/indra/newview/llfilepicker.h
@@ -68,15 +68,6 @@
68#include "SDL/SDL_syswm.h" 68#include "SDL/SDL_syswm.h"
69#endif 69#endif
70 70
71#if LL_GTK
72// we use an aggregate structure so we can pass its pointer through a C callback
73typedef struct {
74 GtkWidget *win;
75 std::vector<LLString> fileVector;
76 std::string contextName;
77} StoreFilenamesStruct;
78#endif // LL_GTK
79
80class LLFilePicker 71class LLFilePicker
81{ 72{
82#ifdef LL_GTK 73#ifdef LL_GTK
@@ -116,28 +107,31 @@ public:
116 FFSAVE_COLLADA = 10, 107 FFSAVE_COLLADA = 10,
117 FFSAVE_RAW = 11, 108 FFSAVE_RAW = 11,
118 FFSAVE_J2C = 12, 109 FFSAVE_J2C = 12,
110 FFSAVE_PNG = 13,
111 FFSAVE_JPEG = 14,
119 }; 112 };
120 113
121 // open the dialog. This is a modal operation 114 // open the dialog. This is a modal operation
122 BOOL getSaveFile( ESaveFilter filter = FFSAVE_ALL, const char* filename = NULL ); 115 BOOL getSaveFile( ESaveFilter filter = FFSAVE_ALL, const std::string& filename = LLStringUtil::null );
123 BOOL getOpenFile( ELoadFilter filter = FFLOAD_ALL ); 116 BOOL getOpenFile( ELoadFilter filter = FFLOAD_ALL );
124 BOOL getMultipleOpenFiles( ELoadFilter filter = FFLOAD_ALL ); 117 BOOL getMultipleOpenFiles( ELoadFilter filter = FFLOAD_ALL );
125 118
126 // Get the filename(s) found. getFirstFile() sets the pointer to 119 // Get the filename(s) found. getFirstFile() sets the pointer to
127 // the start of the structure and allows the start of iteration. 120 // the start of the structure and allows the start of iteration.
128 const char* getFirstFile(); 121 const std::string getFirstFile();
129 122
130 // getNextFile() increments the internal representation and 123 // getNextFile() increments the internal representation and
131 // returns the next file specified by the user. Returns NULL when 124 // returns the next file specified by the user. Returns NULL when
132 // no more files are left. Further calls to getNextFile() are 125 // no more files are left. Further calls to getNextFile() are
133 // undefined. 126 // undefined.
134 const char* getNextFile(); 127 const std::string getNextFile();
135 128
136 // This utility function extracts the directory name but doesn't 129 // This utility function extracts the current file name without
137 // do any incrementing. This is currently only supported when 130 // doing any incrementing.
138 // you're opening multiple files. 131 const std::string getCurFile();
139 const char* getDirname();
140 132
133 // See llvfs/lldir.h : getBaseFileName and getDirName to extract base or directory names
134
141 // clear any lists of buffers or whatever, and make sure the file 135 // clear any lists of buffers or whatever, and make sure the file
142 // picker isn't locked. 136 // picker isn't locked.
143 void reset(); 137 void reset();
@@ -150,11 +144,8 @@ private:
150 FILENAME_BUFFER_SIZE = 65000 144 FILENAME_BUFFER_SIZE = 65000
151 }; 145 };
152 146
153 void buildFilename( void );
154
155#if LL_WINDOWS 147#if LL_WINDOWS
156 OPENFILENAMEW mOFN; // for open and save dialogs 148 OPENFILENAMEW mOFN; // for open and save dialogs
157 char *mOpenFilter;
158 WCHAR mFilesW[FILENAME_BUFFER_SIZE]; 149 WCHAR mFilesW[FILENAME_BUFFER_SIZE];
159 150
160 BOOL setupFilter(ELoadFilter filter); 151 BOOL setupFilter(ELoadFilter filter);
@@ -162,26 +153,26 @@ private:
162 153
163#if LL_DARWIN 154#if LL_DARWIN
164 NavDialogCreationOptions mNavOptions; 155 NavDialogCreationOptions mNavOptions;
165 std::vector<LLString> mFileVector; 156 std::vector<std::string> mFileVector;
166 UInt32 mFileIndex; 157 UInt32 mFileIndex;
167 158
168 OSStatus doNavChooseDialog(ELoadFilter filter); 159 OSStatus doNavChooseDialog(ELoadFilter filter);
169 OSStatus doNavSaveDialog(ESaveFilter filter, const char* filename); 160 OSStatus doNavSaveDialog(ESaveFilter filter, const std::string& filename);
170 void getFilePath(SInt32 index); 161 void getFilePath(SInt32 index);
171 void getFileName(SInt32 index); 162 void getFileName(SInt32 index);
172 static Boolean navOpenFilterProc(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode); 163 static Boolean navOpenFilterProc(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode);
173#endif 164#endif
174 165
175#if LL_GTK 166#if LL_GTK
176 StoreFilenamesStruct mStoreFilenames; 167 static void add_to_selectedfiles(gpointer data, gpointer user_data);
177 U32 mNextFileIndex; 168 static void chooser_responder(GtkWidget *widget, gint response, gpointer user_data);
178 // we remember the last path that was accessed for a particular usage 169 // we remember the last path that was accessed for a particular usage
179 static std::map <std::string, std::string> sContextToPathMap; 170 std::map <std::string, std::string> mContextToPathMap;
171 std::string mCurContextName;
180#endif 172#endif
181 173
182 char mFiles[FILENAME_BUFFER_SIZE]; /*Flawfinder: ignore*/ 174 std::vector<std::string> mFiles;
183 char mFilename[LL_MAX_PATH]; /*Flawfinder: ignore*/ 175 S32 mCurrentFile;
184 char* mCurrentFile;
185 BOOL mLocked; 176 BOOL mLocked;
186 BOOL mMultiFile; 177 BOOL mMultiFile;
187 178