aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/menus
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-04-29 22:18:18 +0800
committerTor Lillqvist <tml@src.gnome.org>2005-04-29 22:18:18 +0800
commit2decafb54490e7d5b1c796e5028d271d0fcce57a (patch)
tree91aca07ea71169cc88b85f09bd7f92e0966e2a46 /widgets/menus
parented13004c60129272797415da45cade65bdc859bc (diff)
downloadgsoc2013-evolution-2decafb54490e7d5b1c796e5028d271d0fcce57a.tar
gsoc2013-evolution-2decafb54490e7d5b1c796e5028d271d0fcce57a.tar.gz
gsoc2013-evolution-2decafb54490e7d5b1c796e5028d271d0fcce57a.tar.bz2
gsoc2013-evolution-2decafb54490e7d5b1c796e5028d271d0fcce57a.tar.lz
gsoc2013-evolution-2decafb54490e7d5b1c796e5028d271d0fcce57a.tar.xz
gsoc2013-evolution-2decafb54490e7d5b1c796e5028d271d0fcce57a.tar.zst
gsoc2013-evolution-2decafb54490e7d5b1c796e5028d271d0fcce57a.zip
Port to Windows, initial commit:
2005-04-29 Tor Lillqvist <tml@novell.com> Port to Windows, initial commit: * configure.in: Check for Win32, define Automake conditional OS_WIN32. Check for regexec() perhaps in separate -lregex, define REGEX_LIBS if so. Require glib-2.0 >= 2.6 (and thus also gtk+-2.0 >= 2.6) so that we can use the gstdio wrappers for full support of non-ASCII filenames on Win32. Don't use -D_REENTRANT on Win32, has ne special meaning. * gal.pc.in: Require gtk+-2.0 >= 2.6 also here for consistency. * gal-zip.in: New file, used to build zipfile format distribution of gal for Win32. * configure.in * Makefile.am: Add gal-zip(.in). * */Makefile.am * */*.c: Harmonize -I and #include conventions. (Of course, this hasn't anything to do with Windows porting as such, I just got carried away...) Use only -I$(top_srcdir). Use paths to gal headers staring with "gal", except for headers from the same directory as the .c file, which are included as such. Include all gal headers using doublequotes. Sort #includes and remove duplicates and obvious redundancies. Include config.h first without any HAVE_CONFIG_H, then system headers, then other GNOME lib headers, than gal's own headers. Just include gtk.h instead of separate gtk*.h headers. Don't include gi18n.h, include e-i18n.h to use e_gettext() consistently. * gal/Makefile.am: Use -no-undefined on Win32 so that libtool agrees to build a shared library. Because of the bidirectional dependency between libgal and libgal-a11y we can build libgal-a11y sanely as a shared library on Win32, so we don't install any separate libgal-a11y at all. So, on Win32, link the stuff that goes into libgal-a11y also into libgal. Link with REGEX_LIBS. * gal/a11y/Makefile.am: See above. Just build a dummy static libgal-a11y on Win32 (can't convince Automake not to build the library at all on one platform using Automake ifdef, apparently). Then (this is a gross hack) explicitly remove the library after installation in the install-data-local rule. * gal/e-table/Makefile.am * gal/e-table/e-table-config.c: Rename ETABLE_GLADEDIR to GAL_GLADEDIR for consistency. * gal/e-table/e-cell-date.c: No localtime_r() in Microsoft's C library, but its localtime() *is* thread-safe. * gal/e-table/e-cell-text.c * gal/e-table/e-cell-tree.c * gal/e-table/e-cell-vbox.c * gal/e-text/e-text.c * gal/widgets/e-unicode.c: Remove unnecessary inclusion of gdkx.h. * gal/e-table/e-cell-tree.c (ect_realize): Instead of the Xlib macro None (whose value is zero), use the corresponding zero-valued enums from the appropriate GDK type. * gal/e-table/e-table-config.c * gal/e-table/e-table-field-chooser.c * gal/menus/gal-define-views-dialog.c * gal/menus/gal-view-instance-save-as-dialog.c * gal/menus/gal-view-new-dialog.c * gal/widgets/e-categories-master-list-array.c * gal/widgets/e-categories-master-list-dialog.c * gal/widgets/e-categories.c: Use g_build_filename() to construct pathnames at run-time instead of compile-time. On Windows the macros GAL_GLADEDIR and GAL_IMAGESDIR expand to function calls, in order to support installing in a freely chosen location. * gal/e-table/e-table-item.c * gal/e-table/e-cell-vbox.c: Instrad of the Xlib GrabSuccess, use GDK_GRAB_SUCCESS (which has the same value). * gal/e-table/e-table-specification.c (e_table_specification_load_from_file) * gal/e-table/e-table.c (e_table_load_specification) * gal/e-table/e-tree-table-adapter.c (open_file) * gal/menus/gal-view-instance.c (load_current_view) * gal/menus/gal-view-instance.c (load_current_view): On Win32, convert filename to the locale character set before passing to xmlParseFile() which doesn't use UTF-8 filenames. Use gstdio wrappers. * gal/util/Makefile.am: Define GAL_PREFIX as $prefix. Define GAL_LOCALEDIR, GAL_GLADEDIR and GAL_IMAGESDIR also here for e-win32-reloc.c. Include e-win32-reloc.c on Win32. * gal/util/e-iconv.c (e_iconv_init): Use g_win32_getlocale() on Windows. * gal/util/e-util.c * gal/util/e-xml-utils.c: Use g_mkstemp() instead of non-portable mkstemp(). Use GLib pathname manipulation functions. Use gstdio wrappers. * gal/util/e-util-private.h: New file. Contains just Win32 bits for now that redefine the directory names from the Makefile as functions calls. * gal/util/e-win32-reloc.c: New file. Contains a minimal DllMain() and functions to support freely chosen installation location on Windows. * gal/util/e-xml-utils.c: No fsync() in the Microsoft C library. * gal/windgets/Makefile.am: Add -I$(top_srcdir)/gal for consistency with the sibling Makefile.am files. * gal/widgets/e-canvas.c: Instead of the Xlib AlreadyGrabbed, use GDK_GRAB_ALREADY_GRABBED. svn path=/trunk/; revision=29249
Diffstat (limited to 'widgets/menus')
-rw-r--r--widgets/menus/gal-define-views-dialog.c18
-rw-r--r--widgets/menus/gal-define-views-model.c7
-rw-r--r--widgets/menus/gal-view-collection.c24
-rw-r--r--widgets/menus/gal-view-etable.c4
-rw-r--r--widgets/menus/gal-view-factory-etable.c4
-rw-r--r--widgets/menus/gal-view-factory.c4
-rw-r--r--widgets/menus/gal-view-instance-save-as-dialog.c19
-rw-r--r--widgets/menus/gal-view-instance.c33
-rw-r--r--widgets/menus/gal-view-new-dialog.c21
-rw-r--r--widgets/menus/gal-view.c4
10 files changed, 93 insertions, 45 deletions
diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c
index a535c79601..43edcef690 100644
--- a/widgets/menus/gal-define-views-dialog.c
+++ b/widgets/menus/gal-define-views-dialog.c
@@ -23,14 +23,16 @@
#include <config.h>
-#include "gal-define-views-dialog.h"
-
#include <gtk/gtk.h>
+
+#include "gal/e-table/e-table-scrolled.h"
+#include "gal/util/e-i18n.h"
+#include "gal/util/e-util.h"
+#include "gal/util/e-util-private.h"
+
+#include "gal-define-views-dialog.h"
#include "gal-define-views-model.h"
#include "gal-view-new-dialog.h"
-#include <gal/e-table/e-table-scrolled.h>
-#include <gal/util/e-i18n.h>
-#include <gal/util/e-util.h>
static void gal_define_views_dialog_init (GalDefineViewsDialog *card);
static void gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass);
@@ -242,10 +244,14 @@ gal_define_views_dialog_init (GalDefineViewsDialog *dialog)
GladeXML *gui;
GtkWidget *widget;
GtkWidget *etable;
+ gchar *filename = g_build_filename (GAL_GLADEDIR,
+ "gal-define-views.glade",
+ NULL);
dialog->collection = NULL;
- gui = glade_xml_new (GAL_GLADEDIR "/gal-define-views.glade", NULL, E_I18N_DOMAIN);
+ gui = glade_xml_new (filename, NULL, E_I18N_DOMAIN);
+ g_free (filename);
dialog->gui = gui;
widget = glade_xml_get_widget(gui, "table-top");
diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c
index 40e54a53b6..318992cc56 100644
--- a/widgets/menus/gal-define-views-model.c
+++ b/widgets/menus/gal-define-views-model.c
@@ -22,12 +22,15 @@
*/
#include <config.h>
+
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/xmlmemory.h>
+
+#include "gal/util/e-i18n.h"
+#include "gal/util/e-util.h"
+
#include "gal-define-views-model.h"
-#include <gal/util/e-i18n.h>
-#include <gal/util/e-util.h>
#define PARENT_TYPE E_TABLE_MODEL_TYPE
static ETableModelClass *parent_class;
diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c
index 5e97419270..826951b9e3 100644
--- a/widgets/menus/gal-view-collection.c
+++ b/widgets/menus/gal-view-collection.c
@@ -23,16 +23,19 @@
#include <config.h>
-#include <util/e-i18n.h>
-#include <sys/stat.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>
+
+#include <glib.h>
#include <libxml/parser.h>
#include <libgnome/gnome-util.h>
-#include <gal/util/e-util.h>
-#include <gal/util/e-xml-utils.h>
-#include <gal/widgets/e-unicode.h>
+
+#include "gal/util/e-i18n.h"
+#include "gal/util/e-util.h"
+#include "gal/util/e-xml-utils.h"
+#include "gal/widgets/e-unicode.h"
+
#include "gal-view-collection.h"
#define PARENT_TYPE G_TYPE_OBJECT
@@ -392,10 +395,17 @@ load_single_dir (GalViewCollection *collection,
xmlNode *child;
char *filename = g_concat_dir_and_file(dir, "galview.xml");
char *default_view;
- struct stat st;
- if (stat (filename, &st) != -1 && S_ISREG (st.st_mode))
+ if (g_file_test (filename, G_FILE_TEST_IS_REGULAR)) {
+#ifdef G_OS_WIN32
+ gchar *locale_filename = gnome_win32_locale_filename_from_utf8 (filename);
+ if (locale_filename != NULL)
+ doc = xmlParseFile (locale_filename);
+ g_free (locale_filename);
+#else
doc = xmlParseFile (filename);
+#endif
+ }
if (!doc) {
g_free (filename);
diff --git a/widgets/menus/gal-view-etable.c b/widgets/menus/gal-view-etable.c
index a46368559e..3f23981fe7 100644
--- a/widgets/menus/gal-view-etable.c
+++ b/widgets/menus/gal-view-etable.c
@@ -22,8 +22,10 @@
*/
#include <config.h>
+
+#include "gal/e-table/e-table-config.h"
+
#include "gal-view-etable.h"
-#include <gal/e-table/e-table-config.h>
#define PARENT_TYPE GAL_VIEW_TYPE
diff --git a/widgets/menus/gal-view-factory-etable.c b/widgets/menus/gal-view-factory-etable.c
index c0d68fe006..3de27833ec 100644
--- a/widgets/menus/gal-view-factory-etable.c
+++ b/widgets/menus/gal-view-factory-etable.c
@@ -22,10 +22,12 @@
*/
#include <config.h>
+
#include "gal/util/e-i18n.h"
#include "gal/util/e-util.h"
-#include "gal-view-factory-etable.h"
+
#include "gal-view-etable.h"
+#include "gal-view-factory-etable.h"
#define PARENT_TYPE GAL_VIEW_FACTORY_TYPE
diff --git a/widgets/menus/gal-view-factory.c b/widgets/menus/gal-view-factory.c
index 5bc2c9f11d..3a644606f6 100644
--- a/widgets/menus/gal-view-factory.c
+++ b/widgets/menus/gal-view-factory.c
@@ -22,9 +22,11 @@
*/
#include <config.h>
-#include "gal-view-factory.h"
+
#include "gal/util/e-util.h"
+#include "gal-view-factory.h"
+
#define PARENT_TYPE G_TYPE_OBJECT
#define d(x)
diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c
index b65d4acba2..d2ce6e9ac3 100644
--- a/widgets/menus/gal-view-instance-save-as-dialog.c
+++ b/widgets/menus/gal-view-instance-save-as-dialog.c
@@ -23,16 +23,15 @@
#include <config.h>
-#include "gal-view-instance-save-as-dialog.h"
+#include <gtk/gtk.h>
+
+#include "gal/e-table/e-table-scrolled.h"
+#include "gal/util/e-i18n.h"
+#include "gal/util/e-util-private.h"
#include "gal-define-views-model.h"
+#include "gal-view-instance-save-as-dialog.h"
#include "gal-view-new-dialog.h"
-#include <gal/e-table/e-table-scrolled.h>
-#include <gal/util/e-i18n.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtktogglebutton.h>
-#include <gtk/gtkbox.h>
-#include <gtk/gtkstock.h>
static GtkDialogClass *parent_class = NULL;
#define PARENT_TYPE GTK_TYPE_DIALOG
@@ -192,10 +191,14 @@ gal_view_instance_save_as_dialog_init (GalViewInstanceSaveAsDialog *dialog)
GladeXML *gui;
GtkWidget *widget;
GtkWidget *table;
+ gchar *filename = g_build_filename (GAL_GLADEDIR,
+ "gal-view-instance-save-as-dialog.glade",
+ NULL);
dialog->instance = NULL;
- gui = glade_xml_new_with_domain (GAL_GLADEDIR "/gal-view-instance-save-as-dialog.glade", NULL, E_I18N_DOMAIN);
+ gui = glade_xml_new_with_domain (filename , NULL, E_I18N_DOMAIN);
+ g_free (filename);
dialog->gui = gui;
widget = glade_xml_get_widget(gui, "vbox-top");
diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c
index 6ce8a2ab86..5cc3c696a3 100644
--- a/widgets/menus/gal-view-instance.c
+++ b/widgets/menus/gal-view-instance.c
@@ -23,21 +23,25 @@
#include <config.h>
-#include <util/e-i18n.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+#include <gtk/gtk.h>
#include <libxml/parser.h>
#include <libgnome/gnome-util.h>
-#include <gal/util/e-util.h>
-#include <gal/util/e-xml-utils.h>
-#include <gal/widgets/e-unicode.h>
+#include <glib/gstdio.h>
+
+#include "gal/util/e-i18n.h"
+#include "gal/util/e-util.h"
+#include "gal/util/e-xml-utils.h"
+#include "gal/widgets/e-unicode.h"
+
+#include "gal-define-views-dialog.h"
#include "gal-view-instance.h"
#include "gal-view-instance-save-as-dialog.h"
-#include "gal-define-views-dialog.h"
-#include <sys/stat.h>
-#include <unistd.h>
-#include <gtk/gtkcheckmenuitem.h>
#define PARENT_TYPE G_TYPE_OBJECT
@@ -242,10 +246,17 @@ load_current_view (GalViewInstance *instance)
xmlDoc *doc = NULL;
xmlNode *root;
GalView *view = NULL;
- struct stat st;
- if (stat (instance->current_view_filename, &st) != -1 && S_ISREG (st.st_mode))
+ if (g_file_test (instance->current_view_filename, G_FILE_TEST_IS_REGULAR)) {
+#ifdef G_OS_WIN32
+ gchar *locale_filename = gnome_win32_locale_filename_from_utf8 (instance->current_view_filename);
+ if (locale_filename != NULL)
+ doc = xmlParseFile(locale_filename);
+ g_free (locale_filename);
+#else
doc = xmlParseFile(instance->current_view_filename);
+#endif
+ }
if (doc == NULL) {
instance->current_id = g_strdup (gal_view_instance_get_default_view (instance));
@@ -454,7 +465,7 @@ gal_view_instance_exists (GalViewInstance *instance)
{
struct stat st;
- if (instance->current_view_filename && stat (instance->current_view_filename, &st) == 0 && st.st_size > 0 && S_ISREG (st.st_mode))
+ if (instance->current_view_filename && g_stat (instance->current_view_filename, &st) == 0 && st.st_size > 0 && S_ISREG (st.st_mode))
return TRUE;
else
return FALSE;
diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c
index 00ef874e40..7de74c69a8 100644
--- a/widgets/menus/gal-view-new-dialog.c
+++ b/widgets/menus/gal-view-new-dialog.c
@@ -22,14 +22,17 @@
*/
#include <config.h>
+
#include <gtk/gtk.h>
-#include <gtk/gtktreeselection.h>
-#include "gal-view-new-dialog.h"
+
+#include "gal/e-table/e-table-scrolled.h"
+#include "gal/util/e-i18n.h"
+#include "gal/util/e-util.h"
+#include "gal/util/e-util-private.h"
+#include "gal/widgets/e-unicode.h"
+
#include "gal-define-views-model.h"
-#include <gal/widgets/e-unicode.h>
-#include <gal/e-table/e-table-scrolled.h>
-#include <gal/util/e-i18n.h>
-#include <gal/util/e-util.h>
+#include "gal-view-new-dialog.h"
static void gal_view_new_dialog_init (GalViewNewDialog *card);
static void gal_view_new_dialog_class_init (GalViewNewDialogClass *klass);
@@ -85,8 +88,12 @@ gal_view_new_dialog_init (GalViewNewDialog *dialog)
{
GladeXML *gui;
GtkWidget *widget;
+ gchar *filename = g_build_filename (GAL_GLADEDIR,
+ "gal-view-new-dialog.glade",
+ NULL);
- gui = glade_xml_new (GAL_GLADEDIR "/gal-view-new-dialog.glade", NULL, E_I18N_DOMAIN);
+ gui = glade_xml_new (filename, NULL, E_I18N_DOMAIN);
+ g_free (filename);
dialog->gui = gui;
widget = glade_xml_get_widget(gui, "table-top");
diff --git a/widgets/menus/gal-view.c b/widgets/menus/gal-view.c
index fa1402fae4..c375b4323f 100644
--- a/widgets/menus/gal-view.c
+++ b/widgets/menus/gal-view.c
@@ -22,9 +22,11 @@
*/
#include <config.h>
-#include "gal-view.h"
+
#include "gal/util/e-util.h"
+#include "gal-view.h"
+
#define PARENT_TYPE G_TYPE_OBJECT
#define d(x)