Author: abrander
Date: 2010-01-31 03:30:17 +0100 (Sun, 31 Jan 2010)
New Revision: 3131

Modified:
   trunk/AUTHORS
   trunk/librawstudio/rs-curve.c
   trunk/librawstudio/rs-icc-profile.c
   trunk/librawstudio/rs-image16.c
   trunk/librawstudio/rs-utils.c
   trunk/plugins/demosaic/demosaic.c
   trunk/plugins/denoise/denoiseinterface.h
   trunk/plugins/load-dcraw/dcraw.cc
   trunk/plugins/load-dcraw/dcraw_api.cc
   trunk/plugins/load-dcraw/mmap-hack.c
   trunk/plugins/load-dcraw/mmap-hack.h
   trunk/plugins/meta-tiff/tiff-meta.c
   trunk/plugins/output-facebook/output-facebook.c
   trunk/plugins/output-flickr/output-flickr.c
   trunk/plugins/output-jpegfile/output-jpegfile.c
   trunk/src/application.c
   trunk/src/filename.c
   trunk/src/gtk-helper.c
   trunk/src/gtk-helper.h
   trunk/src/rs-actions.c
   trunk/src/rs-external-editor.c
   trunk/src/rs-jpeg.c
   trunk/src/rs-preview-widget.c
   trunk/src/rs-store.c
   trunk/src/rs-toolbox.c
Log:
Un-fucked the merge from revision 3125.

Modified: trunk/AUTHORS
===================================================================
--- trunk/AUTHORS       2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/AUTHORS       2010-01-31 02:30:17 UTC (rev 3131)
@@ -1,10 +1,10 @@
 Maintained and developed by:
 Anders Brander <[email protected]>
 Anders Kvist <[email protected]>
+Klaus Post <[email protected]>
 
 Contributions by:
 Anders Lauritsen <[email protected]> - scaling
 Edouard Gomez <[email protected]> - curve widget and x86_64 port
 Henri Nielsen <[email protected]> - win32 port
-Klaus Post <[email protected]> - various optimizations
 Soren Hansen <[email protected]> - gconf code

Modified: trunk/librawstudio/rs-curve.c
===================================================================
--- trunk/librawstudio/rs-curve.c       2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/librawstudio/rs-curve.c       2010-01-31 02:30:17 UTC (rev 3131)
@@ -40,6 +40,8 @@
        guchar *bg_buffer;
        RSColorTransform *rct;
        RSSettings *settings;
+
+       gint last_width[2];
 };
 
 struct _RSCurveWidgetClass
@@ -739,19 +741,23 @@
        gboolean ret = FALSE;
 
        gdk_threads_enter();
-       if (gtk_events_pending())
-               ret = TRUE;
-       else
+       if (GTK_WIDGET(curve)->allocation.width != 
GTK_WIDGET(curve)->allocation.height)
        {
-               if (GTK_WIDGET(curve)->allocation.width != 
GTK_WIDGET(curve)->allocation.height)
-               {
-                       g_signal_handler_block(RS_CURVE_WIDGET(curve), 
RS_CURVE_WIDGET(curve)->size_signal);
-                       gtk_widget_set_size_request(GTK_WIDGET(curve), -1, 
GTK_WIDGET(curve)->allocation.width);
-                       GUI_CATCHUP();
-                       g_signal_handler_unblock(RS_CURVE_WIDGET(curve), 
RS_CURVE_WIDGET(curve)->size_signal);
-               }
-               curve->size_timeout_helper = 0;
+               gint new_height = GTK_WIDGET(curve)->allocation.width;
+
+               if (GTK_WIDGET(curve)->allocation.width == curve->last_width[0])
+                       new_height = GTK_WIDGET(curve)->allocation.height;
+
+               g_signal_handler_block(RS_CURVE_WIDGET(curve), 
RS_CURVE_WIDGET(curve)->size_signal);
+               gtk_widget_set_size_request(GTK_WIDGET(curve), -1, new_height);
+               GUI_CATCHUP();
+               g_signal_handler_unblock(RS_CURVE_WIDGET(curve), 
RS_CURVE_WIDGET(curve)->size_signal);
+
+               curve->last_width[0] = curve->last_width[1];
+               curve->last_width[1] = GTK_WIDGET(curve)->allocation.width;
        }
+       curve->size_timeout_helper = 0;
+
        gdk_threads_leave();
 
        return ret;

Modified: trunk/librawstudio/rs-icc-profile.c
===================================================================
--- trunk/librawstudio/rs-icc-profile.c 2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/librawstudio/rs-icc-profile.c 2010-01-31 02:30:17 UTC (rev 3131)
@@ -18,7 +18,11 @@
  */
 
 #include <sys/stat.h>
+#ifdef WIN32
+#include <Winsock2.h> /* ntohl() */
+#else
 #include <arpa/inet.h> /* ntohl() */
+#endif
 #include <glib.h>
 #include <glib/gstdio.h>
 #include "rs-icc-profile.h"
@@ -276,7 +280,7 @@
 rs_icc_profile_new_from_file(const gchar *path)
 {
        g_assert(path != NULL);
-       g_assert(path[0] == G_DIR_SEPARATOR);
+       g_assert(g_path_is_absolute(path));
 
        RSIccProfile *profile = g_object_new (RS_TYPE_ICC_PROFILE, "filename", 
path, NULL);
 

Modified: trunk/librawstudio/rs-image16.c
===================================================================
--- trunk/librawstudio/rs-image16.c     2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/librawstudio/rs-image16.c     2010-01-31 02:30:17 UTC (rev 3131)
@@ -17,6 +17,11 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA.
  */
 
+#ifdef WIN32 /* Win32 _aligned_malloc */
+#include <malloc.h>
+#include <stdio.h>
+#endif
+
 #include <rawstudio.h>
 #include <gtk/gtk.h>
 #include <string.h>
@@ -152,7 +157,11 @@
                                        offset+=rsi->pixelsize;
                                }
                        }
+#ifdef WIN32
+                       _aligned_free(rsi->pixels);
+#else
                        g_free(rsi->pixels);
+#endif
                        rsi->pixels = swap;
                        rsi->w = width;
                        rsi->h = height;
@@ -185,7 +194,11 @@
                                }
                                offset += rsi->pitch*rsi->pixelsize;
                        }
+#ifdef WIN32
+                       _aligned_free(rsi->pixels);
+#else
                        g_free(rsi->pixels);
+#endif
                        rsi->pixels = swap;
                        rsi->w = width;
                        rsi->h = height;
@@ -802,8 +815,13 @@
        rsi->filters = 0;
 
        /* Allocate actual pixels */
+#ifdef WIN32
+       rsi->pixels = _aligned_malloc(rsi->h*rsi->rowstride * sizeof(gushort), 
16); 
+       if (rsi->pixels == NULL)
+#else
        ret = posix_memalign((void **) &rsi->pixels, 16, rsi->h*rsi->rowstride 
* sizeof(gushort));
        if (ret > 0)
+#endif
        {
                rsi->pixels = NULL;
                g_object_unref(rsi);

Modified: trunk/librawstudio/rs-utils.c
===================================================================
--- trunk/librawstudio/rs-utils.c       2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/librawstudio/rs-utils.c       2010-01-31 02:30:17 UTC (rev 3131)
@@ -22,6 +22,9 @@
 #include <config.h>
 #include <glib.h>
 #include <glib/gstdio.h>
+#ifdef WIN32
+#include <pthread.h> /* MinGW WIN32 gmtime_r() */
+#endif
 #include <time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -75,9 +78,10 @@
 {
        struct tm *tm = g_new0(struct tm, 1);
        GTime timestamp = -1;
-
+#ifndef WIN32 /* There is no strptime() in time.h in MinGW */
        if (strptime(str, "%Y:%m:%d %H:%M:%S", tm))
                timestamp = (GTime) mktime(tm);
+#endif
 
        g_free(tm);
 

Modified: trunk/plugins/demosaic/demosaic.c
===================================================================
--- trunk/plugins/demosaic/demosaic.c   2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/plugins/demosaic/demosaic.c   2010-01-31 02:30:17 UTC (rev 3131)
@@ -317,7 +317,7 @@
 
   int code[16][16][32], *ip, sum[4];
   int c, i, x, y, row, col, shift, color;
-  ushort *pix;
+  gushort *pix;
 
   border_interpolate_INDI(t, colors, 1);
   for (row=0; row < 16; row++)
@@ -394,13 +394,13 @@
   int row, col, c, d;
        int diffA, diffB, guessA, guessB;
        int p = image->pitch;
-  ushort (*pix)[4];
+  gushort (*pix)[4];
 
   {
 /*  Fill in the green layer with gradients and pattern recognition: */
   for (row=start_y; row < end_y; row++)
     for (col=3+(FC(row,3) & 1), c=FC(row,col); col < image->w-3; col+=2) {
-      pix = (ushort (*)[4])GET_PIXEL(image, col, row);
+      pix = (gushort (*)[4])GET_PIXEL(image, col, row);
 
        guessA = (pix[-1][1] + pix[0][c] + pix[1][1]) * 2
                      - pix[-2*1][c] - pix[2*1][c];
@@ -426,7 +426,7 @@
 /*  Calculate red and blue for each green pixel:               */
   for (row=start_y-2; row < end_y+2; row++)
     for (col=1+(FC(row,2) & 1), c=FC(row,col+1); col < image->w-1; col+=2) {
-      pix = (ushort (*)[4])GET_PIXEL(image, col, row);
+      pix = (gushort (*)[4])GET_PIXEL(image, col, row);
       pix[0][c] = CLIP((pix[-1][c] + pix[1][c] + 2*pix[0][1]
           - pix[-1][1] - pix[1][1]) >> 1);
       c=2-c;
@@ -438,7 +438,7 @@
 /*  Calculate blue for red pixels and vice versa:              */
        for (row=start_y-2; row < end_y+2; row++)
                for (col=1+(FC(row,1) & 1), c=2-FC(row,col); col < image->w-1; 
col+=2) {
-                       pix = (ushort (*)[4])GET_PIXEL(image, col, row);
+                       pix = (gushort (*)[4])GET_PIXEL(image, col, row);
                        d = 1 + p;
                        diffA = ABS(pix[-d][c] - pix[d][c]) +
                                ABS(pix[-d][1] - pix[0][1]) +

Modified: trunk/plugins/denoise/denoiseinterface.h
===================================================================
--- trunk/plugins/denoise/denoiseinterface.h    2010-01-30 23:51:32 UTC (rev 
3130)
+++ trunk/plugins/denoise/denoiseinterface.h    2010-01-31 02:30:17 UTC (rev 
3131)
@@ -18,11 +18,7 @@
 
 #ifndef denoiseinterface_h__
 #define denoiseinterface_h__
-#ifndef WIN32
 #include <rawstudio.h>
-#else
-#include "..\..\..\..\win32\rawstudio.h"
-#endif
 
 #ifdef _unix_
 G_BEGIN_DECLS

Modified: trunk/plugins/load-dcraw/dcraw.cc
===================================================================
--- trunk/plugins/load-dcraw/dcraw.cc   2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/plugins/load-dcraw/dcraw.cc   2010-01-31 02:30:17 UTC (rev 3131)
@@ -50,7 +50,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
+#ifdef WITH_MMAP_HACK
 #include "mmap-hack.h"
+#endif
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h> /*For off_t */
 #endif
@@ -5025,7 +5027,6 @@
   int sony_curve[] = { 0,0,0,0,0,4095 };
 #ifndef WITH_MMAP_HACK
   unsigned *buf;
-  FILE *sfp;
 #endif /* WITH_MMAP_HACK */
   unsigned sony_offset=0, sony_length=0, sony_key=0;
   struct jhead jh;

Modified: trunk/plugins/load-dcraw/dcraw_api.cc
===================================================================
--- trunk/plugins/load-dcraw/dcraw_api.cc       2010-01-30 23:51:32 UTC (rev 
3130)
+++ trunk/plugins/load-dcraw/dcraw_api.cc       2010-01-31 02:30:17 UTC (rev 
3131)
@@ -30,7 +30,9 @@
 #include <sys/types.h>
 #include "dcraw_api.h"
 #include "dcraw.h"
+#ifdef WITH_MMAP_HACK
 #include "mmap-hack.h"
+#endif
 #define FORCC for (c=0; c < colors; c++)
 #define FC(filters,row,col) \
     (filters >> ((((row) << 1 & 14) + ((col) & 1)) << 1) & 3)

Modified: trunk/plugins/load-dcraw/mmap-hack.c
===================================================================
--- trunk/plugins/load-dcraw/mmap-hack.c        2010-01-30 23:51:32 UTC (rev 
3130)
+++ trunk/plugins/load-dcraw/mmap-hack.c        2010-01-31 02:30:17 UTC (rev 
3131)
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA.
  */
-
+#ifdef WITH_MMAP_HACK
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -114,3 +114,4 @@
        stream->offset+= scanned;
        return(scanned);
 }
+#endif

Modified: trunk/plugins/load-dcraw/mmap-hack.h
===================================================================
--- trunk/plugins/load-dcraw/mmap-hack.h        2010-01-30 23:51:32 UTC (rev 
3130)
+++ trunk/plugins/load-dcraw/mmap-hack.h        2010-01-31 02:30:17 UTC (rev 
3131)
@@ -57,6 +57,10 @@
 #define fgetc(stream) (int) (RS_FILE(stream)->map[RS_FILE(stream)->offset++])
 #define ftell(stream) (long) (RS_FILE(stream)->offset)
 #define rewind(stream) do {RS_FILE(stream)->offset = 0; } while(0)
+
+#ifdef feof
+#undef feof
+#endif
 #define feof(stream) (RS_FILE(stream)->offset >= RS_FILE(stream)->size)
 
 #ifdef getc

Modified: trunk/plugins/meta-tiff/tiff-meta.c
===================================================================
--- trunk/plugins/meta-tiff/tiff-meta.c 2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/plugins/meta-tiff/tiff-meta.c 2010-01-31 02:30:17 UTC (rev 3131)
@@ -20,7 +20,11 @@
 #include <rawstudio.h>
 #include <gtk/gtk.h>
 #include <math.h>
+#ifdef WIN32
+#include <Winsock2.h> /* ntohl() */
+#else
 #include <arpa/inet.h> /* sony_decrypt(): htonl() */
+#endif
 #include <string.h> /* memcpy() */
 #include <stdlib.h>
 

Modified: trunk/plugins/output-facebook/output-facebook.c
===================================================================
--- trunk/plugins/output-facebook/output-facebook.c     2010-01-30 23:51:32 UTC 
(rev 3130)
+++ trunk/plugins/output-facebook/output-facebook.c     2010-01-31 02:30:17 UTC 
(rev 3131)
@@ -333,6 +333,9 @@
        rs_output_execute (jpegsave, filter);
        g_object_unref (jpegsave);
 
+       if (facebook->filename) /* Most likely batch */
+               facebook->caption = g_path_get_basename(facebook->filename);
+
        gboolean ret = rs_facebook_client_upload_image(facebook_client, 
temp_file, facebook->caption, NULL, &error);
        deal_with_error(&error);
 

Modified: trunk/plugins/output-flickr/output-flickr.c
===================================================================
--- trunk/plugins/output-flickr/output-flickr.c 2010-01-30 23:51:32 UTC (rev 
3130)
+++ trunk/plugins/output-flickr/output-flickr.c 2010-01-31 02:30:17 UTC (rev 
3131)
@@ -443,6 +443,9 @@
 
        flickcurl_set_auth_token (fc, flickr_user_token);
 
+       if (flickr->filename)
+               flickr->title = g_path_get_basename(flickr->filename);
+
        upload_params->photo_file = temp_file;
        upload_params->title = flickr->title;
        upload_params->description = flickr->description;

Modified: trunk/plugins/output-jpegfile/output-jpegfile.c
===================================================================
--- trunk/plugins/output-jpegfile/output-jpegfile.c     2010-01-30 23:51:32 UTC 
(rev 3130)
+++ trunk/plugins/output-jpegfile/output-jpegfile.c     2010-01-31 02:30:17 UTC 
(rev 3131)
@@ -18,6 +18,10 @@
  */
 
 #include <rawstudio.h>
+#ifdef WIN32
+#define HAVE_BOOLEAN
+#define _BASETSD_H_
+#endif
 #include <jpeglib.h>
 #include <gettext.h>
 #include "config.h"

Modified: trunk/src/application.c
===================================================================
--- trunk/src/application.c     2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/src/application.c     2010-01-31 02:30:17 UTC (rev 3131)
@@ -19,12 +19,15 @@
 
 #include <rawstudio.h>
 #include <glib/gstdio.h>
+#include <glib.h>
 #include <unistd.h>
 #include <math.h> /* pow() */
 #include <string.h> /* memset() */
 #include <time.h>
 #include <config.h>
+#ifndef WIN32
 #include <gconf/gconf-client.h>
+#endif
 #include "application.h"
 #include "gtk-interface.h"
 #include "gtk-helper.h"
@@ -571,7 +574,9 @@
        gboolean do_test = FALSE;
        int opt;
        gboolean use_system_theme = DEFAULT_CONF_USE_SYSTEM_THEME;
+#ifndef WIN32
        GConfClient *client;
+#endif
 
        while ((opt = getopt(argc, argv, "nt")) != -1) {
                switch (opt) {
@@ -617,9 +622,11 @@
 
        rs_plugin_manager_load_all_plugins();
 
+#ifndef WIN32
        /* Add our own directory to default GConfClient before anyone uses it */
        client = gconf_client_get_default();
        gconf_client_add_dir(client, "/apps/" PACKAGE, 
GCONF_CLIENT_PRELOAD_NONE, NULL);
+#endif
 
        rs = rs_new();
        rs->queue->cms = rs->cms = rs_cms_init();

Modified: trunk/src/filename.c
===================================================================
--- trunk/src/filename.c        2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/src/filename.c        2010-01-31 02:30:17 UTC (rev 3131)
@@ -19,6 +19,9 @@
 
 #include <glib.h>
 #include <glib/gstdio.h>
+#ifdef WIN32
+#include <pthread.h> /* MinGW WIN32 gmtime_r() */
+#endif
 #include <gtk/gtk.h>
 #include <stdio.h>
 #include <string.h>

Modified: trunk/src/gtk-helper.c
===================================================================
--- trunk/src/gtk-helper.c      2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/src/gtk-helper.c      2010-01-31 02:30:17 UTC (rev 3131)
@@ -21,7 +21,9 @@
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
 #include <config.h>
+#ifndef WIN32
 #include <gconf/gconf-client.h>
+#endif
 #include "application.h"
 #include "conf_interface.h"
 #include "gtk-interface.h"
@@ -1174,13 +1176,15 @@
 void
 gui_box_toggle_callback(GtkExpander *expander, gchar *key)
 {
+#ifndef WIN32
        GConfClient *client = gconf_client_get_default();
        gboolean expanded = gtk_expander_get_expanded(expander);
 
        /* Save state to gconf */
        gconf_client_set_bool(client, key, expanded, NULL);
+#endif
 }
-
+#ifndef WIN32
 void
 gui_box_notify(GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer 
user_data)
 {
@@ -1192,6 +1196,7 @@
                gtk_expander_set_expanded(expander, expanded);
        }
 }
+#endif
 
 GtkWidget *
 gui_box(const gchar *title, GtkWidget *in, gchar *key, gboolean 
default_expanded)
@@ -1205,10 +1210,12 @@
 
        if (key)
        {
+#ifndef WIN32
                GConfClient *client = gconf_client_get_default();
                gchar *name = g_build_filename("/apps", PACKAGE, key, NULL);
                g_signal_connect_after(expander, "activate", 
G_CALLBACK(gui_box_toggle_callback), name);
                gconf_client_notify_add(client, name, gui_box_notify, expander, 
NULL, NULL);
+#endif
        }
        gtk_expander_set_expanded(GTK_EXPANDER(expander), expanded);
 

Modified: trunk/src/gtk-helper.h
===================================================================
--- trunk/src/gtk-helper.h      2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/src/gtk-helper.h      2010-01-31 02:30:17 UTC (rev 3131)
@@ -17,7 +17,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA.
  */
 
+#ifndef WIN32
 #include <gconf/gconf-client.h>
+#endif
 
 typedef struct _RS_CONFBOX RS_CONFBOX;
 
@@ -86,5 +88,7 @@
 extern GtkWidget *gui_label_new_with_mouseover(const gchar *normal_text, const 
gchar *hover_text);
 
 extern void gui_box_toggle_callback(GtkExpander *expander, gchar *key);
+#ifndef WIN32
 extern void gui_box_notify(GConfClient *client, guint cnxn_id, GConfEntry 
*entry, gpointer user_data);
+#endif
 extern GtkWidget * gui_box(const gchar *title, GtkWidget *in, gchar *key, 
gboolean default_expanded);

Modified: trunk/src/rs-actions.c
===================================================================
--- trunk/src/rs-actions.c      2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/src/rs-actions.c      2010-01-31 02:30:17 UTC (rev 3131)
@@ -948,6 +948,7 @@
        const static gchar *authors[] = {
                "Anders Brander <[email protected]>",
                "Anders Kvist <[email protected]>",
+               "Klaus Post <[email protected]>",
                NULL
        };
        const static gchar *artists[] = {

Modified: trunk/src/rs-external-editor.c
===================================================================
--- trunk/src/rs-external-editor.c      2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/src/rs-external-editor.c      2010-01-31 02:30:17 UTC (rev 3131)
@@ -22,10 +22,12 @@
 
 #include <glib.h>
 #include <glib/gstdio.h>
-#include <dbus/dbus.h>
 #include "application.h"
 #include "rs-photo.h"
+#ifndef WIN32
+#include <dbus/dbus.h>
 
+
 static gboolean rs_has_gimp(gint major, gint minor, gint micro);
 
 #define EXPORT_TO_GIMP_TIMEOUT_SECONDS 30
@@ -51,9 +53,13 @@
        }
        return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
+#endif
 
 gboolean
 rs_external_editor_gimp(RS_PHOTO *photo, guint snapshot, void *cms) {
+#ifdef WIN32
+       return FALSE;
+#else
        RSOutput *output;
        g_assert(RS_IS_PHOTO(photo));
 
@@ -132,8 +138,9 @@
        }
 
        return TRUE;
+#endif
 }
-
+#ifndef WIN32
 static gboolean
 rs_has_gimp(gint major, gint minor, gint micro) {
        FILE *fp;
@@ -213,3 +220,4 @@
 
        return retval;
 }
+#endif

Modified: trunk/src/rs-jpeg.c
===================================================================
--- trunk/src/rs-jpeg.c 2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/src/rs-jpeg.c 2010-01-31 02:30:17 UTC (rev 3131)
@@ -23,9 +23,13 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
-#include <jpeglib.h>
 #include "application.h"
 #include "rs-jpeg.h"
+#ifdef WIN32
+#define HAVE_BOOLEAN
+#define _BASETSD_H_
+#endif
+#include <jpeglib.h>
 
 /* This function is an almost verbatim copy from little cms. Thanks Marti, you 
rock! */
 

Modified: trunk/src/rs-preview-widget.c
===================================================================
--- trunk/src/rs-preview-widget.c       2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/src/rs-preview-widget.c       2010-01-31 02:30:17 UTC (rev 3131)
@@ -59,6 +59,10 @@
        MOVE             = 0x4000, /* 0100 0000 0000 0000 */
 } STATE;
 
+/* In win32 windef32.h will define both near and NEAR */
+#undef NEAR
+#undef near
+
 typedef enum {
        CROP_NEAR_INSIDE  = 0x10, /* 0001 0000 */ 
        CROP_NEAR_OUTSIDE = 0x20, /* 0010 0000 */
@@ -80,8 +84,9 @@
 typedef struct {
        gint x;
        gint y;
-} COORD;
+} RS_COORD;
 
+
 typedef enum {
        SPLIT_NONE,
        SPLIT_HORIZONTAL,
@@ -135,10 +140,10 @@
        GString *crop_text;
        GtkWidget *crop_size_label;
        RS_RECT crop_move;
-       COORD crop_start;
+       RS_COORD crop_start;
 
-       COORD straighten_start;
-       COORD straighten_end;
+       RS_COORD straighten_start;
+       RS_COORD straighten_end;
        gfloat straighten_angle;
        RSFilter *filter_input;
 

Modified: trunk/src/rs-store.c
===================================================================
--- trunk/src/rs-store.c        2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/src/rs-store.c        2010-01-31 02:30:17 UTC (rev 3131)
@@ -36,6 +36,10 @@
 #include "rs-photo.h"
 #include "rs-library.h"
 
+#ifdef WIN32
+#undef near
+#endif
+
 /* How many different icon views do we have (tabs) */
 #define NUM_VIEWS 6
 

Modified: trunk/src/rs-toolbox.c
===================================================================
--- trunk/src/rs-toolbox.c      2010-01-30 23:51:32 UTC (rev 3130)
+++ trunk/src/rs-toolbox.c      2010-01-31 02:30:17 UTC (rev 3131)
@@ -20,7 +20,9 @@
 #include <rawstudio.h>
 #include <gtk/gtk.h>
 #include <config.h>
+#ifndef WIN32
 #include <gconf/gconf-client.h>
+#endif
 #include "gettext.h"
 #include "rs-toolbox.h"
 #include "gtk-helper.h"
@@ -88,9 +90,12 @@
        RS_PHOTO *photo;
        GtkWidget *histogram;
        RS_IMAGE16 *histogram_dataset;
+
+ #ifndef WIN32
        guint histogram_connection; /* Got GConf notification */
 
        GConfClient *gconf;
+#endif
 
        gboolean mute_from_sliders;
        gboolean mute_from_photo;
@@ -107,7 +112,9 @@
 static void dcp_profile_selected(RSProfileSelector *selector, RSDcpFile *dcp, 
RSToolbox *toolbox);
 static void icc_profile_selected(RSProfileSelector *selector, RSIccProfile 
*icc, RSToolbox *toolbox);
 static void add_profile_selected(RSProfileSelector *selector, RSToolbox 
*toolbox);
+#ifndef WIN32
 static void conf_histogram_height_changed(GConfClient *client, guint cnxn_id, 
GConfEntry *entry, gpointer user_data);
+#endif
 static void notebook_switch_page(GtkNotebook *notebook, GtkNotebookPage *page, 
guint page_num, RSToolbox *toolbox);
 static void basic_range_value_changed(GtkRange *range, gpointer user_data);
 static gboolean basic_range_reset(GtkWidget *widget, GdkEventButton *event, 
gpointer user_data);
@@ -127,9 +134,11 @@
 {
        RSToolbox *toolbox = RS_TOOLBOX(object);
 
+#ifndef WIN32
        gconf_client_notify_remove(toolbox->gconf, 
toolbox->histogram_connection);
 
        g_object_unref(toolbox->gconf);
+#endif
 
        if (G_OBJECT_CLASS (rs_toolbox_parent_class)->finalize)
                G_OBJECT_CLASS (rs_toolbox_parent_class)->finalize (object);
@@ -178,8 +187,10 @@
        gtk_scrolled_window_set_hadjustment(scrolled_window, NULL);
        gtk_scrolled_window_set_vadjustment(scrolled_window, NULL);
 
+#ifndef WIN32
        /* Get a GConfClient */
        self->gconf = gconf_client_get_default();
+#endif
 
        /* Snapshot labels */
        label[0] = gtk_label_new(_(" A "));
@@ -210,7 +221,9 @@
        gtk_box_pack_start(self->toolbox, gui_box(_("Histogram"), 
self->histogram, "show_histogram", TRUE), FALSE, FALSE, 0);
 
        /* Watch out for gconf-changes */
+#ifndef WIN32
        self->histogram_connection = gconf_client_notify_add(self->gconf, 
"/apps/" PACKAGE "/histogram_height", conf_histogram_height_changed, self, 
NULL, NULL);
+#endif
 
        /* Pack everything nice with scrollers */
        viewport = gtk_viewport_new (gtk_scrolled_window_get_hadjustment 
(scrolled_window),
@@ -225,6 +238,7 @@
        self->mute_from_photo = FALSE;
 }
 
+#ifndef WIN32
 static void
 dcp_profile_selected(RSProfileSelector *selector, RSDcpFile *dcp, RSToolbox 
*toolbox)
 {
@@ -257,6 +271,7 @@
                gtk_widget_set_size_request(toolbox->histogram, 64, height);
        }
 }
+#endif
 
 static void
 notebook_switch_page(GtkNotebook *notebook, GtkNotebookPage *page, guint 
page_num, RSToolbox *toolbox)


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to