add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gtk / src / recentinfo.ccg
1 /* Copyright (C) 2006 The gtkmm Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Library General Public
5  * License as published by the Free Software Foundation; either
6  * version 2 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Library General Public License for more details.
12  *
13  * You should have received a copy of the GNU Library General Public
14  * License along with this library; if not, write to the Free
15  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16  */
17
18 #include <gtk/gtkrecentmanager.h>
19
20 namespace Gtk
21 {
22
23 bool RecentInfo::equal(const RecentInfo& other) const
24 {
25   return (static_cast<bool>(gtk_recent_info_match(const_cast<GtkRecentInfo*>(this->gobj()),
26                                                   const_cast<GtkRecentInfo*>(other.gobj()))));
27 }
28
29 RecentInfo::operator bool() const
30 {
31   return gobj() != 0;
32 }
33
34 Glib::StringArrayHandle RecentInfo::get_applications() const
35 {
36   //We pass 0 for the length output argument, because we don't need it, because the returned array is null-terminated.
37   return Glib::StringArrayHandle(gtk_recent_info_get_applications(const_cast<GtkRecentInfo*>(this->gobj()), 0));
38 }
39
40 Glib::StringArrayHandle RecentInfo::get_groups() const
41 {
42   //We pass 0 for the length output argument, because we don't need it, because the returned array is null-terminated.
43   return Glib::StringArrayHandle(gtk_recent_info_get_groups(const_cast<GtkRecentInfo*>(this->gobj()), 0));
44 }
45
46 RecentInfoTraits::CppType RecentInfoTraits::to_cpp_type(const CType& obj)
47 {
48   return Glib::wrap(const_cast<CTypeNonConst>(obj), true);
49 }
50
51 } // namespace Gtk