ardour/libs/glibmm2/gio/src/mount.ccg

194 lines
5.9 KiB
Text
Raw Normal View History

// -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2 -*-
/* Copyright (C) 2007 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <giomm/drive.h>
#include <giomm/volume.h>
#include <gio/gio.h>
#include "slot_async.h"
namespace Gio
{
void Mount::unmount(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
// and deleted in the callback.
SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
g_mount_unmount(gobj(),
GMountUnmountFlags(flags),
cancellable->gobj(),
&SignalProxy_async_callback,
slot_copy);
}
void Mount::unmount(const SlotAsyncReady& slot, MountUnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
// and deleted in the callback.
SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
g_mount_unmount(gobj(),
GMountUnmountFlags(flags),
NULL,
&SignalProxy_async_callback,
slot_copy);
}
void Mount::unmount(MountUnmountFlags flags)
{
g_mount_unmount(gobj(),
GMountUnmountFlags(flags),
NULL,
NULL,
NULL);
}
void Mount::remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
// and deleted in the callback.
SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
g_mount_remount(gobj(),
static_cast<GMountMountFlags>(flags),
operation->gobj(),
cancellable->gobj(),
&SignalProxy_async_callback,
slot_copy);
}
void Mount::remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, MountMountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
// and deleted in the callback.
SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
g_mount_remount(gobj(),
static_cast<GMountMountFlags>(flags),
operation->gobj(),
NULL,
&SignalProxy_async_callback,
slot_copy);
}
void Mount::remount(const Glib::RefPtr<MountOperation>& operation, MountMountFlags flags)
{
g_mount_remount(gobj(),
static_cast<GMountMountFlags>(flags),
operation->gobj(),
NULL,
NULL,
NULL);
}
void Mount::remount(MountMountFlags flags)
{
g_mount_remount(gobj(),
static_cast<GMountMountFlags>(flags),
NULL,
NULL,
NULL,
NULL);
}
void Mount::eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
// and deleted in the callback.
SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
g_mount_eject(gobj(),
GMountUnmountFlags(flags),
cancellable->gobj(),
&SignalProxy_async_callback,
slot_copy);
}
void Mount::eject(const SlotAsyncReady& slot, MountUnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
// and deleted in the callback.
SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
g_mount_eject(gobj(),
GMountUnmountFlags(flags),
NULL,
&SignalProxy_async_callback,
slot_copy);
}
void Mount::eject(MountUnmountFlags flags)
{
g_mount_eject(gobj(),
GMountUnmountFlags(flags),
NULL,
NULL,
NULL);
}
void Mount::guess_content_type(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, bool force_rescan)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
// and deleted in the callback.
SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
g_mount_guess_content_type(gobj(),
force_rescan,
cancellable->gobj(),
&SignalProxy_async_callback,
slot_copy);
}
void Mount::guess_content_type(const SlotAsyncReady& slot, bool force_rescan)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
// and deleted in the callback.
SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
g_mount_guess_content_type(gobj(),
force_rescan,
NULL,
&SignalProxy_async_callback,
slot_copy);
}
void Mount::guess_content_type(bool force_rescan)
{
g_mount_guess_content_type(gobj(),
force_rescan,
NULL,
NULL,
NULL);
}
} // namespace Gio