1 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 /* Copyright (C) 2007 The giomm Development Team
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include <giomm/private/icon_p.h>
22 #include "slot_async.h"
27 #ifdef GLIBMM_EXCEPTIONS_ENABLED
28 Glib::RefPtr<InputStream>
29 LoadableIcon::load(int size, Glib::ustring& type, const Glib::RefPtr<Cancellable>& cancellable)
31 Glib::RefPtr<InputStream>
32 LoadableIcon::load(int size, Glib::ustring& type, const Glib::RefPtr<Cancellable>& cancellable, std::auto_ptr<Glib::Error>& error)
33 #endif //GLIBMM_EXCEPTIONS_ENABLED
37 Glib::RefPtr<InputStream> retval =
38 Glib::wrap(g_loadable_icon_load(gobj(),
43 #ifdef GLIBMM_EXCEPTIONS_ENABLED
45 ::Glib::Error::throw_exception(gerror);
48 error = ::Glib::Error::throw_exception(gerror);
49 #endif //GLIBMM_EXCEPTIONS_ENABLED
54 retval->reference(); //The function does not do a ref for us.
58 #ifdef GLIBMM_EXCEPTIONS_ENABLED
59 Glib::RefPtr<InputStream>
60 LoadableIcon::load(int size, Glib::ustring& type)
62 Glib::RefPtr<InputStream>
63 LoadableIcon::load(int size, Glib::ustring& type, std::auto_ptr<Glib::Error>& error)
64 #endif //GLIBMM_EXCEPTIONS_ENABLED
68 Glib::RefPtr<InputStream> retval =
69 Glib::wrap(g_loadable_icon_load(gobj(),
74 #ifdef GLIBMM_EXCEPTIONS_ENABLED
76 ::Glib::Error::throw_exception(gerror);
79 error = ::Glib::Error::throw_exception(gerror);
80 #endif //GLIBMM_EXCEPTIONS_ENABLED
85 retval->reference(); //The function does not do a ref for us.
90 LoadableIcon::load_async(int size, const SlotAsyncReady& slot, const
91 Glib::RefPtr<Cancellable>& cancellable)
93 // Create a copy of the slot.
94 // A pointer to it will be passed through the callback's data parameter
95 // and deleted in the callback.
96 SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
98 g_loadable_icon_load_async(gobj(),
101 &SignalProxy_async_callback,
106 LoadableIcon::load_async(int size, const SlotAsyncReady& slot)
108 // Create a copy of the slot.
109 // A pointer to it will be passed through the callback's data parameter
110 // and deleted in the callback.
111 SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
113 g_loadable_icon_load_async(gobj(),
116 &SignalProxy_async_callback,