Commit 6917084b authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

begin tighening the include requirements. ditto. ditto. ditto. ditto.

2002-08-28  Jody Goldberg <jody@gnome.org>

	* dialog-about.c : begin tighening the include requirements.
	* dialog-analysis-tools.c : ditto.
	* dialog-autocorrect.c : ditto.
	* dialog-autoformat.c : ditto.
	* dialog-formula-guru.c : ditto.
	* dialog-goto-cell.c : ditto.
	* dialog-printer-setup.c : ditto.
	* dialog-random-generator.c : ditto.
	* dialog-search-replace.c : ditto. ditto.
	* dialog-search.c : ditto.
	* dialog-stf-export-private.h : ditto.
	* dialog-stf-preview.c : ditto.

	* dialog-stf.c (stf_dialog_druid_page_cancel) : convert to
	  gtkmessagedialog.
	* dialog-stf-export-sheet-page.c (stf_export_dialog_sheet_page_result)
	  ditto.
	* dialog-stf-export.c (stf_export_dialog_druid_page_cancel) : ditto.

	* dialog-define-names.c (name_guru_in_list) : no need to be case
	  insensitive here.

	* dialog-simulation.c (simulation_ok_clicked_cb) : fix const.

2002-08-28  Jody Goldberg <jody@gnome.org>

	* src/func.c (function_marshal_arg) : begin work to support implicit
	  iteration.

2002-08-28  Jody Goldberg <jody@gnome.org>

	* src/gnumeric-canvas.c : begin tighening the include requirements.
	* src/gui-file.c : ditto.
	* src/sheet-object-graphic.c : ditto.
	* src/sheet-object-widget.c : ditto.
	* src/xml-io.c : ditto.

	* src/gutils.c (gnm_extension_pointer) : move to libgsf.
	(gnm_iconv_close) : ditto.

2002-08-28  Jody Goldberg <jody@gnome.org>

	* configure.in : prep for inclusion of libegg code
	  bump libgsf version req.
	* src/Makefile.am : ditto.

	* README : update.
parent 716a6a1a
2002-08-28 Jody Goldberg <jody@gnome.org>
* src/func.c (function_marshal_arg) : begin work to support implicit
iteration.
2002-08-28 Jody Goldberg <jody@gnome.org>
* src/gnumeric-canvas.c : begin tighening the include requirements.
* src/gui-file.c : ditto.
* src/sheet-object-graphic.c : ditto.
* src/sheet-object-widget.c : ditto.
* src/xml-io.c : ditto.
* src/gutils.c (gnm_extension_pointer) : move to libgsf.
(gnm_iconv_close) : ditto.
2002-08-28 Jody Goldberg <jody@gnome.org>
* configure.in : prep for inclusion of libegg code
bump libgsf version req.
* src/Makefile.am : ditto.
* README : update.
2002-08-25 Jody Goldberg <jody@gnome.org>
* Release 1.1.8
......
2002-08-28 Jody Goldberg <jody@gnome.org>
* src/func.c (function_marshal_arg) : begin work to support implicit
iteration.
2002-08-28 Jody Goldberg <jody@gnome.org>
* src/gnumeric-canvas.c : begin tighening the include requirements.
* src/gui-file.c : ditto.
* src/sheet-object-graphic.c : ditto.
* src/sheet-object-widget.c : ditto.
* src/xml-io.c : ditto.
* src/gutils.c (gnm_extension_pointer) : move to libgsf.
(gnm_iconv_close) : ditto.
2002-08-28 Jody Goldberg <jody@gnome.org>
* configure.in : prep for inclusion of libegg code
bump libgsf version req.
* src/Makefile.am : ditto.
* README : update.
2002-08-25 Jody Goldberg <jody@gnome.org>
* Release 1.1.8
......
2002-08-28 Jody Goldberg <jody@gnome.org>
* src/func.c (function_marshal_arg) : begin work to support implicit
iteration.
2002-08-28 Jody Goldberg <jody@gnome.org>
* src/gnumeric-canvas.c : begin tighening the include requirements.
* src/gui-file.c : ditto.
* src/sheet-object-graphic.c : ditto.
* src/sheet-object-widget.c : ditto.
* src/xml-io.c : ditto.
* src/gutils.c (gnm_extension_pointer) : move to libgsf.
(gnm_iconv_close) : ditto.
2002-08-28 Jody Goldberg <jody@gnome.org>
* configure.in : prep for inclusion of libegg code
bump libgsf version req.
* src/Makefile.am : ditto.
* README : update.
2002-08-25 Jody Goldberg <jody@gnome.org>
* Release 1.1.8
......
......@@ -29,18 +29,18 @@ Requirements
You need:
glib >= 1.3.10
gtk+ >= 1.3.10
libgnome >= 1.105.0 ??
libgnomeui >= 1.106.0 ??
libbonobo >= 1.106.0 ??
libbonoboui >= 1.106.0 ??
libgnomeprint >= 1.106.0 ??
libgnomeprintui >= 1.106.0 ??
libgsf >= 1.1.0
glib >= 2.0.0
gtk+ >= 2.0.0
libgnome >= 2.0.0
libgnomeui >= 2.0.0
libbonobo >= 2.0.0
libbonoboui >= 2.0.0
libgnomeprint >= 2.0.0
libgnomeprintui >= 2.0.0
libgsf >= 1.4.0
libglade >= 2.0.0
intltools >= 0.9
libglade >= 1.99.4
gal-2 >= 0.0.0 (gal-2 branch of module gal)
gal-2 >= 0.0.5 (gal-2 branch of module gal)
gnome-xml >= 2.4.12
NOTE : gnome-xml is also known as libxml
......
......@@ -41,7 +41,7 @@ PKG_CHECK_MODULES(GNUMERIC,[
glib-2.0 >= 2.0.0
gobject-2.0 >= 2.0.0
gmodule-2.0 >= 2.0.0
libgsf-1 >= 1.3.0
libgsf-1 >= 1.4.0
gtk+-2.0 >= 2.0.0
libxml-2.0 >= 2.4.12
libglade-2.0 >= 1.99.7
......@@ -668,6 +668,10 @@ src/tools/solver/glpk/Makefile
src/tools/solver/glpk/source/Makefile
src/tools/solver/glpk/include/Makefile
src/tools/solver/lp_solve/Makefile
src/cut-n-paste-code/Makefile
src/cut-n-paste-code/egg/Makefile
src/cut-n-paste-code/egg/menu/Makefile
src/cut-n-paste-code/egg/toolbar/Makefile
doc/Makefile
doc/C/Makefile
doc/de/Makefile
......
2002-08-28 Jody Goldberg <jody@gnome.org>
* ms-excel-read.c (ms_excel_read_workbook) : gnm_iconv_close moved to
libgsf.
* ms-excel-write.c (write_workbook) : ditto.
* ms-summary.c (ms_summary_read) : ditto.
(ms_summary_write) : ditto.
2002-08-25 Jody Goldberg <jody@gnome.org>
* Release 1.1.8
......
......@@ -4881,7 +4881,7 @@ ms_excel_read_workbook (IOContext *context, WorkbookView *wb_view,
/* MW: And on Excel seems to drive the display
of currency amounts. */
guint16 const codepage = GSF_LE_GET_GUINT16 (q->data);
gnm_iconv_close (current_workbook_iconv);
gsf_iconv_close (current_workbook_iconv);
current_workbook_iconv = excel_iconv_open_for_import (codepage);
d (0, {
switch (codepage) {
......@@ -5034,7 +5034,7 @@ ms_excel_read_workbook (IOContext *context, WorkbookView *wb_view,
fflush (stdout);
}
#endif
gnm_iconv_close (current_workbook_iconv);
gsf_iconv_close (current_workbook_iconv);
current_workbook_iconv = NULL;
if (wb) {
/* Cleanup */
......
......@@ -19,7 +19,6 @@
#include <stdio.h>
#include <string.h>
#include <locale.h>
#ifdef HAVE_LANGINFO_H
#include <langinfo.h>
......@@ -372,123 +371,3 @@ lookup_font_base_char_width (char const *name, double size_pts,
/* Use a rough heuristic for unknown fonts. */
return .5625 * size_pts;
}
typedef struct
{
char const * const * keys;/*NULL-terminated list*/
int value;
} s_hash_entry;
/* here is a list of languages for which cp1251 is used on Windows*/
static char const * const cyr_locales[] =
{
"be", "be_BY", "bulgarian", "bg", "bg_BG", "mk", "mk_MK",
"russian", "ru", "ru_RU", "ru_UA", "sp", "sp_YU", "sr", "sr_YU",
"ukrainian", "uk", "uk_UA", NULL
};
/* here is a list of languages for which cp for cjk is used on Windows*/
static char const * const jp_locales[] =
{
"japan", "japanese", "ja", "ja_JP", NULL
};
static char const * const zhs_locales[] =
{
"chinese-s", "zh", "zh_CN", NULL
};
static char const * const kr_locales[] =
{
"korean", "ko", "ko_KR", NULL
};
static char const * const zht_locales[] =
{
"chinese-t", "zh_HK", "zh_TW", NULL
};
static s_hash_entry const win_codepages[]=
{
{ cyr_locales , 1251 },
{ jp_locales , 932 },
{ zhs_locales , 936 },
{ kr_locales , 949 },
{ zht_locales , 950 },
{ NULL } /*terminator*/
};
guint
excel_iconv_win_codepage (void)
{
static guint codepage = 0;
if (codepage == 0) {
char *lang;
if ((lang = getenv("WINDOWS_LANGUAGE")) == NULL) {
char const *locale = setlocale (LC_CTYPE, NULL);
if (locale != NULL) {
char const *lang_sep = strchr (locale, '.');
if (lang_sep)
lang = g_strndup (locale, lang_sep - locale);
else
lang = g_strdup (locale); /* simplifies exit */
}
}
if (lang != NULL) {
s_hash_entry const * entry;
for (entry = win_codepages; entry->keys; ++entry) {
char const* const * key;
for (key = entry->keys; *key; ++key)
if (!g_strcasecmp (*key, lang)) {
g_free (lang);
return (codepage = entry->value);
}
}
g_free (lang);
}
codepage = 1252; /* default */
}
return codepage;
}
/*these two will figure out which charset names to use*/
GIConv
excel_iconv_open_for_import (guint codepage)
{
GIConv iconv_handle;
if (codepage != 1200 && codepage != 1201) {
char* src_charset = g_strdup_printf ("CP%d", codepage);
iconv_handle = g_iconv_open ("UTF-8", src_charset);
g_free (src_charset);
if (iconv_handle != (GIConv)(-1))
return iconv_handle;
g_warning ("Unknown codepage %d", codepage);
return (GIConv)(-1);
}
/* this is 'compressed' unicode. unicode characters 0000->00FF
* which looks the same as 8859-1. I have no idea what little
* endian vs bigendian has to do with this. There is only 1
* byte, and it would certainly not be useful to keep the low
* byte as 0.
*/
return g_iconv_open ("UTF-8", "ISO-8859-1");
}
GIConv
excel_iconv_open_for_export (void)
{
static char* dest_charset = NULL;
GIConv iconv_handle;
if (!dest_charset)
dest_charset = g_strdup_printf ("CP%d", excel_iconv_win_codepage());
iconv_handle = g_iconv_open (dest_charset, "UTF-8");
return iconv_handle;
}
......@@ -49,7 +49,7 @@
#include <gsf/gsf-utils.h>
#include <gsf/gsf-output.h>
#include <gsf/gsf-outfile.h>
#include <gsf/gsf-msole-metadata.h>
#include <gsf/gsf-msole-utils.h>
#include <ctype.h>
#include <math.h>
......@@ -3512,7 +3512,7 @@ write_workbook (IOContext *context, BiffPut *bp, ExcelWorkbook *wb, MsBiffVersio
s->streamPos);
}
/* End Finalised workbook */
gnm_iconv_close (current_workbook_iconv);
gsf_iconv_close (current_workbook_iconv);
current_workbook_iconv = NULL;
}
......
......@@ -251,7 +251,7 @@ ms_summary_read (MsOle *f, SummaryInfo *sin)
printf ("ms_summary_read: Unable to open DocumentSummaryInformation.\n");
#endif
}
gnm_iconv_close (current_summary_iconv);
gsf_iconv_close (current_summary_iconv);
current_summary_iconv = NULL;
}
......@@ -366,7 +366,7 @@ ms_summary_write (MsOle *f, SummaryInfo *sin)
si = ms_ole_docsummary_create (f);
if (si == NULL) {
g_warning ("ms_summary_write: doc summary NOT created.");
gnm_iconv_close (current_summary_iconv);
gsf_iconv_close (current_summary_iconv);
current_summary_iconv = NULL;
return;
}
......@@ -380,6 +380,6 @@ ms_summary_write (MsOle *f, SummaryInfo *sin)
g_list_free (si_list);
ms_ole_summary_close (si);
gnm_iconv_close (current_summary_iconv);
gsf_iconv_close (current_summary_iconv);
current_summary_iconv = NULL;
}
2002-08-28 Jody Goldberg <jody@gnome.org>
* boot.c (lotus_file_open) : gnm_iconv_close has moved to libgsf.
2002-08-25 Jody Goldberg <jody@gnome.org>
* Release 1.1.8
......
......@@ -19,6 +19,7 @@
#include <gutils.h>
#include <gsf/gsf-input.h>
#include <gsf/gsf-utils.h>
GNUMERIC_MODULE_PLUGIN_INFO_DECL;
......@@ -59,5 +60,5 @@ lotus_file_open (GnumFileOpener const *fo, IOContext *io_context,
gnumeric_io_error_string (io_context,
_("Error while reading lotus workbook."));
gnm_iconv_close (state.converter);
gsf_iconv_close (state.converter);
}
......@@ -2,7 +2,7 @@
# Gnumeric's Makefile.
# Author: Miguel de Icaza (miguel@kernel.org)
SUBDIRS = pixmaps dialogs widgets tools
SUBDIRS = pixmaps dialogs widgets tools cut-n-paste-code
if WITH_BONOBO
component = gnumeric-component
......@@ -325,7 +325,8 @@ gnumeric_app_libs = \
tools/libtools.a \
tools/solver/libsolver.a \
tools/solver/glpk/source/libglpk.a \
tools/solver/lp_solve/liblp_solve.a
tools/solver/lp_solve/liblp_solve.a \
cut-n-paste-code/egg/menu/libegg-menu.a
if WITH_BONOBO
......
SUBDIRS = menu
# no toolbar yet
This code is auto copied from the libegg module by the
gnumeric/tools/import-egg script. DO NOT MAKE LOCAL MODIFICATIONS.
All patches should be sent upstream.
INCLUDES = \
$(GNUMERIC_CFLAGS) -I$(top_srcdir)/src \
-DEGG_COMPILATION \
-DGTK_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DG_DISABLE_DEPRECATED
noinst_LIBRARIES = libegg-menu.a
libegg_menu_a_LIBADD =
libegg_menu_a_SOURCES = \
egg-action.c \
egg-action-group.c \
egg-toggle-action.c \
egg-radio-action.c \
egg-markup.c \
egg-menu-merge.c \
egg-accel-dialog.c
noinst_HEADERS = \
egg-menu.h \
egg-action.h \
egg-action-group.h \
egg-toggle-action.h \
egg-radio-action.h \
egg-markup.h \
egg-menu-merge.h \
egg-accel-dialog.h
/* File import from libegg to gnumeric by ./tools/import-egg. Do not edit. */
#include <gnumeric-config.h>
#include <gnumeric-i18n.h>
#include <gnumeric.h>
#include "egg-accel-dialog.h"
static void egg_accel_dialog_init (EggAccelDialog *self);
static void egg_accel_dialog_class_init (EggAccelDialogClass *class);
GType
egg_accel_dialog_get_type (void)
{
static GtkType type = 0;
if (!type)
{
static const GTypeInfo type_info =
{
sizeof (EggAccelDialogClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) egg_accel_dialog_class_init,
(GClassFinalizeFunc) NULL,
NULL,
sizeof (EggAccelDialog),
0, /* n_preallocs */
(GInstanceInitFunc) egg_accel_dialog_init,
};
type = g_type_register_static (GTK_TYPE_DIALOG,
"EggAccelDialog",
&type_info, 0);
}
return type;
}
static void
egg_accel_dialog_class_init (EggAccelDialogClass *class)
{
}
static void accel_path_selection_changed (GtkTreeSelection *selection,
EggAccelDialog *self);
static void accel_path_set (GtkWidget *button, EggAccelDialog *self);
static void accel_path_reset (GtkWidget *button, EggAccelDialog *self);
static void
egg_accel_dialog_init (EggAccelDialog *self)
{
GtkCellRenderer *renderer;
GtkWidget *swin;
GtkWidget *table;
/* set up the list store for all the accelerators */
self->accel_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (self->accel_store),
0, GTK_SORT_ASCENDING);
egg_accel_dialog_rescan_accels (self);
swin = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (self)->vbox), swin,
TRUE, TRUE, 0);
gtk_widget_show (swin);
/* set up a two column view of the model in browse selection mode */
self->accel_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(self->accel_store));
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (self->accel_view), TRUE);
gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (self->accel_view)),
GTK_SELECTION_BROWSE);
g_signal_connect_object (gtk_tree_view_get_selection (GTK_TREE_VIEW (self->accel_view)),
"changed", G_CALLBACK (accel_path_selection_changed),
G_OBJECT (self), 0);
renderer = gtk_cell_renderer_text_new ();
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (self->accel_view),
-1, "Path", renderer,
"text", 0,
NULL);
gtk_tree_view_column_set_sort_column_id (gtk_tree_view_get_column (GTK_TREE_VIEW (self->accel_view), 0), 0);
renderer = gtk_cell_renderer_text_new ();
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (self->accel_view),
-1, "Accel", renderer,
"text", 1,
NULL);
gtk_tree_view_column_set_sort_column_id (gtk_tree_view_get_column (GTK_TREE_VIEW (self->accel_view), 1), 1);
gtk_container_add (GTK_CONTAINER (swin), self->accel_view);
gtk_widget_show (self->accel_view);
table = gtk_table_new (2, 4, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (self)->vbox), table, FALSE,TRUE, 0);
gtk_widget_show (table);
/* widgets for editing accels */
self->shift_toggle = gtk_check_button_new_with_mnemonic ("S_hift");
gtk_table_attach (GTK_TABLE (table), self->shift_toggle,
0, 1, 0, 1,
GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (self->shift_toggle);
self->ctrl_toggle = gtk_check_button_new_with_mnemonic ("_Ctrl");
gtk_table_attach (GTK_TABLE (table), self->ctrl_toggle,
1, 2, 0, 1,
GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (self->ctrl_toggle);
self->alt_toggle = gtk_check_button_new_with_mnemonic ("_Alt");
gtk_table_attach (GTK_TABLE (table), self->alt_toggle,
2, 3, 0, 1,
GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (self->alt_toggle);
self->key_entry = gtk_entry_new ();
gtk_table_attach (GTK_TABLE (table), self->key_entry,
0, 3, 1, 2,
GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
gtk_widget_show (self->key_entry);
/* buttons for changing path */
self->set_button = gtk_button_new_with_mnemonic ("_Set");
gtk_table_attach (GTK_TABLE (table), self->set_button,
3, 4, 0, 1,
GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (self->set_button);
self->reset_button = gtk_button_new_with_mnemonic ("_Reset");
gtk_table_attach (GTK_TABLE (table), self->reset_button,
3, 4, 1, 2,
GTK_FILL, GTK_FILL, 0, 0);
/*gtk_widget_show (self->reset_button);*/
g_signal_connect_object (self->set_button, "clicked",
G_CALLBACK (accel_path_set), G_OBJECT (self), 0);
g_signal_connect_object (self->reset_button, "clicked",
G_CALLBACK (accel_path_reset), G_OBJECT (self), 0);
self->ok_button = gtk_dialog_add_button (GTK_DIALOG (self),
GTK_STOCK_OK,
GTK_RESPONSE_OK);
gtk_widget_grab_default (self->ok_button);
}
static void
accel_map_foreach (gpointer data,
const gchar *accel_path,
guint accel_key,
guint accel_mods,
gboolean changed)
{
EggAccelDialog *self = data;
GtkTreeIter iter;
gchar *accel_name;
gtk_list_store_append (self->accel_store, &iter);
if (accel_key != 0)
accel_name = gtk_accelerator_name (accel_key, accel_mods);
else
accel_name = "";
gtk_list_store_set (self->accel_store, &iter,
0, accel_path,
1, accel_name,
-1);
if (accel_key != 0)
g_free(accel_name);
}
void
egg_accel_dialog_rescan_accels (EggAccelDialog *self)
{
g_return_if_fail (EGG_IS_ACCEL_DIALOG (self));
gtk_list_store_clear (self->accel_store);
gtk_accel_map_foreach (self, accel_map_foreach);
}
/* make sure the currently selected accel is up to date */
static void
refresh_selected_row (EggAccelDialog *self)
{