Skip to content

Commit

Permalink
Import upstream release 1.5.7.pre12
Browse files Browse the repository at this point in the history
  • Loading branch information
kanru committed Nov 29, 2010
1 parent 6c71fe7 commit c8d46b6
Show file tree
Hide file tree
Showing 459 changed files with 96,468 additions and 7,058 deletions.
214 changes: 212 additions & 2 deletions Changelog.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions IC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
#include "gcin.h"

#undef DEBUG

static IC *ic_list = (IC *)NULL;
static IC *free_list = (IC *)NULL;

Expand Down Expand Up @@ -141,10 +143,8 @@ void load_IC(IC *rec)
}

if (cs->input_style & InputStyleOnSpot) {
#if 0
if (cs->b_im_enabled)
if (cs->im_state != GCIN_STATE_DISABLED)
move_IC_in_win(cs);
#endif
} else
if (cs->input_style & InputStyleOverSpot) {
if (cs->im_state != GCIN_STATE_DISABLED)
Expand All @@ -167,7 +167,7 @@ StoreIC(IC *rec, IMChangeICStruct *call_data)

if (!current_CS)
current_CS = cs;
#if DEBUG
#if DEBUG && 0
dbg(".... StoreIC\n");
#endif
for (i = 0; i < (int)call_data->ic_attr_num; i++, ic_attr++) {
Expand Down Expand Up @@ -292,7 +292,7 @@ StoreIC(IC *rec, IMChangeICStruct *call_data)
}

load_IC(rec);
#if DEBUG
#if DEBUG && 0
dbg("exit StoreIC\n");
#endif
}
Expand All @@ -308,7 +308,7 @@ void CreateIC(IMChangeICStruct *call_data)
StoreIC(rec, call_data);
call_data->icid = rec->id;
load_IC(rec);
#if DEBUG
#if DEBUG && 0
dbg("CreateIC .. exit\n");
#endif
return;
Expand Down
11 changes: 5 additions & 6 deletions IC.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ typedef struct {
#endif

typedef struct {
#if WIN32
HWND client_win; /* client window */
#else
Window client_win; /* client window */
#endif
INT32 input_style; /* input style */
GCIN_STATE_E im_state;
gboolean b_half_full_char;
Expand All @@ -69,6 +65,9 @@ typedef struct {
short fixed_x, fixed_y;
short in_method;
XPoint spot_location; /* spot location, relative to client window */
#if USE_XIM
gboolean xim_preedit_started;
#endif
} ClientState;


Expand All @@ -77,9 +76,9 @@ typedef struct _IC {
CARD16 id; /* ic id */
#endif
Window focus_win; /* focus window */
#if USE_XIM
char *resource_name; /* resource name */
char *resource_class; /* resource class */
#if USE_XIM
PreeditAttributes pre_attr; /* preedit attributes */
StatusAttributes sts_attr; /* status attributes */
#endif
Expand All @@ -88,7 +87,7 @@ typedef struct _IC {
} IC;

typedef struct {
char *server_locale;
// char *server_locale;
char xim_server_name[32];
Window xim_xwin;
#if USE_XIM
Expand Down
45 changes: 28 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,41 @@ GCIN_SO= gcin1.so gcin2.so

OBJS=gcin.o eve.o util.o gcin-conf.o gcin-settings.o locale.o gcin-icon.o \
gcin-switch.o gcin-exec-script.o $(GCIN_SO) pho-play.o cache.o gtk_bug_fix.o \
$(gcin_pho_o) $(gcin_gtab_o) gcin-common.o phrase.o t2s-lookup.o gtab-use-count.o
$(gcin_pho_o) $(gcin_gtab_o) gcin-common.o phrase.o t2s-lookup.o gtab-use-count.o \
win-save-phrase.o unix-exec.o

OBJS_TSLEARN=tslearn.o util.o gcin-conf.o pho-util.o tsin-util.o gcin-send.o pho-sym.o \
table-update.o locale.o gcin-settings.o gcin-common.o gcin-icon.o
table-update.o locale.o gcin-settings.o gcin-common.o gcin-icon.o pho-dbg.o
OBJS_JUYIN_LEARN=juyin-learn.o locale.o util.o pho-util.o pho-sym.o \
gcin-settings.o gcin-conf.o table-update.o pinyin.o gcin-icon.o
gcin-settings.o gcin-conf.o table-update.o pinyin.o gcin-icon.o pho-dbg.o
OBJS_sim2trad=sim2trad.o util.o gcin2.so locale.o gcin-conf.o gcin-icon.o
OBJS_phod2a=phod2a.o pho-util.o gcin-conf.o pho-sym.o table-update.o pho-dbg.o locale.o \
gcin-settings.o util.o
OBJS_tsa2d32=tsa2d32.o gcin-send.o util.o pho-sym.o gcin-conf.o locale.o pho-lookup.o
OBJS_phoa2d=phoa2d.o pho-sym.o gcin-send.o gcin-conf.o locale.o pho-lookup.o
OBJS_phoa2d=phoa2d.o pho-sym.o gcin-send.o gcin-conf.o locale.o pho-lookup.o util.o
OBJS_kbmcv=kbmcv.o pho-sym.o util.o locale.o
OBJS_tsd2a32=tsd2a32.o pho-sym.o pho-dbg.o locale.o util.o
OBJS_tsd2a32=tsd2a32.o pho-sym.o pho-dbg.o locale.o util.o gtab-dbg.o
OBJS_gcin2tab=gcin2tab.o gtab-util.o util.o locale.o
OBJS_gtab_merge=gtab-merge.o gtab-util.o util.o locale.o
OBJS_gcin_steup=gcin-setup.o gcin-conf.o util.o gcin-send.o gcin-settings.o \
gcin-setup-list.o gcin-switch.o locale.o gcin-setup-pho.o about.o \
gcin-icon.o gcin-setup-gtab.o gtab-list.o gcin-exec-script.o
OBJS_gcin_setup_tab=gcin-setup-tab.o gcin-conf.o util.o gcin-send.o gcin-settings.o \
gcin-switch.o about.o gcin-icon.o gtab-list.o gcin-exec-script.o

OBJS_gcin_gb_toggle = gcin-gb-toggle.o gcin-conf.o util.o gcin-send.o
OBJS_gcin_kbm_toggle = gcin-kbm-toggle.o gcin-conf.o util.o gcin-send.o
OBJS_gcin_exit = gcin-exit.o gcin-conf.o util.o gcin-send.o
OBJS_gcin_message = gcin-message.o gcin-conf.o util.o gcin-send.o
OBJS_pin_juyin = pin-juyin.o util.o pho-lookup.o locale.o pho-sym.o

OBJS_tsin2gtab_phrase = tsin2gtab-phrase.o gcin-conf.o util.o locale.o \
pho-dbg.o pho-sym.o gtab-dbg.o

#WALL=-Wall
CFLAGS= -DUNIX=1 $(WALL) $(OPTFLAGS) $(GTKINC) -I./IMdkit/include -I./im-client -DDEBUG="0$(GCIN_DEBUG)" \
-DGCIN_TABLE_DIR=\"$(GCIN_TABLE_DIR)\" \
-DGCIN_OGG_DIR=\"$(GCIN_OGG_DIR)\" \
-DDOC_DIR=\"$(DOC_DIR)\" \
-DGCIN_ICON_DIR=\"$(GCIN_ICON_DIR)\" -DGCIN_VERSION=\"$(GCIN_VERSION)\" \
-DGCIN_ICON_DIR=\"$(GCIN_ICON_DIR)\" \
-DGCIN_SCRIPT_DIR=\"$(GCIN_SCRIPT_DIR)\" -DGCIN_BIN_DIR=\"$(GCIN_BIN_DIR)\" \
-DSYS_ICON_DIR=\"$(SYS_ICON_DIR)\" -DFREEBSD=$(FREEBSD) -DMAC_OS=$(MAC_OS) \
-DG_DISABLE_SINGLE_INCLUDES -DG_DISABLE_DEPRECATED \
Expand Down Expand Up @@ -76,7 +78,6 @@ endif
ifeq ($(USE_TSIN),Y)
CFLAGS += -DUSE_TSIN=1
OBJS += $(gcin_tsin_o)
gcin1_so += tsin-char.pico
endif

ifeq ($(USE_ANTHY),Y)
Expand Down Expand Up @@ -109,8 +110,8 @@ OBJ_IMSRV=im-addr.o im-dispatch.o im-srv.o gcin-crypt.o
$(CCX) $(CFLAGS) -c -fpic -o $@ $<

PROGS=gcin tsd2a32 tsa2d32 phoa2d phod2a tslearn gcin-setup gcin2tab \
juyin-learn sim2trad gcin-gb-toggle gcin-message gtab-merge gcin-setup-tab \
gcin-kbm-toggle
juyin-learn sim2trad gcin-gb-toggle gcin-message gtab-merge \
gcin-kbm-toggle tsin2gtab-phrase gcin-exit
PROGS_SYM=trad2sim
PROGS_CV=kbmcv pin-juyin

Expand All @@ -120,13 +121,14 @@ all: $(PROGS) trad2sim $(DATA) $(PROGS_CV) gcin.spec
ifeq ($(USE_I18N),Y)
$(MAKE) -C po
endif
if [ $(GTK3_IM) = 'Y' ]; then $(MAKE) -C gtk3-im; fi
if [ $(QT_IM) = 'Y' ]; then $(MAKE) -C qt-im; fi
if [ $(QT4_IM) = 'Y' ]; then $(MAKE) -C qt4-im; fi

gcin: $(OBJS) $(IMdkitLIB) $(OBJ_IMSRV)
LD_RUN_PATH=$(gcin_ld_run_path) \
$(CCLD) $(EXTRA_LDFLAGS) -o $@ $(OBJS) $(IMdkitLIB) $(OBJ_IMSRV) -lXtst $(LDFLAGS) -L/usr/X11R6/lib
rm -f core.*
rm -f core.* vgcore.*
ln -sf $@ $@.test

gcin-nocur: $(OBJS) $(IMdkitLIB) $(OBJ_IMSRV)
Expand All @@ -153,11 +155,6 @@ gcin-setup: $(OBJS_gcin_steup) im-client/libgcin-im-client.so
export LD_RUN_PATH=$(gcin_ld_run_path) ;\
$(CCLD) -o $@ $(OBJS_gcin_steup) -L./im-client -lgcin-im-client $(LDFLAGS)

gcin-setup-tab: $(OBJS_gcin_setup_tab) im-client/libgcin-im-client.so
rm -f core.*
export LD_RUN_PATH=$(gcinlibdir) ;\
$(CCLD) -o $@ $(OBJS_gcin_setup_tab) -L./im-client -lgcin-im-client $(LDFLAGS)

phoa2d: $(OBJS_phoa2d) im-client/libgcin-im-client.so
export LD_RUN_PATH=$(gcin_ld_run_path) ;\
$(CCLD) -o $@ $(OBJS_phoa2d) -L./im-client -lgcin-im-client $(LDFLAGS)
Expand Down Expand Up @@ -193,16 +190,26 @@ gcin-kbm-toggle: $(OBJS_gcin_kbm_toggle)
export LD_RUN_PATH=$(gcin_ld_run_path) ;\
$(CCLD) -o $@ $(OBJS_gcin_kbm_toggle) -L./im-client -lgcin-im-client $(LDFLAGS)

gcin-exit: $(OBJS_gcin_exit)
export LD_RUN_PATH=$(gcin_ld_run_path) ;\
$(CCLD) -o $@ $(OBJS_gcin_exit) -L./im-client -lgcin-im-client $(LDFLAGS)

gcin-message: $(OBJS_gcin_message)
export LD_RUN_PATH=$(gcin_ld_run_path) ;\
$(CCLD) -o $@ $(OBJS_gcin_message) -L./im-client -lgcin-im-client $(LDFLAGS)

pin-juyin: $(OBJS_pin_juyin)
$(CCLD) -o $@ $(OBJS_pin_juyin) $(LDFLAGS)

tsin2gtab-phrase: $(OBJS_tsin2gtab_phrase)
$(CCLD) -o $@ $(OBJS_tsin2gtab_phrase) $(LDFLAGS)

im-client/libgcin-im-client.so:
$(MAKE) -C im-client

gcin-version.h: VERSION.gcin
echo '#define GCIN_VERSION "'`cat VERSION.gcin`'"' > gcin-version.h

gcin1_so += intcode.pico win-int.pico win-message.pico win-sym.pico \
win-inmd-switch.pico pinyin.pico win-pho-near.pico win-kbm.pico

Expand Down Expand Up @@ -252,6 +259,7 @@ install:
$(MAKE) -C data install
$(MAKE) -C im-client install
$(MAKE) -C gtk-im install
if [ $(GTK3_IM) = 'Y' ]; then $(MAKE) -C gtk3-im install; fi
if [ $(QT_IM) = 'Y' ]; then $(MAKE) -C qt-im install; fi
if [ $(QT4_IM) = 'Y' ]; then $(MAKE) -C qt4-im install; fi
if [ $(prefix) = /usr/local ]; then \
Expand All @@ -278,6 +286,9 @@ clean:
$(MAKE) -C scripts clean
$(MAKE) -C im-client clean
$(MAKE) -C gtk-im clean
ifeq ($(GTK3_IM), Y)
$(MAKE) -C gtk3-im clean
endif
$(MAKE) -C qt-im clean
$(MAKE) -C qt4-im clean
$(MAKE) -C man clean
Expand Down
2 changes: 0 additions & 2 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -1188,8 +1188,6 @@ <h3 id="__13">3.29. 請問一下內定輸入法,是由那個設定檔來決定
<h3 id="_su_sudo_gcin">3.30. 使用 su 或 sudo 後,無法使用 gcin,該怎麼辦?</h3><div style="clear:left"></div>
<div class="para"><p>如果使用的 gcin 是 1.4.3 pre7 之前的版本(含 1.4.3 pre7),可以這麼做:</p></div>
<div class="para"><p>設定 (<em>gcin-setup</em>) → 內定輸入法 &amp; 開啟/關閉 → 遠端 client 程式支援 (port 9999-)</p></div>
<div class="para"><p></p></div>
<div class="para"><p><em>gcin-setup-tab</em> → 通用 → 遠端 client 程式支援 (port 9999-)</p></div>
<div class="para"><p>完成這個動作後,重新登入 X Window System 試試看。</p></div>
<div class="para"><p>如果用的 gcin 是 1.4.3 pre8 後的版本(含 1.4.3 pre8),已支援 su root 的中文輸入,注意—要配合新的 libgcin-im-client.so.1.1.0 才可!</p></div>
<h3 id="_kde_gcin">3.31. 在 KDE 的系統管理頁面無法使用 gcin,該怎麼辦?</h3><div style="clear:left"></div>
Expand Down
2 changes: 1 addition & 1 deletion VERSION.gcin
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.6
1.5.7.pre12
33 changes: 29 additions & 4 deletions about.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "gcin.h"
#include "gcin-version.h"

static GtkWidget *about_window;

Expand Down Expand Up @@ -26,15 +27,27 @@ int html_browser(char *fname);

static void callback_forum( GtkWidget *widget, gpointer data)
{
#define FURL "http://hyperrate.com/dir.php?eid=67"
#if WIN32
#define FURL "http://hyperrate.com/dir.php?eid=215"
ShellExecuteA(NULL, "open", FURL, NULL, NULL, SW_SHOWNORMAL);
#else
#define FURL "http://hyperrate.com/dir.php?eid=67"
html_browser(FURL);
#endif
}


static void callback_changelog( GtkWidget *widget, gpointer data)
{
#define LOG_URL "http://cle.linux.org.tw/gcin/download/Changelog.html"
#if WIN32
ShellExecuteA(NULL, "open", LOG_URL, NULL, NULL, SW_SHOWNORMAL);
#else
html_browser(LOG_URL);
#endif
}


void sys_icon_fname(char *iconame, char fname[]);
void create_about_window()
{
Expand All @@ -48,6 +61,7 @@ void create_about_window()

/* Create a new about_window */
about_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_has_resize_grip(GTK_WINDOW(about_window), FALSE);

gtk_window_set_title (GTK_WINDOW (about_window), _(_L("關於 gcin")));

Expand Down Expand Up @@ -75,10 +89,23 @@ void create_about_window()
GtkWidget *separator = gtk_hseparator_new ();
gtk_box_pack_start(GTK_BOX(vbox), separator, FALSE, FALSE, 3);

#if GTK_CHECK_VERSION(2,18,9)
GtkWidget *label = gtk_label_new(_(_L("<a href='http://hyperrate.com?eid=67'>點選連結前往 gcin 討論區</a>\n"
"<a href='http://hyperrate.com?eid=215'>gcin也有 Windows版</a>\n"
"<a href='http://cle.linux.org.tw/gcin/download/Changelog.html'>gcin改變記錄</a>\n"
)));
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
#else
GtkWidget *button_forum = gtk_button_new_with_label(_(_L("討論區")));
gtk_box_pack_start(GTK_BOX(vbox), button_forum, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (button_forum), "clicked",
G_CALLBACK (callback_forum), NULL);
GtkWidget *button_changelog = gtk_button_new_with_label(_(_L("gcin改變記錄")));
gtk_box_pack_start(GTK_BOX(vbox), button_changelog, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (button_changelog), "clicked",
G_CALLBACK (callback_changelog), NULL);
#endif


#if UNIX
Expand All @@ -89,18 +116,16 @@ void create_about_window()
image = gtk_image_new_from_file (gcin_png);
#endif

label_version = gtk_label_new ("version " GCIN_VERSION);
label_version = gtk_label_new ("version " GCIN_VERSION " " __DATE__);

gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 3);
gtk_box_pack_start (GTK_BOX (hbox), label_version, FALSE, FALSE, 3);


gtk_container_add (GTK_CONTAINER (about_window), vbox);

/* Create a new button */
GtkWidget *button = gtk_button_new_with_label (_(_L("關閉")));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 3);
/* Connect the "clicked" signal of the button to our callback */
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (callback_close), (gpointer) "cool button");

Expand Down
Loading

0 comments on commit c8d46b6

Please sign in to comment.