diff options
author | Joe Marcus Clarke <marcus@FreeBSD.org> | 2003-07-01 06:14:02 +0000 |
---|---|---|
committer | Joe Marcus Clarke <marcus@FreeBSD.org> | 2003-07-01 06:14:02 +0000 |
commit | a47f001dcc729ae1ec20644e4c50bf68e2e3de72 (patch) | |
tree | 8edf3f1e6e1607d837e640cad729eaaa44b2c8aa /www | |
parent | update graphics/p5-chart: 1.0.1 --> 2.2 (diff) |
* Update to 1.4
* Mark IGNORE on Alpha -STABLE
Notes
Notes:
svn path=/head/; revision=83943
Diffstat (limited to 'www')
-rw-r--r-- | www/mozilla/Makefile | 8 | ||||
-rw-r--r-- | www/mozilla/distinfo | 2 | ||||
-rw-r--r-- | www/mozilla/files/patch-gfx_src_gtk_nsFontMetricsXft.cpp | 48 | ||||
-rw-r--r-- | www/mozilla/files/patch-jsfun.c | 29 | ||||
-rw-r--r-- | www/mozilla/files/patch-nsprpub_pr_src_misc_prnetdb.c | 11 | ||||
-rw-r--r-- | www/mozilla/files/patch-nsprpub_pr_src_misc_prtime.c | 25 | ||||
-rw-r--r-- | www/mozilla/files/patch-qt | 23 | ||||
-rw-r--r-- | www/mozilla/files/xim_dekita2.patch | 517 |
8 files changed, 37 insertions, 626 deletions
diff --git a/www/mozilla/Makefile b/www/mozilla/Makefile index abb33535f755..8c76783a4632 100644 --- a/www/mozilla/Makefile +++ b/www/mozilla/Makefile @@ -6,7 +6,7 @@ # PORTNAME?= mozilla -PORTVERSION= 1.3.1 +PORTVERSION= 1.4 PORTEPOCH?= 2 CATEGORIES?= www MASTER_SITES= ${MASTER_SITE_MOZILLA} \ @@ -62,6 +62,7 @@ EXTRACT_AFTER_ARGS= | ${TAR} -xf - --exclude */CVS/* \ --exclude .cvsignore \ --exclude makefile.win \ --exclude MANIFEST +USE_BZIP2= yes USE_X_PREFIX= yes USE_PERL5= yes USE_GMAKE= yes @@ -135,8 +136,7 @@ CONFIGURE_ARGS+= --disable-composer .if defined(WITH_GTK2) CONFIGURE_ARGS+= --enable-default-toolkit=gtk2 PKGCONFIG_FILES= mozilla-gtkmozembed.pc mozilla-js.pc mozilla-xpcom.pc \ - mozilla-nspr.pc mozilla-nss.pc -EXTRA_PATCHES= ${FILESDIR}/xim_dekita2.patch + mozilla-nspr.pc mozilla-nss.pc mozilla-plugin.pc .else CONFIGURE_ARGS+= --enable-default-toolkit=gtk .endif @@ -163,7 +163,7 @@ CONFIGURE_ARGS+= --enable-optimize=-O2 .endif .if ${ARCH} == "alpha" && ${OSVERSION} < 500035 -BROKEN= "core dumps on alpha during post-build" +IGNORE= "core dumps on alpha during post-build" .endif .if exists(${LOCALBASE}/include/freetype/freetype.h) diff --git a/www/mozilla/distinfo b/www/mozilla/distinfo index 17eb241889e4..ae95264fd17f 100644 --- a/www/mozilla/distinfo +++ b/www/mozilla/distinfo @@ -1,2 +1,2 @@ -MD5 (mozilla-source-1.3.1.tar.bz2) = b3a1442a1365461e5ad3e2cc633dd8c0 +MD5 (mozilla-source-1.4.tar.bz2) = a4644caeeeb323d0d8b59758b67d4454 MD5 (libart_lgpl.tar.bz2) = f332c3c026adc1c2c0ceb3ac5847d5f5 diff --git a/www/mozilla/files/patch-gfx_src_gtk_nsFontMetricsXft.cpp b/www/mozilla/files/patch-gfx_src_gtk_nsFontMetricsXft.cpp index c98dd9f63165..d64b52875aaa 100644 --- a/www/mozilla/files/patch-gfx_src_gtk_nsFontMetricsXft.cpp +++ b/www/mozilla/files/patch-gfx_src_gtk_nsFontMetricsXft.cpp @@ -1,6 +1,6 @@ ---- gfx/src/gtk/nsFontMetricsXft.cpp.orig Mon Mar 31 12:30:39 2003 -+++ gfx/src/gtk/nsFontMetricsXft.cpp Mon Mar 31 12:30:58 2003 -@@ -84,6 +84,7 @@ +--- gfx/src/gtk/nsFontMetricsXft.cpp.orig Thu May 29 19:10:54 2003 ++++ gfx/src/gtk/nsFontMetricsXft.cpp Mon Jun 30 23:11:39 2003 +@@ -90,6 +90,7 @@ FcPattern *mPattern; FcPattern *mFontName; FcCharSet *mCharset; @@ -8,43 +8,25 @@ }; struct MozXftLangGroup { -@@ -375,7 +376,7 @@ - PRInt32 end = mLoadedFonts.Count(); - for (PRInt32 j = 0; j < end; ++j) { - font = (nsFontXft *)mLoadedFonts.ElementAt(j); -- if (FcCharSetHasChar(font->mCharset, c)) { -+ if (FcCharSetHasChar(font->mCharset, c) && font->GetXftFont()) { - currFont = font; - goto FoundFont; // for speed -- avoid "if" statement - } -@@ -635,7 +636,7 @@ - - for (PRInt32 j = 0, end = mLoadedFonts.Count(); j < end; ++j) { - font = (nsFontXft *)mLoadedFonts.ElementAt(j); -- if (FcCharSetHasChar(font->mCharset, c)) { -+ if (FcCharSetHasChar(font->mCharset, c) && font->GetXftFont()) { - currFont = font; - goto FoundFont; // for speed -- avoid "if" statement - } -@@ -888,7 +889,7 @@ +@@ -774,7 +775,7 @@ // font in our loaded list that supports the character for (PRInt32 i = 0, end = mLoadedFonts.Count(); i < end; ++i) { nsFontXft *font = (nsFontXft *)mLoadedFonts.ElementAt(i); - if (FcCharSetHasChar(font->mCharset, aChar)) -+ if (FcCharSetHasChar(font->mCharset, aChar) && font->GetXftFont() != NULL) ++ if (FcCharSetHasChar(font->mCharset, aChar) && font->GetXftFont()) return font; } -@@ -1051,7 +1052,7 @@ - +@@ -1196,7 +1197,7 @@ for (PRInt32 j = 0, end = mLoadedFonts.Count(); j < end; ++j) { + nsFontXft *font; font = (nsFontXft *)mLoadedFonts.ElementAt(j); - if (FcCharSetHasChar(font->mCharset, c)) { + if (FcCharSetHasChar(font->mCharset, c) && font->GetXftFont()) { - currFont = font; - goto FoundFont; // for speed -- avoid "if" statement + foundFont = font; + break; } -@@ -1461,6 +1462,7 @@ +@@ -1566,6 +1567,7 @@ FcPatternReference(mFontName); mXftFont = nsnull; @@ -52,7 +34,7 @@ // set up our charset mCharset = nsnull; -@@ -1487,14 +1489,16 @@ +@@ -1592,7 +1594,7 @@ XftFont * nsFontXft::GetXftFont(void) { @@ -61,13 +43,15 @@ FcPattern *pat = FcFontRenderPrepare(0, mPattern, mFontName); if (!pat) return nsnull; +@@ -1611,8 +1613,10 @@ + FcPatternDel(pat, FC_SPACING); mXftFont = XftFontOpenPattern(GDK_DISPLAY(), pat); - if (!mXftFont) -+ if (!mXftFont) { ++ if (!mXftFont) { FcPatternDestroy(pat); -+ mNotXft = 1; -+ } ++ mNotXft = 1; ++ } } return mXftFont; diff --git a/www/mozilla/files/patch-jsfun.c b/www/mozilla/files/patch-jsfun.c deleted file mode 100644 index 69aacb9b54cd..000000000000 --- a/www/mozilla/files/patch-jsfun.c +++ /dev/null @@ -1,29 +0,0 @@ ---- js/src/jsfun.c.orig Fri May 30 20:55:38 2003 -+++ js/src/jsfun.c Fri May 30 20:54:24 2003 -@@ -1081,7 +1081,7 @@ - JSString *atomstr; - char *propname; - JSScopeProperty *sprop; -- jsid userid; -+ uint32 userid; - JSAtom *atom; - uintN i, n, dupflag; - uint32 type; -@@ -1157,7 +1157,7 @@ - userid = INT_TO_JSVAL(sprop->shortid); - propname = ATOM_BYTES((JSAtom *)sprop->id); - if (!JS_XDRUint32(xdr, &type) || -- !JS_XDRUint32(xdr, (uint32 *)&userid) || -+ !JS_XDRUint32(xdr, &userid) || - !JS_XDRCString(xdr, &propname)) { - if (mark) - JS_ARENA_RELEASE(&cx->tempPool, mark); -@@ -1173,7 +1173,7 @@ - uintN attrs = JSPROP_ENUMERATE | JSPROP_PERMANENT; - - if (!JS_XDRUint32(xdr, &type) || -- !JS_XDRUint32(xdr, (uint32 *)&userid) || -+ !JS_XDRUint32(xdr, &userid) || - !JS_XDRCString(xdr, &propname)) { - return JS_FALSE; - } diff --git a/www/mozilla/files/patch-nsprpub_pr_src_misc_prnetdb.c b/www/mozilla/files/patch-nsprpub_pr_src_misc_prnetdb.c deleted file mode 100644 index d136e2e4ee42..000000000000 --- a/www/mozilla/files/patch-nsprpub_pr_src_misc_prnetdb.c +++ /dev/null @@ -1,11 +0,0 @@ ---- nsprpub/pr/src/misc/prnetdb.c 16 Jan 2003 23:09:16 -0000 3.21.2.8 -+++ nsprpub/pr/src/misc/prnetdb.c 25 Jan 2003 00:12:13 -0000 -@@ -319,7 +319,7 @@ - PR_Free(buf); - } - --#elif (defined(DARWIN) && defined(HAVE_GETIFADDRS)) -+#elif (defined(DARWIN) && defined(HAVE_GETIFADDRS)) || defined(FREEBSD) - - /* - * Use the BSD getifaddrs function. diff --git a/www/mozilla/files/patch-nsprpub_pr_src_misc_prtime.c b/www/mozilla/files/patch-nsprpub_pr_src_misc_prtime.c index 6b65ef14fbec..f13ae2faa20e 100644 --- a/www/mozilla/files/patch-nsprpub_pr_src_misc_prtime.c +++ b/www/mozilla/files/patch-nsprpub_pr_src_misc_prtime.c @@ -1,18 +1,11 @@ ---- nsprpub/pr/src/misc/prtime.c.orig Sun Mar 31 12:17:46 2002 -+++ nsprpub/pr/src/misc/prtime.c Tue Dec 17 21:30:30 2002 -@@ -1666,12 +1666,13 @@ - * values for these two fields. +--- nsprpub/pr/src/misc/prtime.c.orig Wed Feb 26 19:01:02 2003 ++++ nsprpub/pr/src/misc/prtime.c Mon Jun 30 23:18:29 2003 +@@ -1666,7 +1666,7 @@ */ --#if defined(SUNOS4) || (__GLIBC__ >= 2) || defined(XP_BEOS) -+#if defined(__FreeBSD__)|| defined(SUNOS4) \ -+ || (__GLIBC__ >= 2) || defined(XP_BEOS) - if (mktime(&a) == -1) { - PR_snprintf(buf, buflen, "can't get timezone"); - return 0; - } --#endif -+#endif /* check for __FreeBSD__, too <alane@freebsd.org> */ - - return strftime(buf, buflen, fmt, &a); - } + #if defined(SUNOS4) || (__GLIBC__ >= 2) || defined(XP_BEOS) \ +- || defined(NETBSD) ++ || defined(NETBSD) || defined(FREEBSD) + a.tm_zone = NULL; + a.tm_gmtoff = tm->tm_params.tp_gmt_offset + tm->tm_params.tp_dst_offset; + #endif diff --git a/www/mozilla/files/patch-qt b/www/mozilla/files/patch-qt index 032397d35040..eae02f50f39f 100644 --- a/www/mozilla/files/patch-qt +++ b/www/mozilla/files/patch-qt @@ -1,23 +1,14 @@ ---- configure.orig Thu Feb 6 17:15:12 2003 -+++ configure Tue Feb 11 22:52:48 2003 -@@ -10974,7 +10974,7 @@ - fi - MOC=$HOST_MOC +--- configure.orig Mon Jun 16 15:15:10 2003 ++++ configure Mon Jun 30 23:21:49 2003 +@@ -11992,9 +11992,9 @@ -- QT_CFLAGS="-I${QTDIR}${QTINCDIR} -DQT_GENUINE_STR -DQT_NO_STL" -+ QT_CFLAGS="-I${QTDIR}/include/X11/qt -DQT_GENUINE_STR" - if test -z "$MOZ_DEBUG"; then - QT_CFLAGS="$QT_CFLAGS -DQT_NO_DEBUG -DNO_DEBUG" - fi -@@ -11840,9 +11840,9 @@ +-MOZ_EXTENSIONS_DEFAULT=" cookie wallet content-packs xml-rpc xmlextras help p3p pref transformiix venkman inspector irc universalchardet typeaheadfind webservices" ++MOZ_EXTENSIONS_DEFAULT=" cookie wallet content-packs xml-rpc xmlextras help p3p pref transformiix venkman inspector universalchardet typeaheadfind webservices" --MOZ_EXTENSIONS_DEFAULT=" cookie wallet content-packs xml-rpc xmlextras help pref transformiix venkman inspector irc universalchardet typeaheadfind" -+MOZ_EXTENSIONS_DEFAULT=" cookie wallet content-packs xml-rpc xmlextras help pref transformiix venkman inspector universalchardet typeaheadfind" - --MOZ_EXTENSIONS_ALL="$MOZ_EXTENSIONS_DEFAULT xmlterm access-builtin p3p interfaceinfo datetime finger cview" -+MOZ_EXTENSIONS_ALL="$MOZ_EXTENSIONS_DEFAULT irc xmlterm access-builtin p3p interfaceinfo datetime finger cview" +-MOZ_EXTENSIONS_ALL="$MOZ_EXTENSIONS_DEFAULT xmlterm access-builtin datetime finger cview" ++MOZ_EXTENSIONS_ALL="$MOZ_EXTENSIONS_DEFAULT irc xmlterm access-builtin datetime finger cview" # Check whether --enable-extensions or --disable-extensions was given. if test "${enable_extensions+set}" = set; then diff --git a/www/mozilla/files/xim_dekita2.patch b/www/mozilla/files/xim_dekita2.patch deleted file mode 100644 index 87cb2ea7b108..000000000000 --- a/www/mozilla/files/xim_dekita2.patch +++ /dev/null @@ -1,517 +0,0 @@ -Index: Makefile.in -=================================================================== -RCS file: /cvsroot/mozilla/widget/src/gtk2/Makefile.in,v -retrieving revision 1.24 -diff -u -r1.24 Makefile.in ---- widget/src/gtk2/Makefile.in 28 Dec 2002 01:14:45 -0000 1.24 -+++ widget/src/gtk2/Makefile.in 7 Mar 2003 07:39:24 -0000 -@@ -90,7 +90,7 @@ - CFLAGS += $(MOZ_GTK2_CFLAGS) - CXXFLAGS += $(MOZ_GTK2_CFLAGS) - --#DEFINES += -DUSE_XIM -+DEFINES += -DUSE_XIM - - INCLUDES += \ - -I$(srcdir)/../xpwidgets \ -Index: nsWindow.cpp -=================================================================== -RCS file: /cvsroot/mozilla/widget/src/gtk2/nsWindow.cpp,v -retrieving revision 1.68 -diff -u -r1.68 nsWindow.cpp ---- widget/src/gtk2/nsWindow.cpp 5 Mar 2003 23:17:28 -0000 1.68 -+++ widget/src/gtk2/nsWindow.cpp 6 Mar 2003 02:22:39 -0000 -@@ -179,6 +179,7 @@ - nsWeakPtr gRollupWindow; - - #ifdef USE_XIM -+static nsWindow *gIMEFocusWindow = NULL; - - struct nsXICLookupEntry { - PLDHashEntryHdr mKeyHash; -@@ -186,7 +187,9 @@ - GtkIMContext* mXIC; - }; - --PLDHashTable nsWindow::gXICLookupTable; -+PLDHashTable nsWindow::gXICLookupTable; -+GdkEventKey* nsWindow::gIMEKeyEvent = NULL; -+PRBool nsWindow::gIMEStringCommited = PR_TRUE; - - static void IM_commit_cb (GtkIMContext *context, - const gchar *str, -@@ -257,61 +260,6 @@ - #endif - } - --#ifdef USE_XIM --void --nsWindow::IMEGetShellWindow(void) --{ -- GtkWidget* top_window = nsnull; -- GetToplevelWidget(&top_window); -- if (top_window) { -- mIMEShellWindow = get_window_for_gtk_widget(top_window); -- } --} -- --GtkIMContext* --nsWindow::IMEGetContext() --{ -- if (!mIMEShellWindow) { -- return NULL; -- } -- PLDHashEntryHdr* hash_entry; -- nsXICLookupEntry* entry; -- -- hash_entry = PL_DHashTableOperate(&gXICLookupTable, -- mIMEShellWindow, PL_DHASH_LOOKUP); -- -- if (hash_entry) { -- entry = NS_REINTERPRET_CAST(nsXICLookupEntry *, hash_entry); -- if (entry->mXIC) { -- return entry->mXIC; -- } -- } -- return NULL; --} -- --void --nsWindow::IMECreateContext(GdkWindow* aGdkWindow) --{ -- PLDHashEntryHdr* hash_entry; -- nsXICLookupEntry* entry; -- GtkIMContext *im = gtk_im_multicontext_new(); -- if (im) { -- hash_entry = PL_DHashTableOperate(&gXICLookupTable, this, PL_DHASH_ADD); -- if (hash_entry) { -- entry = NS_REINTERPRET_CAST(nsXICLookupEntry *, hash_entry); -- entry->mShellWindow = this; -- entry->mXIC = im; -- } -- gtk_im_context_set_client_window(im, aGdkWindow); -- g_signal_connect(G_OBJECT(im), "commit", -- G_CALLBACK(IM_commit_cb), this); -- g_signal_connect(G_OBJECT(im), "preedit_changed", -- G_CALLBACK(IM_preedit_changed_cb), this); -- this->mIMEShellWindow = this; -- } --} --#endif -- - nsWindow::~nsWindow() - { - LOG(("nsWindow::~nsWindow() [%p]\n", (void *)this)); -@@ -397,22 +345,7 @@ - } - - #ifdef USE_XIM -- GtkIMContext *im = IMEGetContext(); -- // If this is the focus window and we have an IM context we need -- // to unset the focus on this window before we destroy the window. -- if (im && gFocusWindow == this) { -- LOGFOCUS((" gtk_im_context_focus_out() from Destroy()\n")); -- gtk_im_context_focus_out(im); -- } -- -- // if shell, delete GtkIMContext -- if (im && mShell) { -- gtk_im_context_reset(im); -- PL_DHashTableOperate(&gXICLookupTable, this, PL_DHASH_REMOVE); -- g_object_unref(G_OBJECT(im)); -- } -- -- mIMEShellWindow = nsnull; -+ IMEDestroyContext(); - #endif - - // make sure that we remove ourself as the focus window -@@ -656,21 +589,30 @@ - return NS_OK; - } - -+#ifdef USE_XIM -+ if (mWindowType == eWindowType_child && !mIMEShellWindow) { -+ IMEGetShellWindow(); -+ } -+#endif -+ - // If there is already a focued child window, dispatch a LOSTFOCUS - // event from that widget and unset its got focus flag. -- if (gFocusWindow) -+ if (gFocusWindow) { -+#ifdef USE_XIM -+ // If same ic is focused, do not call LoseFocus() -+ if (mIMEShellWindow != gFocusWindow->mIMEShellWindow) { -+ gFocusWindow->IMELoseFocus(); -+ } -+#endif - gFocusWindow->LoseFocus(); -+ } - - // Set this window to be the focused child window, update our has - // focus flag and dispatch a GOTFOCUS event. - gFocusWindow = this; - - #ifdef USE_XIM -- GtkIMContext *im = IMEGetContext(); -- if (im && !mIsTopLevel) { -- LOGFOCUS((" gtk_im_context_focus_in()\n")); -- gtk_im_context_focus_in(im); -- } -+ IMESetFocus(); - #endif - - LOGFOCUS((" widget now has focus - dispatching events [%p]\n", -@@ -1165,18 +1107,6 @@ - void - nsWindow::LoseFocus(void) - { --#ifdef USE_XIM -- GtkIMContext *im = IMEGetContext(); -- if (im && !mIsTopLevel) { -- LOGFOCUS((" gtk_im_context_focus_out()\n")); -- gtk_im_context_focus_out(im); -- IMEComposeStart(); -- IMEComposeText(NULL, 0, NULL, NULL); -- IMEComposeEnd(); -- LOG(("gtk_im_context_focus_out\n")); -- } --#endif -- - // make sure that we reset our repeat counter so the next keypress - // for this widget will get the down event - mInKeyRepeat = PR_FALSE; -@@ -1449,6 +1379,7 @@ - DispatchEvent(&event, status); - } - -+ - void - nsWindow::OnContainerFocusInEvent(GtkWidget *aWidget, GdkEventFocus *aEvent) - { -@@ -1516,6 +1447,9 @@ - - foundit: - -+#ifdef USE_XIM -+ gFocusWindow->IMELoseFocus(); -+#endif - gFocusWindow->LoseFocus(); - - // We only dispatch a deactivate event if we are a toplevel -@@ -1537,7 +1471,7 @@ - #ifdef USE_XIM - GtkIMContext *im = IMEGetContext(); - if (im) { -- if (gtk_im_context_filter_keypress(im, aEvent)) { -+ if (IMFilterKeypress(im, aEvent)) { - LOGFOCUS((" keypress filtered by XIM\n")); - return TRUE; - } -@@ -1621,7 +1555,7 @@ - #ifdef USE_XIM - GtkIMContext *im = IMEGetContext(); - if (im) { -- if (gtk_im_context_filter_keypress(im, aEvent)) { -+ if (IMFilterKeypress(im, aEvent)) { - LOGFOCUS((" keypress filtered by XIM\n")); - return TRUE; - } -@@ -2155,6 +2089,15 @@ - - // and the drawing area - mDrawingarea = moz_drawingarea_new(nsnull, mContainer); -+ -+#ifdef USE_XIM -+#ifndef XIM_CREATE_IC_AT_FOCUS -+ if (mWindowType != eWindowType_popup) { -+ // create im context for shell -+ IMECreateContext(mShell->window); -+ } -+#endif /* XIM_CREATE_IC_AT_FOCUS */ -+#endif /* USE_XIM */ - } - break; - case eWindowType_child: { -@@ -2167,11 +2110,13 @@ - gtk_widget_realize(GTK_WIDGET(mContainer)); - - mDrawingarea = moz_drawingarea_new(nsnull, mContainer); -- } - #ifdef USE_XIM -- // get mIMEShellWindow and keep it -- IMEGetShellWindow(); --#endif -+#ifndef XIM_CREATE_IC_AT_FOCUS -+ // create im context for gtk container -+ IMECreateContext(GTK_WIDGET(mContainer)->window); -+#endif /* XIM_CREATE_IC_AT_FOCUS */ -+#endif /* USE_XIM */ -+ } - } - break; - default: -@@ -2216,13 +2161,6 @@ - G_CALLBACK(property_notify_event_cb), NULL); - } - --#ifdef USE_XIM -- if (mShell) { -- // init GtkIMContext for shell -- IMECreateContext(mShell->window); -- } --#endif -- - if (mContainer) { - g_signal_connect_after(G_OBJECT(mContainer), "size_allocate", - G_CALLBACK(size_allocate_cb), NULL); -@@ -3667,6 +3605,77 @@ - } - - #ifdef USE_XIM -+void -+nsWindow::IMEGetShellWindow(void) -+{ -+ GtkWidget* top_window = nsnull; -+ GetToplevelWidget(&top_window); -+ if (top_window) { -+ mIMEShellWindow = get_window_for_gtk_widget(top_window); -+ if (mIMEShellWindow) { -+ return; -+ } -+ } -+ -+ // find deepest nsWindow -+ if (!mDrawingarea) { -+ return; -+ } -+ GdkWindow *parent = gdk_window_get_parent(mDrawingarea->inner_window); -+ while (parent) { -+ nsWindow *window = get_window_for_gdk_window(parent); -+ if (window == nsnull) { -+ break; -+ } -+ if (window->mContainer) { -+ mIMEShellWindow = window; -+ } -+ parent = gdk_window_get_parent (parent); -+ } -+} -+ -+GtkIMContext* -+nsWindow::IMEGetContext() -+{ -+ if (!mIMEShellWindow) { -+ return NULL; -+ } -+ PLDHashEntryHdr* hash_entry; -+ nsXICLookupEntry* entry; -+ -+ hash_entry = PL_DHashTableOperate(&gXICLookupTable, -+ mIMEShellWindow, PL_DHASH_LOOKUP); -+ -+ if (hash_entry) { -+ entry = NS_REINTERPRET_CAST(nsXICLookupEntry *, hash_entry); -+ if (entry->mXIC) { -+ return entry->mXIC; -+ } -+ } -+ return NULL; -+} -+ -+void -+nsWindow::IMECreateContext(GdkWindow* aGdkWindow) -+{ -+ PLDHashEntryHdr* hash_entry; -+ nsXICLookupEntry* entry; -+ GtkIMContext *im = gtk_im_multicontext_new(); -+ if (im) { -+ hash_entry = PL_DHashTableOperate(&gXICLookupTable, this, PL_DHASH_ADD); -+ if (hash_entry) { -+ entry = NS_REINTERPRET_CAST(nsXICLookupEntry *, hash_entry); -+ entry->mShellWindow = this; -+ entry->mXIC = im; -+ } -+ gtk_im_context_set_client_window(im, aGdkWindow); -+ g_signal_connect(G_OBJECT(im), "commit", -+ G_CALLBACK(IM_commit_cb), this); -+ g_signal_connect(G_OBJECT(im), "preedit_changed", -+ G_CALLBACK(IM_preedit_changed_cb), this); -+ this->mIMEShellWindow = this; -+ } -+} - - void - nsWindow::IMEComposeStart(void) -@@ -3737,6 +3746,26 @@ - DispatchEvent(&compEvent, status); - } - -+PRBool -+nsWindow::IMFilterKeypress (GtkIMContext *context, -+ GdkEventKey *aEvent) -+{ -+ gIMEKeyEvent = aEvent; -+ if (gtk_im_context_filter_keypress(context, aEvent)) { -+ /* return true if the keyevent is commited as string and -+ ** has been dispatched as TextEvent. -+ */ -+ if( gIMEStringCommited ) { -+ return TRUE; -+ } -+ gIMEStringCommited = PR_TRUE; -+ } -+ gIMEKeyEvent = NULL; -+ -+ /* the Keyevent is not filtered by IME */ -+ return FALSE; -+} -+ - /* static */ - void - IM_preedit_changed_cb(GtkIMContext *context, -@@ -3747,7 +3776,8 @@ - PangoAttrList *feedback_list; - - // call for focused window -- nsWindow *window = gFocusWindow; -+ // if gFocusWindow is null, use the last focused gIMEFocusWindow -+ nsWindow *window = gFocusWindow ? gFocusWindow : gIMEFocusWindow; - if (!window) return; - - // Should use cursor_pos ? -@@ -3760,6 +3790,7 @@ - if (!preedit_string || !*preedit_string) { - window->IMEComposeStart(); - window->IMEComposeText(NULL, 0, NULL, NULL); -+ window->IMEComposeEnd(); - return; - } - -@@ -3800,9 +3831,31 @@ - glong uniStrLen; - - // call for focused window -- nsWindow *window = gFocusWindow; -+ // if gFocusWindow is null, use the last focused gIMEFocusWindow -+ nsWindow *window = gFocusWindow ? gFocusWindow : gIMEFocusWindow; - if (!window) return; - -+ /* if the IME does not change the keystrock, we won't send it -+ * through the TextEvent. -+ */ -+ nsWindow::gIMEStringCommited = PR_TRUE; -+ if ( nsWindow::gIMEKeyEvent ) -+ { -+ char keyval_utf8[8]; /* should have at least 6 bytes of space */ -+ gint keyval_utf8_len; -+ keyval_utf8_len = g_unichar_to_utf8( -+ gdk_keyval_to_unicode(nsWindow::gIMEKeyEvent->keyval), -+ keyval_utf8); -+ -+ keyval_utf8[keyval_utf8_len] = '\0'; -+ if ( strcmp(utf8_str, keyval_utf8) == 0) -+ { -+ nsWindow::gIMEStringCommited = PR_FALSE; -+ return; -+ } -+ nsWindow::gIMEKeyEvent = NULL; -+ } -+ - uniStr = NULL; - uniStrLen = 0; - uniStr = g_utf8_to_utf16(utf8_str, -1, NULL, &uniStrLen, NULL); -@@ -3944,6 +3997,60 @@ - *aTextRangeListLengthResult = count + 1; - - pango_attr_iterator_destroy(aFeedbackIterator); -+} -+ -+void -+nsWindow::IMELoseFocus(void) -+{ -+ GtkIMContext *im = IMEGetContext(); -+ if (!im) { -+ return; -+ } -+ gtk_im_context_focus_out(im); -+} -+ -+void -+nsWindow::IMESetFocus(void) -+{ -+ GtkIMContext *im = IMEGetContext(); -+#ifdef XIM_CREATE_IC_AT_FOCUS -+ if (!im && mIMEShellWindow) { -+ if (mIMEShellWindow->mShell) { -+ // init GtkIMContext for shell -+ mIMEShellWindow->IMECreateContext(mIMEShellWindow->mShell->window); -+ } else if (mIMEShellWindow->mContainer) { -+ // init GtkIMContext for mContainer -+ mIMEShellWindow->IMECreateContext(GTK_WIDGET(mIMEShellWindow->mContainer)->window); -+ } -+ } -+ im = IMEGetContext(); -+#endif /* XIM_CREATE_IC_AT_FOCUS */ -+ if (!im) { -+ return; -+ } -+ gtk_im_context_focus_in(im); -+ gIMEFocusWindow = this; -+} -+ -+void -+nsWindow::IMEDestroyContext(void) -+{ -+ GtkIMContext *im = IMEGetContext(); -+ if (im) { -+ // If this is the focus window and we have an IM context we need -+ // to unset the focus on this window before we destroy the window. -+ if (gIMEFocusWindow == this) { -+ gIMEFocusWindow->IMELoseFocus(); -+ gIMEFocusWindow = nsnull; -+ } -+ // if shell, delete GtkIMContext -+ if (mIMEShellWindow == this) { -+ gtk_im_context_set_client_window(im, NULL); -+ PL_DHashTableOperate(&gXICLookupTable, this, PL_DHASH_REMOVE); -+ g_object_unref(G_OBJECT(im)); -+ } -+ } -+ mIMEShellWindow = nsnull; - } - - #endif -Index: nsWindow.h -=================================================================== -RCS file: /cvsroot/mozilla/widget/src/gtk2/nsWindow.h,v -retrieving revision 1.32 -diff -u -r1.32 nsWindow.h ---- widget/src/gtk2/nsWindow.h 17 Feb 2003 18:50:01 -0000 1.32 -+++ widget/src/gtk2/nsWindow.h 6 Mar 2003 02:22:39 -0000 -@@ -239,6 +239,9 @@ - static guint32 mLastButtonPressTime; - - #ifdef USE_XIM -+ void IMEDestroyContext(void); -+ void IMESetFocus(void); -+ void IMELoseFocus(void); - void IMEComposeStart(void); - void IMEComposeText(const PRUnichar *aText, - const PRInt32 aLen, -@@ -249,9 +252,13 @@ - void IMEGetShellWindow(void); - GtkIMContext* IMEGetContext(void); - void IMECreateContext(GdkWindow* aGdkWindow); -- -+ PRBool IMFilterKeypress (GtkIMContext *context, -+ GdkEventKey *aEvent); -+ - nsWindow* mIMEShellWindow; - static PLDHashTable gXICLookupTable; -+ static GdkEventKey* gIMEKeyEvent; -+ static PRBool gIMEStringCommited; - #endif - - private: |