[gnome-commander] ImageRender: initial migration to C++
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] ImageRender: initial migration to C++
- Date: Wed, 27 Jul 2011 20:36:56 +0000 (UTC)
commit 0dc6c208a94183a4c78a74a4c73d8969b00c0fbd
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Wed Jul 27 22:35:44 2011 +0200
ImageRender: initial migration to C++
src/intviewer/image-render.cc | 8 ++++----
src/intviewer/image-render.h | 26 +++++++++++++-------------
src/intviewer/viewer-widget.cc | 4 ++--
3 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/src/intviewer/image-render.cc b/src/intviewer/image-render.cc
index 4e6b584..5fda16f 100644
--- a/src/intviewer/image-render.cc
+++ b/src/intviewer/image-render.cc
@@ -56,11 +56,11 @@ static guint image_render_signals[LAST_SIGNAL] = { 0 };
struct ImageRenderClass
{
GtkWidgetClass parent_class;
- void (*image_status_changed) (ImageRender *obj, ImageRenderStatus *status);
+ void (*image_status_changed) (ImageRender *obj, ImageRender::Status *status);
};
// Class Private Data
-struct ImageRenderPrivate
+struct ImageRender::Private
{
guint8 button; // The button pressed in "button_press_event"
@@ -245,7 +245,7 @@ static void image_render_class_init (ImageRenderClass *klass)
static void image_render_init (ImageRender *w)
{
- w->priv = g_new0 (ImageRenderPrivate, 1);
+ w->priv = g_new0 (ImageRender::Private, 1);
w->priv->button = 0;
@@ -319,7 +319,7 @@ void image_render_notify_status_changed (ImageRender *w)
{
g_return_if_fail (IS_IMAGE_RENDER (w));
- ImageRenderStatus stat;
+ ImageRender::Status stat;
memset(&stat, 0, sizeof(stat));
diff --git a/src/intviewer/image-render.h b/src/intviewer/image-render.h
index f2b465b..6ac00b4 100644
--- a/src/intviewer/image-render.h
+++ b/src/intviewer/image-render.h
@@ -32,22 +32,22 @@
#define IMAGE_RENDER_DEFAULT_WIDTH (100)
#define IMAGE_RENDER_DEFAULT_HEIGHT (200)
-struct ImageRenderPrivate;
-struct ImageRenderStatus;
-
struct ImageRender
{
- GtkWidget widget;
- ImageRenderPrivate *priv;
-};
+ GtkWidget parent;
-struct ImageRenderStatus
-{
- gboolean best_fit;
- gdouble scale_factor;
- gint image_width;
- gint image_height;
- gint bits_per_sample;
+ struct Private;
+
+ Private *priv;
+
+ struct Status
+ {
+ gboolean best_fit;
+ gdouble scale_factor;
+ gint image_width;
+ gint image_height;
+ gint bits_per_sample;
+ };
};
enum IMAGEOPERATION
diff --git a/src/intviewer/viewer-widget.cc b/src/intviewer/viewer-widget.cc
index 0b8cc7f..57219f1 100644
--- a/src/intviewer/viewer-widget.cc
+++ b/src/intviewer/viewer-widget.cc
@@ -84,7 +84,7 @@ static void gviewer_class_init (GViewerClass *klass);
static void gviewer_destroy (GtkObject *object);
static void gviewer_text_status_update(TextRender *obj, TextRender::Status *status, GViewer *viewer);
-static void gviewer_image_status_update(ImageRender *obj, ImageRenderStatus *status, GViewer *viewer);
+static void gviewer_image_status_update(ImageRender *obj, ImageRender::Status *status, GViewer *viewer);
static gboolean on_text_viewer_button_pressed (GtkWidget *treeview, GdkEventButton *event, GViewer *viewer);
static VIEWERDISPLAYMODE guess_display_mode(const unsigned char *data, int len);
@@ -217,7 +217,7 @@ static void gviewer_text_status_update(TextRender *obj, TextRender::Status *stat
}
-static void gviewer_image_status_update(ImageRender *obj, ImageRenderStatus *status, GViewer *viewer)
+static void gviewer_image_status_update(ImageRender *obj, ImageRender::Status *status, GViewer *viewer)
{
g_return_if_fail (IS_GVIEWER (viewer));
g_return_if_fail (status!=NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]