Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Ticket #410: gtkd_ldc_workaround.patch

File gtkd_ldc_workaround.patch, 35.8 kB (added by john_i_, 1 year ago)
  • gtkd/gtkD/src/gio/Mount.d

    old new  
    7272{ 
    7373     
    7474    // Minimal implementation. 
    75     mixin MountT!(GMount); 
     75    //mixin MountT!(GMount); 
     76// MANUAL TEMPLATE 
     77    /** the main Gtk struct */ 
     78    protected GMount* gMount; 
     79     
     80     
     81    public GMount* getMountTStruct() 
     82    { 
     83        return cast(GMount*)getStruct(); 
     84    } 
     85     
     86     
     87    /** 
     88     */ 
     89    int[char[]] connectedSignals; 
     90     
     91    void delegate(MountIF)[] _onChangedListeners; 
     92    void delegate(MountIF)[] onChangedListeners() 
     93    { 
     94        return  _onChangedListeners; 
     95    } 
     96    /** 
     97     * Emitted when the mount has been changed. 
     98     */ 
     99    void addOnChanged(void delegate(MountIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 
     100    { 
     101        if ( !("changed" in connectedSignals) ) 
     102        { 
     103            Signals.connectData( 
     104            getStruct(), 
     105            "changed", 
     106            cast(GCallback)&callBackChanged, 
     107            cast(void*)cast(MountIF)this, 
     108            null, 
     109            connectFlags); 
     110            connectedSignals["changed"] = 1; 
     111        } 
     112        _onChangedListeners ~= dlg; 
     113    } 
     114    extern(C) static void callBackChanged(GMount* mountStruct, MountIF mountIF) 
     115    { 
     116        foreach ( void delegate(MountIF) dlg ; mountIF.onChangedListeners ) 
     117        { 
     118            dlg(mountIF); 
     119        } 
     120    } 
     121     
     122    void delegate(MountIF)[] _onPreUnmountListeners; 
     123    void delegate(MountIF)[] onPreUnmountListeners() 
     124    { 
     125        return  _onPreUnmountListeners; 
     126    } 
     127    /** 
     128     * This signal is emitted when the GMount is about to be 
     129     * unmounted. 
     130     * Since 2.22 
     131     */ 
     132    void addOnPreUnmount(void delegate(MountIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 
     133    { 
     134        if ( !("pre-unmount" in connectedSignals) ) 
     135        { 
     136            Signals.connectData( 
     137            getStruct(), 
     138            "pre-unmount", 
     139            cast(GCallback)&callBackPreUnmount, 
     140            cast(void*)cast(MountIF)this, 
     141            null, 
     142            connectFlags); 
     143            connectedSignals["pre-unmount"] = 1; 
     144        } 
     145        _onPreUnmountListeners ~= dlg; 
     146    } 
     147    extern(C) static void callBackPreUnmount(GMount* mountStruct, MountIF mountIF) 
     148    { 
     149        foreach ( void delegate(MountIF) dlg ; mountIF.onPreUnmountListeners ) 
     150        { 
     151            dlg(mountIF); 
     152        } 
     153    } 
     154     
     155    void delegate(MountIF)[] _onUnmountedListeners; 
     156    void delegate(MountIF)[] onUnmountedListeners() 
     157    { 
     158        return  _onUnmountedListeners; 
     159    } 
     160    /** 
     161     * This signal is emitted when the GMount have been 
     162     * unmounted. If the recipient is holding references to the 
     163     * object they should release them so the object can be 
     164     * finalized. 
     165     */ 
     166    void addOnUnmounted(void delegate(MountIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 
     167    { 
     168        if ( !("unmounted" in connectedSignals) ) 
     169        { 
     170            Signals.connectData( 
     171            getStruct(), 
     172            "unmounted", 
     173            cast(GCallback)&callBackUnmounted, 
     174            cast(void*)cast(MountIF)this, 
     175            null, 
     176            connectFlags); 
     177            connectedSignals["unmounted"] = 1; 
     178        } 
     179        _onUnmountedListeners ~= dlg; 
     180    } 
     181    extern(C) static void callBackUnmounted(GMount* mountStruct, MountIF mountIF) 
     182    { 
     183        foreach ( void delegate(MountIF) dlg ; mountIF.onUnmountedListeners ) 
     184        { 
     185            dlg(mountIF); 
     186        } 
     187    } 
     188     
     189     
     190    /** 
     191     * Gets the name of mount. 
     192     * Returns: the name for the given mount.  The returned string should be freed with g_free() when no longer needed. 
     193     */ 
     194    public string getName() 
     195    { 
     196        // char * g_mount_get_name (GMount *mount); 
     197        return Str.toString(g_mount_get_name(getMountTStruct())); 
     198    } 
     199     
     200    /** 
     201     * Gets the UUID for the mount. The reference is typically based on 
     202     * the file system UUID for the mount in question and should be 
     203     * considered an opaque string. Returns NULL if there is no UUID 
     204     * available. 
     205     * Returns: the UUID for mount or NULL if no UUID can be computed. The returned string should be freed with g_free() when no longer needed. 
     206     */ 
     207    public string getUuid() 
     208    { 
     209        // char * g_mount_get_uuid (GMount *mount); 
     210        return Str.toString(g_mount_get_uuid(getMountTStruct())); 
     211    } 
     212     
     213    /** 
     214     * Gets the icon for mount. 
     215     * Returns: a GIcon. The returned object should be unreffed with  g_object_unref() when no longer needed. 
     216     */ 
     217    public IconIF getIcon() 
     218    { 
     219        // GIcon * g_mount_get_icon (GMount *mount); 
     220        auto p = g_mount_get_icon(getMountTStruct()); 
     221        if(p is null) 
     222        { 
     223            return null; 
     224        } 
     225        return new Icon(cast(GIcon*) p); 
     226    } 
     227     
     228    /** 
     229     * Gets the drive for the mount. 
     230     * This is a convenience method for getting the GVolume and then 
     231     * using that object to get the GDrive. 
     232     * Returns: a GDrive or NULL if mount is not associated with a volume or a drive. The returned object should be unreffed with  g_object_unref() when no longer needed. 
     233     */ 
     234    public DriveIF getDrive() 
     235    { 
     236        // GDrive * g_mount_get_drive (GMount *mount); 
     237        auto p = g_mount_get_drive(getMountTStruct()); 
     238        if(p is null) 
     239        { 
     240            return null; 
     241        } 
     242        return new Drive(cast(GDrive*) p); 
     243    } 
     244     
     245    /** 
     246     * Gets the root directory on mount. 
     247     * Returns: a GFile.  The returned object should be unreffed with  g_object_unref() when no longer needed. 
     248     */ 
     249    public File getRoot() 
     250    { 
     251        // GFile * g_mount_get_root (GMount *mount); 
     252        auto p = g_mount_get_root(getMountTStruct()); 
     253        if(p is null) 
     254        { 
     255            return null; 
     256        } 
     257        return new File(cast(GFile*) p); 
     258    } 
     259     
     260    /** 
     261     * Gets the volume for the mount. 
     262     * Returns: a GVolume or NULL if mount is not associated with a volume. The returned object should be unreffed with  g_object_unref() when no longer needed. 
     263     */ 
     264    public VolumeIF getVolume() 
     265    { 
     266        // GVolume * g_mount_get_volume (GMount *mount); 
     267        auto p = g_mount_get_volume(getMountTStruct()); 
     268        if(p is null) 
     269        { 
     270            return null; 
     271        } 
     272        return new Volume(cast(GVolume*) p); 
     273    } 
     274     
     275    /** 
     276     * Checks if mount can be mounted. 
     277     * Params: 
     278     * mount =  a GMount. 
     279     * Returns: TRUE if the mount can be unmounted. 
     280     */ 
     281    public int canUnmount() 
     282    { 
     283        // gboolean g_mount_can_unmount (GMount *mount); 
     284        return g_mount_can_unmount(getMountTStruct()); 
     285    } 
     286     
     287    /** 
     288     * Warning 
     289     * g_mount_unmount has been deprecated since version 2.22 and should not be used in newly-written code. Use g_mount_unmount_with_operation() instead. 
     290     * Unmounts a mount. This is an asynchronous operation, and is 
     291     * finished by calling g_mount_unmount_finish() with the mount 
     292     * and GAsyncResult data returned in the callback. 
     293     * Params: 
     294     * mount =  a GMount. 
     295     * flags =  flags affecting the operation 
     296     * cancellable =  optional GCancellable object, NULL to ignore. 
     297     * callback =  a GAsyncReadyCallback, or NULL. 
     298     * userData =  user data passed to callback. 
     299     */ 
     300    public void unmount(GMountUnmountFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData) 
     301    { 
     302        // void g_mount_unmount (GMount *mount,  GMountUnmountFlags flags,  GCancellable *cancellable,  GAsyncReadyCallback callback,  gpointer user_data); 
     303        g_mount_unmount(getMountTStruct(), flags, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); 
     304    } 
     305     
     306    /** 
     307     * Warning 
     308     * g_mount_unmount_finish has been deprecated since version 2.22 and should not be used in newly-written code. Use g_mount_unmount_with_operation_finish() instead. 
     309     * Finishes unmounting a mount. If any errors occurred during the operation, 
     310     * error will be set to contain the errors and FALSE will be returned. 
     311     * Params: 
     312     * mount =  a GMount. 
     313     * result =  a GAsyncResult. 
     314     * Returns: TRUE if the mount was successfully unmounted. FALSE otherwise. 
     315     * Throws: GException on failure. 
     316     */ 
     317    public int unmountFinish(AsyncResultIF result) 
     318    { 
     319        // gboolean g_mount_unmount_finish (GMount *mount,  GAsyncResult *result,  GError **error); 
     320        GError* err = null; 
     321         
     322        auto p = g_mount_unmount_finish(getMountTStruct(), (result is null) ? null : result.getAsyncResultTStruct(), &err); 
     323         
     324        if (err !is null) 
     325        { 
     326            throw new GException( new ErrorG(err) ); 
     327        } 
     328         
     329        return p; 
     330    } 
     331     
     332    /** 
     333     * Unmounts a mount. This is an asynchronous operation, and is 
     334     * finished by calling g_mount_unmount_with_operation_finish() with the mount 
     335     * and GAsyncResult data returned in the callback. 
     336     * Since 2.22 
     337     * Params: 
     338     * mount =  a GMount. 
     339     * flags =  flags affecting the operation 
     340     * mountOperation =  a GMountOperation or NULL to avoid user interaction. 
     341     * cancellable =  optional GCancellable object, NULL to ignore. 
     342     * callback =  a GAsyncReadyCallback, or NULL. 
     343     * userData =  user data passed to callback. 
     344     */ 
     345    public void unmountWithOperation(GMountUnmountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData) 
     346    { 
     347        // void g_mount_unmount_with_operation (GMount *mount,  GMountUnmountFlags flags,  GMountOperation *mount_operation,  GCancellable *cancellable,  GAsyncReadyCallback callback,  gpointer user_data); 
     348        g_mount_unmount_with_operation(getMountTStruct(), flags, (mountOperation is null) ? null : mountOperation.getMountOperationStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); 
     349    } 
     350     
     351    /** 
     352     * Finishes unmounting a mount. If any errors occurred during the operation, 
     353     * error will be set to contain the errors and FALSE will be returned. 
     354     * Since 2.22 
     355     * Params: 
     356     * mount =  a GMount. 
     357     * result =  a GAsyncResult. 
     358     * Returns: TRUE if the mount was successfully unmounted. FALSE otherwise. 
     359     * Throws: GException on failure. 
     360     */ 
     361    public int unmountWithOperationFinish(AsyncResultIF result) 
     362    { 
     363        // gboolean g_mount_unmount_with_operation_finish  (GMount *mount,  GAsyncResult *result,  GError **error); 
     364        GError* err = null; 
     365         
     366        auto p = g_mount_unmount_with_operation_finish(getMountTStruct(), (result is null) ? null : result.getAsyncResultTStruct(), &err); 
     367         
     368        if (err !is null) 
     369        { 
     370            throw new GException( new ErrorG(err) ); 
     371        } 
     372         
     373        return p; 
     374    } 
     375     
     376    /** 
     377     * Remounts a mount. This is an asynchronous operation, and is 
     378     * finished by calling g_mount_remount_finish() with the mount 
     379     * and GAsyncResults data returned in the callback. 
     380     * Remounting is useful when some setting affecting the operation 
     381     * of the volume has been changed, as these may need a remount to 
     382     * take affect. While this is semantically equivalent with unmounting 
     383     * and then remounting not all backends might need to actually be 
     384     * unmounted. 
     385     * Params: 
     386     * mount =  a GMount. 
     387     * flags =  flags affecting the operation 
     388     * mountOperation =  a GMountOperation or NULL to avoid user interaction. 
     389     * cancellable =  optional GCancellable object, NULL to ignore. 
     390     * callback =  a GAsyncReadyCallback, or NULL. 
     391     * userData =  user data passed to callback. 
     392     */ 
     393    public void remount(GMountMountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData) 
     394    { 
     395        // void g_mount_remount (GMount *mount,  GMountMountFlags flags,  GMountOperation *mount_operation,  GCancellable *cancellable,  GAsyncReadyCallback callback,  gpointer user_data); 
     396        g_mount_remount(getMountTStruct(), flags, (mountOperation is null) ? null : mountOperation.getMountOperationStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); 
     397    } 
     398     
     399    /** 
     400     * Finishes remounting a mount. If any errors occurred during the operation, 
     401     * error will be set to contain the errors and FALSE will be returned. 
     402     * Params: 
     403     * mount =  a GMount. 
     404     * result =  a GAsyncResult. 
     405     * Returns: TRUE if the mount was successfully remounted. FALSE otherwise. 
     406     * Throws: GException on failure. 
     407     */ 
     408    public int remountFinish(AsyncResultIF result) 
     409    { 
     410        // gboolean g_mount_remount_finish (GMount *mount,  GAsyncResult *result,  GError **error); 
     411        GError* err = null; 
     412         
     413        auto p = g_mount_remount_finish(getMountTStruct(), (result is null) ? null : result.getAsyncResultTStruct(), &err); 
     414         
     415        if (err !is null) 
     416        { 
     417            throw new GException( new ErrorG(err) ); 
     418        } 
     419         
     420        return p; 
     421    } 
     422     
     423    /** 
     424     * Checks if mount can be eject. 
     425     * Returns: TRUE if the mount can be ejected. 
     426     */ 
     427    public int canEject() 
     428    { 
     429        // gboolean g_mount_can_eject (GMount *mount); 
     430        return g_mount_can_eject(getMountTStruct()); 
     431    } 
     432     
     433    /** 
     434     * Warning 
     435     * g_mount_eject has been deprecated since version 2.22 and should not be used in newly-written code. Use g_mount_eject_with_operation() instead. 
     436     * Ejects a mount. This is an asynchronous operation, and is 
     437     * finished by calling g_mount_eject_finish() with the mount 
     438     * and GAsyncResult data returned in the callback. 
     439     * Params: 
     440     * mount =  a GMount. 
     441     * flags =  flags affecting the unmount if required for eject 
     442     * cancellable =  optional GCancellable object, NULL to ignore. 
     443     * callback =  a GAsyncReadyCallback, or NULL. 
     444     * userData =  user data passed to callback. 
     445     */ 
     446    public void eject(GMountUnmountFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData) 
     447    { 
     448        // void g_mount_eject (GMount *mount,  GMountUnmountFlags flags,  GCancellable *cancellable,  GAsyncReadyCallback callback,  gpointer user_data); 
     449        g_mount_eject(getMountTStruct(), flags, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); 
     450    } 
     451     
     452    /** 
     453     * Warning 
     454     * g_mount_eject_finish has been deprecated since version 2.22 and should not be used in newly-written code. Use g_mount_eject_with_operation_finish() instead. 
     455     * Finishes ejecting a mount. If any errors occurred during the operation, 
     456     * error will be set to contain the errors and FALSE will be returned. 
     457     * Params: 
     458     * result =  a GAsyncResult. 
     459     * Returns: TRUE if the mount was successfully ejected. FALSE otherwise. 
     460     * Throws: GException on failure. 
     461     */ 
     462    public int ejectFinish(AsyncResultIF result) 
     463    { 
     464        // gboolean g_mount_eject_finish (GMount *mount,  GAsyncResult *result,  GError **error); 
     465        GError* err = null; 
     466         
     467        auto p = g_mount_eject_finish(getMountTStruct(), (result is null) ? null : result.getAsyncResultTStruct(), &err); 
     468         
     469        if (err !is null) 
     470        { 
     471            throw new GException( new ErrorG(err) ); 
     472        } 
     473         
     474        return p; 
     475    } 
     476     
     477    /** 
     478     * Ejects a mount. This is an asynchronous operation, and is 
     479     * finished by calling g_mount_eject_with_operation_finish() with the mount 
     480     * and GAsyncResult data returned in the callback. 
     481     * Since 2.22 
     482     * Params: 
     483     * mount =  a GMount. 
     484     * flags =  flags affecting the unmount if required for eject 
     485     * mountOperation =  a GMountOperation or NULL to avoid user interaction. 
     486     * cancellable =  optional GCancellable object, NULL to ignore. 
     487     * callback =  a GAsyncReadyCallback, or NULL. 
     488     * userData =  user data passed to callback. 
     489     */ 
     490    public void ejectWithOperation(GMountUnmountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData) 
     491    { 
     492        // void g_mount_eject_with_operation (GMount *mount,  GMountUnmountFlags flags,  GMountOperation *mount_operation,  GCancellable *cancellable,  GAsyncReadyCallback callback,  gpointer user_data); 
     493        g_mount_eject_with_operation(getMountTStruct(), flags, (mountOperation is null) ? null : mountOperation.getMountOperationStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); 
     494    } 
     495     
     496    /** 
     497     * Finishes ejecting a mount. If any errors occurred during the operation, 
     498     * error will be set to contain the errors and FALSE will be returned. 
     499     * Since 2.22 
     500     * Params: 
     501     * result =  a GAsyncResult. 
     502     * Returns: TRUE if the mount was successfully ejected. FALSE otherwise. 
     503     * Throws: GException on failure. 
     504     */ 
     505    public int ejectWithOperationFinish(AsyncResultIF result) 
     506    { 
     507        // gboolean g_mount_eject_with_operation_finish (GMount *mount,  GAsyncResult *result,  GError **error); 
     508        GError* err = null; 
     509         
     510        auto p = g_mount_eject_with_operation_finish(getMountTStruct(), (result is null) ? null : result.getAsyncResultTStruct(), &err); 
     511         
     512        if (err !is null) 
     513        { 
     514            throw new GException( new ErrorG(err) ); 
     515        } 
     516         
     517        return p; 
     518    } 
     519     
     520    /** 
     521     * Tries to guess the type of content stored on mount. Returns one or 
     522     * more textual identifiers of well-known content types (typically 
     523     * prefixed with "x-content/"), e.g. x-content/image-dcf for camera 
     524     * memory cards. See the shared-mime-info 
     525     * specification for more on x-content types. 
     526     * This is an asynchronous operation (see 
     527     * g_mount_guess_content_type_sync() for the synchronous version), and 
     528     * is finished by calling g_mount_guess_content_type_finish() with the 
     529     * mount and GAsyncResult data returned in the callback. 
     530     * Since 2.18 
     531     * Params: 
     532     * forceRescan =  Whether to force a rescan of the content. 
     533     *  Otherwise a cached result will be used if available 
     534     * cancellable =  optional GCancellable object, NULL to ignore 
     535     * callback =  a GAsyncReadyCallback 
     536     * userData =  user data passed to callback 
     537     */ 
     538    public void guessContentType(int forceRescan, Cancellable cancellable, GAsyncReadyCallback callback, void* userData) 
     539    { 
     540        // void g_mount_guess_content_type (GMount *mount,  gboolean force_rescan,  GCancellable *cancellable,  GAsyncReadyCallback callback,  gpointer user_data); 
     541        g_mount_guess_content_type(getMountTStruct(), forceRescan, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); 
     542    } 
     543     
     544    /** 
     545     * Finishes guessing content types of mount. If any errors occured 
     546     * during the operation, error will be set to contain the errors and 
     547     * FALSE will be returned. In particular, you may get an 
     548     * G_IO_ERROR_NOT_SUPPORTED if the mount does not support content 
     549     * guessing. 
     550     * Since 2.18 
     551     * Params: 
     552     * result =  a GAsyncResult 
     553     * Returns: a NULL-terminated array of content types or NULL on error.  Caller should free this array with g_strfreev() when done with it. 
     554     * Throws: GException on failure. 
     555     */ 
     556    public string[] guessContentTypeFinish(AsyncResultIF result) 
     557    { 
     558        // gchar ** g_mount_guess_content_type_finish (GMount *mount,  GAsyncResult *result,  GError **error); 
     559        GError* err = null; 
     560         
     561        auto p = Str.toStringArray(g_mount_guess_content_type_finish(getMountTStruct(), (result is null) ? null : result.getAsyncResultTStruct(), &err)); 
     562         
     563        if (err !is null) 
     564        { 
     565            throw new GException( new ErrorG(err) ); 
     566        } 
     567         
     568        return p; 
     569    } 
     570     
     571    /** 
     572     * Tries to guess the type of content stored on mount. Returns one or 
     573     * more textual identifiers of well-known content types (typically 
     574     * prefixed with "x-content/"), e.g. x-content/image-dcf for camera 
     575     * memory cards. See the shared-mime-info 
     576     * specification for more on x-content types. 
     577     * This is an synchronous operation and as such may block doing IO; 
     578     * see g_mount_guess_content_type() for the asynchronous version. 
     579     * Since 2.18 
     580     * Params: 
     581     * forceRescan =  Whether to force a rescan of the content. 
     582     *  Otherwise a cached result will be used if available 
     583     * cancellable =  optional GCancellable object, NULL to ignore 
     584     * Returns: a NULL-terminated array of content types or NULL on error. Caller should free this array with g_strfreev() when done with it. 
     585     * Throws: GException on failure. 
     586     */ 
     587    public string[] guessContentTypeSync(int forceRescan, Cancellable cancellable) 
     588    { 
     589        // gchar ** g_mount_guess_content_type_sync (GMount *mount,  gboolean force_rescan,  GCancellable *cancellable,  GError **error); 
     590        GError* err = null; 
     591         
     592        auto p = Str.toStringArray(g_mount_guess_content_type_sync(getMountTStruct(), forceRescan, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err)); 
     593         
     594        if (err !is null) 
     595        { 
     596            throw new GException( new ErrorG(err) ); 
     597        } 
     598         
     599        return p; 
     600    } 
     601     
     602    /** 
     603     * Determines if mount is shadowed. Applications or libraries should 
     604     * avoid displaying mount in the user interface if it is shadowed. 
     605     * A mount is said to be shadowed if there exists one or more user 
     606     * visible objects (currently GMount objects) with a root that is 
     607     * inside the root of mount. 
     608     * One application of shadow mounts is when exposing a single file 
     609     * system that is used to address several logical volumes. In this 
     610     * situation, a GVolumeMonitor implementation would create two 
     611     * GVolume objects (for example, one for the camera functionality of 
     612     * the device and one for a SD card reader on the device) with 
     613     * activation URIs gphoto2://[usb:001,002]/store1/ 
     614     * and gphoto2://[usb:001,002]/store2/. When the 
     615     * underlying mount (with root 
     616     * gphoto2://[usb:001,002]/) is mounted, said 
     617     * GVolumeMonitor implementation would create two GMount objects 
     618     * (each with their root matching the corresponding volume activation 
     619     * root) that would shadow the original mount. 
     620     * The proxy monitor in GVfs 2.26 and later, automatically creates and 
     621     * manage shadow mounts (and shadows the underlying mount) if the 
     622     * activation root on a GVolume is set. 
     623     * Since 2.20 
     624     * Returns: TRUE if mount is shadowed. 
     625     */ 
     626    public int isShadowed() 
     627    { 
     628        // gboolean g_mount_is_shadowed (GMount *mount); 
     629        return g_mount_is_shadowed(getMountTStruct()); 
     630    } 
     631     
     632    /** 
     633     * Increments the shadow count on mount. Usually used by 
     634     * GVolumeMonitor implementations when creating a shadow mount for 
     635     * mount, see g_mount_is_shadowed() for more information. The caller 
     636     * will need to emit the "changed" signal on mount manually. 
     637     * Since 2.20 
     638     */ 
     639    public void shadow() 
     640    { 
     641        // void g_mount_shadow (GMount *mount); 
     642        g_mount_shadow(getMountTStruct()); 
     643    } 
     644     
     645    /** 
     646     * Decrements the shadow count on mount. Usually used by 
     647     * GVolumeMonitor implementations when destroying a shadow mount for 
     648     * mount, see g_mount_is_shadowed() for more information. The caller 
     649     * will need to emit the "changed" signal on mount manually. 
     650     * Since 2.20 
     651     * Signal Details 
     652     * The "changed" signal 
     653     * void user_function (GMount *mount, 
     654     *  gpointer user_data) : Run Last 
     655     * Emitted when the mount has been changed. 
     656     */ 
     657    public void unshadow() 
     658    { 
     659        // void g_mount_unshadow (GMount *mount); 
     660        g_mount_unshadow(getMountTStruct()); 
     661    } 
     662// MANUAL TEMPLATE 
    76663     
    77664    /** the main Gtk struct as a void* */ 
    78665    protected override void* getStruct() 
  • gtkd/gtkD/src/gio/SocketAddress.d

    old new  
    121121    } 
    122122     
    123123    // add the SocketConnectable capabilities 
    124     mixin SocketConnectableT!(GSocketAddress); 
     124    //mixin SocketConnectableT!(GSocketAddress); 
     125// MANUAL TEMPLATE 
     126  
     127     
     128    /** the main Gtk struct */ 
     129    protected GSocketConnectable* gSocketConnectable; 
     130     
     131     
     132    public GSocketConnectable* getSocketConnectableTStruct() 
     133    { 
     134        return cast(GSocketConnectable*)getStruct(); 
     135    } 
     136     
     137     
     138    /** 
     139     */ 
     140     
     141    /** 
     142     * Creates a GSocketAddressEnumerator for connectable. 
     143     * Since 2.22 
     144     * Returns: a new GSocketAddressEnumerator. 
     145     */ 
     146    public SocketAddressEnumerator enumerate() 
     147    { 
     148        // GSocketAddressEnumerator * g_socket_connectable_enumerate  (GSocketConnectable *connectable); 
     149        auto p = g_socket_connectable_enumerate(getSocketConnectableTStruct()); 
     150        if(p is null) 
     151        { 
     152            return null; 
     153        } 
     154        return new SocketAddressEnumerator(cast(GSocketAddressEnumerator*) p); 
     155    } 
     156// MANUAL TEMPLATE 
    125157     
    126158    /** 
    127159     */ 
  • gtkd/gtkD/src/gio/Volume.d

    old new  
    7272{ 
    7373     
    7474    // Minimal implementation. 
    75     mixin VolumeT!(GVolume); 
     75    //mixin VolumeT!(GVolume); 
     76//MANUAL TEMPLATE 
     77    /** the main Gtk struct */ 
     78    protected GVolume* gVolume; 
     79     
     80     
     81    public GVolume* getVolumeTStruct() 
     82    { 
     83        return cast(GVolume*)getStruct(); 
     84    } 
     85     
     86     
     87    /** 
     88     */ 
     89    int[char[]] connectedSignals; 
     90     
     91    void delegate(VolumeIF)[] _onChangedListeners; 
     92    void delegate(VolumeIF)[] onChangedListeners() 
     93    { 
     94        return  _onChangedListeners; 
     95    } 
     96    /** 
     97     * Emitted when the volume has been changed. 
     98     */ 
     99    void addOnChanged(void delegate(VolumeIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 
     100    { 
     101        if ( !("changed" in connectedSignals) ) 
     102        { 
     103            Signals.connectData( 
     104            getStruct(), 
     105            "changed", 
     106            cast(GCallback)&callBackChanged, 
     107            cast(void*)cast(VolumeIF)this, 
     108            null, 
     109            connectFlags); 
     110            connectedSignals["changed"] = 1; 
     111        } 
     112        _onChangedListeners ~= dlg; 
     113    } 
     114    extern(C) static void callBackChanged(GVolume* arg0Struct, VolumeIF volumeIF) 
     115    { 
     116        foreach ( void delegate(VolumeIF) dlg ; volumeIF.onChangedListeners ) 
     117        { 
     118            dlg(volumeIF); 
     119        } 
     120    } 
     121     
     122    void delegate(VolumeIF)[] _onRemovedListeners; 
     123    void delegate(VolumeIF)[] onRemovedListeners() 
     124    { 
     125        return  _onRemovedListeners; 
     126    } 
     127    /** 
     128     * This signal is emitted when the GVolume have been removed. If 
     129     * the recipient is holding references to the object they should 
     130     * release them so the object can be finalized. 
     131     */ 
     132    void addOnRemoved(void delegate(VolumeIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 
     133    { 
     134        if ( !("removed" in connectedSignals) ) 
     135        { 
     136            Signals.connectData( 
     137            getStruct(), 
     138            "removed", 
     139            cast(GCallback)&callBackRemoved, 
     140            cast(void*)cast(VolumeIF)this, 
     141            null, 
     142            connectFlags); 
     143            connectedSignals["removed"] = 1; 
     144        } 
     145        _onRemovedListeners ~= dlg; 
     146    } 
     147    extern(C) static void callBackRemoved(GVolume* arg0Struct, VolumeIF volumeIF) 
     148    { 
     149        foreach ( void delegate(VolumeIF) dlg ; volumeIF.onRemovedListeners ) 
     150        { 
     151            dlg(volumeIF); 
     152        } 
     153    } 
     154     
     155     
     156    /** 
     157     * Gets the name of volume. 
     158     * Returns: the name for the given volume. The returned string should be freed with g_free() when no longer needed. 
     159     */ 
     160    public string getName() 
     161    { 
     162        // char * g_volume_get_name (GVolume *volume); 
     163        return Str.toString(g_volume_get_name(getVolumeTStruct())); 
     164    } 
     165     
     166    /** 
     167     * Gets the UUID for the volume. The reference is typically based on 
     168     * the file system UUID for the volume in question and should be 
     169     * considered an opaque string. Returns NULL if there is no UUID 
     170     * available. 
     171     * Returns: the UUID for volume or NULL if no UUID can be computed. The returned string should be freed with g_free()  when no longer needed. 
     172     */ 
     173    public string getUuid() 
     174    { 
     175        // char * g_volume_get_uuid (GVolume *volume); 
     176        return Str.toString(g_volume_get_uuid(getVolumeTStruct())); 
     177    } 
     178     
     179    /** 
     180     * Gets the icon for volume. 
     181     * Returns: a GIcon. The returned object should be unreffed with g_object_unref() when no longer needed. 
     182     */ 
     183    public IconIF getIcon() 
     184    { 
     185        // GIcon * g_volume_get_icon (GVolume *volume); 
     186        auto p = g_volume_get_icon(getVolumeTStruct()); 
     187        if(p is null) 
     188        { 
     189            return null; 
     190        } 
     191        return new Icon(cast(GIcon*) p); 
     192    } 
     193     
     194    /** 
     195     * Gets the drive for the volume. 
     196     * Returns: a GDrive or NULL if volume is not associated with a drive. The returned object should be unreffed with g_object_unref() when no longer needed. 
     197     */ 
     198    public DriveIF getDrive() 
     199    { 
     200        // GDrive * g_volume_get_drive (GVolume *volume); 
     201        auto p = g_volume_get_drive(getVolumeTStruct()); 
     202        if(p is null) 
     203        { 
     204            return null; 
     205        } 
     206        return new Drive(cast(GDrive*) p); 
     207    } 
     208     
     209    /** 
     210     * Gets the mount for the volume. 
     211     * Returns: a GMount or NULL if volume isn't mounted. The returned object should be unreffed with g_object_unref() when no longer needed. 
     212     */ 
     213    public MountIF getMount() 
     214    { 
     215        // GMount * g_volume_get_mount (GVolume *volume); 
     216        auto p = g_volume_get_mount(getVolumeTStruct()); 
     217        if(p is null) 
     218        { 
     219            return null; 
     220        } 
     221        return new Mount(cast(GMount*) p); 
     222    } 
     223     
     224    /** 
     225     * Checks if a volume can be mounted. 
     226     * Returns: TRUE if the volume can be mounted. FALSE otherwise. 
     227     */ 
     228    public int canMount() 
     229    { 
     230        // gboolean g_volume_can_mount (GVolume *volume); 
     231        return g_volume_can_mount(getVolumeTStruct()); 
     232    } 
     233     
     234    /** 
     235     * Returns whether the volume should be automatically mounted. 
     236     * Returns: TRUE if the volume should be automatically mounted. 
     237     */ 
     238    public int shouldAutomount() 
     239    { 
     240        // gboolean g_volume_should_automount (GVolume *volume); 
     241        return g_volume_should_automount(getVolumeTStruct()); 
     242    } 
     243     
     244    /** 
     245     * Gets the activation root for a GVolume if it is known ahead of 
     246     * mount time. Returns NULL otherwise. If not NULL and if volume 
     247     * is mounted, then the result of g_mount_get_root() on the 
     248     * GMount object obtained from g_volume_get_mount() will always 
     249     * either be equal or a prefix of what this function returns. In 
     250     * other words, in code 
     251     *  GMount *mount; 
     252     *  GFile *mount_root 
     253     *  GFile *volume_activation_root; 
     254     *  mount = g_volume_get_mount (volume); /+* mounted, so never NULL +/ 
     255     *  mount_root = g_mount_get_root (mount); 
     256     *  volume_activation_root = g_volume_get_activation_root(volume); /+* assume not NULL +/ 
     257     * then the expression 
     258     *  (g_file_has_prefix (volume_activation_root, mount_root) || 
     259     *  g_file_equal (volume_activation_root, mount_root)) 
     260     * will always be TRUE. 
     261     * Activation roots are typically used in GVolumeMonitor 
     262     * implementations to find the underlying mount to shadow, see 
     263     * g_mount_is_shadowed() for more details. 
     264     * Since 2.18 
     265     * Returns: the activation root of volume or NULL. Useg_object_unref() to free. 
     266     */ 
     267    public File getActivationRoot() 
     268    { 
     269        // GFile * g_volume_get_activation_root (GVolume *volume); 
     270        auto p = g_volume_get_activation_root(getVolumeTStruct()); 
     271        if(p is null) 
     272        { 
     273            return null; 
     274        } 
     275        return new File(cast(GFile*) p); 
     276    } 
     277     
     278    /** 
     279     * Mounts a volume. This is an asynchronous operation, and is 
     280     * finished by calling g_volume_mount_finish() with the volume 
     281     * and GAsyncResult returned in the callback. 
     282     * Params: 
     283     * flags =  flags affecting the operation 
     284     * mountOperation =  a GMountOperation or NULL to avoid user interaction. 
     285     * cancellable =  optional GCancellable object, NULL to ignore. 
     286     * callback =  a GAsyncReadyCallback, or NULL. 
     287     * userData =  user data that gets passed to callback 
     288     */ 
     289    public void mount(GMountMountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData) 
     290    { 
     291        // void g_volume_mount (GVolume *volume,  GMountMountFlags flags,  GMountOperation *mount_operation,  GCancellable *cancellable,  GAsyncReadyCallback callback,  gpointer user_data); 
     292        g_volume_mount(getVolumeTStruct(), flags, (mountOperation is null) ? null : mountOperation.getMountOperationStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); 
     293    } 
     294     
     295    /** 
     296     * Finishes mounting a volume. If any errors occured during the operation, 
     297     * error will be set to contain the errors and FALSE will be returned. 
     298     * If the mount operation succeeded, g_volume_get_mount() on volume 
     299     * is guaranteed to return the mount right after calling this 
     300     * function; there's no need to listen for the 'mount-added' signal on 
     301     * GVolumeMonitor. 
     302     * Params: 
     303     * result =  a GAsyncResult 
     304     * Returns: TRUE, FALSE if operation failed. 
     305     * Throws: GException on failure. 
     306     */ 
     307    public int mountFinish(AsyncResultIF result) 
     308    { 
     309        // gboolean g_volume_mount_finish (GVolume *volume,  GAsyncResult *result,  GError **error); 
     310        GError* err = null; 
     311         
     312        auto p = g_volume_mount_finish(getVolumeTStruct(), (result is null) ? null : result.getAsyncResultTStruct(), &err); 
     313         
     314        if (err !is null) 
     315        { 
     316            throw new GException( new ErrorG(err) ); 
     317        } 
     318         
     319        return p; 
     320    } 
     321     
     322    /** 
     323     * Checks if a volume can be ejected. 
     324     * Returns: TRUE if the volume can be ejected. FALSE otherwise. 
     325     */ 
     326    public int canEject() 
     327    { 
     328        // gboolean g_volume_can_eject (GVolume *volume); 
     329        return g_volume_can_eject(getVolumeTStruct()); 
     330    } 
     331     
     332    /** 
     333     * Warning 
     334     * g_volume_eject has been deprecated since version 2.22 and should not be used in newly-written code. Use g_volume_eject_with_operation() instead. 
     335     * Ejects a volume. This is an asynchronous operation, and is 
     336     * finished by calling g_volume_eject_finish() with the volume 
     337     * and GAsyncResult returned in the callback. 
     338     * Params: 
     339     * flags =  flags affecting the unmount if required for eject 
     340     * cancellable =  optional GCancellable object, NULL to ignore. 
     341     * callback =  a GAsyncReadyCallback, or NULL. 
     342     * userData =  user data that gets passed to callback 
     343     */ 
     344    public void eject(GMountUnmountFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData) 
     345    { 
     346        // void g_volume_eject (GVolume *volume,  GMountUnmountFlags flags,  GCancellable *cancellable,  GAsyncReadyCallback callback,  gpointer user_data); 
     347        g_volume_eject(getVolumeTStruct(), flags, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); 
     348    } 
     349     
     350    /** 
     351     * Warning 
     352     * g_volume_eject_finish has been deprecated since version 2.22 and should not be used in newly-written code. Use g_volume_eject_with_operation_finish() instead. 
     353     * Finishes ejecting a volume. If any errors occured during the operation, 
     354     * error will be set to contain the errors and FALSE will be returned. 
     355     * Params: 
     356     * result =  a GAsyncResult. 
     357     * Returns: TRUE, FALSE if operation failed. 
     358     * Throws: GException on failure. 
     359     */ 
     360    public int ejectFinish(AsyncResultIF result) 
     361    { 
     362        // gboolean g_volume_eject_finish (GVolume *volume,  GAsyncResult *result,  GError **error); 
     363        GError* err = null; 
     364         
     365        auto p = g_volume_eject_finish(getVolumeTStruct(), (result is null) ? null : result.getAsyncResultTStruct(), &err); 
     366         
     367        if (err !is null) 
     368        { 
     369            throw new GException( new ErrorG(err) ); 
     370        } 
     371         
     372        return p; 
     373    } 
     374     
     375    /** 
     376     * Ejects a volume. This is an asynchronous operation, and is 
     377     * finished by calling g_volume_eject_with_operation_finish() with the volume 
     378     * and GAsyncResult data returned in the callback. 
     379     * Since 2.22 
     380     * Params: 
     381     * flags =  flags affecting the unmount if required for eject 
     382     * mountOperation =  a GMountOperation or NULL to avoid user interaction. 
     383     * cancellable =  optional GCancellable object, NULL to ignore. 
     384     * callback =  a GAsyncReadyCallback, or NULL. 
     385     * userData =  user data passed to callback. 
     386     */ 
     387    public void ejectWithOperation(GMountUnmountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData) 
     388    { 
     389        // void g_volume_eject_with_operation (GVolume *volume,  GMountUnmountFlags flags,  GMountOperation *mount_operation,  GCancellable *cancellable,  GAsyncReadyCallback callback,  gpointer user_data); 
     390        g_volume_eject_with_operation(getVolumeTStruct(), flags, (mountOperation is null) ? null : mountOperation.getMountOperationStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); 
     391    } 
     392     
     393    /** 
     394     * Finishes ejecting a volume. If any errors occurred during the operation, 
     395     * error will be set to contain the errors and FALSE will be returned. 
     396     * Since 2.22 
     397     * Params: 
     398     * result =  a GAsyncResult. 
     399     * Returns: TRUE if the volume was successfully ejected. FALSE otherwise. 
     400     * Throws: GException on failure. 
     401     */ 
     402    public int ejectWithOperationFinish(AsyncResultIF result) 
     403    { 
     404        // gboolean g_volume_eject_with_operation_finish  (GVolume *volume,  GAsyncResult *result,  GError **error); 
     405        GError* err = null; 
     406         
     407        auto p = g_volume_eject_with_operation_finish(getVolumeTStruct(), (result is null) ? null : result.getAsyncResultTStruct(), &err); 
     408         
     409        if (err !is null) 
     410        { 
     411            throw new GException( new ErrorG(err) ); 
     412        } 
     413         
     414        return p; 
     415    } 
     416     
     417    /** 
     418     * Gets the kinds of identifiers 
     419     * that volume has. Use g_volume_get_identifer() to obtain 
     420     * the identifiers themselves. 
     421     * Returns: a NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free. 
     422     */ 
     423    public string[] enumerateIdentifiers() 
     424    { 
     425        // char ** g_volume_enumerate_identifiers (GVolume *volume); 
     426        return Str.toStringArray(g_volume_enumerate_identifiers(getVolumeTStruct())); 
     427    } 
     428     
     429    /** 
     430     * Gets the identifier of the given kind for volume. 
     431     * See the introduction 
     432     * for more information about volume identifiers. 
     433     * Params: 
     434     * kind =  the kind of identifier to return 
     435     * Returns: a newly allocated string containing the requested identfier, or NULL if the GVolume doesn't have this kind of identifierSignal DetailsThe "changed" signalvoid user_function (GVolume *arg0, gpointer user_data) : Run LastEmitted when the volume has been changed. 
     436     */ 
     437    public string getIdentifier(string kind) 
     438    { 
     439        // char * g_volume_get_identifier (GVolume *volume,  const char *kind); 
     440        return Str.toString(g_volume_get_identifier(getVolumeTStruct(), Str.toStringz(kind))); 
     441    } 
     442//MANUAL TEMPLATE 
    76443     
    77444    /** the main Gtk struct as a void* */ 
    78445    protected override void* getStruct() 
Copyright © 2008, LDC Development Team.