Author: al
Date: 2009-12-30 21:53:29 +0100 (Wed, 30 Dec 2009)
New Revision: 2917
Modified:
trunk/src/application.c
trunk/src/gtk-helper.c
trunk/src/gtk-helper.h
trunk/src/rs-external-editor.c
trunk/src/rs-store.c
trunk/src/rs-toolbox.c
Log:
Removed all use of gconf and dbus when compiling with WIN32.
Modified: trunk/src/application.c
===================================================================
--- trunk/src/application.c 2009-12-30 20:50:41 UTC (rev 2916)
+++ trunk/src/application.c 2009-12-30 20:53:29 UTC (rev 2917)
@@ -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"
@@ -474,7 +477,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) {
@@ -520,9 +525,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/gtk-helper.c
===================================================================
--- trunk/src/gtk-helper.c 2009-12-30 20:50:41 UTC (rev 2916)
+++ trunk/src/gtk-helper.c 2009-12-30 20:53:29 UTC (rev 2917)
@@ -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 2009-12-30 20:50:41 UTC (rev 2916)
+++ trunk/src/gtk-helper.h 2009-12-30 20:53:29 UTC (rev 2917)
@@ -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-external-editor.c
===================================================================
--- trunk/src/rs-external-editor.c 2009-12-30 20:50:41 UTC (rev 2916)
+++ trunk/src/rs-external-editor.c 2009-12-30 20:53:29 UTC (rev 2917)
@@ -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-store.c
===================================================================
--- trunk/src/rs-store.c 2009-12-30 20:50:41 UTC (rev 2916)
+++ trunk/src/rs-store.c 2009-12-30 20:53:29 UTC (rev 2917)
@@ -37,6 +37,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 2009-12-30 20:50:41 UTC (rev 2916)
+++ trunk/src/rs-toolbox.c 2009-12-30 20:53:29 UTC (rev 2917)
@@ -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"
@@ -80,9 +82,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;
@@ -96,7 +101,9 @@
};
static guint signals[LAST_SIGNAL] = { 0 };
+#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);
@@ -115,9 +122,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);
@@ -157,8 +166,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 "));
@@ -191,7 +202,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),
@@ -206,6 +219,7 @@
self->mute_from_photo = FALSE;
}
+#ifndef WIN32
static void
conf_histogram_height_changed(GConfClient *client, guint cnxn_id, GConfEntry
*entry, gpointer user_data)
{
@@ -218,6 +232,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