| 1 | /* GTK - The GIMP Toolkit |
| 2 | * gtkfilechooserutils.c: Private utility functions useful for |
| 3 | * implementing a GtkFileChooser interface |
| 4 | * Copyright (C) 2003, Red Hat, Inc. |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Lesser General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Lesser General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Lesser General Public |
| 17 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
| 20 | #include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 21 | #include "gtkfilechooserutils.h"cxx . . $ `<file>/gtk/gtkfilechooserutils.h`/ |
| 22 | #include "deprecated/gtkfilechooser.h"cxx . . $ `<file>/gtk/deprecated/gtkfilechooser.h`/ |
| 23 | #include "gtktypebuiltins.h"cxx . . $ `<file>/build/gtk/gtktypebuiltins.h`/ |
| 24 | #include "gtkprivate.h"cxx . . $ `<file>/gtk/gtkprivate.h`/ |
| 25 | #include "gdktextureutilsprivate.h"cxx . . $ `<file>/gtk/gdktextureutilsprivate.h`/ |
| 26 | #include <glib/gi18n-lib.h> |
| 27 | |
| 28 | |
| 29 | G_GNUC_BEGIN_IGNORE_DEPRECATIONScxx . . $ `<external>/12741050725406041920/gmacros.h:771:9`! |
| 30 | |
| 31 | static gbooleancxx . . $ gboolean# delegate_set_current_foldercxx . . $ delegate_set_current_folder(8eaa44d9a655b703). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 32 | GFilecxx . . $ GFile# *file, |
| 33 | GErrorcxx . . $ GError# **error); |
| 34 | static GFilecxx . . $ GFile# * delegate_get_current_foldercxx . . $ delegate_get_current_folder(8b2c5e6cedeb460b). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser); |
| 35 | static void delegate_set_current_namecxx . . $ delegate_set_current_name(302564de0657f400). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 36 | const char *name); |
| 37 | static char * delegate_get_current_namecxx . . $ delegate_get_current_name(f4ae60207fd6f43f). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser); |
| 38 | static gbooleancxx . . $ gboolean# delegate_select_filecxx . . $ delegate_select_file(8eaa44d9a655b703). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 39 | GFilecxx . . $ GFile# *file, |
| 40 | GErrorcxx . . $ GError# **error); |
| 41 | static void delegate_unselect_filecxx . . $ delegate_unselect_file(e133c5872693865a). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 42 | GFilecxx . . $ GFile# *file); |
| 43 | static void delegate_select_allcxx . . $ delegate_select_all(b52fd5f863455f78). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser); |
| 44 | static void delegate_unselect_allcxx . . $ delegate_unselect_all(b52fd5f863455f78). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser); |
| 45 | static GListModelcxx . . $ GListModel# * delegate_get_filescxx . . $ delegate_get_files(1d40da239557ab32). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser); |
| 46 | static void delegate_add_filtercxx . . $ delegate_add_filter(f752e1aeee6cee8c). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 47 | GtkFileFiltercxx . . $ GtkFileFilter# *filter); |
| 48 | static void delegate_remove_filtercxx . . $ delegate_remove_filter(f752e1aeee6cee8c). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 49 | GtkFileFiltercxx . . $ GtkFileFilter# *filter); |
| 50 | static GListModelcxx . . $ GListModel# * delegate_get_filterscxx . . $ delegate_get_filters(1d40da239557ab32). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser); |
| 51 | static gbooleancxx . . $ gboolean# delegate_add_shortcut_foldercxx . . $ delegate_add_shortcut_folder(8eaa44d9a655b703). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 52 | GFilecxx . . $ GFile# *file, |
| 53 | GErrorcxx . . $ GError# **error); |
| 54 | static gbooleancxx . . $ gboolean# delegate_remove_shortcut_foldercxx . . $ delegate_remove_shortcut_folder(8eaa44d9a655b703). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 55 | GFilecxx . . $ GFile# *file, |
| 56 | GErrorcxx . . $ GError# **error); |
| 57 | static GListModelcxx . . $ GListModel# * delegate_get_shortcut_folderscxx . . $ delegate_get_shortcut_folders(1d40da239557ab32). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser); |
| 58 | static void delegate_notifycxx . . $ delegate_notify(4ebbded80fa75af1). (GObjectcxx . . $ GObject# *object, |
| 59 | GParamSpeccxx . . $ GParamSpec# *pspec, |
| 60 | gpointercxx . . $ gpointer# data); |
| 61 | |
| 62 | static void delegate_add_choicecxx . . $ delegate_add_choice(9e28ea55e22fd5bf). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 63 | const char *id, |
| 64 | const char *label, |
| 65 | const char **options, |
| 66 | const char **option_labels); |
| 67 | static void delegate_remove_choicecxx . . $ delegate_remove_choice(302564de0657f400). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 68 | const char *id); |
| 69 | static void delegate_set_choicecxx . . $ delegate_set_choice(7abb91e84bf07c45). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 70 | const char *id, |
| 71 | const char *option); |
| 72 | static const char * delegate_get_choicecxx . . $ delegate_get_choice(bef1f03008a2fb5f). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 73 | const char *id); |
| 74 | |
| 75 | |
| 76 | /** |
| 77 | * _gtk_file_chooser_install_properties: |
| 78 | * @klass: the class structure for a type deriving from `GObject` |
| 79 | * |
| 80 | * Installs the necessary properties for a class implementing |
| 81 | * `GtkFileChooser`. |
| 82 | * |
| 83 | * A `GtkParamSpecOverride` property is installed for each property, |
| 84 | * using the values from the `GtkFileChooserProp` enumeration. The |
| 85 | * caller must make sure itself that the enumeration values don’t |
| 86 | * collide with some other property values they are using. |
| 87 | */ |
| 88 | void |
| 89 | _gtk_file_chooser_install_propertiescxx . . $ _gtk_file_chooser_install_properties(961ebb3dba2f46fb). (GObjectClasscxx . . $ GObjectClass# *klass) |
| 90 | { |
| 91 | g_object_class_override_propertycxx . . $ g_object_class_override_property(3aa56717d1bf1f20). (klass, |
| 92 | GTK_FILE_CHOOSER_PROP_ACTIONcxx . . $ GTK_FILE_CHOOSER_PROP_ACTION., |
| 93 | "action"); |
| 94 | g_object_class_override_propertycxx . . $ g_object_class_override_property(3aa56717d1bf1f20). (klass, |
| 95 | GTK_FILE_CHOOSER_PROP_FILTERcxx . . $ GTK_FILE_CHOOSER_PROP_FILTER., |
| 96 | "filter"); |
| 97 | g_object_class_override_propertycxx . . $ g_object_class_override_property(3aa56717d1bf1f20). (klass, |
| 98 | GTK_FILE_CHOOSER_PROP_SELECT_MULTIPLEcxx . . $ GTK_FILE_CHOOSER_PROP_SELECT_MULTIPLE., |
| 99 | "select-multiple"); |
| 100 | g_object_class_override_propertycxx . . $ g_object_class_override_property(3aa56717d1bf1f20). (klass, |
| 101 | GTK_FILE_CHOOSER_PROP_CREATE_FOLDERScxx . . $ GTK_FILE_CHOOSER_PROP_CREATE_FOLDERS., |
| 102 | "create-folders"); |
| 103 | g_object_class_override_propertycxx . . $ g_object_class_override_property(3aa56717d1bf1f20). (klass, |
| 104 | GTK_FILE_CHOOSER_PROP_FILTERScxx . . $ GTK_FILE_CHOOSER_PROP_FILTERS., |
| 105 | "filters"); |
| 106 | g_object_class_override_propertycxx . . $ g_object_class_override_property(3aa56717d1bf1f20). (klass, |
| 107 | GTK_FILE_CHOOSER_PROP_SHORTCUT_FOLDERScxx . . $ GTK_FILE_CHOOSER_PROP_SHORTCUT_FOLDERS., |
| 108 | "shortcut-folders"); |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * _gtk_file_chooser_delegate_iface_init: |
| 113 | * @iface: a `GtkFileChoserIface` structure |
| 114 | * |
| 115 | * An interface-initialization function for use in cases where |
| 116 | * an object is simply delegating the methods, signals of |
| 117 | * the `GtkFileChooser` interface to another object. |
| 118 | * |
| 119 | * _gtk_file_chooser_set_delegate() must be called on each |
| 120 | * instance of the object so that the delegate object can |
| 121 | * be found. |
| 122 | **/ |
| 123 | void |
| 124 | _gtk_file_chooser_delegate_iface_initcxx . . $ _gtk_file_chooser_delegate_iface_init(b1868fe4e6407c76). (GtkFileChooserIfacecxx . . $ GtkFileChooserIface# *iface) |
| 125 | { |
| 126 | iface->set_current_foldercxx . . $ _GtkFileChooserIface#set_current_folder. = delegate_set_current_foldercxx . . $ delegate_set_current_folder(8eaa44d9a655b703).; |
| 127 | iface->get_current_foldercxx . . $ _GtkFileChooserIface#get_current_folder. = delegate_get_current_foldercxx . . $ delegate_get_current_folder(8b2c5e6cedeb460b).; |
| 128 | iface->set_current_namecxx . . $ _GtkFileChooserIface#set_current_name. = delegate_set_current_namecxx . . $ delegate_set_current_name(302564de0657f400).; |
| 129 | iface->get_current_namecxx . . $ _GtkFileChooserIface#get_current_name. = delegate_get_current_namecxx . . $ delegate_get_current_name(f4ae60207fd6f43f).; |
| 130 | iface->select_filecxx . . $ _GtkFileChooserIface#select_file. = delegate_select_filecxx . . $ delegate_select_file(8eaa44d9a655b703).; |
| 131 | iface->unselect_filecxx . . $ _GtkFileChooserIface#unselect_file. = delegate_unselect_filecxx . . $ delegate_unselect_file(e133c5872693865a).; |
| 132 | iface->select_allcxx . . $ _GtkFileChooserIface#select_all. = delegate_select_allcxx . . $ delegate_select_all(b52fd5f863455f78).; |
| 133 | iface->unselect_allcxx . . $ _GtkFileChooserIface#unselect_all. = delegate_unselect_allcxx . . $ delegate_unselect_all(b52fd5f863455f78).; |
| 134 | iface->get_filescxx . . $ _GtkFileChooserIface#get_files. = delegate_get_filescxx . . $ delegate_get_files(1d40da239557ab32).; |
| 135 | iface->add_filtercxx . . $ _GtkFileChooserIface#add_filter. = delegate_add_filtercxx . . $ delegate_add_filter(f752e1aeee6cee8c).; |
| 136 | iface->remove_filtercxx . . $ _GtkFileChooserIface#remove_filter. = delegate_remove_filtercxx . . $ delegate_remove_filter(f752e1aeee6cee8c).; |
| 137 | iface->get_filterscxx . . $ _GtkFileChooserIface#get_filters. = delegate_get_filterscxx . . $ delegate_get_filters(1d40da239557ab32).; |
| 138 | iface->add_shortcut_foldercxx . . $ _GtkFileChooserIface#add_shortcut_folder. = delegate_add_shortcut_foldercxx . . $ delegate_add_shortcut_folder(8eaa44d9a655b703).; |
| 139 | iface->remove_shortcut_foldercxx . . $ _GtkFileChooserIface#remove_shortcut_folder. = delegate_remove_shortcut_foldercxx . . $ delegate_remove_shortcut_folder(8eaa44d9a655b703).; |
| 140 | iface->get_shortcut_folderscxx . . $ _GtkFileChooserIface#get_shortcut_folders. = delegate_get_shortcut_folderscxx . . $ delegate_get_shortcut_folders(1d40da239557ab32).; |
| 141 | iface->add_choicecxx . . $ _GtkFileChooserIface#add_choice. = delegate_add_choicecxx . . $ delegate_add_choice(9e28ea55e22fd5bf).; |
| 142 | iface->remove_choicecxx . . $ _GtkFileChooserIface#remove_choice. = delegate_remove_choicecxx . . $ delegate_remove_choice(302564de0657f400).; |
| 143 | iface->set_choicecxx . . $ _GtkFileChooserIface#set_choice. = delegate_set_choicecxx . . $ delegate_set_choice(7abb91e84bf07c45).; |
| 144 | iface->get_choicecxx . . $ _GtkFileChooserIface#get_choice. = delegate_get_choicecxx . . $ delegate_get_choice(bef1f03008a2fb5f).; |
| 145 | } |
| 146 | |
| 147 | /** |
| 148 | * _gtk_file_chooser_set_delegate: |
| 149 | * @receiver: a `GObject` implementing `GtkFileChooser` |
| 150 | * @delegate: another `GObject` implementing `GtkFileChooser` |
| 151 | * |
| 152 | * Establishes that calls on @receiver for `GtkFileChooser` |
| 153 | * methods should be delegated to @delegate, and that |
| 154 | * `GtkFileChooser` signals emitted on @delegate should be |
| 155 | * forwarded to @receiver. Must be used in conjunction with |
| 156 | * _gtk_file_chooser_delegate_iface_init(). |
| 157 | **/ |
| 158 | void |
| 159 | _gtk_file_chooser_set_delegatecxx . . $ _gtk_file_chooser_set_delegate(385bc6676cd2f8fe). (GtkFileChoosercxx . . $ GtkFileChooser# *receiver, |
| 160 | GtkFileChoosercxx . . $ GtkFileChooser# *delegate) |
| 161 | { |
| 162 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_FILE_CHOOSERcxx . . $ `gtk/deprecated/gtkfilechooser.h:32:9`! (receiver)); |
| 163 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_FILE_CHOOSERcxx . . $ `gtk/deprecated/gtkfilechooser.h:32:9`! (delegate)); |
| 164 | |
| 165 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (receiver), I_cxx . . $ `gdk/gdkprivate.h:35:9`!("gtk-file-chooser-delegate"), delegate); |
| 166 | g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (delegate, "notify", |
| 167 | G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (delegate_notify), receiver); |
| 168 | } |
| 169 | |
| 170 | GQuarkcxx . . $ GQuark# |
| 171 | _gtk_file_chooser_delegate_get_quarkcxx . . $ _gtk_file_chooser_delegate_get_quark(db52760e79bf9054). (void) |
| 172 | { |
| 173 | static GQuarkcxx . . $ GQuark# quark = 0; |
| 174 | |
| 175 | if (G_UNLIKELYcxx . . $ `<external>/12741050725406041920/gmacros.h:1285:9`! (quark == 0)) |
| 176 | quark = g_quark_from_static_stringcxx . . $ g_quark_from_static_string(c61c63047ce273de). ("gtk-file-chooser-delegate"); |
| 177 | |
| 178 | return quark; |
| 179 | } |
| 180 | |
| 181 | static GtkFileChoosercxx . . $ GtkFileChooser# * |
| 182 | get_delegatecxx . . $ get_delegate(579597deebdd22d9). (GtkFileChoosercxx . . $ GtkFileChooser# *receiver) |
| 183 | { |
| 184 | return g_object_get_qdatacxx . . $ g_object_get_qdata(b02fb2b4fc775a4). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (receiver), |
| 185 | GTK_FILE_CHOOSER_DELEGATE_QUARKcxx . . $ `gtk/gtkfilechooserutils.h:27:9`!); |
| 186 | } |
| 187 | |
| 188 | static gbooleancxx . . $ gboolean# |
| 189 | delegate_select_filecxx . . $ delegate_select_file(8eaa44d9a655b703). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 190 | GFilecxx . . $ GFile# *file, |
| 191 | GErrorcxx . . $ GError# **error) |
| 192 | { |
| 193 | return gtk_file_chooser_select_filecxx . . $ gtk_file_chooser_select_file(8eaa44d9a655b703). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser), file, error); |
| 194 | } |
| 195 | |
| 196 | static void |
| 197 | delegate_unselect_filecxx . . $ delegate_unselect_file(e133c5872693865a). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 198 | GFilecxx . . $ GFile# *file) |
| 199 | { |
| 200 | gtk_file_chooser_unselect_filecxx . . $ gtk_file_chooser_unselect_file(e133c5872693865a). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser), file); |
| 201 | } |
| 202 | |
| 203 | static void |
| 204 | delegate_select_allcxx . . $ delegate_select_all(b52fd5f863455f78). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser) |
| 205 | { |
| 206 | gtk_file_chooser_select_allcxx . . $ gtk_file_chooser_select_all(b52fd5f863455f78). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser)); |
| 207 | } |
| 208 | |
| 209 | static void |
| 210 | delegate_unselect_allcxx . . $ delegate_unselect_all(b52fd5f863455f78). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser) |
| 211 | { |
| 212 | gtk_file_chooser_unselect_allcxx . . $ gtk_file_chooser_unselect_all(b52fd5f863455f78). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser)); |
| 213 | } |
| 214 | |
| 215 | static GListModelcxx . . $ GListModel# * |
| 216 | delegate_get_filescxx . . $ delegate_get_files(1d40da239557ab32). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser) |
| 217 | { |
| 218 | return gtk_file_chooser_get_filescxx . . $ gtk_file_chooser_get_files(1d40da239557ab32). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser)); |
| 219 | } |
| 220 | |
| 221 | static void |
| 222 | delegate_add_filtercxx . . $ delegate_add_filter(f752e1aeee6cee8c). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 223 | GtkFileFiltercxx . . $ GtkFileFilter# *filter) |
| 224 | { |
| 225 | gtk_file_chooser_add_filtercxx . . $ gtk_file_chooser_add_filter(f752e1aeee6cee8c). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser), filter); |
| 226 | } |
| 227 | |
| 228 | static void |
| 229 | delegate_remove_filtercxx . . $ delegate_remove_filter(f752e1aeee6cee8c). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 230 | GtkFileFiltercxx . . $ GtkFileFilter# *filter) |
| 231 | { |
| 232 | gtk_file_chooser_remove_filtercxx . . $ gtk_file_chooser_remove_filter(f752e1aeee6cee8c). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser), filter); |
| 233 | } |
| 234 | |
| 235 | static GListModelcxx . . $ GListModel# * |
| 236 | delegate_get_filterscxx . . $ delegate_get_filters(1d40da239557ab32). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser) |
| 237 | { |
| 238 | return gtk_file_chooser_get_filterscxx . . $ gtk_file_chooser_get_filters(1d40da239557ab32). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser)); |
| 239 | } |
| 240 | |
| 241 | static gbooleancxx . . $ gboolean# |
| 242 | delegate_add_shortcut_foldercxx . . $ delegate_add_shortcut_folder(8eaa44d9a655b703). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 243 | GFilecxx . . $ GFile# *file, |
| 244 | GErrorcxx . . $ GError# **error) |
| 245 | { |
| 246 | return gtk_file_chooser_add_shortcut_foldercxx . . $ gtk_file_chooser_add_shortcut_folder(8eaa44d9a655b703). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser), file, error); |
| 247 | } |
| 248 | |
| 249 | static gbooleancxx . . $ gboolean# |
| 250 | delegate_remove_shortcut_foldercxx . . $ delegate_remove_shortcut_folder(8eaa44d9a655b703). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 251 | GFilecxx . . $ GFile# *file, |
| 252 | GErrorcxx . . $ GError# **error) |
| 253 | { |
| 254 | return gtk_file_chooser_remove_shortcut_foldercxx . . $ gtk_file_chooser_remove_shortcut_folder(8eaa44d9a655b703). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser), file, error); |
| 255 | } |
| 256 | |
| 257 | static GListModelcxx . . $ GListModel# * |
| 258 | delegate_get_shortcut_folderscxx . . $ delegate_get_shortcut_folders(1d40da239557ab32). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser) |
| 259 | { |
| 260 | return gtk_file_chooser_get_shortcut_folderscxx . . $ gtk_file_chooser_get_shortcut_folders(1d40da239557ab32). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser)); |
| 261 | } |
| 262 | |
| 263 | static gbooleancxx . . $ gboolean# |
| 264 | delegate_set_current_foldercxx . . $ delegate_set_current_folder(8eaa44d9a655b703). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 265 | GFilecxx . . $ GFile# *file, |
| 266 | GErrorcxx . . $ GError# **error) |
| 267 | { |
| 268 | return gtk_file_chooser_set_current_foldercxx . . $ gtk_file_chooser_set_current_folder(8eaa44d9a655b703). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser), file, error); |
| 269 | } |
| 270 | |
| 271 | static GFilecxx . . $ GFile# * |
| 272 | delegate_get_current_foldercxx . . $ delegate_get_current_folder(8b2c5e6cedeb460b). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser) |
| 273 | { |
| 274 | return gtk_file_chooser_get_current_foldercxx . . $ gtk_file_chooser_get_current_folder(8b2c5e6cedeb460b). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser)); |
| 275 | } |
| 276 | |
| 277 | static void |
| 278 | delegate_set_current_namecxx . . $ delegate_set_current_name(302564de0657f400). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 279 | const char *name) |
| 280 | { |
| 281 | gtk_file_chooser_set_current_namecxx . . $ gtk_file_chooser_set_current_name(302564de0657f400). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser), name); |
| 282 | } |
| 283 | |
| 284 | static char * |
| 285 | delegate_get_current_namecxx . . $ delegate_get_current_name(f4ae60207fd6f43f). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser) |
| 286 | { |
| 287 | return gtk_file_chooser_get_current_namecxx . . $ gtk_file_chooser_get_current_name(f4ae60207fd6f43f). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser)); |
| 288 | } |
| 289 | |
| 290 | static void |
| 291 | delegate_notifycxx . . $ delegate_notify(4ebbded80fa75af1). (GObjectcxx . . $ GObject# *object, |
| 292 | GParamSpeccxx . . $ GParamSpec# *pspec, |
| 293 | gpointercxx . . $ gpointer# data) |
| 294 | { |
| 295 | gpointercxx . . $ gpointer# iface; |
| 296 | |
| 297 | iface = g_type_interface_peekcxx . . $ g_type_interface_peek(417ab160f6baadc6). (g_type_class_peekcxx . . $ g_type_class_peek(bfcfa4d6b7f7ef64). (G_OBJECT_TYPEcxx . . $ `<external>/1341695927569185362/gobject.h:98:9`! (object)), |
| 298 | gtk_file_chooser_get_typecxx . . $ gtk_file_chooser_get_type(f708dce9a8856c70). ()); |
| 299 | if (g_object_interface_find_propertycxx . . $ g_object_interface_find_property(aed974c1964428ea). (iface, pspec->namecxx . . $ _GParamSpec#name.)) |
| 300 | g_object_notifycxx . . $ g_object_notify(174c9e6df5777c4e). (data, pspec->namecxx . . $ _GParamSpec#name.); |
| 301 | } |
| 302 | |
| 303 | GSettingscxx . . $ GSettings# * |
| 304 | _gtk_file_chooser_get_settings_for_widgetcxx . . $ _gtk_file_chooser_get_settings_for_widget(6048a9f164868c66). (GtkWidgetcxx . . $ GtkWidget# *widget) |
| 305 | { |
| 306 | static GQuarkcxx . . $ GQuark# file_chooser_settings_quark = 0; |
| 307 | GtkSettingscxx . . $ GtkSettings# *gtksettings; |
| 308 | GSettingscxx . . $ GSettings# *settings; |
| 309 | |
| 310 | if (G_UNLIKELYcxx . . $ `<external>/12741050725406041920/gmacros.h:1285:9`! (file_chooser_settings_quark == 0)) |
| 311 | file_chooser_settings_quark = g_quark_from_static_stringcxx . . $ g_quark_from_static_string(c61c63047ce273de). ("-gtk-file-chooser-settings"); |
| 312 | |
| 313 | gtksettings = gtk_widget_get_settingscxx . . $ gtk_widget_get_settings(ffe4fbf99830fa29). (widget); |
| 314 | settings = g_object_get_qdatacxx . . $ g_object_get_qdata(b02fb2b4fc775a4). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (gtksettings), file_chooser_settings_quark); |
| 315 | |
| 316 | if (G_UNLIKELYcxx . . $ `<external>/12741050725406041920/gmacros.h:1285:9`! (settings == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)) |
| 317 | { |
| 318 | settings = g_settings_newcxx . . $ g_settings_new(5087f26a8cbce16d). ("org.gtk.gtk4.Settings.FileChooser"); |
| 319 | g_settings_delaycxx . . $ g_settings_delay(89c4c2d7cd22fbd0). (settings); |
| 320 | |
| 321 | g_object_set_qdata_fullcxx . . $ g_object_set_qdata_full(65a765778c030710). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (gtksettings), |
| 322 | file_chooser_settings_quark, |
| 323 | settings, |
| 324 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).); |
| 325 | } |
| 326 | |
| 327 | return settings; |
| 328 | } |
| 329 | |
| 330 | char * |
| 331 | _gtk_file_chooser_label_for_filecxx . . $ _gtk_file_chooser_label_for_file(bd69fa69840f32a9). (GFilecxx . . $ GFile# *file) |
| 332 | { |
| 333 | const char *path, *start, *end, *p; |
| 334 | char *uri, *host, *label; |
| 335 | |
| 336 | uri = g_file_get_uricxx . . $ g_file_get_uri(bd69fa69840f32a9). (file); |
| 337 | |
| 338 | start = strstrcxx . . $ strstr(a713fe7b9a57cf96). (uri, "://"); |
| 339 | if (start) |
| 340 | { |
| 341 | start += 3; |
| 342 | path = strchrcxx . . $ strchr(2050848944e00d54). (start, '/'); |
| 343 | if (path) |
| 344 | end = path; |
| 345 | else |
| 346 | { |
| 347 | end = uri + strlencxx . . $ strlen(751346f8406fd082). (uri); |
| 348 | path = "/"; |
| 349 | } |
| 350 | |
| 351 | /* strip username */ |
| 352 | p = strchrcxx . . $ strchr(2050848944e00d54). (start, '@'); |
| 353 | if (p && p < end) |
| 354 | start = p + 1; |
| 355 | |
| 356 | p = strchrcxx . . $ strchr(2050848944e00d54). (start, ':'); |
| 357 | if (p && p < end) |
| 358 | end = p; |
| 359 | |
| 360 | host = g_strndupcxx . . $ g_strndup(eabdfdef77619b3d). (start, end - start); |
| 361 | /* Translators: the first string is a path and the second string |
| 362 | * is a hostname. Nautilus and the panel contain the same string |
| 363 | * to translate. |
| 364 | */ |
| 365 | label = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). (_cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("%1$s on %2$s"), path, host); |
| 366 | |
| 367 | g_freecxx . . $ g_free(5d22bdacc48458e8). (host); |
| 368 | } |
| 369 | else |
| 370 | { |
| 371 | label = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (uri); |
| 372 | } |
| 373 | |
| 374 | g_freecxx . . $ g_free(5d22bdacc48458e8). (uri); |
| 375 | |
| 376 | return label; |
| 377 | } |
| 378 | |
| 379 | static void |
| 380 | delegate_add_choicecxx . . $ delegate_add_choice(9e28ea55e22fd5bf). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 381 | const char *id, |
| 382 | const char *label, |
| 383 | const char **options, |
| 384 | const char **option_labels) |
| 385 | { |
| 386 | gtk_file_chooser_add_choicecxx . . $ gtk_file_chooser_add_choice(9e28ea55e22fd5bf). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser), |
| 387 | id, label, options, option_labels); |
| 388 | } |
| 389 | static void |
| 390 | delegate_remove_choicecxx . . $ delegate_remove_choice(302564de0657f400). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 391 | const char *id) |
| 392 | { |
| 393 | gtk_file_chooser_remove_choicecxx . . $ gtk_file_chooser_remove_choice(302564de0657f400). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser), id); |
| 394 | } |
| 395 | |
| 396 | static void |
| 397 | delegate_set_choicecxx . . $ delegate_set_choice(7abb91e84bf07c45). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 398 | const char *id, |
| 399 | const char *option) |
| 400 | { |
| 401 | gtk_file_chooser_set_choicecxx . . $ gtk_file_chooser_set_choice(7abb91e84bf07c45). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser), id, option); |
| 402 | } |
| 403 | |
| 404 | |
| 405 | static const char * |
| 406 | delegate_get_choicecxx . . $ delegate_get_choice(bef1f03008a2fb5f). (GtkFileChoosercxx . . $ GtkFileChooser# *chooser, |
| 407 | const char *id) |
| 408 | { |
| 409 | return gtk_file_chooser_get_choicecxx . . $ gtk_file_chooser_get_choice(bef1f03008a2fb5f). (get_delegatecxx . . $ get_delegate(579597deebdd22d9). (chooser), id); |
| 410 | } |
| 411 | |
| 412 | gbooleancxx . . $ gboolean# |
| 413 | _gtk_file_info_consider_as_directorycxx . . $ _gtk_file_info_consider_as_directory(c8288432bf522328). (GFileInfocxx . . $ GFileInfo# *info) |
| 414 | { |
| 415 | GFileTypecxx . . $ GFileType# type = g_file_info_get_file_typecxx . . $ g_file_info_get_file_type(6744f067282143be). (info); |
| 416 | |
| 417 | return (type == G_FILE_TYPE_DIRECTORYcxx . . $ G_FILE_TYPE_DIRECTORY. || |
| 418 | type == G_FILE_TYPE_MOUNTABLEcxx . . $ G_FILE_TYPE_MOUNTABLE. || |
| 419 | type == G_FILE_TYPE_SHORTCUTcxx . . $ G_FILE_TYPE_SHORTCUT.); |
| 420 | } |
| 421 | |
| 422 | gbooleancxx . . $ gboolean# |
| 423 | _gtk_file_has_native_pathcxx . . $ _gtk_file_has_native_path(1c6b5e197c84b8bc). (GFilecxx . . $ GFile# *file) |
| 424 | { |
| 425 | char *local_file_path; |
| 426 | gbooleancxx . . $ gboolean# has_native_path; |
| 427 | |
| 428 | /* Don't use g_file_is_native(), as we want to support FUSE paths if available */ |
| 429 | local_file_path = g_file_get_pathcxx . . $ g_file_get_path(bd69fa69840f32a9). (file); |
| 430 | has_native_path = (local_file_path != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 431 | g_freecxx . . $ g_free(5d22bdacc48458e8). (local_file_path); |
| 432 | |
| 433 | return has_native_path; |
| 434 | } |
| 435 | |
| 436 | gbooleancxx . . $ gboolean# |
| 437 | _gtk_file_consider_as_remotecxx . . $ _gtk_file_consider_as_remote(1c6b5e197c84b8bc). (GFilecxx . . $ GFile# *file) |
| 438 | { |
| 439 | GFileInfocxx . . $ GFileInfo# *info; |
| 440 | gbooleancxx . . $ gboolean# is_remote; |
| 441 | |
| 442 | info = g_file_query_filesystem_infocxx . . $ g_file_query_filesystem_info(9a04b3a3309675e9). (file, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTEcxx . . $ `<external>/10155032491143044340/gfileinfo.h:1229:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 443 | if (info) |
| 444 | { |
| 445 | is_remote = g_file_info_get_attribute_booleancxx . . $ g_file_info_get_attribute_boolean(b98a6a1613e404ac). (info, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTEcxx . . $ `<external>/10155032491143044340/gfileinfo.h:1229:9`!); |
| 446 | |
| 447 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (info); |
| 448 | } |
| 449 | else |
| 450 | is_remote = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 451 | |
| 452 | return is_remote; |
| 453 | } |
| 454 | |
| 455 | GIconcxx . . $ GIcon# * |
| 456 | _gtk_file_info_get_iconcxx . . $ _gtk_file_info_get_icon(9e50917cd5e54407). (GFileInfocxx . . $ GFileInfo# *info, |
| 457 | int icon_size, |
| 458 | int scale, |
| 459 | GtkIconThemecxx . . $ GtkIconTheme# *icon_theme) |
| 460 | { |
| 461 | GIconcxx . . $ GIcon# *icon; |
| 462 | const char *thumbnail_path; |
| 463 | |
| 464 | thumbnail_path = g_file_info_get_attribute_byte_stringcxx . . $ g_file_info_get_attribute_byte_string(d998cc976a5a0b3d). (info, G_FILE_ATTRIBUTE_THUMBNAIL_PATHcxx . . $ `<external>/10155032491143044340/gfileinfo.h:931:9`!); |
| 465 | |
| 466 | if (thumbnail_path) |
| 467 | { |
| 468 | GdkTexturecxx . . $ GdkTexture# *texture; |
| 469 | |
| 470 | texture = gdk_texture_new_from_filename_at_scalecxx . . $ gdk_texture_new_from_filename_at_scale(9255ba3a4d9a6bcb). (thumbnail_path, |
| 471 | icon_size*scale, icon_size*scale, |
| 472 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 473 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 474 | |
| 475 | if (texture != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 476 | return G_ICONcxx . . $ `<external>/8661236154227042850/gicon.h:35:9`! (texture); |
| 477 | } |
| 478 | |
| 479 | icon = g_file_info_get_iconcxx . . $ g_file_info_get_icon(d4bbc8f2592fb209). (info); |
| 480 | if (icon && gtk_icon_theme_has_giconcxx . . $ gtk_icon_theme_has_gicon(652227442b7053b4). (icon_theme, icon)) |
| 481 | return g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (icon); |
| 482 | |
| 483 | /* Use general fallback for all files without icon */ |
| 484 | icon = g_themed_icon_newcxx . . $ g_themed_icon_new(325c2ed61a9b94ee). ("text-x-generic"); |
| 485 | return icon; |
| 486 | } |
| 487 | |
| 488 | GFilecxx . . $ GFile# * |
| 489 | _gtk_file_info_get_filecxx . . $ _gtk_file_info_get_file(b15960441760c648). (GFileInfocxx . . $ GFileInfo# *info) |
| 490 | { |
| 491 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (G_IS_FILE_INFOcxx . . $ `<external>/10155032491143044340/gfileinfo.h:37:9`! (info)); |
| 492 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (g_file_info_has_attribute (info, "standard::file")); |
| 493 | |
| 494 | return G_FILEcxx . . $ `<external>/13962853800498659056/gfile.h:35:9`! (g_file_info_get_attribute_object (info, "standard::file")); |
| 495 | } |