[PATCH 04/13] core: Replaced grl-media-image defines with functions



---
 src/data/grl-media-image.c |   28 ++++++++++++++++++++++++++++
 src/data/grl-media-image.h |   21 +++++++--------------
 2 files changed, 35 insertions(+), 14 deletions(-)

diff --git a/src/data/grl-media-image.c b/src/data/grl-media-image.c
index df5c63a..ff3fffb 100644
--- a/src/data/grl-media-image.c
+++ b/src/data/grl-media-image.c
@@ -87,3 +87,31 @@ grl_media_image_set_size (GrlMediaImage *image,
   grl_media_image_set_width (image, width);
   grl_media_image_set_height (image, height);
 }
+
+void
+grl_media_image_set_width (GrlMediaImage *data, gint width)
+{
+  grl_data_set_int (GRL_DATA (data),
+                    GRL_METADATA_KEY_WIDTH,
+                    width);
+}
+
+void
+grl_media_image_set_height (GrlMediaImage *data, gint height)
+{
+  grl_data_set_int (GRL_DATA (data),
+                    GRL_METADATA_KEY_HEIGHT,
+                    height);
+}
+
+gint
+grl_media_image_get_width (GrlMediaImage *data)
+{
+  return grl_data_get_int (GRL_DATA (data), GRL_METADATA_KEY_WIDTH);
+}
+
+gint
+grl_media_image_get_height (GrlMediaImage *data)
+{
+  return grl_data_get_int (GRL_DATA (data), GRL_METADATA_KEY_HEIGHT);
+}
diff --git a/src/data/grl-media-image.h b/src/data/grl-media-image.h
index a774688..5e990f4 100644
--- a/src/data/grl-media-image.h
+++ b/src/data/grl-media-image.h
@@ -73,20 +73,13 @@ struct _GrlMediaImage
   GrlMedia parent;
 };
 
-#define grl_media_image_set_width(data, width)  \
-  grl_data_set_int(GRL_DATA((data)),            \
-                   GRL_METADATA_KEY_WIDTH,      \
-                   (width))
-
-#define grl_media_image_set_height(data, height)        \
-  grl_data_set_int(GRL_DATA((data)),                    \
-                   GRL_METADATA_KEY_HEIGHT,             \
-                   (height))
-
-#define grl_media_image_get_width(data)                         \
-  grl_data_get_int(GRL_DATA((data)), GRL_METADATA_KEY_WIDTH)
-#define grl_media_image_get_height(data)                        \
-  grl_data_get_int(GRL_DATA((data)), GRL_METADATA_KEY_HEIGHT)
+void grl_media_image_set_width (GrlMediaImage *data, gint width);
+
+void grl_media_image_set_height (GrlMediaImage *data, gint height);
+
+gint grl_media_image_get_width (GrlMediaImage *data);
+
+gint grl_media_image_get_height (GrlMediaImage *data);
 
 GType grl_media_image_get_type (void) G_GNUC_CONST;
 GrlMedia *grl_media_image_new (void);
-- 
1.7.0.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]