diff -buNr planner-0.13/Makefile.win32 planner-0.13-new/Makefile.win32 --- planner-0.13/Makefile.win32 Wed Dec 31 19:00:00 1969 +++ planner-0.13-new/Makefile.win32 Tue Mar 29 06:53:44 2005 @@ -0,0 +1,34 @@ +# +# Makefile.win32 +# + +SUBDIRS=libplanner libegg/recent-files src + +RECURSIVE_TARGETS = all-recursive clean-recursive + +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) -f Makefile.win32 $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) -f Makefile.win32 "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +all: all-recursive +all-am: + +clean: clean-recursive + +clean-am: + rm -f config.h diff -buNr planner-0.13/config.h.win32 planner-0.13-new/config.h.win32 --- planner-0.13/config.h.win32 Wed Dec 31 19:00:00 1969 +++ planner-0.13-new/config.h.win32 Tue Mar 29 10:55:41 2005 @@ -0,0 +1,8 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#define GETTEXT_PACKAGE "planner" +#define PACKAGE "planner" +#define VERSION "0.13" +#define GNOMELOCALEDIR "share/locale" +#endif diff -buNr planner-0.13/configure.in planner-0.13-new/configure.in --- planner-0.13/configure.in Sun Mar 13 06:17:04 2005 +++ planner-0.13-new/configure.in Fri Apr 1 22:33:04 2005 @@ -111,6 +111,9 @@ gconf-2.0 >= $GCONF_REQUIRED ]) +AC_DEFINE(HAVE_GCONF, 1, [Define to 1 to indicate presence of GCONF]) +AC_DEFINE(HAVE_GNOME_VFS, 1, [Define to 1 to indicate presence of GNOME VFS]) + AC_SUBST(PLANNER_CFLAGS) AC_SUBST(PLANNER_LIBS) dnl ----------------------------------------------------------- diff -buNr planner-0.13/data/glade/html-output.glade.win32 planner-0.13-new/data/glade/html-output.glade.win32 --- planner-0.13/data/glade/html-output.glade.win32 Wed Dec 31 19:00:00 1969 +++ planner-0.13-new/data/glade/html-output.glade.win32 Thu Mar 31 14:52:19 2005 @@ -0,0 +1,313 @@ + + + + + + + 5 + Export to HTML + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + False + + + + True + False + 2 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + True + gtk-save + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 5 + True + False + 4 + + + + True + <b>Save to file</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 6 + + + + True + False + 0 + + + + True + True + True + True + 0 + + True + * + False + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + True + View the result in browser + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + 2 + 2 + False + 6 + 12 + + + + True + True + Local file: + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + True + Web location: + True + GTK_RELIEF_NORMAL + True + False + False + True + local_radiobutton + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 0 + 1 + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 1 + 2 + + + + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + Binary files planner-0.13/data/images/gnome-planner.ico and planner-0.13-new/data/images/gnome-planner.ico differ diff -buNr planner-0.13/libegg/recent-files/Makefile.win32 planner-0.13-new/libegg/recent-files/Makefile.win32 --- planner-0.13/libegg/recent-files/Makefile.win32 Wed Dec 31 19:00:00 1969 +++ planner-0.13-new/libegg/recent-files/Makefile.win32 Mon Mar 28 09:27:42 2005 @@ -0,0 +1,75 @@ +# +# Makefile.win32 +# + +# +# PATHS +# + +# Compiler Options + +DLL_LD_FLAGS += -Wl,--enable-auto-image-base + +CFLAGS = -mms-bitfields -mno-cygwin -I../.. `pkg-config --cflags gtk+-2.0` -I/usr/include -I/home/fmoraes/dev/include + +libdir=. +datadir=. + +DEFINES = -DWIN32 \ + -DHAVE_CONFIG_H \ + -DUSE_STABLE_LIBGNOMEUI \ + -DWIN32_LEAN_AND_MEAN + +libeggrecent_la_SOURCES = \ + egg-recent-item.c \ + egg-recent-model.c \ + egg-recent-util.c \ + egg-recent-view-uimanager.c \ + egg-recent-view.c + +libeggrecent_la_CFLAGS = + +libeggrecent_la_LDFLAGS = -lwsock32 + +OBJECTS_LIBEGG = $(libeggrecent_la_SOURCES:%.c=%.o) + + +## +## LIBRARIES +## + +LIBS = `pkg-config --libs gtk+-2.0` + +## +## RULES +## + +# How to make a C file + +%.o: %.c + $(CC) $(CFLAGS) $(libeggrecent_la_CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $< + +## +## TARGET DEFINITIONS +## + +.PHONY: all clean + +all: libeggrecent.dll + +## +## BUILD DLL +## + +libeggrecent.dll: $(OBJECTS_LIBEGG) + $(CC) -shared $(OBJECTS_LIBEGG) $(LIB_PATHS) $(LIBS) $(libeggrecent_la_LDFLAGS) $(DLL_LD_FLAGS) -Wl,--out-implib=libeggrecent.lib -Wl,-Map -Wl,libeggrecent.map -Wl,--cref -o libeggrecent.dll + +## +## CLEAN RULES +## + +clean: + rm -f *.o + rm -f libeggrecent.dll + rm -f *.lib + rm -f *.map diff -buNr planner-0.13/libegg/recent-files/egg-recent-item.c planner-0.13-new/libegg/recent-files/egg-recent-item.c --- planner-0.13/libegg/recent-files/egg-recent-item.c Sun Oct 3 05:32:15 2004 +++ planner-0.13-new/libegg/recent-files/egg-recent-item.c Tue Mar 22 01:17:05 2005 @@ -22,8 +22,10 @@ #include #include #include +#ifdef HAVE_GNOME_VFS #include #include +#endif #include "egg-recent-item.h" @@ -97,10 +99,14 @@ return NULL; } +#ifdef HAVE_GNOME_VFS item->mime_type = gnome_vfs_get_mime_type (item->uri); if (!item->mime_type) item->mime_type = g_strdup (GNOME_VFS_MIME_TYPE_UNKNOWN); +#else + item->mime_type = "application/octet-stream"; +#endif return item; } @@ -189,7 +195,14 @@ /* if G_BROKEN_FILENAMES is not set, this should succede */ if (g_utf8_validate (uri, -1, NULL)) { +#ifdef HAVE_GNOME_VFS item->uri = gnome_vfs_make_uri_from_input (uri); +#else + if (g_strncasecmp(uri, "file:", 5) == 0) + item->uri = g_strdup(uri); + else + item->uri = g_filename_to_uri(uri, NULL, NULL); +#endif } else { utf8_uri = g_filename_to_utf8 (uri, -1, NULL, NULL, NULL); @@ -199,7 +212,11 @@ } if (g_utf8_validate (utf8_uri, -1, NULL)) { +#ifdef HAVE_GNOME_VFS item->uri = gnome_vfs_make_uri_from_input (utf8_uri); +#else + item->uri = g_filename_to_uri(utf8_uri, NULL, NULL); +#endif } else { g_free (utf8_uri); return FALSE; @@ -235,7 +252,11 @@ gchar * egg_recent_item_get_uri_for_display (const EggRecentItem *item) { +#ifdef HAVE_GNOME_VFS return gnome_vfs_format_uri_for_display (item->uri); +#else + return g_filename_from_uri (item->uri, NULL, NULL); +#endif } /* Stolen from gnome_vfs_make_valid_utf8() */ @@ -290,7 +311,9 @@ gchar * egg_recent_item_get_short_name (const EggRecentItem *item) { +#ifdef HAVE_GNOME_VFS GnomeVFSURI *uri; +#endif char *short_name; gboolean valid; @@ -299,6 +322,7 @@ if (item->uri == NULL) return NULL; +#ifdef HAVE_GNOME_VFS uri = gnome_vfs_uri_new (item->uri); if (uri == NULL) return NULL; @@ -327,6 +351,10 @@ } gnome_vfs_uri_unref (uri); +#else + short_name = g_filename_display_basename (item->uri); +#endif + return short_name; } diff -buNr planner-0.13/libegg/recent-files/egg-recent-model.c planner-0.13-new/libegg/recent-files/egg-recent-model.c --- planner-0.13/libegg/recent-files/egg-recent-model.c Sun Oct 3 05:32:15 2004 +++ planner-0.13-new/libegg/recent-files/egg-recent-model.c Tue Mar 29 10:35:37 2005 @@ -31,9 +31,19 @@ #include #include #include +#ifdef WIN32 +#include +#include +#define ftruncate _chsize +#define fsync _commit +#endif +#ifdef HAVE_GNOME_VFS #include #include +#endif +#ifdef HAVE_GCONF #include +#endif #include "egg-recent-model.h" #include "egg-recent-item.h" @@ -62,9 +72,13 @@ GHashTable *monitors; +#ifdef HAVE_GNOME_VFS GnomeVFSMonitorHandle *monitor; +#endif +#ifdef HAVE_GCONF GConfClient *client; +#endif gboolean use_default_limit; guint limit_change_notify_id; @@ -176,14 +190,22 @@ { int len; int fd; +#ifdef WIN32 + struct _stat sbuf; +#else struct stat sbuf; +#endif rewind (file); len = strlen (content); fd = fileno (file); +#ifdef WIN32 + if (_fstat (fd, &sbuf) < 0) +#else if (fstat (fd, &sbuf) < 0) +#endif g_warning ("Couldn't stat XML document."); if ((off_t)len < sbuf.st_size) { @@ -260,7 +282,11 @@ while (tmp) { EggRecentItem *item = tmp->data; +#ifdef HAVE_GNOME_VFS if (gnome_vfs_uris_match (egg_recent_item_peek_uri (item), uri)) { +#else + if (g_utf8_collate(egg_recent_item_peek_uri (item), uri) == 0) { +#endif egg_recent_item_set_timestamp (item, (time_t) -1); egg_recent_model_add_new_groups (item, upd_item); @@ -557,8 +583,13 @@ if (pass_mime_test && pass_group_test && model->priv->scheme_filter_values != NULL) { gchar *scheme; - +#ifdef HAVE_GNOME_VFS scheme = gnome_vfs_get_uri_scheme (uri); +#else + scheme = g_strdup (uri); + if (g_utf8_strchr(scheme, -1, ':')) + *g_utf8_strchr(scheme, -1, ':') = 0; +#endif if (egg_recent_model_string_match (model->priv->scheme_filter_values, scheme)) @@ -613,8 +644,10 @@ tmp = list; while (tmp) { EggRecentItem *item = (EggRecentItem *)tmp->data; +#ifdef HAVE_GNOME_VFS GnomeVFSMonitorHandle *handle; GnomeVFSResult res; +#endif gchar *uri; tmp = tmp->next; @@ -626,6 +659,7 @@ continue; } +#ifdef HAVE_GNOME_VFS res = gnome_vfs_monitor_add (&handle, uri, GNOME_VFS_MONITOR_FILE, egg_recent_model_monitor_list_cb, @@ -634,6 +668,7 @@ if (res == GNOME_VFS_OK) g_hash_table_insert (model->priv->monitors, uri, handle); else +#endif g_free (uri); } } @@ -648,6 +683,7 @@ return FALSE; } +#ifdef HAVE_GNOME_VFS static void egg_recent_model_monitor_cb (GnomeVFSMonitorHandle *handle, const gchar *monitor_uri, @@ -672,10 +708,12 @@ model); } } +#endif static void egg_recent_model_monitor (EggRecentModel *model, gboolean should_monitor) { +#ifdef HAVE_GNOME_VFS if (should_monitor && model->priv->monitor == NULL) { char *uri; @@ -692,11 +730,11 @@ /* if the above fails, don't worry about it. * local notifications will still happen */ - } else if (!should_monitor && model->priv->monitor != NULL) { gnome_vfs_monitor_cancel (model->priv->monitor); model->priv->monitor = NULL; } +#endif } static void @@ -879,6 +917,7 @@ return file; } +#ifndef WIN32 static gboolean egg_recent_model_lock_file (FILE *file) { @@ -923,6 +962,32 @@ return (lockf (fd, F_ULOCK, 0) == 0) ? TRUE : FALSE; } +#else +#include +#include + +static gboolean +egg_recent_model_lock_file (FILE *file) +{ + int fd; + + rewind (file); + fd = fileno (file); + + return _locking(fd, _LK_LOCK, -1) == 0; +} + +static gboolean +egg_recent_model_unlock_file (FILE *file) +{ + int fd; + + rewind (file); + fd = fileno (file); + + return _locking(fd, _LK_UNLCK, -1) == 0; +} +#endif static void egg_recent_model_finalize (GObject *object) @@ -947,20 +1012,24 @@ g_slist_free (model->priv->group_filter_values); model->priv->group_filter_values = NULL; - +#ifdef HAVE_GCONF if (model->priv->limit_change_notify_id) gconf_client_notify_remove (model->priv->client, model->priv->limit_change_notify_id); +#endif model->priv->expiration_change_notify_id = 0; +#ifdef HAVE_GCONF if (model->priv->expiration_change_notify_id) gconf_client_notify_remove (model->priv->client, model->priv->expiration_change_notify_id); +#endif model->priv->expiration_change_notify_id = 0; +#ifdef HAVE_GCONF g_object_unref (model->priv->client); model->priv->client = NULL; - +#endif g_free (model->priv->path); model->priv->path = NULL; @@ -1111,7 +1180,7 @@ } - +#ifdef HAVE_GCONF static void egg_recent_model_limit_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data) @@ -1147,14 +1216,17 @@ { } +#endif static void egg_recent_model_init (EggRecentModel * model) { +#ifdef HAVE_GNOME_VFS if (!gnome_vfs_init ()) { g_warning ("gnome-vfs initialization failed."); return; } +#endif model->priv = g_new0 (EggRecentModelPrivate, 1); @@ -1166,6 +1238,7 @@ model->priv->group_filter_values = NULL; model->priv->scheme_filter_values = NULL; +#ifdef HAVE_GCONF model->priv->client = gconf_client_get_default (); gconf_client_add_dir (model->priv->client, EGG_RECENT_MODEL_KEY_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); @@ -1186,7 +1259,7 @@ model->priv->client, EGG_RECENT_MODEL_EXPIRE_KEY, NULL); - +#endif #if 0 /* keep this out, for now */ model->priv->limit = gconf_client_get_int ( @@ -1200,9 +1273,15 @@ model->priv->monitors = g_hash_table_new_full ( g_str_hash, g_str_equal, (GDestroyNotify) g_free, +#ifdef HAVE_GNOME_VFS (GDestroyNotify) gnome_vfs_monitor_cancel); +#else + NULL); +#endif +#ifdef HAVE_GNOME_VFS model->priv->monitor = NULL; +#endif egg_recent_model_monitor (model, TRUE); } @@ -1300,12 +1379,16 @@ fclose (file); +#ifdef HAVE_GNOME_VFS if (model->priv->monitor == NULL) { +#endif /* since monitoring isn't working, at least give a * local notification */ egg_recent_model_changed (model); +#ifdef HAVE_GNOME_VFS } +#endif return ret; } @@ -1398,12 +1481,16 @@ g_hash_table_remove (model->priv->monitors, uri); +#ifdef HAVE_GNOME_VFS if (model->priv->monitor == NULL && ret) { +#endif /* since monitoring isn't working, at least give a * local notification */ egg_recent_model_changed (model); +#ifdef HAVE_GNOME_VFS } +#endif return ret; } diff -buNr planner-0.13/libegg/recent-files/egg-recent-util.c planner-0.13-new/libegg/recent-files/egg-recent-util.c --- planner-0.13/libegg/recent-files/egg-recent-util.c Sun Oct 3 05:32:15 2004 +++ planner-0.13-new/libegg/recent-files/egg-recent-util.c Tue Mar 29 10:35:51 2005 @@ -12,6 +12,10 @@ #include #include "egg-recent-util.h" +#ifdef WIN32 +#include +#endif + #define EGG_RECENT_UTIL_HOSTNAME_SIZE 512 /* ripped out of gedit2 */ diff -buNr planner-0.13/libegg/recent-files/egg-recent-view-uimanager.c planner-0.13-new/libegg/recent-files/egg-recent-view-uimanager.c --- planner-0.13/libegg/recent-files/egg-recent-view-uimanager.c Sat Feb 19 07:46:21 2005 +++ planner-0.13-new/libegg/recent-files/egg-recent-view-uimanager.c Tue Mar 22 00:54:43 2005 @@ -28,11 +28,15 @@ #include #include #include +#ifdef HAVE_GNOME_VFS #include +#endif #ifndef USE_STABLE_LIBGNOMEUI #include #endif +#ifdef HAVE_GCONF #include +#endif #include "egg-recent-model.h" #include "egg-recent-view.h" #include "egg-recent-view-uimanager.h" @@ -69,7 +73,9 @@ gpointer tooltip_func_data; EggRecentModel *model; +#ifdef HAVE_GCONF GConfClient *client; +#endif GtkIconSize icon_size; GList *item_list; @@ -397,10 +403,12 @@ } #endif +#ifdef HAVE_GCONF if (view->client != NULL) { g_object_unref (view->client); view->client = NULL; } +#endif } static void @@ -463,6 +471,7 @@ iface->do_set_model = egg_recent_view_uimanager_set_model; } +#ifdef HAVE_GCONF static void show_menus_changed_cb (GConfClient *client, guint cnxn_id, @@ -476,6 +485,7 @@ egg_recent_view_uimanager_show_icons (view, gconf_value_get_bool (value)); } +#endif #ifndef USE_STABLE_LIBGNOMEUI static void @@ -490,6 +500,7 @@ static void egg_recent_view_uimanager_init (EggRecentViewUIManager * view) { +#ifdef HAVE_GCONF view->client = gconf_client_get_default (); view->show_icons = gconf_client_get_bool (view->client, @@ -503,7 +514,7 @@ "/desktop/gnome/interface/menus_have_icons", (GConfClientNotifyFunc)show_menus_changed_cb, view, NULL, NULL); - +#endif view->leading_sep = FALSE; view->trailing_sep = FALSE; diff -buNr planner-0.13/libplanner/Makefile.win32 planner-0.13-new/libplanner/Makefile.win32 --- planner-0.13/libplanner/Makefile.win32 Wed Dec 31 19:00:00 1969 +++ planner-0.13-new/libplanner/Makefile.win32 Tue Mar 29 11:07:39 2005 @@ -0,0 +1,143 @@ +# +# Makefile.win32 +# + +# +# PATHS +# + +# Compiler Options + +DLL_LD_FLAGS += -Wl,--enable-auto-image-base + +CFLAGS = -mms-bitfields -mno-cygwin -I.. `pkg-config --cflags gtk+-2.0` -I/usr/include -I/home/fmoraes/dev/include + +libdir=lib +datadir=share + +DEFINES = -DWIN32 \ + -DWIN32_LEAN_AND_MEAN \ + -DMRP_STORAGEMODULEDIR=\""$(libdir)/planner/storage-modules"\" \ + -DMRP_FILE_MODULES_DIR=\""$(libdir)/planner/file-modules"\" \ + -DDATADIR=\""$(datadir)"\" \ + -DDTDDIR=\""$(datadir)/planner/dtd"\" \ + -DSTYLESHEETDIR=\""$(datadir)/planner/stylesheets"\" + +C_SRC = \ + mrp-marshal-main.c \ + mrp-application.c \ + mrp-assignment.c \ + mrp-calendar.c \ + mrp-day.c \ + mrp-group.c \ + mrp-object.c \ + mrp-file-module.c \ + mrp-project.c \ + mrp-resource.c \ + mrp-storage-module.c \ + mrp-storage-module-factory.c \ + mrp-task-manager.c \ + mrp-task.c \ + mrp-relation.c \ + mrp-types.c \ + mrp-property.c \ + mrp-time.c \ + mrp-error.c + +libstorage_mrproject_1_la_SOURCES = \ + mrp-storage-mrproject.c \ + mrp-parser.c + +libstorage_mrproject_1_la_CFLAGS = `pkg-config --cflags libxml-2.0` + +libstorage_mrproject_1_la_LDFLAGS = -avoid-version -module `pkg-config --libs libxml-2.0` -lplanner-1 -L. + +libmrp_xml_la_SOURCES = \ + mrp-xml.c \ + mrp-old-xml.c + +libmrp_xml_la_CFLAGS = +libmrp_xml_la_LDFLAGS = -avoid-version -module `pkg-config --libs libxml-2.0` -lplanner-1 -L. + +libmrp_xsl_la_SOURCES = \ + mrp-xsl.c + +libmrp_xsl_la_CFLAGS = \ + `pkg-config --cflags libxslt` + +libmrp_xsl_la_LIBADD = `pkg-config --libs libxslt` +libmrp_xsl_la_LDFLAGS = -avoid-version -module `pkg-config --libs libexslt` -lplanner-1 -L. + +OBJECTS_XSL = $(libmrp_xsl_la_SOURCES:%.c=%.o) + +OBJECTS_STORAGE = $(libstorage_mrproject_1_la_SOURCES:%.c=%.o) + +OBJECTS_FILE = $(libmrp_xml_la_SOURCES:%.c=%.o) + +OBJECTS = $(C_SRC:%.c=%.o) + + +## +## LIBRARIES +## + +LIBS = `pkg-config --libs gtk+-2.0` + +## +## RULES +## + +# How to make a C file + +%.o: %.c + $(CC) $(CFLAGS) $(libstorage_mrproject_1_la_CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $< + +## +## TARGET DEFINITIONS +## + +.PHONY: all clean + +all: ../config.h libplanner-1.dll libstorage-mrproject-1.dll libmrp-xml.dll libmrp-xsl.dll + +mrp-marshal.h: mrp-marshal.list + glib-genmarshal --prefix=mrp_marshal mrp-marshal.list --header > xgen-gmh \ + && (cmp -s xgen-gmh mrp-marshal.h || cp xgen-gmh mrp-marshal.h) \ + && rm -f xgen-gmh xgen-gmh~ + +mrp-marshal.c: mrp-marshal.list + glib-genmarshal --prefix=mrp_marshal mrp-marshal.list --body > xgen-gmc \ + && cp xgen-gmc mrp-marshal.c \ + && rm -f xgen-gmc xgen-gmc~ + +mrp-marshal-main.c: mrp-marshal.c mrp-marshal.h + +../config.h: ../config.h.win32 + cp ../config.h.win32 ../config.h + +## +## BUILD DLL +## + +libplanner-1.dll: $(OBJECTS) + $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) --out-implib,libplanner-1.lib -Wl,-Map -Wl,libplanner-1.map -Wl,--cref -o libplanner-1.dll + +libstorage-mrproject-1.dll: $(OBJECTS_STORAGE) + $(CC) -shared $(OBJECTS_STORAGE) $(LIB_PATHS) $(LIBS) $(libstorage_mrproject_1_la_LDFLAGS) $(DLL_LD_FLAGS) -Wl,-Map -Wl,libstorage-mrproject-1.map -Wl,--cref -o libstorage-mrproject-1.dll + +libmrp-xml.dll: $(OBJECTS_FILE) + $(CC) -shared $(OBJECTS_FILE) $(LIB_PATHS) $(LIBS) $(libmrp_xml_la_LDFLAGS) $(DLL_LD_FLAGS) -Wl,-Map -Wl,libmrp-xml.map -Wl,--cref -o libmrp-xml.dll + +libmrp-xsl.dll: $(OBJECTS_XSL) + $(CC) -shared $(OBJECTS_XSL) $(LIB_PATHS) $(LIBS) $(libmrp_xsl_la_LDFLAGS) $(DLL_LD_FLAGS) -Wl,-Map -Wl,libmrp-xsl.map -Wl,--cref -o libmrp-xsl.dll + +## +## CLEAN RULES +## + +clean: + rm -f *.o + rm -f *.dll + rm -f *.map + rm -f mrp-marshal.c mrp-marshal.h + rm -f *.lib diff -buNr planner-0.13/libplanner/mrp-project.c planner-0.13-new/libplanner/mrp-project.c --- planner-0.13/libplanner/mrp-project.c Sat Feb 19 19:15:43 2005 +++ planner-0.13-new/libplanner/mrp-project.c Mon Mar 28 13:20:44 2005 @@ -743,9 +743,13 @@ mrp_task_manager_set_block_scheduling (priv->task_manager, FALSE); imrp_project_set_needs_saving (project, FALSE); + g_free (file_str); + return TRUE; } } + + g_free (file_str); mrp_task_manager_set_block_scheduling (priv->task_manager, FALSE); diff -buNr planner-0.13/libplanner/mrp-time.c planner-0.13-new/libplanner/mrp-time.c --- planner-0.13/libplanner/mrp-time.c Sun Feb 20 13:23:29 2005 +++ planner-0.13-new/libplanner/mrp-time.c Tue Mar 29 10:55:56 2005 @@ -26,7 +26,11 @@ #include #include #include +#ifndef WIN32 #include +#else +#include +#endif #include "mrp-time.h" #include "mrp-types.h" #include @@ -35,6 +39,7 @@ static const gchar *short_month_names[12]; static const gchar *month_names[12]; + static const gchar *month_names_initial[12]; static const gchar *short_day_names[7]; static const gchar *day_names[7]; @@ -188,7 +193,11 @@ putenv (tmp); g_free (tmp); } else { - unsetenv ("TZ"); +#ifdef WIN32 + putenv ("TZ="); +#else + unsetenv("TZ"); +#endif } g_free (old_tz); @@ -407,7 +416,11 @@ tm = mrp_time_to_tm (t); +#ifdef WIN32 + strftime (str, sizeof (str), "%U", tm); +#else strftime (str, sizeof (str), "%V", tm); +#endif return atoi (str); } @@ -717,9 +730,9 @@ imrp_time_init (void) { gint i; - /* Get month and day names. */ +#ifndef WIN32 for (i = 0; i < 12; i++) { gunichar c; @@ -741,6 +754,77 @@ day_names[i] = g_locale_to_utf8 (nl_langinfo (DAY_1 + i), -1, NULL, NULL, NULL); } +#else + for (i = 0; i < 12; i++) { + gunichar c; + int len; + gchar *buffer; + + len = GetLocaleInfo(LOCALE_USER_DEFAULT, + LOCALE_SABBREVMONTHNAME1+i, + NULL, + 0); + buffer = g_malloc(len); + + GetLocaleInfo(LOCALE_USER_DEFAULT, + LOCALE_SABBREVMONTHNAME1+i, + buffer, + len); + short_month_names[i] = g_locale_to_utf8(buffer, -1, NULL, NULL, + NULL); + + len = GetLocaleInfo(LOCALE_USER_DEFAULT, + LOCALE_SMONTHNAME1+i, + NULL, + 0); + buffer = g_realloc(buffer, len); + + GetLocaleInfo(LOCALE_USER_DEFAULT, + LOCALE_SMONTHNAME1+i, + buffer, + len); + month_names[i] = g_locale_to_utf8(buffer, -1, NULL, NULL, + NULL); + g_free(buffer); + + c = g_utf8_get_char (month_names[i]); + month_names_initial[i] = g_malloc0 (7); + g_unichar_to_utf8 (c, (char *)month_names_initial[i]); + + } + + for (i = 0; i < 7; i++) { + int len; + gchar *buffer; + + len = GetLocaleInfo(LOCALE_USER_DEFAULT, + LOCALE_SABBREVDAYNAME1+i, + NULL, + 0); + buffer = g_malloc(len); + + GetLocaleInfo(LOCALE_USER_DEFAULT, + LOCALE_SABBREVDAYNAME1+i, + buffer, + len); + short_day_names[i] = g_locale_to_utf8(buffer, -1, NULL, NULL, + NULL); + + len = GetLocaleInfo(LOCALE_USER_DEFAULT, + LOCALE_SDAYNAME1+i, + NULL, + 0); + buffer = g_realloc(buffer, len); + + GetLocaleInfo(LOCALE_USER_DEFAULT, + LOCALE_SABBREVDAYNAME1+i, + buffer, + len); + day_names[i] = g_locale_to_utf8(buffer, -1, NULL, NULL, + NULL); + g_free(buffer); + } +#endif } static gint diff -buNr planner-0.13/libplanner/mrp-xsl.c planner-0.13-new/libplanner/mrp-xsl.c --- planner-0.13/libplanner/mrp-xsl.c Sun Feb 13 04:38:04 2005 +++ planner-0.13-new/libplanner/mrp-xsl.c Tue Mar 29 13:00:15 2005 @@ -25,7 +25,9 @@ #include #include #include +#ifdef HAVE_GNOME_VFS #include +#endif #include #include #include @@ -60,11 +62,15 @@ xsltStylesheet *stylesheet; xmlDoc *doc; xmlDoc *final_doc; - GnomeVFSHandle *handle; xmlChar *buffer; gint len; +#ifdef HAVE_GNOME_VFS + GnomeVFSHandle *handle; GnomeVFSResult result; +#endif gboolean ret; + FILE *file; + gint length; if (!mrp_project_save_to_xml (project, &xml_project, error)) { return FALSE; @@ -85,7 +91,8 @@ ret = TRUE; if (final_doc && - xsltSaveResultToString (&buffer, &len, final_doc, stylesheet) != -1) { + xsltSaveResultToString (&buffer, &length, final_doc, stylesheet) != -1) { +#ifndef WIN32 result = gnome_vfs_create (&handle, uri, GNOME_VFS_OPEN_WRITE, FALSE, 0644); @@ -99,6 +106,40 @@ gnome_vfs_result_to_string (result)); ret = FALSE; } +#else + len = strlen (uri); + + /* Get a local file from the uri. */ + if (len > 3 && !strstr (uri, ":/")) { + /* No protocol. */ + } else { + if (len > 7 && !strncmp (uri, "file:/", 6)) { + /* Naively strip method. */ + uri = uri + 7; + } else { + g_set_error (error, + MRP_ERROR, + MRP_ERROR_INVALID_URI, + _("Invalid URI: '%s'"), + uri); + + return FALSE; + } + } + + file = fopen(uri, "w"); + + if(file) { + fwrite(buffer, 1, length, file); + fclose(file); + } else { + g_set_error (error, + MRP_ERROR, + MRP_ERROR_EXPORT_FAILED, + "Failed to create file"); + ret = FALSE; + } +#endif xmlFree (buffer); } else { @@ -127,11 +168,15 @@ xsltStylesheet *stylesheet; xmlDoc *doc; xmlDoc *final_doc; - GnomeVFSHandle *handle; xmlChar *buffer; gint len; +#ifdef HAVE_GNOME_VFS GnomeVFSResult result; + GnomeVFSHandle *handle; +#endif gboolean ret; + gint length; + FILE *file; if (!mrp_project_save_to_xml (project, &xml_project, error)) { return FALSE; @@ -150,7 +195,8 @@ ret = TRUE; - if (xsltSaveResultToString (&buffer, &len, final_doc, stylesheet) != -1) { + if (xsltSaveResultToString (&buffer, &length, final_doc, stylesheet) != -1) { +#ifndef WIN32 result = gnome_vfs_create (&handle, uri, GNOME_VFS_OPEN_WRITE, FALSE, 0644); @@ -164,6 +210,40 @@ gnome_vfs_result_to_string (result)); ret = FALSE; } +#else + len = strlen (uri); + + /* Get a local file from the uri. */ + if (len > 3 && !strstr (uri, ":/")) { + /* No protocol. */ + } else { + if (len > 7 && !strncmp (uri, "file:/", 6)) { + /* Naively strip method. */ + uri = uri + 7; + } else { + g_set_error (error, + MRP_ERROR, + MRP_ERROR_INVALID_URI, + _("Invalid URI: '%s'"), + uri); + + return FALSE; + } + } + + file = fopen(uri, "w"); + + if(file) { + fwrite(buffer, 1, length, file); + fclose(file); + } else { + g_set_error (error, + MRP_ERROR, + MRP_ERROR_EXPORT_FAILED, + "Failed to create file"); + ret = FALSE; + } +#endif xmlFree (buffer); } else { diff -buNr planner-0.13/src/Makefile.win32 planner-0.13-new/src/Makefile.win32 --- planner-0.13/src/Makefile.win32 Wed Dec 31 19:00:00 1969 +++ planner-0.13-new/src/Makefile.win32 Fri Apr 1 22:21:22 2005 @@ -0,0 +1,252 @@ +# +# Makefile.win32 +# + +# +# PATHS +# + +# Compiler Options + +DLL_LD_FLAGS += -mms-bitfields -mno-cygwin -Wl,--enable-auto-image-base --no-undefined -Wl,--export-all -mwin32 + +CFLAGS = -mms-bitfields -mno-cygwin -I.. `pkg-config --cflags libgnomecanvas-2.0,libglade-2.0,libgnomeprint-2.2,libgnomeprintui-2.2` -I/usr/include -I../libplanner -I~/dev/include + +libdir=lib +datadir=share + +DEFINES = -DWIN32 \ + -DWIN32_LEAN_AND_MEAN \ + -DUSE_STABLE_LIBGNOMEUI \ + -DGLADEDIR=\""$(datadir)/planner/glade"\" \ + -DVIEWDIR=\""$(libdir)/planner/views"\" \ + -DDATADIR=\""$(datadir)"\" \ + -DIMAGEDIR=\""$(datadir)/pixmaps/planner"\" \ + -DSTYLESHEETDIR=\""$(datadir)/planner/stylesheets"\" \ + -DDTDDIR=\""$(datadir)/planner/dtd"\" \ + -DPLUGINDIR=\""$(libdir)/planner/plugins"\" + +C_SRC = \ + eel-canvas-rect.c \ + planner-application.c \ + planner-assignment-model.c \ + planner-calendar.c \ + planner-calendar-dialog.c \ + planner-calendar-selector.c \ + planner-canvas-line.c \ + planner-cell-renderer-date.c \ + planner-cell-renderer-list.c \ + planner-cell-renderer-popup.c \ + planner-cmd-manager.c \ + planner-conf-win32.c \ + planner-day-type-dialog.c \ + planner-default-week-dialog.c \ + planner-format.c \ + planner-group-dialog.c \ + planner-group-model.c \ + planner-list-model.c \ + planner-main.c \ + planner-phase-dialog.c \ + planner-plugin.c \ + planner-plugin-loader.c \ + planner-popup-button.c \ + planner-popup-entry.c \ + planner-predecessor-model.c \ + planner-print-dialog.c \ + planner-print-job.c \ + planner-project-properties.c \ + planner-property-dialog.c \ + planner-property-model.c \ + planner-resource-cmd.c \ + planner-resource-dialog.c \ + planner-resource-input-dialog.c \ + planner-scale-utils.c \ + planner-sidebar.c \ + planner-table-print-sheet.c \ + planner-task-cmd.c \ + planner-task-date-widget.c \ + planner-task-dialog.c \ + planner-task-input-dialog.c \ + planner-view.c \ + planner-view-loader.c \ + planner-window.c \ + planner-working-time-dialog.c + +RC = planner.rc + + +libutil_la_SOURCES = planner-marshal-main.c + +libresource_view_la_SOURCES = \ + planner-resource-view.c + +libresource_view_la_LDFLAGS = -avoid-version -module + +libgantt_view_la_SOURCES = \ + planner-relation-arrow.c \ + planner-gantt-chart.c \ + planner-gantt-print.c \ + planner-gantt-row.c \ + planner-gantt-view.c + + +libtask_view_la_SOURCES = \ + planner-task-view.c + +libtask_view_la_LDFLAGS = -avoid-version -module +libtask_view_la_LIBADD = libgantt-task.la + +libgantt_view_la_LDFLAGS = -avoid-version -module +libgantt_view_la_LIBADD = libgantt-task.la + +libtimetable_view_la_SOURCES = \ + planner-ttable-view.c \ + planner-ttable-chart.c \ + planner-ttable-model.c \ + planner-ttable-print.c \ + planner-ttable-row.c \ + planner-ttable-tree.c + + +libtimetable_view_la_LDFLAGS = -avoid-version -module +libtimetable_view_la_LIBADD = libgantt-task.la + +libgantt_task_la_LIBADD = libutil.la +libgantt_task_la_LDFLAGS = -avoid-version + +libgantt_task_la_SOURCES = \ + planner-gantt-background.c \ + planner-gantt-header.c \ + planner-gantt-model.c \ + planner-task-tree.c \ + planner-task-popup.c + +libhtml_plugin_la_SOURCES = planner-html-plugin.c +libhtml_plugin_la_LDFLAGS = -avoid-version -module + +libxmlplanner_plugin_la_SOURCES = planner-xml-planner-plugin.c +libxmlplanner_plugin_la_LDFLAGS = -avoid-version -module + +libmsp_plugin_la_SOURCES = planner-msp-plugin.c +libmsp_plugin_la_LDFLAGS = -avoid-version -module `pkg-config --libs libxml-2.0,libexslt` + +OBJECTS = $(C_SRC:%.c=%.o) $(RC:%.rc=%.o) + +OBJECTS_libutil_la = $(libutil_la_SOURCES:%.c=%.o) + +OBJECTS_libresource_view_la = $(libresource_view_la_SOURCES:%.c=%.o) + +OBJECTS_libgantt_view_la = $(libgantt_view_la_SOURCES:%.c=%.o) + +OBJECTS_libgantt_task_la = $(libgantt_task_la_SOURCES:%.c=%.o) + +OBJECTS_libtask_view_la = $(libtask_view_la_SOURCES:%.c=%.o) + +OBJECTS_libtimetable_view_la = $(libtimetable_view_la_SOURCES:%.c=%.o) + +OBJECTS_libhtml_plugin_la = $(libhtml_plugin_la_SOURCES:%.c=%.o) + +OBJECTS_libxmlplanner_plugin_la = $(libxmlplanner_plugin_la_SOURCES:%.c=%.o) + +OBJECTS_libmsp_plugin_la = $(libmsp_plugin_la_SOURCES:%.c=%.o) + +## +## LIBRARIES +## + +LIBS = `pkg-config --libs libgnomecanvas-2.0,libglade-2.0,libgnomeprint-2.2,libgnomeprintui-2.2` -lplanner-1 -L../libplanner -lpopt + +## +## RULES +## + +# How to make a C file + +%.o: %.c + $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $< + +%.o: %.rc + windres -i $< -o $@ + +## +## TARGET DEFINITIONS +## + +.PHONY: all clean + +all: \ + ../config.h \ + planner-marshal.h \ + planner.exe \ + libresource-view.dll \ + libgantt-task.dll \ + libgantt-view.dll \ + libtask-view.dll \ + libtimetable-view.dll \ + libxmlplanner-plugin.dll \ + libmsp-plugin.dll \ + libhtml-plugin.dll + +planner-marshal.h: planner-marshal.list + glib-genmarshal --prefix=planner_marshal planner-marshal.list --header > xgen-gmh \ + && (cmp -s xgen-gmh planner-marshal.h || cp xgen-gmh planner-marshal.h) \ + && rm -f xgen-gmh xgen-gmh~ + +planner-marshal.c: planner-marshal.list + glib-genmarshal --prefix=planner_marshal planner-marshal.list --body > xgen-gmc \ + && cp xgen-gmc planner-marshal.c \ + && rm -f xgen-gmc xgen-gmc~ + +planner-marshal-main.c: planner-marshal.c planner-marshal.h + +../config.h: ../config.h.win32 + cp ../config.h.win32 ../config.h + +## +## BUILD EXE +## + +planner.exe: libutil.a $(OBJECTS) + $(CC) $(OBJECTS) $(OBJECTS_libutil_la) $(LIB_PATHS) $(LIBS) -mwindows -leggrecent -L../libegg/recent-files -Wl,-Map -Wl,planner.map -Wl,--cref --no-undefined -export-all -Wl,--output-def -Wl,planner.def -Wl,--out-implib=planner.a -o planner.exe + +libutil.a: $(OBJECTS_libutil_la) + $(AR) r libutil.a $(OBJECTS_libutil_la) + +libgantt-task.dll: $(OBJECTS_libgantt_task_la) + $(CC) -shared $(OBJECTS_libgantt_task_la) planner.a libutil.a $(LIB_PATHS) $(LIBS) $(libgantt_task_la_LDFLAGS) $(DLL_LD_FLAGS) -Wl,-Map -Wl,libgantt-task.map -Wl,--cref --no-undefined -export-all -Wl,--out-implib=libgantt-task.a -o libgantt-task.dll + +libresource-view.dll: libutil.a $(OBJECTS_libresource_view_la) + $(CC) -shared $(OBJECTS_libresource_view_la) planner.a libutil.a $(LIB_PATHS) $(LIBS) $(libresource_view_la_LDFLAGS) $(DLL_LD_FLAGS) -Wl,-Map -Wl,libresource-view.map -Wl,--cref -o libresource-view.dll + +libgantt-view.dll: libutil.a libgantt-task.a $(OBJECTS_libgantt_view_la) + $(CC) -shared $(OBJECTS_libgantt_view_la) planner.a libutil.a libgantt-task.a $(LIB_PATHS) $(LIBS) $(libgantt_view_la_LDFLAGS) $(DLL_LD_FLAGS) -Wl,-Map -Wl,libgantt-view.map -Wl,--cref -o libgantt-view.dll + +libtask-view.dll: libutil.a libgantt-task.a $(OBJECTS_libtask_view_la) + $(CC) -shared $(OBJECTS_libtask_view_la) planner.a libutil.a libgantt-task.a $(LIB_PATHS) $(LIBS) $(libtask_view_la_LDFLAGS) $(DLL_LD_FLAGS) -Wl,-Map -Wl,libtask-view.map -Wl,--cref -o libtask-view.dll + +libtimetable-view.dll: libutil.a libgantt-task.a $(OBJECTS_libtimetable_view_la) + $(CC) -shared $(OBJECTS_libtimetable_view_la) planner.a libutil.a libgantt-task.a $(LIB_PATHS) $(LIBS) $(libtimetable_view_la_LDFLAGS) $(DLL_LD_FLAGS) -Wl,-Map -Wl,libtimetable-view.map -Wl,--cref -o libtimetable-view.dll + +libhtml-plugin.dll: $(OBJECTS_libhtml_plugin_la) + $(CC) -shared $(OBJECTS_libhtml_plugin_la) planner.a $(LIB_PATHS) $(LIBS) $(libhtml_plugin_la_LDFLAGS) $(DLL_LD_FLAGS) -Wl,-Map -Wl,libhtml-plugin.map -Wl,--cref -o libhtml-plugin.dll + +libxmlplanner-plugin.dll: $(OBJECTS_libxmlplanner_plugin_la) + $(CC) -shared $(OBJECTS_libxmlplanner_plugin_la) planner.a $(LIB_PATHS) $(LIBS) $(libxmlplanner_plugin_la_LDFLAGS) $(DLL_LD_FLAGS) -Wl,-Map -Wl,libxmlplanner-plugin.map -Wl,--cref -o libxmlplanner-plugin.dll + +libmsp-plugin.dll: $(OBJECTS_libmsp_plugin_la) + $(CC) -shared $(OBJECTS_libmsp_plugin_la) planner.a $(LIB_PATHS) $(LIBS) $(libmsp_plugin_la_LDFLAGS) $(DLL_LD_FLAGS) -Wl,-Map -Wl,libmsp-plugin.map -Wl,--cref -o libmsp-plugin.dll + +## +## CLEAN RULES +## + +clean: + rm -f *.o + rm -f planner.exe + rm -f planner-marshal.c planner-marshal.h + rm -f *.dll + rm -f *.lib + rm -f *.map + rm -f *.a + rm -f *.def + diff -buNr planner-0.13/src/eel-canvas-rect.c planner-0.13-new/src/eel-canvas-rect.c --- planner-0.13/src/eel-canvas-rect.c Sun Aug 15 07:13:12 2004 +++ planner-0.13-new/src/eel-canvas-rect.c Tue Mar 29 10:38:10 2005 @@ -30,7 +30,9 @@ #include #include +#ifndef WIN32 #include +#endif /* FIXME: check for this in configure and use it. */ #ifdef HAVE_RENDER diff -buNr planner-0.13/src/planner-conf-win32.c planner-0.13-new/src/planner-conf-win32.c --- planner-0.13/src/planner-conf-win32.c Wed Dec 31 19:00:00 1969 +++ planner-0.13-new/src/planner-conf-win32.c Tue Mar 29 23:20:45 2005 @@ -0,0 +1,174 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 2004 Jani Tiainen + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include + +#include "planner-conf.h" + +#define WIN32_KEYNAME "Software\\Planner" + +#include + +gboolean +planner_conf_dir_exists (const gchar *dir, GError **error) +{ + gboolean ret_val; + HKEY hKey; + + ret_val = RegOpenKeyEx(HKEY_CURRENT_USER, WIN32_KEYNAME, 0, KEY_READ, &hKey); + RegCloseKey(hKey); + + return ret_val == ERROR_SUCCESS; +} + +static gboolean planner_conf_create() +{ + gboolean ret_val; + DWORD disp = 0; + HKEY hKey; + + ret_val = RegOpenKeyEx(HKEY_CURRENT_USER, WIN32_KEYNAME, 0, KEY_READ, &hKey); + RegCloseKey(hKey); + if(ret_val == ERROR_SUCCESS) + return TRUE; + + ret_val = RegCreateKeyEx(HKEY_CURRENT_USER, WIN32_KEYNAME, 0, "", + REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, + &hKey, + &disp); + RegCloseKey(hKey); + + return ret_val == ERROR_SUCCESS; +} + +gboolean +planner_conf_get_bool (const gchar *key, GError **error) +{ + gboolean ret_val = FALSE; + gchar *keyBuffer; + glong keyLen; + HKEY hKey; + + RegOpenKeyEx(HKEY_CURRENT_USER, WIN32_KEYNAME, 0, KEY_READ, &hKey); + if (RegQueryValueEx(hKey, key, 0, NULL, NULL, &keyLen) == ERROR_SUCCESS) { + keyBuffer = g_malloc(keyLen + 1); + RegQueryValueEx(hKey, key, 0, NULL, keyBuffer, &keyLen); + RegCloseKey(hKey); + + ret_val = g_ascii_strncasecmp(keyBuffer, "TRUE", 4) == 0 ? TRUE : FALSE; + g_free(keyBuffer); + } + + return ret_val; +} + +gchar * +planner_conf_get_string (const gchar *key, GError **error) +{ + gchar *keyBuffer; + glong keyLen; + HKEY hKey; + + RegOpenKeyEx(HKEY_CURRENT_USER, WIN32_KEYNAME, 0, KEY_READ, &hKey); + RegQueryValueEx(hKey, key, 0, NULL, NULL, &keyLen); + keyBuffer = g_malloc(keyLen + 1); + RegQueryValueEx(hKey, key, 0, NULL, keyBuffer, &keyLen); + RegCloseKey(hKey); + + return keyBuffer; +} + +gint +planner_conf_get_int (const gchar *key, GError **error) +{ + gint ret_val = 0; + gchar *keyBuffer; + glong keyLen; + HKEY hKey; + + RegOpenKeyEx(HKEY_CURRENT_USER, WIN32_KEYNAME, 0, KEY_READ, &hKey); + RegQueryValueEx(hKey, key, 0, NULL, NULL, &keyLen); + keyBuffer = g_malloc(keyLen + 1); + RegQueryValueEx(hKey, key, 0, NULL, keyBuffer, &keyLen); + + ret_val = g_ascii_strtoull(keyBuffer, NULL, 10); + + g_free(keyBuffer); + + RegCloseKey(hKey); + + return ret_val; +} + +gboolean +planner_conf_set_bool (const gchar *key, gboolean value, GError **error) +{ + gboolean ret_val = 0; + + gchar keyBuffer[10]; + gint keyType = REG_SZ; + HKEY hKey; + g_return_if_fail(planner_conf_create()); + RegOpenKeyEx(HKEY_CURRENT_USER, WIN32_KEYNAME, 0, KEY_WRITE, &hKey); + + g_stpcpy(keyBuffer, value == TRUE ? "TRUE" : "FALSE"); + ret_val = RegSetValueEx(hKey, key, 0, keyType, keyBuffer, sizeof(keyBuffer)); + RegCloseKey(hKey); + + return ret_val; +} + +gboolean +planner_conf_set_string (const gchar *key, const gchar *value, GError **error) +{ + gboolean ret_val = 0; + + gint keyType = REG_SZ; + HKEY hKey; + g_return_if_fail(planner_conf_create()); + RegOpenKeyEx(HKEY_CURRENT_USER, WIN32_KEYNAME, 0, KEY_WRITE, &hKey); + + ret_val = RegSetValueEx(hKey, key, 0, keyType, value, strlen(value) + 1); + + RegCloseKey(hKey); + + return ret_val; +} + +gboolean +planner_conf_set_int (const gchar *key, gint value, GError **error) +{ + gboolean ret_val = 0; + gint keyType = REG_SZ; + gchar keyBuffer[20]; + HKEY hKey; + g_return_if_fail(planner_conf_create()); + RegOpenKeyEx(HKEY_CURRENT_USER, WIN32_KEYNAME, 0, KEY_WRITE, &hKey); + + g_snprintf(keyBuffer, sizeof(keyBuffer), "%d", value); + ret_val = RegSetValueEx(hKey, key, 0, keyType, keyBuffer, strlen(keyBuffer) + 1); + + RegCloseKey(hKey); + + + return ret_val; +} + diff -buNr planner-0.13/src/planner-html-plugin.c planner-0.13-new/src/planner-html-plugin.c --- planner-0.13/src/planner-html-plugin.c Fri Feb 25 18:00:20 2005 +++ planner-0.13-new/src/planner-html-plugin.c Tue Mar 29 13:04:41 2005 @@ -30,9 +30,14 @@ #include #include #include +#ifndef WIN32 #include #include #include +#else +#include +#include +#endif #include "planner-window.h" #include "planner-plugin.h" @@ -128,10 +133,17 @@ G_CALLBACK (html_plugin_server_toggled), user_data); +#ifndef WIN32 g_signal_connect (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (priv->local_fileentry)), "activate", G_CALLBACK (html_plugin_activated), ok_button); +#else + g_signal_connect (priv->local_fileentry, + "activate", + G_CALLBACK (html_plugin_activated), + ok_button); +#endif project = planner_window_get_project (priv->main_window); uri = mrp_project_get_uri (project); @@ -153,8 +165,13 @@ filename = g_strdup_printf ("%s.html", tmp); +#ifndef WIN32 gnome_file_entry_set_filename (GNOME_FILE_ENTRY (priv->local_fileentry), filename); +#else + gtk_entry_set_text (GTK_ENTRY (priv->local_fileentry), + filename); +#endif g_free (tmp); g_free (basename); @@ -169,6 +186,7 @@ static void show_url (PlannerPlugin *plugin, const char *url) { +#ifndef WIN32 GConfClient *gconf_client; gchar *cmd, *tmp; gchar *cmdline; @@ -196,6 +214,9 @@ g_free (cmdline); g_free (cmd); +#else + ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL); +#endif } static void @@ -212,7 +233,11 @@ view = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->browser_button)); if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->local_button))) { +#ifndef WIN32 path = gnome_file_entry_get_full_path (GNOME_FILE_ENTRY (priv->local_fileentry), FALSE); +#else + path = gtk_entry_get_text (GTK_ENTRY (priv->local_fileentry) ); +#endif if (!path || strlen (path) == 0) { return; @@ -255,8 +280,11 @@ } } else { GtkEntry *entry; - +#ifndef WIN32 entry = GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (priv->server_entry))); +#else + entry = GTK_ENTRY (priv->server_entry); +#endif path = gtk_entry_get_text (entry); if (strlen (path) > 0) { @@ -272,7 +300,11 @@ if (view) { gchar *url; +#ifdef HAVE_GNOME_VFS url = gnome_vfs_get_uri_from_local_path (path); +#else + url = g_filename_to_uri(path, NULL, NULL); +#endif show_url (plugin, url); g_free (url); diff -buNr planner-0.13/src/planner-main.c planner-0.13-new/src/planner-main.c --- planner-0.13/src/planner-main.c Sat Feb 19 19:15:43 2005 +++ planner-0.13-new/src/planner-main.c Tue Mar 29 10:41:25 2005 @@ -28,9 +28,13 @@ #include #include #include +#ifndef WIN32 #include #include #include +#else +#include +#endif #include "planner-application.h" #include "planner-window.h" @@ -41,7 +45,9 @@ main (int argc, char **argv) { GtkWidget *main_window; +#ifndef WIN32 GnomeProgram *program; +#endif gchar *geometry; poptContext popt_context; const gchar **args; @@ -49,6 +55,7 @@ struct poptOption options[] = { { "geometry", 'g', POPT_ARG_STRING, &geometry, 0, N_("Create the initial window with the given geometry."), N_("GEOMETRY") }, + POPT_AUTOHELP { NULL, '\0', 0, NULL, 0, NULL, NULL } }; @@ -58,6 +65,7 @@ geometry = NULL; +#ifndef WIN32 program = gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, argc, argv, @@ -70,6 +78,14 @@ GNOME_PARAM_POPT_CONTEXT, &popt_context, NULL); +#else + gtk_init(&argc, &argv); + + popt_context = poptGetContext(NULL, argc, (const char **)argv, options, 0); + + gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), + "share/icons"); +#endif /* Check for argument consistency. */ args = poptGetArgs (popt_context); diff -buNr planner-0.13/src/planner-print-dialog.c planner-0.13-new/src/planner-print-dialog.c --- planner-0.13/src/planner-print-dialog.c Sun Feb 20 16:39:23 2005 +++ planner-0.13-new/src/planner-print-dialog.c Wed Mar 23 14:41:43 2005 @@ -55,7 +55,7 @@ dir = g_build_filename (g_get_home_dir (), ".gnome2", NULL); if (!g_file_test (dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) { - if (mkdir (dir, 0755) != 0) { + if (g_mkdir (dir, 0755) != 0) { g_free (dir); return FALSE; } @@ -66,7 +66,7 @@ dir = g_build_filename (g_get_home_dir (), ".gnome2", "planner", NULL); if (!g_file_test (dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) { - if (mkdir (dir, 0755) != 0) { + if (g_mkdir (dir, 0755) != 0) { g_free (dir); return FALSE; } diff -buNr planner-0.13/src/planner-property-dialog.h planner-0.13-new/src/planner-property-dialog.h --- planner-0.13/src/planner-property-dialog.h Mon Jun 21 06:21:29 2004 +++ planner-0.13-new/src/planner-property-dialog.h Mon Mar 21 13:42:41 2005 @@ -24,7 +24,7 @@ #include #include -#include +#include "planner-window.h" GtkWidget *planner_property_dialog_new (PlannerWindow *main_window, MrpProject *project, diff -buNr planner-0.13/src/planner-window.c planner-0.13-new/src/planner-window.c --- planner-0.13/src/planner-window.c Wed Mar 2 13:18:58 2005 +++ planner-0.13-new/src/planner-window.c Tue Mar 29 10:53:59 2005 @@ -30,11 +30,18 @@ #include #include #include +#ifndef WIN32 #include +#else +#include +#include +#endif #include +#ifndef WIN32 #include #include #include +#endif #include #include #include @@ -83,7 +90,6 @@ GList *views; GList *plugins; GTimer *last_saved; - EggRecentViewUIManager *recent_view; }; @@ -295,8 +301,13 @@ { "HelpHelp", GTK_STOCK_HELP, N_("_User Guide"), "F1", N_("Show the Planner User Guide"), G_CALLBACK (window_help_cb) }, +#ifndef WIN32 { "HelpAbout", GNOME_STOCK_ABOUT, N_("_About"), NULL, N_("About this application"), +#else + { "HelpAbout", + GTK_STOCK_ABOUT, N_("_About"), NULL, N_("About this application"), +#endif G_CALLBACK (window_about_cb) }, }; @@ -362,6 +373,9 @@ DATADIR "/pixmaps/gnome-planner.png", NULL); + gtk_window_set_default_icon_from_file (DATADIR "/pixmaps/gnome-planner.png", + NULL); + /* Setup drag-n-drop. */ gtk_drag_dest_set (GTK_WIDGET (window), GTK_DEST_DEFAULT_ALL, @@ -507,7 +521,6 @@ g_object_set (gtk_action_group_get_action (priv->actions, "FileSave"), "sensitive", FALSE, NULL); - /* Handle recent file stuff. */ priv->recent_view = egg_recent_view_uimanager_new (priv->ui_manager, "/MenuBar/File/OpenRecent", @@ -1106,6 +1119,7 @@ window_help_cb (GtkAction *action, gpointer data) { +#ifndef WIN32 GError *error = NULL; GtkWidget *dialog; @@ -1122,15 +1136,35 @@ gtk_widget_destroy (dialog); g_error_free (error); } +#else + // should use HtmlHelp function, but it is not part of MSYS... + ShellExecute(NULL, "open", "planner.chm", + NULL, NULL, SW_SHOWNORMAL); +#endif } +#ifdef WIN32 +static void +about_url_hook (GtkAboutDialog *about, + const gchar *link, + gpointer data) +{ + ShellExecute(NULL, "open", link, + NULL, NULL, SW_SHOWNORMAL); +} +#endif + static void window_about_cb (GtkAction *action, gpointer data) { static GtkWidget *about; +#ifndef WIN32 GtkWidget *hbox; GtkWidget *href; +#else + gchar *license; +#endif const gchar *authors[] = { "Richard Hult ", @@ -1156,6 +1190,7 @@ return; } +#ifndef WIN32 about = gnome_about_new ("Imendio Planner", VERSION, "", /*"Copyright \xc2\xa9"*/ _("A Project Management application for the GNOME desktop"), @@ -1163,7 +1198,26 @@ documenters, strcmp (translator_credits, _("translator-credits")) != 0 ? _(translator_credits) : NULL, NULL); - +#else + gtk_about_dialog_set_url_hook (about_url_hook, NULL, NULL); + about = gtk_about_dialog_new (); + g_object_set(about, + "name", "Imendio Planner", + "version", VERSION, + "copyright", "", /*"Copyright \xc2\xa9"*/ + "comments", _("A Project Management application for the GNOME desktop"), + "authors", authors, + "documenters", documenters, + "translator-credits", strcmp (translator_credits, _("translator-credits")) != 0 ? _(translator_credits) : NULL, + "website", "http://www.imendio.com/projects/planner/", + "website-label", _("The Planner Homepage"), + "license", "", + NULL); + if (g_file_get_contents ("COPYING", &license, NULL, NULL)) { + gtk_about_dialog_set_license (GTK_ABOUT_DIALOG (about), license); + g_free (license); + } +#endif gtk_window_set_transient_for (GTK_WINDOW (about), GTK_WINDOW (data)); @@ -1173,12 +1227,14 @@ G_CALLBACK (gtk_widget_destroyed), &about); +#ifndef WIN32 hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (about)->vbox), hbox, FALSE, FALSE, 0); href = gnome_href_new ("http://www.imendio.com/projects/planner/", _("The Planner Homepage")); gtk_box_pack_start (GTK_BOX (hbox), href, TRUE, FALSE, 0); +#endif gtk_widget_show_all (about); } diff -buNr planner-0.13/src/planner.rc planner-0.13-new/src/planner.rc --- planner-0.13/src/planner.rc Wed Dec 31 19:00:00 1969 +++ planner-0.13-new/src/planner.rc Thu Mar 31 00:52:51 2005 @@ -0,0 +1,26 @@ +#define PLANNER_ICON 101 + +PLANNER_ICON ICON "../data/images/gnome-planner.ico" + +1 VERSIONINFO +FILEVERSION 0,13,0,0 +PRODUCTVERSION 0,13,0,0 +FILEFLAGSMASK 0x0000003FL +FILEFLAGS (0x00000008L|0x00000002L|0x00000001L) +FILEOS 0x00010001L +FILETYPE 0x00000001L +FILESUBTYPE 0x00000000L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "Imendio\0" + VALUE "FileDescription", "GNOME Planner for Windows\0" + VALUE "FileVersion", "0.13\0" + VALUE "InternalName", "PLANNER" "\0" + VALUE "ProductName", "GNOME Planner\0" + VALUE "ProuctVersion", "0.13\0" + END + END +END