aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog11
-rw-r--r--addressbook/printing/e-contact-print-envelope.c164
-rw-r--r--addressbook/printing/e-contact-print-envelope.h27
-rw-r--r--addressbook/tools/evolution-addressbook-abuse.c91
-rw-r--r--addressbook/tools/evolution-addressbook-import.c90
5 files changed, 11 insertions, 372 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 2ce3cf36f8..c2431f1143 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,14 @@
+2007-11-03 Matthew Barnes <mbarnes@redhat.com>
+
+ ** Remove dead files from source control. The dates below
+ indicate when the file was removed from Makefile.am.
+ Fixes part of bug #478704.
+
+ * printing/e-contact-print-envelope.c (Apr 2007)
+ * printing/e-contact-print-envelope.h (Apr 2007)
+ * tools/evolution-addressbook-abuse.c (May 2004)
+ * tools/evolution-addressbook-import.c (no history)
+
2007-10-31 Michael Monreal <mmonreal@svn.gnome.org>
** Fix for bug #484064
diff --git a/addressbook/printing/e-contact-print-envelope.c b/addressbook/printing/e-contact-print-envelope.c
deleted file mode 100644
index f9ff1efc0f..0000000000
--- a/addressbook/printing/e-contact-print-envelope.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-print-envelope.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * 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 library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-/* XXX Keeping the rendering code around for future reference,
- * but it needs a lot of work to make it usable again. */
-
-#if 0
-
-#include <config.h>
-#include "addressbook/printing/e-contact-print-envelope.h"
-#include <glib.h>
-#include <glib/gi18n.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <time.h>
-#include <e-util/e-print.h>
-
-#define ENVELOPE_HEIGHT (72.0 * 4.0)
-#define ENVELOPE_WIDTH (72.0 * 9.5)
-
-typedef struct {
- int start;
- int length;
-} EcpeLine;
-
-static void
-startset(void *pointer, EcpeLine **iterator)
-{
- (*iterator)--;
- (*iterator)->start = GPOINTER_TO_INT(pointer);
-}
-
-static void
-lengthset(void *pointer, EcpeLine **iterator)
-{
- (*iterator)--;
- (*iterator)->length = GPOINTER_TO_INT(pointer);
-}
-
-static EcpeLine *
-ecpe_break(char *address)
-{
- int i;
- int length = 0;
- int laststart = 0;
- GList *startlist = NULL;
- GList *lengthlist = NULL;
- EcpeLine *ret_val;
- EcpeLine *iterator;
-
- for (i = 0; address[i]; i++) {
- if (address[i] == '\n') {
- startlist = g_list_prepend (startlist, GINT_TO_POINTER(laststart));
- lengthlist = g_list_prepend (lengthlist, GINT_TO_POINTER(i - laststart));
- length ++;
- laststart = i + 1;
- }
- }
- startlist = g_list_prepend (startlist, GINT_TO_POINTER(laststart));
- lengthlist = g_list_prepend (lengthlist, GINT_TO_POINTER(i - laststart));
- length ++;
-
- ret_val = g_new(EcpeLine, length + 1);
-
- iterator = ret_val + length;
- g_list_foreach(startlist, (GFunc) startset, &iterator);
- g_list_free(startlist);
-
- iterator = ret_val + length;
- g_list_foreach(lengthlist, (GFunc) lengthset, &iterator);
- g_list_free(lengthlist);
-
- ret_val[length].start = -1;
- ret_val[length].length = -1;
-
- return ret_val;
-}
-
-static void
-ecpe_linelist_dimensions(GnomeFont *font, char *address, EcpeLine *linelist, double *widthp, double *heightp)
-{
- double width = 0;
- int i;
- if (widthp) {
- for (i = 0; linelist[i].length != -1; i++) {
- width = MAX(width, gnome_font_get_width_utf8_sized (font, address + linelist[i].start, linelist[i].length));
- }
- *widthp = width;
- } else {
- for (i = 0; linelist[i].length != -1; i++)
- /* Intentionally empty */;
- }
- if (heightp) {
- *heightp = gnome_font_get_size(font) * i;
- }
-}
-
-static void
-ecpe_linelist_print(GnomePrintContext *pc, GnomeFont *font, char *address, EcpeLine *linelist, double x, double y)
-{
- int i;
- gnome_print_setfont(pc, font);
- for (i = 0; linelist[i].length != -1; i++) {
- gnome_print_moveto(pc, x, y + gnome_font_get_ascender(font));
- gnome_print_show_sized (pc, address + linelist[i].start, linelist[i].length);
- y -= gnome_font_get_size(font);
- }
-}
-
-static void
-ecpe_print(GnomePrintContext *pc, EContact *contact, gboolean as_return)
-{
- char *address;
- EcpeLine *linelist;
- double x;
- double y;
- GnomeFont *font;
-
-
- gnome_print_rotate(pc, 90);
- gnome_print_translate(pc, 72.0 * 11.0 - ENVELOPE_WIDTH, -72.0 * 8.5 + (72.0 * 8.5 - ENVELOPE_HEIGHT) / 2);
-
- address = e_contact_get(contact, E_CONTACT_ADDRESS_LABEL_WORK);
- linelist = ecpe_break(address);
- if (as_return)
- font = gnome_font_find ("Sans", 9);
- else
- font = gnome_font_find ("Sans", 12);
- ecpe_linelist_dimensions(font, address, linelist, NULL, &y);
- if (as_return) {
- x = 36;
- y = ENVELOPE_HEIGHT - 36;
- } else {
- x = ENVELOPE_WIDTH / 2;
- y = (ENVELOPE_HEIGHT - y) / 2;
- }
- ecpe_linelist_print(pc, font, address, linelist, x, y);
- g_object_unref(font);
- g_free(linelist);
-
- g_free(address);
-
- gnome_print_showpage(pc);
- gnome_print_context_close(pc);
-}
-
-#endif
diff --git a/addressbook/printing/e-contact-print-envelope.h b/addressbook/printing/e-contact-print-envelope.h
deleted file mode 100644
index ff647af5c2..0000000000
--- a/addressbook/printing/e-contact-print-envelope.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-print-envelope.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * 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 library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef E_CONTACT_PRINT_ENVELOPE_H
-#define E_CONTACT_PRINT_ENVELOPE_H
-
-/* XXX Currently unused */
-
-#endif /* E_CONTACT_PRINT_ENVELOPE_H */
diff --git a/addressbook/tools/evolution-addressbook-abuse.c b/addressbook/tools/evolution-addressbook-abuse.c
deleted file mode 100644
index 3446e15938..0000000000
--- a/addressbook/tools/evolution-addressbook-abuse.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-#include <config.h>
-
-#include <bonobo/bonobo-main.h>
-
-#include <backend/ebook/e-book.h>
-#include <gnome.h>
-
-#define CONTACTS_TO_ADD 2000
-
-static gchar *
-make_random_string (void)
-{
- const gchar *elements = " abcdefghijklmnopqrstuvwxyz1234567890 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- gint len = strlen (elements);
- gint i, N = 5 + (random () % 10);
- gchar *str = g_malloc (N+1);
-
- for (i = 0; i < N; ++i) {
- str[i] = elements[random () % len];
- }
- str[i] = '\0';
-
- return str;
-}
-
-static gchar *
-make_random_vcard (void)
-{
- gchar *fa = make_random_string ();
- gchar *name = make_random_string ();
- gchar *email = make_random_string ();
- gchar *org = make_random_string ();
-
- gchar *vcard;
-
- vcard = g_strdup_printf ("BEGIN:VCARD\n"
- "X-EVOLUTION-FILE-AS:%s\n"
- "N:%s\n"
- "EMAIL;INTERNET:%s\n"
- "ORG:%s\n"
- "END:VCARD",
- fa, name, email, org);
- g_free (fa);
- g_free (name);
- g_free (email);
- g_free (org);
-
- return vcard;
-}
-
-int
-main (int argc, char *argv[])
-{
- EBook *book;
- int i;
-
- if (getenv ("ABUSE_THE_WOMBAT") == NULL) {
- g_print ("You probably don't want to use this program.\n"
- "It isn't very nice.\n");
- exit(0);
- }
-
- bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
- textdomain (GETTEXT_PACKAGE);
-
- gnome_program_init ("evolution-addressbook-abuse", VERSION,
- LIBGNOMEUI_MODULE, argc, argv,
- GNOME_PROGRAM_STANDARD_PROPERTIES,
- NULL);
-
- if (!e_book_get_default_addressbook (&book, NULL)) {
- g_warning ("couldn't open addressbook");
- exit (1);
- }
-
- for (i = 0; i < CONTACTS_TO_ADD; ++i) {
- gchar *vcard = make_random_vcard ();
- EContact *contact = e_contact_new_from_vcard (vcard);
- g_message ("adding %d", i);
- if (!e_book_add_contact (book, contact, NULL)) {
- g_warning ("something went wrong...");
- exit (1);
- }
- g_free (vcard);
- g_object_unref (contact);
- }
-
- return 0;
-}
diff --git a/addressbook/tools/evolution-addressbook-import.c b/addressbook/tools/evolution-addressbook-import.c
deleted file mode 100644
index 28871efd96..0000000000
--- a/addressbook/tools/evolution-addressbook-import.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-#include <config.h>
-
-#include <bonobo-activation/bonobo-activation.h>
-#include <bonobo/bonobo-main.h>
-#include <backend/ebook/e-book-async.h>
-#include <gnome.h>
-
-static int exec_ref_count = 0;
-
-static void
-ref_executable (void)
-{
- exec_ref_count ++;
-}
-
-static void
-unref_executable (void)
-{
- exec_ref_count --;
- if (exec_ref_count == 0)
- g_main_loop_quit (0);
-}
-
-static void
-add_cb (EBook *book, EBookStatus status, const char *id, gpointer closure)
-{
- switch (status) {
- case E_BOOK_ERROR_OK:
- unref_executable ();
- break;
- default:
- g_main_loop_quit (NULL);
- break;
- }
-}
-
-static void
-use_addressbook (EBook *book, gpointer closure)
-{
- GList *cards, *list;
- char *filename = closure;
-
- if (book == NULL)
- g_error (_("Error loading default addressbook."));
-
- cards = e_card_load_cards_from_file (filename);
-
- ref_executable ();
-
- for (list = cards; list; list = list->next) {
- ref_executable ();
- e_book_add_card (book, list->data, add_cb, closure);
- }
- sync();
-
- unref_executable ();
-}
-
-int
-main (int argc, char *argv[])
-{
- char *filename = NULL;
-
- struct poptOption options[] = {
- { "input-file", '\0', POPT_ARG_STRING, &filename, 0, N_("Input File"), NULL },
- POPT_AUTOHELP
- { NULL, '\0', 0, NULL, 0, NULL, NULL }
- };
-
- bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
- textdomain (GETTEXT_PACKAGE);
-
- gnome_program_init ("evolution-addressbook-import", VERSION,
- LIBGNOMEUI_MODULE, argc, argv,
- GNOME_PROGRAM_STANDARD_PROPERTIES,
- GNOME_PARAM_POPT_TABLE, options,
- NULL);
-
- if (filename == NULL) {
- g_error (_("No filename provided."));
- }
-
- e_book_async_get_default_addressbook (use_addressbook, filename);
-
- bonobo_main ();
-
- return 0;
-}