rpms/gcin/FC-3 1.2.5-update.patch, NONE, 1.1 .cvsignore, 1.4, 1.5 gcin.spec, 1.7, 1.8 sources, 1.4, 1.5

Chung-Yen Chang (candyz) fedora-extras-commits at redhat.com
Fri Sep 8 13:58:49 UTC 2006


Author: candyz

Update of /cvs/extras/rpms/gcin/FC-3
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14482

Modified Files:
	.cvsignore gcin.spec sources 
Added Files:
	1.2.5-update.patch 
Log Message:
update to 1.2.5

1.2.5-update.patch:

--- NEW FILE 1.2.5-update.patch ---
Binary files gcin-1.2.5.orig/.tedfilepos and gcin-1.2.5/.tedfilepos differ
diff -urN gcin-1.2.5.orig/data/tsin.src gcin-1.2.5/data/tsin.src
--- gcin-1.2.5.orig/data/tsin.src	2006-09-08 20:45:07.000000000 +0800
+++ gcin-1.2.5/data/tsin.src	2006-09-08 21:22:49.000000000 +0800
@@ -32244,3 +32244,4 @@
 『』 【 】 0
 【】 【 】 0
 馬櫻丹 ㄇㄚ3 ㄧㄥ ㄉㄢ 0
+一首 ㄧ4 ㄕㄡ3 0
diff -urN gcin-1.2.5.orig/eliu at candyz.caydyz.org gcin-1.2.5/eliu at candyz.caydyz.org
--- gcin-1.2.5.orig/eliu at candyz.caydyz.org	2006-09-08 18:35:37.000000000 +0800
+++ gcin-1.2.5/eliu at candyz.caydyz.org	1970-01-01 08:00:00.000000000 +0800
@@ -1,251 +0,0 @@
-#include "gcin.h"
-#include "pho.h"
-#include "gtab.h"
-#include "win-sym.h"
-#include "eggtrayicon.h"
-
-static GdkPixbuf *pixbuf, *pixbuf_ch;
-static PangoLayout* pango;
-static GtkWidget *da;
-static GdkGC *gc;
-
-static char gcin_icon[]=GCIN_ICON_DIR"/gcin-tray.png";
-static char pixbuf_ch_fname[128];
-
-static void
-cb_pref (GtkAction * action)
-{
-  system(GCIN_BIN_DIR"/gcin-setup &");
-}
-
-void toggle_gb_output();
-extern gboolean gb_output;
-
-static void get_text_w_h(char *s, int *w, int *h)
-{
-  pango_layout_set_text(pango, s, strlen(s));
-  pango_layout_get_pixel_size(pango, w, h);
-}
-
-
-static void draw_icon()
-{
-
-  GdkPixbuf *pix =  !current_CS ||
-    (current_CS->im_state == GCIN_STATE_DISABLED||current_CS->im_state == GCIN_STATE_ENG_FULL) ?
-    pixbuf : pixbuf_ch;
-
-  int dw = da->allocation.width, dh = da->allocation.height;
-  int w, h;
-
-  GdkColor color_fg;
-
-  gdk_color_parse("black", &color_fg);
-  gdk_gc_set_rgb_fg_color(gc, &color_fg);
-
-  if (pix)
-    gdk_draw_pixbuf(da->window, NULL, pix, 0, 0, 0, 0, -1, -1, GDK_RGB_DITHER_NORMAL, 0, 0);
-  else {
-    get_text_w_h(inmd[current_CS->in_method].cname, &w, &h);
-    gdk_draw_layout(da->window, gc, 0, 0, pango);
-  }
-
-  if (current_CS) {
-    if (current_CS->b_half_full_char) {
-      static char full[] = "å…¨";
-
-      get_text_w_h(full,  &w, &h);
-      gdk_draw_layout(da->window, gc, dw - w, dh - h, pango);
-    }
-
-    if (current_CS->im_state == GCIN_STATE_ENG_FULL) {
-      static char efull[] = "英全";
-
-      get_text_w_h(efull,  &w, &h);
-      gdk_draw_layout(da->window, gc, 0, 0, pango);
-    }
-  }
-
-  gdk_color_parse("red", &color_fg);
-  gdk_gc_set_rgb_fg_color(gc, &color_fg);
-
-  if (gb_output) {
-    static char sim[] = "简";
-    get_text_w_h(sim,  &w, &h);
-    gdk_draw_layout(da->window, gc, 0, dh - h, pango);
-  }
-}
-
-void update_tray_icon()
-{
-  gtk_widget_queue_draw(da);
-}
-
-void load_tray_icon()
-{
-  char *iconame = inmd[current_CS->in_method].icon;
-  char *fname = NULL;
-  char tt[128];
-
-  if (iconame) {
-    get_gcin_user_fname(iconame, tt);
-
-    fname = tt;
-    if (access(tt, R_OK)) {
-      sprintf(tt, GCIN_ICON_DIR"/%s", iconame);
-      if (access(tt, R_OK))
-        fname = NULL;
-    }
-  }
-
-#if 0
-  dbg("fname %x %s\n", fname, fname);
-#endif
-  if (!fname) {
-    if (pixbuf_ch)
-      gdk_pixbuf_unref(pixbuf_ch);
-
-    pixbuf_ch = NULL;
-    pixbuf_ch_fname[0] = 0;
-  } else
-  if (strcmp(fname, pixbuf_ch_fname)) {
-    strcpy(pixbuf_ch_fname, fname);
-
-    if (pixbuf_ch)
-      gdk_pixbuf_unref(pixbuf_ch);
-
-    GError *err = NULL;
-    pixbuf_ch = gdk_pixbuf_new_from_file(fname, &err);
-  }
-
-  update_tray_icon();
-}
-
-
-void cb_trad_sim_toggle()
-{
-  toggle_gb_output();
-  update_tray_icon();
-}
-
-static void cb_sim2trad()
-{
-  system(GCIN_BIN_DIR"/sim2trad &");
-}
-
-
-static void cb_trad2sim()
-{
-  system(GCIN_BIN_DIR"/trad2sim &");
-}
-
-struct {
-  char *name;
-  char *stock_id;
-  void (*cb)();
-} mitems[] = {
-  {"設定", GTK_STOCK_PREFERENCES, cb_pref},
-  {"æ­£->ç°¡é«”", NULL, cb_trad2sim},
-  {"簡->正體", NULL, cb_sim2trad},
-};
-
-
-GtkWidget *menu;
-
-static void create_menu()
-{
-  menu = gtk_menu_new ();
-
-  int i;
-  for(i=0; i < sizeof(mitems)/ sizeof(mitems[0]); i++) {
-    GtkWidget *item;
-
-    if (mitems[i].stock_id) {
-      item = gtk_image_menu_item_new_with_label (mitems[i].name);
-      gtk_image_menu_item_set_image(item, gtk_image_new_from_stock(mitems[i].stock_id, GTK_ICON_SIZE_MENU));
-    }
-    else
-      item = gtk_menu_item_new_with_label (mitems[i].name);
-
-    g_signal_connect (G_OBJECT (item), "activate",
-                      G_CALLBACK (mitems[i].cb), NULL);
-
-    gtk_widget_show(item);
-
-    gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-  }
-
-  return;
-}
-
-gint inmd_switch_popup_handler (GtkWidget *widget, GdkEvent *event);
-
-gboolean
-tray_button_press_event_cb (GtkWidget * button, GdkEventButton * event, gpointer userdata)
-{
-  switch (event->button) {
-    case 1:
-      cb_trad_sim_toggle(NULL);
-      break;
-    case 2:
-      inmd_switch_popup_handler(NULL, (GdkEvent *)event);
-      break;
-    case 3:
-      if (!menu)
-        create_menu();
-
-      gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
-         event->button, event->time);
-      break;
-  }
-
-  return TRUE;
-}
-
-gboolean cb_expose(GtkWidget *da, GdkEventExpose *event, gpointer data)
-{
-  draw_icon();
-}
-
-
-void create_tray()
-{
-  EggTrayIcon *tray_icon = egg_tray_icon_new ("gcin");
-  GtkWidget *event_box = gtk_event_box_new ();
-
-  GtkTooltips *tips = gtk_tooltips_new ();
-  gtk_tooltips_set_tip (GTK_TOOLTIPS (tips), event_box, "左:正/簡體 中:輸入法 右:選項", NULL);
-
-  gtk_container_add (GTK_CONTAINER (tray_icon), event_box);
-
-  g_signal_connect (G_OBJECT (event_box), "button-press-event",
-                    G_CALLBACK (tray_button_press_event_cb), NULL);
-
-  GError *err = NULL;
-  pixbuf = gdk_pixbuf_new_from_file(gcin_icon, &err);
-  int pwidth = gdk_pixbuf_get_width (pixbuf);
-  int pheight = gdk_pixbuf_get_height (pixbuf);
-
-  if (!pixbuf)
-    p_err("cannot load file");
-
-  da =  gtk_drawing_area_new();
-
-  g_signal_connect(G_OBJECT(da), "expose-event", G_CALLBACK(cb_expose), NULL);
-
-  gtk_container_add (GTK_CONTAINER (event_box), da);
-
-  gtk_widget_set_size_request(tray_icon, pwidth, pheight);
-
-  pango = gtk_widget_create_pango_layout(da, " ");
-
-  PangoContext *context=gtk_widget_get_pango_context(da);
-  PangoFontDescription* desc=pango_context_get_font_description(context);
-  pango_font_description_set_size(desc, 10);
-
-  pango_layout_set_font_description(pango, desc);
-
-  gtk_widget_show_all (GTK_WIDGET (tray_icon));
-
-  gc = gdk_gc_new (da->window);
-}
diff -urN gcin-1.2.5.orig/tray.c gcin-1.2.5/tray.c
--- gcin-1.2.5.orig/tray.c	2006-09-08 18:47:50.000000000 +0800
+++ gcin-1.2.5/tray.c	2006-09-08 21:05:37.000000000 +0800
@@ -13,7 +13,7 @@
 static char pixbuf_ch_fname[128];
 
 static void
-cb_pref (GtkAction * action)
+cb_pref ()
 {
   system(GCIN_BIN_DIR"/gcin-setup &");
 }
diff -urN gcin-1.2.5.orig/tsin-parse.c gcin-1.2.5/tsin-parse.c
--- gcin-1.2.5.orig/tsin-parse.c	2006-09-07 14:39:14.000000000 +0800
+++ gcin-1.2.5/tsin-parse.c	2006-09-08 20:50:41.000000000 +0800
@@ -25,7 +25,6 @@
 
 static void add_cache(int start, float score, TSIN_PARSE *out)
 {
-  cache = trealloc(cache, CACHE, cacheN+1);
   cache[cacheN].start = start;
   cache[cacheN].score = score;
   memcpy(cache[cacheN].best, out, sizeof(TSIN_PARSE) * (c_len - start));
@@ -147,6 +146,7 @@
 
 void tsin_parse(TSIN_PARSE out[])
 {
+  cache = tmalloc(CACHE, c_len);
   cacheN = 0;
 
   tsin_parse_recur(0, out);
diff -urN gcin-1.2.5.orig/tsin.c gcin-1.2.5/tsin.c
--- gcin-1.2.5.orig/tsin.c	2006-09-08 14:10:33.000000000 +0800
+++ gcin-1.2.5/tsin.c	2006-09-08 21:00:32.000000000 +0800
@@ -1496,10 +1496,13 @@
            clear_tsin_buffer();
            return 1;
          } else
+         if (xkey>=XK_1 && xkey<=XK_3) {
+           return 1;
+         } else {
            return 0;
+         }
        }
 
-
        char *pp;
 
        char xkey_lcase = xkey;
diff -urN gcin-1.2.5.orig/win0.c gcin-1.2.5/win0.c
--- gcin-1.2.5.orig/win0.c	2006-09-08 14:01:03.000000000 +0800
+++ gcin-1.2.5/win0.c	2006-09-08 21:22:13.000000000 +0800
@@ -257,8 +257,7 @@
   GtkWidget *widget = chars[index].vbox;
 #endif
 
-  gtk_widget_realize(widget);
-  gtk_widget_show_now(widget);
+  gtk_widget_show(widget);
 
   GtkRequisition sz;
   gtk_widget_size_request(widget, &sz);


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/gcin/FC-3/.cvsignore,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- .cvsignore	5 Sep 2006 07:42:09 -0000	1.4
+++ .cvsignore	8 Sep 2006 13:58:49 -0000	1.5
@@ -1 +1 @@
-gcin-1.2.4.tar.bz2
+gcin-1.2.5.tar.bz2


Index: gcin.spec
===================================================================
RCS file: /cvs/extras/rpms/gcin/FC-3/gcin.spec,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- gcin.spec	7 Sep 2006 23:18:38 -0000	1.7
+++ gcin.spec	8 Sep 2006 13:58:49 -0000	1.8
@@ -1,6 +1,6 @@
 Name:           gcin
-Version:        1.2.4
-Release:        2%{?dist}
+Version:        1.2.5
+Release:        1%{?dist}
 Summary:        Input method for Traditional Chinese
 
 Group:          System Environment/Libraries
@@ -13,6 +13,7 @@
 Patch2:         qt.patch
 Patch3:         configure.patch
 Patch4:         gcin-x86_64.patch
+Patch5:         1.2.5-update.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  qt-devel, gtk2-devel, desktop-file-utils
@@ -30,9 +31,9 @@
 %patch2 -p1 -b .qt
 %patch3 -p1 -b .configure
 %patch4 -p1 -b .x86_64
+%patch5 -p1 -b .update
 cp -f gcinicon/gtab.list data/
 cp -f gcinicon/*.png icons/
-cp -af *.1 man/
 find . -name \*.h -o -name \*.c | xargs chmod ugo-x 
 sed -i.strip -e 's|install[ \t][ \t]*-s|install|' Makefile
 
@@ -98,6 +99,9 @@
 %{_libdir}/libgcin-im-client.so
 
 %changelog
+* Fri Sep 08 2006 Chung-Yen Chang <candyz0416 at gmail.com> - 1.2.5-1
+- update to 1.2.5
+
 * Fri Sep 08 2006 Chung-Yen Chang <candyz0416 at gmail.com> - 1.2.4-2
 - fix x86_64 build problems
 


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/gcin/FC-3/sources,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- sources	5 Sep 2006 07:42:09 -0000	1.4
+++ sources	8 Sep 2006 13:58:49 -0000	1.5
@@ -1 +1 @@
-bfddb035152f93c1b7f9b80f4754a781  gcin-1.2.4.tar.bz2
+79e681c5a2106d0f9c52c281fe2bd11b  gcin-1.2.5.tar.bz2




More information about the scm-commits mailing list