Commit 38af577c authored by Jody Goldberg's avatar Jody Goldberg

drop in a non-functional ssindex (needs some libgsf extension)

and prep for release
parent 23a47cd5
......@@ -8,14 +8,16 @@ release, and longer term bugs.
Release Critical
----------------
: debian 272697
1.4.1
-----
: Use GNOME Recent for the gnome build
: kasal's popt patch
: tie the custom ui into action sensitivity pools
: kasal's popt patch
: JHM's paper size patch
: enable contour plots
Worries
-------
: provide undo for dropped objects from sheet_objects_relocate
: provide undo for dropped objects from sheet_objects_clear
: undo of pasting copy/cut of objects
......@@ -52,6 +54,8 @@ Worries
Pending Patches
---------------
http://bugzilla.gnome.org/show_bug.cgi?id=157997
: Apply after 1.4.0 to clean up the xls sheet object creation a bit.
http://bugzilla.gnome.org/show_bug.cgi?id=84062
- XIM menu, blocking on gtk changes
......
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
......@@ -8,20 +14,27 @@ various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
......@@ -55,14 +68,16 @@ Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
......@@ -75,11 +90,11 @@ directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
......@@ -123,21 +138,31 @@ Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it cannot guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
need to know the machine type.
If you are building compiler tools for cross-compiling, you can also
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
......@@ -150,20 +175,44 @@ default values for variables like `CC', `cache_file', and `prefix'.
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
......@@ -175,9 +224,6 @@ operates.
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
......@@ -12,6 +12,7 @@ Andreas:
Jody:
* Pull the file open filters from the openers
* Enable ssindex
Harald Ashburner:
* Update derivatives.gnumeric
......
......@@ -275,9 +275,12 @@ if test "$GCC" = "yes" -a "x$set_more_warnings" != "xno"; then
fi
AC_SUBST(WARN_CFLAGS)
AC_ARG_ENABLE(ssconvert, [--disable-ssconvert Do not build ssconvert to speed the compile link cycle during development],
AC_ARG_ENABLE(ssconvert, [--disable-ssconvert Do not build ssconvert (cmd line spreadsheet conversion tool)],
[ ], [enable_ssconvert=yes])
AM_CONDITIONAL(ENABLE_SSCONVERT, test x"$enable_ssconvert" = "xyes")
AC_ARG_ENABLE(ssindex, [--enable-ssindex Do not build ssindex (spreadsheet indexer for beagle)],
[ ], [enable_ssindex=no])
AM_CONDITIONAL(ENABLE_SSINDEX, test x"$enable_ssindex" = "xyes")
dnl ****************************
dnl GDA Plugin
......
......@@ -18,6 +18,9 @@ endif
if ENABLE_SSCONVERT
bin_PROGRAMS += ssconvert
endif
if ENABLE_SSINDEX
bin_PROGRAMS += ssindex
endif
INCLUDES = \
-I$(top_srcdir) \
......@@ -341,6 +344,11 @@ ssconvert_LDFLAGS = -export-dynamic
ssconvert_SOURCES = \
$(GNUMERIC_SOURCE) \
ssconvert.c
ssindex_LDADD = $(gnumeric_LDADD)
ssindex_LDFLAGS = -export-dynamic
ssindex_SOURCES = \
$(GNUMERIC_SOURCE) \
ssindex.c
#test_pango_LDADD = $(gnumeric_LDADD)
#test_pango_LDFLAGS = -export-dynamic
......@@ -390,7 +398,7 @@ EXTRA_DIST = GNOME_Gnumeric-gtk.xml.in \
main-application.c \
main-component.c \
$(GNUMERIC_GNOME) README.gnm_float \
gnumeric-paths.sh.in ssconvert.c gnumeric.rc
gnumeric-paths.sh.in ssconvert.c ssindex.c gnumeric.rc
DISTCLEANFILES = GNOME_Gnumeric-gtk.xml
#number_match_SOURCES = number-match.c formats.c dates.c number-match-test.c
......
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* ssindex.c: A wrapper application to index spreadsheets
*
* Author:
* Jody Goldberg <jody@gnome.org>
*
* Copyright (C) 2004 Jody Goldberg
*/
#include <gnumeric-config.h>
#include <glib/gi18n.h>
#include "gnumeric.h"
#include "libgnumeric.h"
#include "gnumeric-paths.h"
#include "plugin.h"
#include "command-context-stderr.h"
#include "io-context.h"
#include "workbook-view.h"
#include "file.h"
#include "workbook.h"
#include "sheet.h"
#include "cell.h"
#include "value.h"
#include "mstyle.h"
#include "sheet-style.h"
#include "hlink.h"
#include "sheet-object-graph.h"
#include <goffice/utils/go-file.h>
#include <gsf/gsf-utils.h>
#include <gsf/gsf-libxml.h>
#include <string.h>
static gboolean ssindex_show_version = FALSE;
static gboolean ssindex_list_mime_types = FALSE;
static gboolean ssindex_run_indexer = FALSE;
static char const *ssindex_import_encoding = NULL;
#ifdef WIN32
#define POPT_STATIC
#endif
const struct poptOption
ssindex_popt_options[] = {
{ NULL, '\0', POPT_ARG_INTL_DOMAIN, (char *)GETTEXT_PACKAGE, 0, NULL, NULL },
{ "version", 'v', POPT_ARG_NONE, &ssindex_show_version, 0,
N_("Display Gnumeric's version"), NULL },
{ "lib-dir", 'L', POPT_ARG_STRING, &gnumeric_lib_dir, 0,
N_("Set the root library directory"), NULL },
{ "data-dir", 'D', POPT_ARG_STRING, &gnumeric_data_dir, 0,
N_("Adjust the root data directory"), NULL },
{ "list-mime-types", 'm', POPT_ARG_NONE, &ssindex_list_mime_types, 0,
N_("Optionally specify an encoding for imported content"), NULL },
{ "index", 'i', POPT_ARG_NONE, &ssindex_run_indexer, 0,
N_("Optionally specify an encoding for imported content"), NULL },
{ "import-encoding", 'E', POPT_ARG_STRING, &ssindex_import_encoding, 0,
N_("Optionally specify an encoding for imported content"), N_("ENCODING") },
POPT_AUTOHELP
POPT_TABLEEND
};
typedef struct {
IOContext *context;
WorkbookView const *wb_view;
Workbook const *wb;
Sheet *sheet;
GsfXMLOut *output;
} IndexerState;
static void
cb_index_cell (G_GNUC_UNUSED gpointer ignore,
GnmCell const *cell, IndexerState *state)
{
if (cell->value != NULL && VALUE_IS_STRING (cell->value))
gsf_xml_out_simple_element (state->output,
"data", value_peek_string (cell->value));
}
static void
cb_index_styles (GnmStyle *style, gconstpointer dummy, IndexerState *state)
{
if (mstyle_is_element_set (style, MSTYLE_HLINK)) {
guchar const *str;
GnmHLink const *lnk = mstyle_get_hlink (style);
if (NULL != (str = gnm_hlink_get_target (lnk)))
gsf_xml_out_simple_element (state->output, "data", str);
if (NULL != (str = gnm_hlink_get_tip (lnk)))
gsf_xml_out_simple_element (state->output, "data", str);
}
}
static void
ssindex_chart (IndexerState *state, GogObject *obj)
{
GSList *ptr;
/* TODO */
for (ptr = obj->children ; ptr != NULL ; ptr = ptr->next)
ssindex_chart (state, ptr->data);
}
/**
* Other things we could index
* - The names of external refernces
* - functions used
* - plugins used
**/
static int
ssindex (char const *file, IOContext *ioc)
{
int i, res = 0;
GParamSpec *pspec;
GSList *objs, *ptr;
char *str = go_shell_arg_to_uri (file);
IndexerState state;
state.wb_view = wb_view_new_from_uri (str, NULL,
ioc, ssindex_import_encoding);
g_free (str);
if (state.wb_view == NULL)
return 1;
state.wb = wb_view_workbook (state.wb_view);
for (i = 0 ; i < workbook_sheet_count (state.wb); i++) {
state.sheet = workbook_sheet_by_index (state.wb, i);
gsf_xml_out_simple_element (state.output,
"data", state.sheet->name_unquoted);
/* cell content */
sheet_foreach_cell (state.sheet,
(GHFunc)&cb_index_cell, &state);
/* now the objects */
objs = sheet_objects_get (state.sheet, NULL, G_TYPE_NONE);
for (ptr = objs ; ptr != NULL ; ptr = ptr->next) {
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (ptr->data), "text");
if (pspec != NULL) {
g_object_get (G_OBJECT (ptr->data), "text", &str, NULL);
if (str != NULL) {
gsf_xml_out_simple_element (state.output,
"data", str);
g_free (str);
}
} else if (IS_SHEET_OBJECT_GRAPH (ptr->data))
ssindex_chart (&state,
(GogObject *)sheet_object_graph_get_gog (ptr->data));
}
g_slist_free (objs);
/* and finally the hyper-links */
sheet_style_foreach (state.sheet,
(GHFunc)&cb_index_styles, &state);
}
g_object_unref ((gpointer)state.wb);
return res;
}
int
main (int argc, char const *argv [])
{
ErrorInfo *plugin_errs;
int res = 0;
GnmCmdContext *cc;
poptContext ctx;
gnm_pre_parse_init (argv[0]);
ctx = poptGetContext (NULL, argc, argv, ssindex_popt_options, 0);
while (poptGetNextOpt (ctx) > 0)
;
if (ssindex_show_version) {
printf (_("ssindex version '%s'\ndatadir := '%s'\nlibdir := '%s'\n"),
GNUMERIC_VERSION, gnumeric_data_dir, gnumeric_lib_dir);
poptFreeContext (ctx);
return 0;
} else if (!ssindex_run_indexer && !ssindex_list_mime_types) {
poptPrintUsage(ctx, stderr, 0);
return 1;
}
gnm_common_init (FALSE);
cc = cmd_context_stderr_new ();
plugins_init (cc);
plugin_db_activate_plugin_list (
plugins_get_available_plugins (), &plugin_errs);
if (ssindex_run_indexer) {
IOContext *ioc = gnumeric_io_context_new (cc);
char const **args = poptGetArgs (ctx);
int argc = 0;
while (args != NULL && args[argc] != NULL)
argc++;
gnm_io_context_set_num_files (ioc, argc);
for (; args != NULL && *args ; args++) {
gnm_io_context_processing_file (ioc, *args);
printf ("-> %s\n", *args);
res |= ssindex (*args, ioc);
}
g_object_unref (ioc);
} else if (ssindex_list_mime_types) {
GList *o;
for (o = get_file_openers (); o != NULL ; o = o->next) {
GSList const *mime = gnm_file_opener_get_mimes (o->data);
for (; mime != NULL ; mime = mime->next)
printf ("%s\n", (char const *)mime->data);
}
}
poptFreeContext (ctx);
g_object_unref (cc);
gnm_shutdown ();
return res;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment