mkdir $(CopyDir)
mkdir $(CopyDir)\bin
copy $(BinDir)\glibmm-vc$(VSVer)0-$(ApiMajorVersion)_$(ApiMinorVersion).dll $(CopyDir)\bin
+copy $(BinDir)\glibmm-vc$(VSVer)0-$(ApiMajorVersion)_$(ApiMinorVersion).pdb $(CopyDir)\bin
copy $(BinDir)\giomm-vc$(VSVer)0-$(ApiMajorVersion)_$(ApiMinorVersion).dll $(CopyDir)\bin
+copy $(BinDir)\giomm-vc$(VSVer)0-$(ApiMajorVersion)_$(ApiMinorVersion).pdb $(CopyDir)\bin
mkdir $(CopyDir)\lib\glibmm-$(ApiMajorVersion).$(ApiMinorVersion)\include
mkdir $(CopyDir)\lib\giomm-$(ApiMajorVersion).$(ApiMinorVersion)\include
-2.50.0:
+2.50.1 (stable):
+
+Glib
+* Dispatcher: Don't cast a HANDLE to an int on Windows.
+ (Kjell Ahlstedt) Bug 772074
+
+Gio:
+* Action: Include variant.h in the header.
+ (Daniel Boles) Bug #777953
+* Application::get_default(): Correct the refcounting.
+ (Daniel Boles) Bug #779936
+* SettingsSchemaSource: Correct the refcounting.
+ (Marcin Kolny) Bug #774593
+
+Gio::DBus
+* Proxy: Fix memory leak in get_cached_property_names().
+ (Kjell Ahlstedt) Bug #775210
+
+Documentation:
+* Glib::Variant: Improve documentation of "maybe" types.
+ (Daniel Boles) Bug #778219
+ Gio::ActionMap: Clarify doc of ActivateWithParameterSlot.
+ (Daniel Boles)
+
+Build:
+* C++11: Variant: Replace throw(std::bad_cast) with noexcept(false).
+ See https://bugzilla.redhat.com/show_bug.cgi?id=1438766
+* Visual Studio: Install the .pdb files.
+ (Chun-wei Fan)
+
+
+2.50.0 (stable):
No changes since 2.49.7.
## You should have received a copy of the GNU Lesser General Public License
## along with this library. If not, see <http://www.gnu.org/licenses/>.
-AC_INIT([glibmm], [2.50.0],
+AC_INIT([glibmm], [2.50.1],
[http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm],
[glibmm], [http://www.gtkmm.org/])
AC_PREREQ([2.59])
signal_increment_.connect(sigc::mem_fun(*this, &ThreadTimer::timer_increment));
}
-ThreadTimer::~ThreadTimer()
-{
-}
-
void
ThreadTimer::launch()
{
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <glibmm/exceptionhandler.h>
-#include <glibmm/variant.h>
#include <gio/gio.h>
namespace Gio
_CONFIGINCLUDE(giommconfig.h)
#include <glibmm/interface.h>
+#include <glibmm/variant.h>
#include <glibmm/varianttype.h>
#include <gio/gio.h>
typedef struct _GActionInterface GActionInterface;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-namespace Glib
-{
-
-class VariantBase;
-
-}
-
namespace Gio
{
_WRAP_METHOD(Glib::RefPtr<Action> lookup_action(const Glib::ustring& action_name), g_action_map_lookup_action, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Action> lookup_action(const Glib::ustring& action_name) const, g_action_map_lookup_action, constversion, refreturn)
- /** A Slot to be called when an action has been activated.
+ /** A Slot to be called when an action has been activated,
+ * passing a parameter of a specified type.
* See add_action_with_parameter().
*
* For instance,
/** A Slot to be called when an action has been activated,
* without passing a parameter to the slot.
- * See add_action().
+ * See add_action() and add_action_bool().
*
* For instance,
* void on_slot_activated();
* See add_action_radio_string().
*
* For instance,
- * void on_slot_activated(const Glib::VariantBase& parameter);
+ * void on_slot_activated(const Glib::ustring& parameter);
*/
using ActivateWithStringParameterSlot = sigc::slot<void, const Glib::ustring&>;
Glib::RefPtr<SimpleAction> add_action_radio_integer(const Glib::ustring& name, gint32 state);
/** A Slot to be called when an action has been activated.
- * See add_action_radio_int().
+ * See add_action_radio_integer().
*
* For instance,
- * void on_slot_activated(const Glib::VariantBase& parameter);
+ * void on_slot_activated(int parameter);
*/
using ActivateWithIntParameterSlot = sigc::slot<void, int>;
/// Unsets any existing default application.
static void unset_default();
- _WRAP_METHOD(static Glib::RefPtr<Application> get_default(), g_application_get_default)
+ _WRAP_METHOD(static Glib::RefPtr<Application> get_default(), g_application_get_default, refreturn)
_WRAP_METHOD(void mark_busy(), g_application_mark_busy)
_WRAP_METHOD(void unmark_busy(), g_application_unmark_busy)
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
/* Copyright (C) 2010 The giomm Development Team
*
* This library is free software; you can redistribute it and/or
_WRAP_METHOD(void set_cached_property(const Glib::ustring& property_name, const Glib::VariantBase& value), g_dbus_proxy_set_cached_property)
-#m4 _CONVERSION(`gchar**', `Glib::StringArrayHandle', `Glib::StringArrayHandle($3)')
+#m4 _CONVERSION(`gchar**', `Glib::StringArrayHandle', `Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
_WRAP_METHOD(Glib::StringArrayHandle get_cached_property_names() const, g_dbus_proxy_get_cached_property_names)
_WRAP_METHOD(void set_interface_info(const Glib::RefPtr<InterfaceInfo>& info), g_dbus_proxy_set_interface_info)
public:
- _WRAP_METHOD(static Glib::RefPtr<SettingsSchemaSource> get_default(), g_settings_schema_source_get_default)
+ _WRAP_METHOD(static Glib::RefPtr<SettingsSchemaSource> get_default(), g_settings_schema_source_get_default, refreturn)
/* TODO:
GLIB_AVAILABLE_IN_2_32
*/
explicit SimpleAction(const Glib::ustring& name);
- /** Creates a new new stateful action.
- *
- * The created action is stateless.
+ /** Creates a new stateful action.
*
* @a state is the initial state of the action. All future state values
* must have the same VariantType as the initial state.
try
{
-#ifdef G_OS_WIN32
- const int fd = GPOINTER_TO_INT(fd_receiver_);
-#else
- const int fd = fd_receiver_;
-#endif
+ // PollFD::fd_t is the type of GPollFD::fd.
+ // In Windows, it has the same size as HANDLE, but it's not guaranteed to be the same type.
+ // In Unix, a file descriptor is an int.
+ const auto fd = (PollFD::fd_t)fd_receiver_;
+
// The following code is equivalent to
// context_->signal_io().connect(
// sigc::mem_fun(*this, &DispatchNotifier::pipe_io_handler), fd, Glib::IO_IN);
gobject_.revents = 0;
}
-PollFD::PollFD(int fd)
+PollFD::PollFD(PollFD::fd_t fd)
{
gobject_.fd = fd;
gobject_.events = 0;
gobject_.revents = 0;
}
-PollFD::PollFD(int fd, IOCondition events)
+PollFD::PollFD(PollFD::fd_t fd, IOCondition events)
{
gobject_.fd = fd;
gobject_.events = events;
sigc::connection
SignalIO::connect(
- const sigc::slot<bool, IOCondition>& slot, int fd, IOCondition condition, int priority)
+ const sigc::slot<bool, IOCondition>& slot, PollFD::fd_t fd, IOCondition condition, int priority)
{
const auto source = IOSource::create(fd, condition);
// static
Glib::RefPtr<IOSource>
-IOSource::create(int fd, IOCondition condition)
+IOSource::create(PollFD::fd_t fd, IOCondition condition)
{
return Glib::RefPtr<IOSource>(new IOSource(fd, condition));
}
return connect_generic(slot);
}
-IOSource::IOSource(int fd, IOCondition condition) : poll_fd_(fd, condition)
+IOSource::IOSource(PollFD::fd_t fd, IOCondition condition) : poll_fd_(fd, condition)
{
add_poll(poll_fd_);
}
class PollFD
{
public:
+ using fd_t = decltype(GPollFD::fd);
+
PollFD();
- explicit PollFD(int fd);
- PollFD(int fd, IOCondition events);
+ explicit PollFD(fd_t fd);
+ PollFD(fd_t fd, IOCondition events);
- void set_fd(int fd) { gobject_.fd = fd; }
- int get_fd() const { return gobject_.fd; }
+ void set_fd(fd_t fd) { gobject_.fd = fd; }
+ fd_t get_fd() const { return gobject_.fd; }
void set_events(IOCondition events) { gobject_.events = events; }
IOCondition get_events() const { return static_cast<IOCondition>(gobject_.events); }
* @param priority The priority of the new event source.
* @return A connection handle, which can be used to disconnect the handler.
*/
- sigc::connection connect(const sigc::slot<bool, IOCondition>& slot, int fd, IOCondition condition,
+ sigc::connection connect(const sigc::slot<bool, IOCondition>& slot, PollFD::fd_t fd, IOCondition condition,
int priority = PRIORITY_DEFAULT);
/** Connects an I/O handler that watches an I/O channel.
public:
using CppObjectType = Glib::IOSource;
- static Glib::RefPtr<IOSource> create(int fd, IOCondition condition);
+ static Glib::RefPtr<IOSource> create(PollFD::fd_t fd, IOCondition condition);
static Glib::RefPtr<IOSource> create(
const Glib::RefPtr<IOChannel>& channel, IOCondition condition);
sigc::connection connect(const sigc::slot<bool, IOCondition>& slot);
protected:
- IOSource(int fd, IOCondition condition);
+ IOSource(PollFD::fd_t fd, IOCondition condition);
IOSource(const Glib::RefPtr<IOChannel>& channel, IOCondition condition);
/** Wrap an existing GSource object and install the given callback function.
if (castitem)
{
if (g_variant_is_floating(castitem))
- {
g_variant_ref_sink(castitem);
- }
+
if (make_a_copy)
- {
g_variant_ref(castitem);
- }
}
gobject_ = castitem;
var_ptr* const var_array = new var_ptr[children.size()];
for (std::vector<VariantBase>::size_type i = 0; i < children.size(); i++)
- {
var_array[i] = const_cast<GVariant*>(children[i].gobj());
- }
VariantContainerBase result =
VariantContainerBase(g_variant_new_tuple(var_array, children.size()));
// VariantContainerBase has no method variant_type()
template <>
VariantContainerBase
-VariantBase::cast_dynamic<VariantContainerBase>(const VariantBase& v) throw(std::bad_cast)
+VariantBase::cast_dynamic<VariantContainerBase>(const VariantBase& v) noexcept(false)
{
if (!v.gobj())
- {
return VariantContainerBase();
- }
+
if (v.get_type().is_container())
{
return VariantContainerBase(const_cast<GVariant*>(v.gobj()), true);
return true;
}
else
+ {
return false;
+ }
}
VariantIter
// See http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-get-string
template <>
Variant<Glib::ustring>
-VariantBase::cast_dynamic<Variant<Glib::ustring>>(const VariantBase& v) throw(std::bad_cast)
+VariantBase::cast_dynamic<Variant<Glib::ustring>>(const VariantBase& v) noexcept(false)
{
if (!v.gobj())
{
// See http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-get-string
template <>
Variant<std::string>
-VariantBase::cast_dynamic<Variant<std::string>>(const VariantBase& v) throw(std::bad_cast)
+VariantBase::cast_dynamic<Variant<std::string>>(const VariantBase& v) noexcept(false)
{
if (!v.gobj())
{
// Add the elements of the vector into the builder.
for (const auto& str : data)
- {
g_variant_builder_add(builder, element_variant_type.get_string().c_str(), str.c_str());
- }
// Create the variant using the builder.
auto result =
for (gsize i = 0; i < n_children; i++)
{
GVariant* gvariant = g_variant_get_child_value(const_cast<GVariant*>(gobj()), i);
-
result.emplace_back(Glib::Variant<Glib::ustring>(gvariant).get());
}
// Add the elements of the vector into the string array.
for (type_vec_string::size_type i = 0; i < data.size(); i++)
- {
str_array[i] = g_strdup(data[i].c_str());
- }
// Terminate the string array.
str_array[data.size()] = nullptr;
// Add the elements of the vector into the string array.
for (type_vec_string::size_type i = 0; i < data.size(); i++)
- {
str_array[i] = g_strdup(data[i].c_str());
- }
// Terminate the string array.
str_array[data.size()] = nullptr;
for (gsize i = 0; i < n_children; i++)
{
GVariant* gvariant = g_variant_get_child_value(const_cast<GVariant*>(gobj()), i);
-
result.emplace_back(Glib::Variant<std::string>(gvariant).get());
}
* @throws std::bad_cast if the Variant was not of the expected type.
*/
template<class V_CastTo>
- static V_CastTo cast_dynamic(const VariantBase& v) throw(std::bad_cast);
+ static V_CastTo cast_dynamic(const VariantBase& v) noexcept(false);
_IGNORE(g_variant_dict_new)
template<class V_CastTo>
V_CastTo VariantBase::cast_dynamic(const VariantBase& v)
-throw(std::bad_cast)
+noexcept(false)
{
if(!(v.gobj()))
{
_WRAP_METHOD(static bool is_signature(const std::string& string), g_variant_is_signature)
};
-/** The base class from which multiple-item Variants derive, such as Variants
- * containing tuples or arrays.
+/** The base class for multiple-item Variants, such as Variants containing
+ * tuples or arrays, and also for maybe-typed (i.e. nullable) Variant types.
*
* @newin{2,28}
* @ingroup Variant
DataType get_child(gsize index = 0) const;
*/
- /** If this is a maybe-typed instance, extract its value. If the value is
- * Nothing, then this function returns <tt>false</tt>.
+ /** If this is a maybe-typed instance, try to extract its value. If there is
+ * no value (the value is <tt>nothing</tt>), return <tt>false</tt. Otherwise,
+ * the value is copied to the supplied Variant and <tt>true</tt> is returned.
*
- * @param maybe A place in which to return the value (the value may be
- * <tt>0</tt>).
+ * @param maybe A place in which to return the value, if it isn’t
+ * <tt>nothing</tt>.
* @newin{2,28}
*/
bool get_maybe(VariantBase& maybe) const;
template<>
VariantContainerBase VariantBase::cast_dynamic<VariantContainerBase>(const VariantBase& v)
-throw(std::bad_cast);
+noexcept(false);
/** Template class used for the specialization of the Variant<> classes.
* @newin{2,28}
/****************** Specializations ***********************************/
/** Specialization of Variant containing a VariantBase.
+ * Perhaps the main use of this is as a maybe-typed (i.e. nullable) Variant, as
+ * it inherits methods create_maybe() and get_maybe() from VariantContainerBase.
+ *
* @newin{2,28}
* @ingroup Variant
*/
//TODO: When we can break ABI, remove this template specialization.
template<>
Variant<Glib::ustring> VariantBase::cast_dynamic< Variant<Glib::ustring> >(const VariantBase& v)
-throw(std::bad_cast);
+noexcept(false);
/** Specialization of Variant containing a std::string, for variants of type
* bytestring, string, object path, or signature.
//TODO: When we can break ABI, remove this template specialization.
template<>
Variant<std::string> VariantBase::cast_dynamic< Variant<std::string> >(const VariantBase& v)
-throw(std::bad_cast);
+noexcept(false);
/** Specialization of Variant containing a dictionary entry. See also
* Variant< std::map<K, V> >.
_IGNORE(g_variant_get_fixed_array)
/** Gets a VariantIter of the Variant.
- * @return the VaraintIter.
+ * @return the VariantIter.
* @newin{2,28}
*/
VariantIter get_iter() const;
_IGNORE(g_variant_get_strv, g_variant_dup_strv)
/** Gets a VariantIter of the Variant.
- * @return the VaraintIter.
+ * @return the VariantIter.
* @newin{2,28}
*/
VariantIter get_iter() const;
_IGNORE(g_variant_get_objv, g_variant_dup_objv)
/** Gets a VariantIter of the Variant.
- * @return the VaraintIter.
+ * @return the VariantIter.
* @newin{2,28}
*/
VariantIter get_iter() const;
std::map<K, V> get() const;
/** Gets a VariantIter of the Variant.
- * @return the VaraintIter.
+ * @return the VariantIter.
* @newin{2,28}
*/
VariantIter get_iter() const;