[glibmm] Add get_symbolic_icon() methods.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Add get_symbolic_icon() methods.
- Date: Fri, 7 Sep 2012 07:33:26 +0000 (UTC)
commit dab2df892735fefb6936fc369fa0a8c98099c16c
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Sep 6 10:10:48 2012 +0200
Add get_symbolic_icon() methods.
* gio/src/gio_methods.defs: Regenerated.
* gio/giomm/contenttype.[h|cc]: Add get_symbolic_icon().
* gio/src/drive.hg: Add get_symbolic_icon().
* gio/src/fileinfo.hg: Add get_symbolic_icon().
* gio/src/mount.hg: Add get_symbolic_icon().
* gio/src/volume.hg: Add get_symbolic_icon().
ChangeLog | 11 +++++++++
gio/giomm/contenttype.cc | 10 ++++++-
gio/giomm/contenttype.h | 10 ++++++++
gio/src/drive.hg | 3 ++
gio/src/fileinfo.hg | 4 +++
gio/src/gio_methods.defs | 55 ++++++++++++++++++++++++++++++++++++++++++++++
gio/src/mount.hg | 3 ++
gio/src/volume.hg | 7 ++++++
8 files changed, 101 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ee9f96c..5702e81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-09-06 Murray Cumming <murrayc murrayc com>
+
+ Add get_symbolic_icon() methods.
+
+ * gio/src/gio_methods.defs: Regenerated.
+ * gio/giomm/contenttype.[h|cc]: Add get_symbolic_icon().
+ * gio/src/drive.hg: Add get_symbolic_icon().
+ * gio/src/fileinfo.hg: Add get_symbolic_icon().
+ * gio/src/mount.hg: Add get_symbolic_icon().
+ * gio/src/volume.hg: Add get_symbolic_icon().
+
2012-09-06 Josà Alburquerque <jaalburquerque gmail com>
Converter: Correct the "convert" virtual function.
diff --git a/gio/giomm/contenttype.cc b/gio/giomm/contenttype.cc
index c0c3a49..b48840a 100644
--- a/gio/giomm/contenttype.cc
+++ b/gio/giomm/contenttype.cc
@@ -50,11 +50,17 @@ Glib::ustring content_type_get_mime_type(const Glib::ustring& type)
Glib::RefPtr<Gio::Icon> content_type_get_icon(const Glib::ustring& type)
{
- //TODO: Does g_content_type_get_icon() return a reference?
- //It currently has no implementation so it's hard to know. murrayc.
return Glib::wrap(g_content_type_get_icon(type.c_str()));
}
+Glib::RefPtr<Gio::Icon> content_type_get_symbloic_icon(const Glib::ustring& type)
+{
+ Glib::RefPtr<Icon> retvalue = Glib::wrap(g_content_type_get_symbolic_icon(type.c_str()));
+ if(retvalue)
+ retvalue->reference(); //The function does not do a ref for us.
+ return retvalue;
+}
+
bool content_type_can_be_executable(const Glib::ustring& type)
{
return g_content_type_can_be_executable(type.c_str());
diff --git a/gio/giomm/contenttype.h b/gio/giomm/contenttype.h
index 0ccb05e..e6ce3cb 100644
--- a/gio/giomm/contenttype.h
+++ b/gio/giomm/contenttype.h
@@ -89,6 +89,16 @@ Glib::ustring content_type_get_mime_type(const Glib::ustring& type);
Glib::RefPtr<Icon> content_type_get_icon(const Glib::ustring& type);
/**
+ * Gets the symbolic icon for a content type.
+ *
+ * @param type A content type string.
+ * @return Icon corresponding to the content type.
+ *
+ * @newin{2,34}
+ */
+Glib::RefPtr<Icon> content_type_get_symbolic_icon(const Glib::ustring& type);
+
+/**
* Checks if a content type can be executable. Note that for instance
* things like text files can be executables (i.e. scripts and batch files).
*
diff --git a/gio/src/drive.hg b/gio/src/drive.hg
index c428d6b..3d60f51 100644
--- a/gio/src/drive.hg
+++ b/gio/src/drive.hg
@@ -59,6 +59,9 @@ public:
_WRAP_METHOD(Glib::RefPtr<Icon> get_icon(), g_drive_get_icon, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Icon> get_icon() const, g_drive_get_icon, refreturn, constversion)
+ _WRAP_METHOD(Glib::RefPtr<Icon> get_symbolic_icon(), g_drive_get_symbolic_icon, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const Icon> get_symbolic_icon() const, g_drive_get_symbolic_icon, refreturn, constversion)
+
_WRAP_METHOD(bool has_volumes() const, g_drive_has_volumes)
#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Volume> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
diff --git a/gio/src/fileinfo.hg b/gio/src/fileinfo.hg
index b3638c5..a6ec703 100644
--- a/gio/src/fileinfo.hg
+++ b/gio/src/fileinfo.hg
@@ -158,6 +158,9 @@ public:
_WRAP_METHOD(Glib::RefPtr<Icon> get_icon(), g_file_info_get_icon, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Icon> get_icon() const, g_file_info_get_icon, refreturn, constversion)
+ _WRAP_METHOD(Glib::RefPtr<Icon> get_symbolic_icon(), g_file_info_get_symbolic_icon, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const Icon> get_symbolic_icon() const, g_file_info_get_symbolic_icon, refreturn, constversion)
+
//TODO: This should return a ustring instead. See https://bugzilla.gnome.org/show_bug.cgi?id=615950#c4
_WRAP_METHOD(std::string get_content_type() const, g_file_info_get_content_type)
@@ -189,6 +192,7 @@ public:
_WRAP_METHOD(void set_edit_name(const std::string& edit_name), g_file_info_set_edit_name)
_WRAP_METHOD(void set_icon(const Glib::RefPtr<Icon>& icon), g_file_info_set_icon)
+ _WRAP_METHOD(void set_symbolic_icon(const Glib::RefPtr<Icon>& icon), g_file_info_set_symbolic_icon)
//TODO: This should take a ustring instead. See https://bugzilla.gnome.org/show_bug.cgi?id=615950#c4
_WRAP_METHOD(void set_content_type(const std::string& content_type), g_file_info_set_content_type)
diff --git a/gio/src/gio_methods.defs b/gio/src/gio_methods.defs
index 899037a..19db096 100644
--- a/gio/src/gio_methods.defs
+++ b/gio/src/gio_methods.defs
@@ -2996,6 +2996,14 @@
)
)
+(define-function g_content_type_get_symbolic_icon
+ (c-name "g_content_type_get_symbolic_icon")
+ (return-type "GIcon*")
+ (parameters
+ '("const-gchar*" "type")
+ )
+)
+
(define-function g_content_type_can_be_executable
(c-name "g_content_type_can_be_executable")
(return-type "gboolean")
@@ -6218,6 +6226,12 @@
(return-type "GIcon*")
)
+(define-method get_symbolic_icon
+ (of-object "GDrive")
+ (c-name "g_drive_get_symbolic_icon")
+ (return-type "GIcon*")
+)
+
(define-method has_volumes
(of-object "GDrive")
(c-name "g_drive_has_volumes")
@@ -8317,6 +8331,12 @@
(return-type "GIcon*")
)
+(define-method get_symbolic_icon
+ (of-object "GFileInfo")
+ (c-name "g_file_info_get_symbolic_icon")
+ (return-type "GIcon*")
+)
+
(define-method get_content_type
(of-object "GFileInfo")
(c-name "g_file_info_get_content_type")
@@ -8434,6 +8454,15 @@
)
)
+(define-method set_symbolic_icon
+ (of-object "GFileInfo")
+ (c-name "g_file_info_set_symbolic_icon")
+ (return-type "none")
+ (parameters
+ '("GIcon*" "icon")
+ )
+)
+
(define-method set_content_type
(of-object "GFileInfo")
(c-name "g_file_info_set_content_type")
@@ -10796,6 +10825,12 @@
(return-type "GIcon*")
)
+(define-method get_symbolic_icon
+ (of-object "GMount")
+ (c-name "g_mount_get_symbolic_icon")
+ (return-type "GIcon*")
+)
+
(define-method get_uuid
(of-object "GMount")
(c-name "g_mount_get_uuid")
@@ -15950,6 +15985,14 @@
)
)
+(define-function g_unix_mount_guess_symbolic_icon
+ (c-name "g_unix_mount_guess_symbolic_icon")
+ (return-type "GIcon*")
+ (parameters
+ '("GUnixMountEntry*" "mount_entry")
+ )
+)
+
(define-method compare
(of-object "GUnixMountPoint")
(c-name "g_unix_mount_point_compare")
@@ -16019,6 +16062,12 @@
(return-type "GIcon*")
)
+(define-method guess_symbolic_icon
+ (of-object "GUnixMountPoint")
+ (c-name "g_unix_mount_point_guess_symbolic_icon")
+ (return-type "GIcon*")
+)
+
(define-function g_unix_mount_points_get
(c-name "g_unix_mount_points_get")
(return-type "GList*")
@@ -16281,6 +16330,12 @@
(return-type "GIcon*")
)
+(define-method get_symbolic_icon
+ (of-object "GVolume")
+ (c-name "g_volume_get_symbolic_icon")
+ (return-type "GIcon*")
+)
+
(define-method get_uuid
(of-object "GVolume")
(c-name "g_volume_get_uuid")
diff --git a/gio/src/mount.hg b/gio/src/mount.hg
index e62f472..fb529cf 100644
--- a/gio/src/mount.hg
+++ b/gio/src/mount.hg
@@ -70,6 +70,9 @@ public:
_WRAP_METHOD(Glib::RefPtr<Icon> get_icon(), g_mount_get_icon, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Icon> get_icon() const, g_mount_get_icon, refreturn, constversion)
+ _WRAP_METHOD(Glib::RefPtr<Icon> get_symbolic_icon(), g_mount_get_symbolic_icon, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const Icon> get_symbolic_icon() const, g_mount_get_symbolic_icon, refreturn, constversion)
+
_WRAP_METHOD(std::string get_uuid() const, g_mount_get_uuid)
_WRAP_METHOD(Glib::RefPtr<Volume> get_volume(), g_mount_get_volume, refreturn)
diff --git a/gio/src/volume.hg b/gio/src/volume.hg
index 615250c..7d6bfc1 100644
--- a/gio/src/volume.hg
+++ b/gio/src/volume.hg
@@ -67,6 +67,13 @@ public:
g_volume_get_icon,
refreturn, constversion)
+ _WRAP_METHOD(Glib::RefPtr<Icon> get_symbolic_icon(),
+ g_volume_get_symbolic_icon,
+ refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const Icon> get_symbolic_icon() const,
+ g_volume_get_symbolic_icon,
+ refreturn, constversion)
+
_WRAP_METHOD(Glib::RefPtr<Drive> get_drive(),
g_volume_get_drive,
refreturn)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]