| 1197 | } |
| 1198 | |
| 1199 | cc_result Window_SaveFileDialog(const struct SaveFileDialogArgs* args) { |
| 1200 | const char* const* titles = args->titles; |
| 1201 | const char* const* fileExts = args->filters; |
| 1202 | cc_string path; char pathBuffer[1024]; |
| 1203 | int i; |
| 1204 | |
| 1205 | String_InitArray_NT(path, pathBuffer); |
| 1206 | String_AppendConst(&path, "zenity --file-selection"); |
| 1207 | for (i = 0; fileExts[i]; i++) |
| 1208 | { |
| 1209 | String_Format3(&path, " --file-filter='%c (*%c) | *%c'", titles[i], fileExts[i], fileExts[i]); |
| 1210 | } |
| 1211 | String_AppendConst(&path, " --save --confirm-overwrite"); |
| 1212 | |
| 1213 | /* TODO: Utf8 encode filename */ |
| 1214 | if (args->defaultName.length) { |
| 1215 | String_Format1(&path, " --filename='%s'", &args->defaultName); |
| 1216 | } |
| 1217 | |
| 1218 | path.buffer[path.length] = '\0'; |
| 1219 | return OpenSaveFileDialog(path.buffer, args->Callback, fileExts[0]); |
| 1220 | } |
| 1221 | |
| 1222 | static GC fb_gc; |
| 1223 | static XImage* fb_image; |
nothing calls this directly
no test coverage detected