URL:
https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-11-06 Simon Nivault <simon.nivault(a)lrde.epita.fr>
Improve plug-in display.
* sandbox/nivault/plugin-gimp/src/Makefile.am: Include milena.
* sandbox/nivault/plugin-gimp/src/build-image.hxx: Display
images faster.
* sandbox/nivault/plugin-gimp/src/interface.hxx: Update widgets.
Cleaning repository.
* sandbox/nivault/plugin-gimp/Makefile.in,
* sandbox/nivault/plugin-gimp/aclocal.m4,
* sandbox/nivault/plugin-gimp/autom4te.cache/output.0,
* sandbox/nivault/plugin-gimp/autom4te.cache/output.1,
* sandbox/nivault/plugin-gimp/autom4te.cache/output.2,
* sandbox/nivault/plugin-gimp/autom4te.cache/output.3,
* sandbox/nivault/plugin-gimp/autom4te.cache/requests,
* sandbox/nivault/plugin-gimp/autom4te.cache/traces.0,
* sandbox/nivault/plugin-gimp/autom4te.cache/traces.1,
* sandbox/nivault/plugin-gimp/autom4te.cache/traces.2,
* sandbox/nivault/plugin-gimp/autom4te.cache/traces.3,
* sandbox/nivault/plugin-gimp/autom4te.cache,
* sandbox/nivault/plugin-gimp/autoscan-2.61.log,
* sandbox/nivault/plugin-gimp/config.guess,
* sandbox/nivault/plugin-gimp/config.h.in,
* sandbox/nivault/plugin-gimp/config.sub,
* sandbox/nivault/plugin-gimp/configure.scan,
* sandbox/nivault/plugin-gimp/configure,
* sandbox/nivault/plugin-gimp/depcomp,
* sandbox/nivault/plugin-gimp/help/Makefile.in,
* sandbox/nivault/plugin-gimp/help/en/Makefile.in,
* sandbox/nivault/plugin-gimp/help/images/Makefile.in,
* sandbox/nivault/plugin-gimp/install-sh,
* sandbox/nivault/plugin-gimp/intltool-extract.in,
* sandbox/nivault/plugin-gimp/intltool-merge.in,
* sandbox/nivault/plugin-gimp/intltool-update.in,
* sandbox/nivault/plugin-gimp/missing,
* sandbox/nivault/plugin-gimp/mkinstalldirs,
* sandbox/nivault/plugin-gimp/po/Makefile.in.in,
* sandbox/nivault/plugin-gimp/po/POTFILES.in,
* sandbox/nivault/plugin-gimp/src/Makefile.in: Remove.
---
trunk/milena/sandbox/nivault/plugin-gimp/src/Makefile.am | 2
trunk/milena/sandbox/nivault/plugin-gimp/src/build-image.hxx | 59 +++--------
trunk/milena/sandbox/nivault/plugin-gimp/src/interface.hxx | 32 ++---
3 files changed, 30 insertions(+), 63 deletions(-)
Index: trunk/milena/sandbox/nivault/plugin-gimp/mkinstalldirs (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/configure (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/intltool-extract.in (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/autoscan-2.61.log (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/Makefile.in (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/depcomp (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/intltool-update.in (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/config.guess (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/config.sub (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/config.h.in (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/configure.scan (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/intltool-merge.in (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/missing (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/aclocal.m4 (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/install-sh (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/src/Makefile.in (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/src/build-image.hxx
===================================================================
--- trunk/milena/sandbox/nivault/plugin-gimp/src/build-image.hxx (revision 1433)
+++ trunk/milena/sandbox/nivault/plugin-gimp/src/build-image.hxx (revision 1434)
@@ -25,7 +25,6 @@
* authorization from the Author.
*/
-#include <sstream>
#include "build-image.hh"
typedef mln::image2d<mln::value::rgb8> I;
@@ -66,45 +65,23 @@
GdkEventExpose *event,
gpointer data)
{
-// GimpDrawable* drawable = (GimpDrawable *)area->window;
-// GimpPixelRgn region;
-// std::stringstream ss;
-// gimp_pixel_rgn_init(®ion,
-// drawable,
-// 0,
-// 0,
-// drawable->width,
-// drawable->height,
-// FALSE,
-// FALSE);
-// ss << region.bpp << std::endl;
-// g_message(ss.str().c_str());
-
-
-// gimp_pixel_rgn_set_rect(®ion,
-// (const guchar *) ima.buffer(),
-// 0,
-// 0,
-// drawable->width,
-// drawable->height / 4);
-
-
- mln_piter_(I) p(ima.domain());
- assert(area->window);
- GdkGC *cc = gdk_gc_new(area->window);
- GdkColor col;
+ GimpDrawable* drawable = gimp_drawable_preview_get_drawable((GimpDrawablePreview
*)area);
+ assert(drawable != NULL);
+ GimpPixelRgn region;
+ std::stringstream ss;
+ gimp_pixel_rgn_init(®ion,
+ drawable,
+ 0,
+ 0,
+ drawable->width,
+ drawable->height,
+ FALSE,
+ FALSE);
- for_all(p)
- {
- mln::value::rgb8 rgb = ima(p);
- col.red = 256 * rgb.red();
- col.green = 256 * rgb.green();
- col.blue = 256 * rgb.blue();
- gdk_gc_set_rgb_fg_color(cc, &col);
-
- gdk_draw_point(area->window,
- cc,
- p[1], p[0]);
- }
- g_object_unref (cc);
+ gimp_pixel_rgn_set_rect(®ion,
+ (const guchar *) ima.buffer(),
+ 0,
+ 0,
+ drawable->width,
+ drawable->height);
}
Index: trunk/milena/sandbox/nivault/plugin-gimp/src/interface.hxx
===================================================================
--- trunk/milena/sandbox/nivault/plugin-gimp/src/interface.hxx (revision 1433)
+++ trunk/milena/sandbox/nivault/plugin-gimp/src/interface.hxx (revision 1434)
@@ -54,10 +54,8 @@
GtkWidget *main_vbox;
GtkWidget *image_layout;
GtkWidget *frame;
-// GtkWidget *scroll;
-
- GtkAdjustment *hadjust = NULL;
- GtkAdjustment *vadjust = NULL;
+// GtkAdjustment *hadjust = NULL;
+// GtkAdjustment *vadjust = NULL;
GimpRGB color;
gimp_ui_init (PLUGIN_NAME, TRUE);
@@ -79,26 +77,18 @@
gtk_widget_show (frame);
gimp_rgb_set(&color, 0, 0, 0);
-// scroll = gtk_scrolled_window_new((GtkAdjustment *)hadjust,
-// (GtkAdjustment *)vadjust);
-
-// gtk_container_set_border_width (GTK_CONTAINER (scroll), 10);
-// gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
-// GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
-// gtk_widget_show (scroll);
+ drawing_area = gimp_drawable_preview_new(drawable, NULL);
+ gtk_container_add (GTK_CONTAINER (frame), drawing_area);
+//** Not declared ?? **//
+// gimp_scrolled_preview_set_policy((GimpScrolledPreview *)drawing_area,
+// GTK_POLICY_ALWAYS,
+// GTK_POLICY_ALWAYS);
- drawing_area = gtk_drawing_area_new();
- gtk_container_add (GTK_CONTAINER (frame), drawing_area);
gtk_widget_set_size_request(drawing_area,
- mln::geom::ncols(get_ima()),
- mln::geom::nrows(get_ima()));
- g_signal_connect (G_OBJECT (drawing_area),
- "expose_event",
- G_CALLBACK (draw_milena_image),
- G_OBJECT (NULL));
-// gtk_scrolled_window_add_with_viewport (
-// GTK_SCROLLED_WINDOW (scroll), drawing_area);
+ 500,
+ 500);
+ draw_milena_image(drawing_area, NULL, 0);
gtk_widget_show (drawing_area);
gtk_widget_show (main_vbox);
Index: trunk/milena/sandbox/nivault/plugin-gimp/src/Makefile.am
===================================================================
--- trunk/milena/sandbox/nivault/plugin-gimp/src/Makefile.am (revision 1433)
+++ trunk/milena/sandbox/nivault/plugin-gimp/src/Makefile.am (revision 1434)
@@ -18,7 +18,7 @@
INCLUDES =\
-I$(top_srcdir) \
- -I../../olena/trunk/milena/ \
+ -I../../../../ \
@GIMP_CFLAGS@ \
-I$(includedir)
Index: trunk/milena/sandbox/nivault/plugin-gimp/help/Makefile.in (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/help/en/Makefile.in (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/help/images/Makefile.in (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/po/Makefile.in.in (deleted)
===================================================================
Index: trunk/milena/sandbox/nivault/plugin-gimp/po/POTFILES.in (deleted)
===================================================================
Property changes on: trunk/milena/sandbox/nivault/plugin-gimp
___________________________________________________________________
Name: svn:ignore
+ autoscan-2.61.log
mkinstalldirs
intltool-extract.in
Makefile.in
depcomp
intltool-update.in
config.h.in
autom4te.cache
configure.scan
intltool-merge.in
missing
aclocal.m4
install-sh