aboutsummaryrefslogtreecommitdiffstats
path: root/japanese
diff options
context:
space:
mode:
Diffstat (limited to 'japanese')
-rw-r--r--japanese/Makefile1
-rw-r--r--japanese/awffull/Makefile16
-rw-r--r--japanese/awffull/files/awffull-ja.diff267
3 files changed, 284 insertions, 0 deletions
diff --git a/japanese/Makefile b/japanese/Makefile
index e10f916f71ef..7179c49fca2f 100644
--- a/japanese/Makefile
+++ b/japanese/Makefile
@@ -19,6 +19,7 @@
SUBDIR += anthy
SUBDIR += asterisk-sound
SUBDIR += aterm
+ SUBDIR += awffull
SUBDIR += bible_names-fpw
SUBDIR += bookview
SUBDIR += bugzilla
diff --git a/japanese/awffull/Makefile b/japanese/awffull/Makefile
new file mode 100644
index 000000000000..ca36574af878
--- /dev/null
+++ b/japanese/awffull/Makefile
@@ -0,0 +1,16 @@
+# New ports collection makefile for: ja-awffull
+# Date created: 2008-12-31
+# Whom: Norikatsu Shigemura <nork@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+CATEGORIES= japanese www
+
+MAINTAINER= nork@FreeBSD.org
+
+MASTERDIR= ${.CURDIR}/../../www/awffull
+
+EXTRA_PATCHES= ${.CURDIR}/files/awffull-ja.diff
+
+.include "${MASTERDIR}/Makefile"
diff --git a/japanese/awffull/files/awffull-ja.diff b/japanese/awffull/files/awffull-ja.diff
new file mode 100644
index 000000000000..ff6d63c9c200
--- /dev/null
+++ b/japanese/awffull/files/awffull-ja.diff
@@ -0,0 +1,267 @@
+--- src/awffull.c.orig 2008-12-13 11:28:35.000000000 +0900
++++ src/awffull.c 2008-12-31 16:43:45.000000000 +0900
+@@ -37,6 +37,9 @@
+ /* STANDARD INCLUDES */
+ /*********************************************/
+ #include "awffull.h" /* main header */
++#ifdef HAVE_ICONV
++#include <iconv.h>
++#endif
+
+ /* internal function prototypes */
+
+@@ -137,6 +140,10 @@ static char const ab_month_name[][4] = {
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+ };
+
++#ifdef HAVE_ICONV
++iconv_t cd_from_sjis, cd_from_eucj;
++#endif
++
+ /*********************************************/
+ /* MAIN - start here */
+ /*********************************************/
+@@ -339,6 +346,11 @@ main(int argc, char *argv[])
+
+ start_time = times(&mytms);
+
++#ifdef HAVE_ICONV
++ cd_from_sjis = iconv_open("UTF-8", "Shift_JIS");
++ cd_from_eucj = iconv_open("UTF-8", "EUC-JP");
++#endif
++
+ /*********************************************
+ * MAIN PROCESS LOOP - read through log file *
+ *********************************************/
+@@ -801,9 +813,17 @@ main(int argc, char *argv[])
+ }
+
+ del_htabs();
++#ifdef HAVE_ICONV
++ iconv_close(cd_from_sjis);
++ iconv_close(cd_from_eucj);
++#endif
+ /* Whew, all done! Exit with completion status (0) */
+ exit(0);
+ } else {
++#ifdef HAVE_ICONV
++ iconv_close(cd_from_sjis);
++ iconv_close(cd_from_eucj);
++#endif
+ /* No valid records found... exit with error (1) */
+ VPRINT(VERBOSE1, "%s\n", _("No valid records found!"));
+ exit(1);
+@@ -1740,6 +1760,26 @@ unescape(char *str)
+ if (!str)
+ return NULL; /* make sure strings valid */
+
++ /* for apache log's escape code. */
++ while (*cp1) {
++ if (*cp1 == '\\' && *(cp1 + 1) == 'x' &&
++ isxdigit(*(cp1 + 2)) && isxdigit(*(cp1 + 3))) {
++ *cp2 = from_hex(*(cp1 + 2)) * 16 + from_hex(*(cp1 + 3));
++ if ((*cp2 < 32) || (*cp2 == 127))
++ *cp2 = '_';
++ cp1 += 4;
++ cp2++;
++ } else if (*cp1 == '\\' && *(cp1 + 1) == '\\') {
++ *cp2 = '\\';
++ cp1 += 2;
++ cp2++;
++ } else {
++ *cp2++ = *cp1++;
++ }
++ }
++ *cp2 = *cp1;
++ cp1 = cp2 = str;
++
+ while (*cp1) {
+ if (*cp1 == '%') { /* Found an escape? */
+ cp1++;
+@@ -1762,16 +1802,139 @@ unescape(char *str)
+ return str; /* return the string */
+ }
+
++#ifdef HAVE_ICONV
++
++/*********************************************/
++/* SCORE_XXX - calculate score */
++/*********************************************/
++
++int score_eucj(unsigned char *str)
++{
++ int stat=0;
++ int score=0;
++ int bad=0;
++ if(str==NULL) return -1;
++
++ for(; *str!=0;str++){
++ switch(stat){
++ case 0:
++ if(*str>= 0x20 && *str <= 0x7e) score++; //ASCII
++ else if(*str >= 0xa1 && *str <= 0xfe) stat=1; //KANJI(1)
++ else if(*str == 0x8f); // HOJYO KANJI
++ else if(*str == 0x8e) stat=2; // KANA
++ else if(*str < 0x20); //CTRL
++ else bad=1;
++ break;
++ case 1:
++ if(*str >= 0xa1 && *str <= 0xfe) score += 2; //KANJI(2)
++ else bad=1;
++ stat=0;
++ break;
++ case 2:
++ if(*str >= 0xa1 && *str <= 0xdf); //hankaku <- 0
++ else bad=1;
++ stat=0;
++ break;
++ }
++ }
++ if(bad != 0) score = -1;
++ return score;
++}
++
++int score_sjis(unsigned char *str)
++{
++ int stat=0;
++ int score=0;
++ int bad=0;
++ if(str==NULL) return -1;
++
++ for(; *str != 0; str++){
++ switch(stat){
++ case 0:
++ if(*str>= 0x20 && *str <= 0x7e) score++;//ASCII
++ else if((*str >= 0x81 && *str <= 0x9f) ||
++ (*str >= 0xe0 && *str <= 0xfc)) stat=1; //SJIS(1)
++ else if(*str >= 0xa1 && *str <= 0xdf); // KANA
++ else if(*str < 0x20); // CTRL
++ else bad=1;
++ break;
++ case 1:
++ if((*str >= 0x40 && *str <= 0x7e) ||
++ (*str >= 0x80 && *str <= 0xfc)) score += 2; //SJIS(2)
++ else bad=1;
++ stat=0;
++ break;
++ }
++ }
++ if(bad != 0) score = -1;
++ return score;
++}
++
++int score_utf8(unsigned char *str)
++{
++ int stat=0;
++ int score=0;
++ int bad=0;
++ if(str==NULL) return -1;
++
++ for(; *str != 0; str++){
++ switch(stat){
++ case 0:
++ if(*str>= 0x20 && *str <= 0x7e) score++; //ASCII
++ else if(*str >= 0xc0 && *str <= 0xdf) stat=1; //greek etc.
++ else if(*str >= 0xe0 && *str <= 0xef) stat=2; //KANJI etc.
++ else if(*str >= 0xf0 && *str <= 0xf7) stat=4;
++ else if(*str < 0x20); //CTRL
++ else bad=1;
++ break;
++ case 1:
++ if(*str >= 0x80 && *str <= 0xbf) score++;
++ else bad=1;
++ stat=0;
++ break;
++ case 2:
++ if(*str >= 0x80 && *str <= 0xbf) stat=3; //KANJI(2)
++ else {bad=1; stat=0;}
++ break;
++ case 3:
++ if(*str >= 0x80 && *str <= 0xbf) score+=3; //KANJI(3)
++ else bad=1;
++ stat=0;
++ break;
++ case 4:
++ case 5:
++ if(*str >= 0x80 && *str <= 0xbf) stat++;
++ else {bad=1; stat=0;}
++ break;
++ case 6:
++ if(*str >= 0x80 && *str <= 0xbf) score+=4;
++ else bad=1;
++ stat=0;
++ break;
++ }
++ }
++ if(bad != 0) score = -1;
++ return score;
++}
++
++#endif
++
+ /*********************************************/
+ /* SRCH_STRING - get search strings from ref */
+ /*********************************************/
+ void
+ srch_string(char *refer, char *ptr)
+ {
+- char tmpbuf[BUFSIZE];
+- char srch[80] = "";
+- char *cp1, *cp2, *cps;
++ unsigned char tmpbuf[BUFSIZE];
++ unsigned char srch[80] = "";
++ unsigned char *cp1, *cp2, *cps;
+ int sp_flg = 0;
++#ifdef HAVE_ICONV
++ int sjis, eucj, utf8;
++ unsigned char tmpbuf2[BUFSIZE];
++ unsigned char *cp3;
++ size_t inlen, outlen;
++#endif
+
+ /* Check if search engine referrer or return */
+ if ((cps = isinlist(search_list, refer)) == NULL)
+@@ -1832,6 +1995,35 @@ srch_string(char *refer, char *ptr)
+ else
+ break;
+
++#ifdef HAVE_ICONV
++ utf8 = score_utf8(cp2);
++ sjis = score_sjis(cp2);
++ eucj = score_eucj(cp2);
++ if (sjis > utf8 && sjis > eucj) {
++ iconv(cd_from_sjis, NULL, 0, NULL, 0);
++ cp3 = cp2;
++ inlen = strlen(cp2) + 1;
++ cp1 = tmpbuf2;
++ outlen = sizeof(tmpbuf2);
++ if (iconv(cd_from_sjis,
++ (const char **)&cp3, &inlen, (char**)&cp1, &outlen) >= 0 &&
++ inlen == 0) {
++ cp2 = tmpbuf2;
++ }
++ } else if (eucj > utf8 && eucj > sjis) {
++ iconv(cd_from_eucj, NULL, 0, NULL, 0);
++ cp3 = cp2;
++ inlen = strlen(cp2) + 1;
++ cp1 = tmpbuf2;
++ outlen = sizeof(tmpbuf2);
++ if (iconv(cd_from_eucj,
++ (const char **)&cp3, &inlen, (char**)&cp1, &outlen) >= 0 &&
++ inlen == 0) {
++ cp2 = tmpbuf2;
++ }
++ }
++#endif
++
+ /* strip invalid chars */
+ cp1 = cp2;
+ while (*cp1 != '\0') {
+@@ -2391,6 +2583,7 @@ cleanup_refer(char *refer, char *srchstr
+
+ /* unescape referrer */
+ unescape(refer);
++ unescape(refer); /* XXX */
+
+ /* fix referrer field */
+ cp1 = refer;
668' href='#n668'>668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185
/* Evolution calendar - Main page of the memo editor dialog
 *
 * Copyright (C) 2001 Ximian, Inc.
 *
 * Authors: Federico Mena-Quintero <federico@ximian.com>
 *          Miguel de Icaza <miguel@ximian.com>
 *          Seth Alves <alves@hungry.com>
 *          JP Rosevear <jpr@ximian.com>
 *          Nathan Owens <pianocomp81@yahoo.com>
 *
 * This program 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 program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <string.h>
#include <gtk/gtksignal.h>
#include <gtk/gtktextview.h>
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkspinbutton.h>
#include <gtk/gtkoptionmenu.h>
#include <gtk/gtkmessagedialog.h>
#include <glib/gi18n.h>
#include <glade/glade.h>
#include <libedataserverui/e-source-option-menu.h>
#include <libedataserverui/e-name-selector.h>
#include <libedataserverui/e-name-selector-entry.h>
#include <libedataserverui/e-name-selector-list.h>
#include <widgets/misc/e-dateedit.h>

#include "common/authentication.h"
#include "e-util/e-dialog-widgets.h"
#include <e-util/e-dialog-utils.h>
#include "e-util/e-categories-config.h"
#include "e-util/e-util-private.h"
#include "../calendar-config.h"
#include "comp-editor.h"
#include "comp-editor-util.h"
#include "e-send-options-utils.h"
#include "memo-page.h"


/* Private part of the TaskPage structure */
struct _MemoPagePrivate {
    /* Glade XML data */
    GladeXML *xml;

    /* Widgets from the Glade file */
    GtkWidget *main;

    GtkWidget *memo_content;

    EAccountList *accounts;

    /* Bonobo Controller for the menu/toolbar */
    BonoboUIComponent *uic;

    ECalComponentClassification classification;

    /* Organizer */
    GtkWidget *org_label;
    GtkWidget *org_combo;

    /* To field */
    GtkWidget *to_button;
    GtkWidget *to_hbox;
    GtkWidget *to_entry;
    
    /* Summary */
    GtkWidget *summary_label;
    GtkWidget *summary_entry;

    /* Start date */
    GtkWidget *start_label;
    GtkWidget *start_date;
    
    GtkWidget *categories_btn;
    GtkWidget *categories;

    GtkWidget *source_selector;

    char *default_address;

    ENameSelector *name_selector;

    gboolean updating;
};

static const int classification_map[] = {
    E_CAL_COMPONENT_CLASS_PUBLIC,
    E_CAL_COMPONENT_CLASS_PRIVATE,
    E_CAL_COMPONENT_CLASS_CONFIDENTIAL,
    -1
};



static void memo_page_finalize (GObject *object);

static GtkWidget *memo_page_get_widget (CompEditorPage *page);
static void memo_page_focus_main_widget (CompEditorPage *page);
static gboolean memo_page_fill_widgets (CompEditorPage *page, ECalComponent *comp);
static gboolean memo_page_fill_component (CompEditorPage *page, ECalComponent *comp);

G_DEFINE_TYPE (MemoPage, memo_page, TYPE_COMP_EDITOR_PAGE)



/**
 * memo_page_get_type:
 * 
 * Registers the #TaskPage class if necessary, and returns the type ID
 * associated to it.
 * 
 * Return value: The type ID of the #TaskPage class.
 **/

/* Class initialization function for the memo page */
static void
memo_page_class_init (MemoPageClass *klass)
{
    CompEditorPageClass *editor_page_class;
    GObjectClass *object_class;

    editor_page_class = (CompEditorPageClass *) klass;
    object_class = (GObjectClass *) klass;

    editor_page_class->get_widget = memo_page_get_widget;
    editor_page_class->focus_main_widget = memo_page_focus_main_widget;
    editor_page_class->fill_widgets = memo_page_fill_widgets;
    editor_page_class->fill_component = memo_page_fill_component;
    
    object_class->finalize = memo_page_finalize;
}

/* Object initialization function for the memo page */
static void
memo_page_init (MemoPage *mpage)
{
    MemoPagePrivate *priv;

    priv = g_new0 (MemoPagePrivate, 1);
    mpage->priv = priv;

    priv->xml = NULL;

    priv->main = NULL;
    priv->memo_content = NULL;
    priv->classification = E_CAL_COMPONENT_CLASS_NONE;
    priv->categories_btn = NULL;
    priv->categories = NULL;

    priv->updating = FALSE;
}

/* Destroy handler for the memo page */
static void
memo_page_finalize (GObject *object)
{
    MemoPage *mpage;
    MemoPagePrivate *priv;

    g_return_if_fail (object != NULL);
    g_return_if_fail (IS_MEMO_PAGE (object));

    mpage = MEMO_PAGE (object);
    priv = mpage->priv;
    
    if (priv->main)
        g_object_unref (priv->main);

    if (priv->xml) {
        g_object_unref (priv->xml);
        priv->xml = NULL;
    }

    if (priv->default_address) {
        g_free (priv->default_address);
        priv->default_address = NULL;
    }

    g_free (priv);
    mpage->priv = NULL;

    if (G_OBJECT_CLASS (memo_page_parent_class)->finalize)
        (* G_OBJECT_CLASS (memo_page_parent_class)->finalize) (object);
}

static void
set_classification_menu (MemoPage *page, gint class)
{
    bonobo_ui_component_freeze (page->priv->uic, NULL);
    switch (class) {
        case E_CAL_COMPONENT_CLASS_PUBLIC:
            bonobo_ui_component_set_prop (
                page->priv->uic, "/commands/ActionClassPublic",
                "state", "1", NULL);
            break;
        case E_CAL_COMPONENT_CLASS_CONFIDENTIAL:
            bonobo_ui_component_set_prop (
                page->priv->uic, "/commands/ActionClassConfidential",
                "state", "1", NULL);
            break;
        case E_CAL_COMPONENT_CLASS_PRIVATE:
            bonobo_ui_component_set_prop (
                page->priv->uic, "/commands/ActionClassPrivate",
                "state", "1", NULL);
            break;
    }
    bonobo_ui_component_thaw (page->priv->uic, NULL);
}

/* get_widget handler for the task page */
static GtkWidget *
memo_page_get_widget (CompEditorPage *page)
{
    MemoPage *mpage;
    MemoPagePrivate *priv;

    mpage = MEMO_PAGE (page);
    priv = mpage->priv;

    return priv->main;
}

/* focus_main_widget handler for the memo page */
static void
memo_page_focus_main_widget (CompEditorPage *page)
{
    MemoPage *mpage;
    MemoPagePrivate *priv;

    mpage = MEMO_PAGE (page);
    priv = mpage->priv;

    gtk_widget_grab_focus (priv->summary_entry);
}

/* Fills the widgets with default values */
static void
clear_widgets (MemoPage *mpage)
{
    MemoPagePrivate *priv;

    priv = mpage->priv;

    /* Summary */
    e_dialog_editable_set (priv->summary_entry, NULL);

    /* memo content */
    gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->memo_content)), "", 0);

    /* Classification */
    priv->classification = E_CAL_COMPONENT_CLASS_PRIVATE;
    set_classification_menu (mpage, priv->classification);

    /* Categories */
    e_dialog_editable_set (priv->categories, NULL);

    if (priv->default_address)
        gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->org_combo)->entry), priv->default_address);
}

void 
memo_page_set_classification (MemoPage *page, ECalComponentClassification class)
{
    page->priv->classification = class;
}

static void
sensitize_widgets (MemoPage *mpage)
{
    gboolean read_only, sens = FALSE, sensitize;
    MemoPagePrivate *priv;
    
    priv = mpage->priv;

    if (!e_cal_is_read_only (COMP_EDITOR_PAGE (mpage)->client, &read_only, NULL))
        read_only = TRUE;
    
    if (COMP_EDITOR_PAGE (mpage)->flags & COMP_EDITOR_IS_SHARED)
        sens = COMP_EDITOR_PAGE (mpage)->flags & COMP_EDITOR_PAGE_USER_ORG;
    else
        sens = TRUE;

    sensitize = (!read_only && sens);
    
    priv = mpage->priv;

    if (!e_cal_is_read_only (COMP_EDITOR_PAGE (mpage)->client, &read_only, NULL))
        read_only = TRUE;
    
    gtk_text_view_set_editable (GTK_TEXT_VIEW (priv->memo_content), sensitize);
    gtk_widget_set_sensitive (priv->start_date, sensitize);
    gtk_widget_set_sensitive (priv->categories_btn, !read_only);
    gtk_editable_set_editable (GTK_EDITABLE (priv->categories), !read_only);
    gtk_editable_set_editable (GTK_EDITABLE (priv->summary_entry), sensitize);
    
    if (COMP_EDITOR_PAGE (mpage)->flags & COMP_EDITOR_IS_SHARED) {
        gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->org_combo)->entry), sensitize);
    
        if (priv->to_entry) {
            gtk_editable_set_editable (GTK_EDITABLE (priv->to_entry), !read_only);
            gtk_widget_grab_focus (priv->to_entry);