diff options
author | Brad Laue <brad@gentoo.org> | 2004-09-09 17:24:29 +0000 |
---|---|---|
committer | Brad Laue <brad@gentoo.org> | 2004-09-09 17:24:29 +0000 |
commit | 38e284744811d64ef32afc038bb056e5351994dd (patch) | |
tree | cfd82fd4d8779dd58826ad06b0cd269993c18e1e /net-www/mozilla | |
parent | Reapplying unconditional -fPIC stuff (#55238). Stable on hppa. (Manifest reco... (diff) | |
download | gentoo-2-38e284744811d64ef32afc038bb056e5351994dd.tar.gz gentoo-2-38e284744811d64ef32afc038bb056e5351994dd.tar.bz2 gentoo-2-38e284744811d64ef32afc038bb056e5351994dd.zip |
epkgmove sucks!!!!!!!!!!!
Diffstat (limited to 'net-www/mozilla')
39 files changed, 4162 insertions, 0 deletions
diff --git a/net-www/mozilla/files/1.2/mozilla-1.2-branch-update.patch.bz2 b/net-www/mozilla/files/1.2/mozilla-1.2-branch-update.patch.bz2 Binary files differnew file mode 100644 index 000000000000..b5c2056d0393 --- /dev/null +++ b/net-www/mozilla/files/1.2/mozilla-1.2-branch-update.patch.bz2 diff --git a/net-www/mozilla/files/1.2/mozilla-1.2-cutnpaste-limit-fix.patch.bz2 b/net-www/mozilla/files/1.2/mozilla-1.2-cutnpaste-limit-fix.patch.bz2 Binary files differnew file mode 100644 index 000000000000..9f9d585e6776 --- /dev/null +++ b/net-www/mozilla/files/1.2/mozilla-1.2-cutnpaste-limit-fix.patch.bz2 diff --git a/net-www/mozilla/files/1.2/mozilla-1.2-image-reload-memleak.patch b/net-www/mozilla/files/1.2/mozilla-1.2-image-reload-memleak.patch new file mode 100644 index 000000000000..209de2bb0464 --- /dev/null +++ b/net-www/mozilla/files/1.2/mozilla-1.2-image-reload-memleak.patch @@ -0,0 +1,45 @@ +? hpradhan@hedwig +Index: nsImageDocument.cpp +=================================================================== +RCS file: /cvsroot/mozilla/content/html/document/src/nsImageDocument.cpp,v +retrieving revision 1.87 +diff -u -u -r1.87 nsImageDocument.cpp +--- content/html/document/src/nsImageDocument.cpp 28 Sep 2002 10:50:50 -0000 1.87 ++++ content/html/document/src/nsImageDocument.cpp 11 Dec 2002 11:52:11 -0000 +@@ -97,6 +97,8 @@ + PRBool aReset = PR_TRUE, + nsIContentSink* aSink = nsnull); + ++ NS_IMETHOD SetScriptGlobalObject(nsIScriptGlobalObject* aScriptGlobalObject); ++ + nsresult CreateSyntheticDocument(); + + nsresult EndLayout(nsISupports *ctxt, +@@ -144,8 +146,6 @@ + NS_IMETHODIMP + ImageListener::OnStartRequest(nsIRequest* request, nsISupports *ctxt) + { +- nsresult rv; +- + nsCOMPtr<nsIChannel> channel = do_QueryInterface(request); + if (!channel) return NS_ERROR_NULL_POINTER; + +@@ -276,6 +276,18 @@ + return NS_OK; + } + ++NS_IMETHODIMP ++nsImageDocument::SetScriptGlobalObject(nsIScriptGlobalObject* aScriptGlobalObject) ++{ ++ if (!aScriptGlobalObject) { ++ // If the global object is being set to null, then it means we are ++ // going away soon. Drop our ref to imgRequest so that we dont end ++ // up leaking due to cycles through imgLib ++ mImageRequest = nsnull; ++ } ++ ++ return nsHTMLDocument::SetScriptGlobalObject(aScriptGlobalObject); ++} + + nsresult + nsImageDocument::CreateSyntheticDocument() diff --git a/net-www/mozilla/files/1.2/mozilla-1.2.1-Xrender-includes.patch.bz2 b/net-www/mozilla/files/1.2/mozilla-1.2.1-Xrender-includes.patch.bz2 Binary files differnew file mode 100644 index 000000000000..41edbfa1ff26 --- /dev/null +++ b/net-www/mozilla/files/1.2/mozilla-1.2.1-Xrender-includes.patch.bz2 diff --git a/net-www/mozilla/files/1.2/mozilla-1.2b-Xft-includes.patch.bz2 b/net-www/mozilla/files/1.2/mozilla-1.2b-Xft-includes.patch.bz2 Binary files differnew file mode 100644 index 000000000000..88c4228e1601 --- /dev/null +++ b/net-www/mozilla/files/1.2/mozilla-1.2b-Xft-includes.patch.bz2 diff --git a/net-www/mozilla/files/1.2/mozilla-1.2b-default-plugin-less-annoying.patch.bz2 b/net-www/mozilla/files/1.2/mozilla-1.2b-default-plugin-less-annoying.patch.bz2 Binary files differnew file mode 100644 index 000000000000..5ced88422a95 --- /dev/null +++ b/net-www/mozilla/files/1.2/mozilla-1.2b-default-plugin-less-annoying.patch.bz2 diff --git a/net-www/mozilla/files/1.2/mozilla-1.2b-freetype.patch.bz2 b/net-www/mozilla/files/1.2/mozilla-1.2b-freetype.patch.bz2 Binary files differnew file mode 100644 index 000000000000..a9e53b643364 --- /dev/null +++ b/net-www/mozilla/files/1.2/mozilla-1.2b-freetype.patch.bz2 diff --git a/net-www/mozilla/files/1.2/mozilla-1.2b-gtk2.patch.bz2 b/net-www/mozilla/files/1.2/mozilla-1.2b-gtk2.patch.bz2 Binary files differnew file mode 100644 index 000000000000..d58237e3202f --- /dev/null +++ b/net-www/mozilla/files/1.2/mozilla-1.2b-gtk2.patch.bz2 diff --git a/net-www/mozilla/files/1.2/mozilla-1.2b-over-the-spot.patch.bz2 b/net-www/mozilla/files/1.2/mozilla-1.2b-over-the-spot.patch.bz2 Binary files differnew file mode 100644 index 000000000000..14c8ae0659f6 --- /dev/null +++ b/net-www/mozilla/files/1.2/mozilla-1.2b-over-the-spot.patch.bz2 diff --git a/net-www/mozilla/files/1.2/mozilla-1.2b-wallet.patch.bz2 b/net-www/mozilla/files/1.2/mozilla-1.2b-wallet.patch.bz2 Binary files differnew file mode 100644 index 000000000000..b8208dbfe4f9 --- /dev/null +++ b/net-www/mozilla/files/1.2/mozilla-1.2b-wallet.patch.bz2 diff --git a/net-www/mozilla/files/1.3/mozilla-1.3-fix-RAW-target.patch b/net-www/mozilla/files/1.3/mozilla-1.3-fix-RAW-target.patch new file mode 100644 index 000000000000..5951496e9893 --- /dev/null +++ b/net-www/mozilla/files/1.3/mozilla-1.3-fix-RAW-target.patch @@ -0,0 +1,12 @@ +--- mozilla/xpinstall/packager/Makefile.in.orig 2003-02-23 14:41:08.000000000 +0200 ++++ mozilla/xpinstall/packager/Makefile.in 2003-02-23 14:41:36.000000000 +0200 +@@ -87,6 +87,9 @@ + ifeq ($(MOZ_PKG_FORMAT),DEB) + PKG_SUFFIX = .deb + endif ++ifeq ($(MOZ_PKG_FORMAT),RAW) ++MAKE_SDK = echo ++endif + + TARGETS = $(PACKAGE) $(SDK) + diff --git a/net-www/mozilla/files/1.3/mozilla-1.3-fix-gtkim.patch b/net-www/mozilla/files/1.3/mozilla-1.3-fix-gtkim.patch new file mode 100644 index 000000000000..9c0e642aed9f --- /dev/null +++ b/net-www/mozilla/files/1.3/mozilla-1.3-fix-gtkim.patch @@ -0,0 +1,31 @@ +--- mozilla/widget/src/gtk2/nsWindow.cpp.orig 2002-11-17 21:04:42.000000000 +0900 ++++ mozilla/widget/src/gtk2/nsWindow.cpp 2002-11-20 02:17:53.000000000 +0900 +@@ -2094,7 +2094,7 @@ + } + #ifdef USE_XIM + // get mIMEShellWindow and keep it +- IMEGetShellWindow(); ++// IMEGetShellWindow(); + #endif + } + break; +@@ -2144,6 +2144,8 @@ + if (mShell) { + // init GtkIMContext for shell + IMECreateContext(mShell->window); ++ } else if (mDrawingarea) { ++ IMECreateContext(mDrawingarea->inner_window); + } + #endif + +--- mozilla/widget/src/gtk2/Makefile.in.orig 2002-11-17 21:04:40.000000000 +0900 ++++ mozilla/widget/src/gtk2/Makefile.in 2002-11-20 02:19:26.000000000 +0900 +@@ -88,7 +88,7 @@ + CFLAGS += $(MOZ_GTK2_CFLAGS) + CXXFLAGS += $(MOZ_GTK2_CFLAGS) + +-#DEFINES += -DUSE_XIM ++DEFINES += -DUSE_XIM + + INCLUDES += \ + -I$(srcdir)/../xpwidgets \ diff --git a/net-www/mozilla/files/1.3/mozilla-1.3-gtk2.patch b/net-www/mozilla/files/1.3/mozilla-1.3-gtk2.patch new file mode 100644 index 000000000000..9026767d0a9e --- /dev/null +++ b/net-www/mozilla/files/1.3/mozilla-1.3-gtk2.patch @@ -0,0 +1,588 @@ +--- mozilla/widget/src/gtk2/Makefile.in.gtk2 2002-12-28 02:14:45.000000000 +0100 ++++ mozilla/widget/src/gtk2/Makefile.in 2003-03-11 14:05:45.000000000 +0100 +@@ -90,7 +90,7 @@ + CFLAGS += $(MOZ_GTK2_CFLAGS) + CXXFLAGS += $(MOZ_GTK2_CFLAGS) + +-#DEFINES += -DUSE_XIM ++DEFINES += -DUSE_XIM + + INCLUDES += \ + -I$(srcdir)/../xpwidgets \ +--- mozilla/widget/src/gtk2/nsWindow.h.gtk2 2003-02-17 19:50:01.000000000 +0100 ++++ mozilla/widget/src/gtk2/nsWindow.h 2003-03-13 10:14:36.000000000 +0100 +@@ -139,9 +139,11 @@ + PRBool aDoCapture, + PRBool aConsumeRollupEvent); + NS_IMETHOD GetAttention(); ++ NS_IMETHOD HideWindowChrome(PRBool aShouldHide); + + // utility methods + void LoseFocus(); ++ gint ConvertBorderStyles(nsBorderStyle bs); + + // event callbacks + gboolean OnExposeEvent(GtkWidget *aWidget, +@@ -239,6 +241,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 +254,14 @@ + 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: +--- mozilla/widget/src/gtk2/nsWindow.cpp.gtk2 2003-02-21 02:09:17.000000000 +0100 ++++ mozilla/widget/src/gtk2/nsWindow.cpp 2003-03-13 10:13:17.000000000 +0100 +@@ -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 +@@ -666,11 +599,7 @@ + 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", +@@ -735,7 +664,11 @@ + GtkWidget *widget = + get_gtk_widget_for_gdk_window(mDrawingarea->inner_window); + nsWindow *window = get_window_for_gtk_widget(widget); +- return window->SetCursor(aCursor); ++ if (window) { ++ return window->SetCursor(aCursor); ++ } ++ else ++ return NS_OK; + } + + // Only change cursor if it's actually been changed +@@ -746,7 +679,12 @@ + + if (nsnull != newCursor) { + mCursor = aCursor; ++ ++ if (!mContainer) ++ return NS_OK; ++ + gdk_window_set_cursor(GTK_WIDGET(mContainer)->window, newCursor); ++ + XFlush(GDK_DISPLAY()); + } + } +@@ -1161,17 +1099,8 @@ + 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")); +- } ++ IMELoseFocus(); + #endif +- + // make sure that we reset our repeat counter so the next keypress + // for this widget will get the down event + mInKeyRepeat = PR_FALSE; +@@ -1382,7 +1311,7 @@ + nsWindow *containerWindow; + GetContainerWindow(&containerWindow); + +- if (!gFocusWindow) { ++ if (!gFocusWindow && !containerWindow) { + containerWindow->mActivatePending = PR_FALSE; + DispatchActivateEvent(); + } +@@ -1532,7 +1461,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; + } +@@ -1616,7 +1545,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; + } +@@ -2150,6 +2079,13 @@ + + // and the drawing area + mDrawingarea = moz_drawingarea_new(nsnull, mContainer); ++ ++#if defined(USE_XIM) && !defined(XIM_CREATE_IC_AT_FOCUS) ++ if (mWindowType != eWindowType_popup) { ++ // create im context for shell ++ IMECreateContext(mShell->window); ++ } ++#endif /* XIM_CREATE_IC_AT_FOCUS && !XIM_CREATE_IC_AT_FOCUS*/ + } + break; + case eWindowType_child: { +@@ -2162,11 +2098,11 @@ + gtk_widget_realize(GTK_WIDGET(mContainer)); + + mDrawingarea = moz_drawingarea_new(nsnull, mContainer); ++#if defined(USE_XIM) && !defined(XIM_CREATE_IC_AT_FOCUS) ++ // create im context for gtk container ++ IMECreateContext(GTK_WIDGET(mContainer)->window); ++#endif /* XIM_CREATE_IC_AT_FOCUS && !XIM_CREATE_IC_AT_FOCUS*/ + } +-#ifdef USE_XIM +- // get mIMEShellWindow and keep it +- IMEGetShellWindow(); +-#endif + } + break; + default: +@@ -2211,13 +2147,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); +@@ -2694,6 +2623,83 @@ + } + + ++gint ++nsWindow::ConvertBorderStyles(nsBorderStyle bs) ++{ ++ gint w = 0; ++ ++ if (bs == eBorderStyle_default) ++ return -1; ++ ++ if (bs & eBorderStyle_all) ++ w |= GDK_DECOR_ALL; ++ if (bs & eBorderStyle_border) ++ w |= GDK_DECOR_BORDER; ++ if (bs & eBorderStyle_resizeh) ++ w |= GDK_DECOR_RESIZEH; ++ if (bs & eBorderStyle_title) ++ w |= GDK_DECOR_TITLE; ++ if (bs & eBorderStyle_menu) ++ w |= GDK_DECOR_MENU; ++ if (bs & eBorderStyle_minimize) ++ w |= GDK_DECOR_MINIMIZE; ++ if (bs & eBorderStyle_maximize) ++ w |= GDK_DECOR_MAXIMIZE; ++ if (bs & eBorderStyle_close) { ++#ifdef DEBUG ++ printf("we don't handle eBorderStyle_close yet... please fix me\n"); ++#endif /* DEBUG */ ++ } ++ ++ return w; ++} ++ ++NS_IMETHODIMP ++nsWindow::HideWindowChrome(PRBool aShouldHide) ++{ ++ if (!mShell) { ++ // Pass the request to the toplevel window ++ GtkWidget *topWidget = nsnull; ++ GetToplevelWidget(&topWidget); ++ nsWindow *topWindow = get_window_for_gtk_widget(topWidget); ++ if (topWindow) ++ return topWindow->HideWindowChrome(aShouldHide); ++ else ++ return NS_OK; ++ } ++ ++ // Sawfish, metacity, and presumably other window managers get ++ // confused if we change the window decorations while the window ++ // is visible. ++#if GTK_CHECK_VERSION(2,2,0) ++ if (aShouldHide) ++ gdk_window_fullscreen (mShell->window); ++ else ++ gdk_window_unfullscreen (mShell->window); ++#else ++ gdk_window_hide(mShell->window); ++ ++ gint wmd; ++ if (aShouldHide) ++ wmd = 0; ++ else ++ wmd = ConvertBorderStyles(mBorderStyle); ++ ++ gdk_window_set_decorations(mShell->window, (GdkWMDecoration) wmd); ++ ++ gdk_window_show(mShell->window); ++#endif ++ ++ // For some window managers, adding or removing window decorations ++ // requires unmapping and remapping our toplevel window. Go ahead ++ // and flush the queue here so that we don't end up with a BadWindow ++ // error later when this happens (when the persistence timer fires ++ // and GetWindowPos is called) ++ XSync(GDK_DISPLAY(), False); ++ ++ return NS_OK; ++} ++ + PRBool + check_for_rollup(GdkWindow *aWindow, gdouble aMouseX, gdouble aMouseY, + PRBool aIsWheel) +@@ -3662,6 +3668,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) +@@ -3732,6 +3809,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, +@@ -3742,7 +3839,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 ? +@@ -3755,6 +3853,7 @@ + if (!preedit_string || !*preedit_string) { + window->IMEComposeStart(); + window->IMEComposeText(NULL, 0, NULL, NULL); ++ window->IMEComposeEnd(); + return; + } + +@@ -3795,9 +3894,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); +@@ -3941,4 +4062,61 @@ + 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) ++{ ++ if (mWindowType == eWindowType_child && !mIMEShellWindow) { ++ IMEGetShellWindow(); ++ } ++ 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 diff --git a/net-www/mozilla/files/1.3/mozilla-1.3-provider-shutdown.patch b/net-www/mozilla/files/1.3/mozilla-1.3-provider-shutdown.patch new file mode 100644 index 000000000000..78f5eeb5a437 --- /dev/null +++ b/net-www/mozilla/files/1.3/mozilla-1.3-provider-shutdown.patch @@ -0,0 +1,123 @@ +Index: embedding/browser/gtk/src/EmbedPrivate.cpp +=================================================================== +RCS file: /cvsroot/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp,v +retrieving revision 1.30 +diff -u -r1.30 EmbedPrivate.cpp +--- embedding/browser/gtk/src/EmbedPrivate.cpp 9 Nov 2002 19:38:31 -0000 1.30 ++++ embedding/browser/gtk/src/EmbedPrivate.cpp 11 Feb 2003 00:11:18 -0000 +@@ -78,6 +78,7 @@ + GtkWidget *EmbedPrivate::sOffscreenWindow = 0; + GtkWidget *EmbedPrivate::sOffscreenFixed = 0; + nsIDirectoryServiceProvider *EmbedPrivate::sAppFileLocProvider = nsnull; ++nsProfileDirServiceProvider *EmbedPrivate::sProfileDirServiceProvider = nsnull; + + EmbedPrivate::EmbedPrivate(void) + { +@@ -796,16 +797,14 @@ + NS_NewProfileDirServiceProvider(PR_TRUE, getter_AddRefs(locProvider)); + if (!locProvider) + return NS_ERROR_FAILURE; +- +- // Directory service holds an strong reference to any +- // provider that is registered with it. Let it hold the +- // only ref. locProvider won't die when we leave this scope. + rv = locProvider->Register(); + if (NS_FAILED(rv)) + return rv; + rv = locProvider->SetProfileDir(profileDir); + if (NS_FAILED(rv)) + return rv; ++ // Keep a ref so we can shut it down. ++ NS_ADDREF(sProfileDirServiceProvider = locProvider); + + // get prefs + nsCOMPtr<nsIPref> pref; +@@ -822,6 +821,11 @@ + void + EmbedPrivate::ShutdownProfile(void) + { ++ if (sProfileDirServiceProvider) { ++ sProfileDirServiceProvider->Shutdown(); ++ NS_RELEASE(sProfileDirServiceProvider); ++ sProfileDirServiceProvider = 0; ++ } + if (sPrefs) { + NS_RELEASE(sPrefs); + sPrefs = 0; +Index: embedding/browser/gtk/src/EmbedPrivate.h +=================================================================== +RCS file: /cvsroot/mozilla/embedding/browser/gtk/src/EmbedPrivate.h,v +retrieving revision 1.16 +diff -u -r1.16 EmbedPrivate.h +--- embedding/browser/gtk/src/EmbedPrivate.h 29 Jan 2002 21:39:30 -0000 1.16 ++++ embedding/browser/gtk/src/EmbedPrivate.h 11 Feb 2003 00:11:18 -0000 +@@ -46,6 +46,7 @@ + + class nsPIDOMWindow; + class nsIDirectoryServiceProvider; ++class nsProfileDirServiceProvider; + + class EmbedPrivate { + +@@ -134,6 +135,7 @@ + static char *sProfileDir; + static char *sProfileName; + // for profiles ++ static nsProfileDirServiceProvider *sProfileDirServiceProvider; + static nsIPref *sPrefs; + + static nsIDirectoryServiceProvider * sAppFileLocProvider; +Index: profile/dirserviceprovider/public/nsProfileDirServiceProvider.h +=================================================================== +RCS file: /cvsroot/mozilla/profile/dirserviceprovider/public/nsProfileDirServiceProvider.h,v +retrieving revision 1.1 +diff -u -r1.1 nsProfileDirServiceProvider.h +--- profile/dirserviceprovider/public/nsProfileDirServiceProvider.h 9 Nov 2002 19:38:23 -0000 1.1 ++++ profile/dirserviceprovider/public/nsProfileDirServiceProvider.h 11 Feb 2003 00:11:54 -0000 +@@ -79,6 +79,16 @@ + + virtual nsresult Register(); + ++ /** ++ * Shutdown ++ * ++ * This method must be called before shutting down XPCOM if this object ++ * was created with aNotifyObservers == PR_TRUE. If this object was ++ * created with aNotifyObservers == PR_FALSE, this method is a no-op. ++ */ ++ ++ virtual nsresult Shutdown(); ++ + protected: + nsProfileDirServiceProvider(PRBool aNotifyObservers = PR_TRUE); + virtual ~nsProfileDirServiceProvider(); +Index: profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp +=================================================================== +RCS file: /cvsroot/mozilla/profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp,v +retrieving revision 1.3 +diff -u -r1.3 nsProfileDirServiceProvider.cpp +--- profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp 8 Jan 2003 22:41:35 -0000 1.3 ++++ profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp 11 Feb 2003 00:11:54 -0000 +@@ -155,6 +155,22 @@ + return directoryService->RegisterProvider(this); + } + ++nsresult ++nsProfileDirServiceProvider::Shutdown() ++{ ++ if (!mNotifyObservers) ++ return NS_OK; ++ ++ nsCOMPtr<nsIObserverService> observerService = ++ do_GetService("@mozilla.org/observer-service;1"); ++ if (!observerService) ++ return NS_ERROR_FAILURE; ++ ++ NS_NAMED_LITERAL_STRING(context, "shutdown-persist"); ++ observerService->NotifyObservers(nsnull, "profile-before-change", context.get()); ++ return NS_OK; ++} ++ + //***************************************************************************** + // nsProfileDirServiceProvider::nsISupports + //***************************************************************************** diff --git a/net-www/mozilla/files/10mozilla b/net-www/mozilla/files/10mozilla new file mode 100644 index 000000000000..d200bce154bd --- /dev/null +++ b/net-www/mozilla/files/10mozilla @@ -0,0 +1,3 @@ +LDPATH=/usr/lib/mozilla +MOZILLA_FIVE_HOME=/usr/lib/mozilla +CONFIG_PROTECT=/usr/lib/mozilla/defaults/pref diff --git a/net-www/mozilla/files/digest-mozilla-1.6-r1 b/net-www/mozilla/files/digest-mozilla-1.6-r1 new file mode 100644 index 000000000000..57588c8c94e1 --- /dev/null +++ b/net-www/mozilla/files/digest-mozilla-1.6-r1 @@ -0,0 +1,3 @@ +MD5 da612f8768320dbafd0bfb3c254c2788 mozilla-source-1.6.tar.bz2 31037452 +MD5 70d1b085d8b2ed7c82b6666fa1d537af enigmail-0.83.3.tar.gz 325747 +MD5 457f8277b12f3e37defa71dc186f83b4 ipc-1.0.5.tar.gz 137083 diff --git a/net-www/mozilla/files/digest-mozilla-1.7 b/net-www/mozilla/files/digest-mozilla-1.7 new file mode 100644 index 000000000000..813569f1bcaa --- /dev/null +++ b/net-www/mozilla/files/digest-mozilla-1.7 @@ -0,0 +1,3 @@ +MD5 5b4494934c4ffaee83bc79a8b181a8c3 mozilla-source-1.7.tar.bz2 35174502 +MD5 e4c79a7bb5ac7428dfef767e835fc770 ipc-1.0.6.tar.gz 116519 +MD5 b8bc2517de376a99b6ad7a9ad96747d2 enigmail-0.84.1-r1.tar.gz 309440 diff --git a/net-www/mozilla/files/digest-mozilla-1.7-r1 b/net-www/mozilla/files/digest-mozilla-1.7-r1 new file mode 100644 index 000000000000..813569f1bcaa --- /dev/null +++ b/net-www/mozilla/files/digest-mozilla-1.7-r1 @@ -0,0 +1,3 @@ +MD5 5b4494934c4ffaee83bc79a8b181a8c3 mozilla-source-1.7.tar.bz2 35174502 +MD5 e4c79a7bb5ac7428dfef767e835fc770 ipc-1.0.6.tar.gz 116519 +MD5 b8bc2517de376a99b6ad7a9ad96747d2 enigmail-0.84.1-r1.tar.gz 309440 diff --git a/net-www/mozilla/files/digest-mozilla-1.7.2-r1 b/net-www/mozilla/files/digest-mozilla-1.7.2-r1 new file mode 100644 index 000000000000..adc8e1f10d9f --- /dev/null +++ b/net-www/mozilla/files/digest-mozilla-1.7.2-r1 @@ -0,0 +1,3 @@ +MD5 262987cfcb793bab9fb1aebb21c527ce mozilla-source3-1.7.2.tar.bz2 34438800 +MD5 f605ba029ff4c71dcc10c29635c1c79e ipc-1.0.7.tar.gz 104193 +MD5 7ad587bba6bdb002be2670ac94b09139 enigmail-0.85.0.tar.gz 326337 diff --git a/net-www/mozilla/files/enigmail-Makefile b/net-www/mozilla/files/enigmail-Makefile new file mode 100644 index 000000000000..c6a95caba45d --- /dev/null +++ b/net-www/mozilla/files/enigmail-Makefile @@ -0,0 +1,45 @@ +#!gmake +# +# The contents of this file are subject to the Mozilla Public +# License Version 1.1 (the "MPL"); you may not use this file +# except in compliance with the MPL. You may obtain a copy of +# the MPL at http://www.mozilla.org/MPL/ +# +# Software distributed under the MPL is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the MPL for the specific language governing +# rights and limitations under the MPL. +# +# The Original Code is Enigmail. +# +# The Initial Developer of the Original Code is Ramalingam Saravanan. +# Portions created by Ramalingam Saravanan <svn@xmlterm.org> are +# Copyright (C) 2001 Ramalingam Saravanan. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the +# terms of the GNU General Public License (the "GPL"), in which case +# the provisions of the GPL are applicable instead of +# those above. If you wish to allow use of your version of this +# file only under the terms of the GPL and not to allow +# others to use your version of this file under the MPL, indicate +# your decision by deleting the provisions above and replace them +# with the notice and other provisions required by the GPL. +# If you do not delete the provisions above, a recipient +# may use your version of this file under either the MPL or the +# GPL. +# + +DEPTH = ../.. +topsrcdir = ../.. +srcdir = . +VPATH = . + +include $(DEPTH)/config/autoconf.mk + +DIRS = public src build ui package + +include $(topsrcdir)/config/config.mk + +include $(topsrcdir)/config/rules.mk diff --git a/net-www/mozilla/files/enigmail/Makefile-enigmail b/net-www/mozilla/files/enigmail/Makefile-enigmail new file mode 100644 index 000000000000..c6a95caba45d --- /dev/null +++ b/net-www/mozilla/files/enigmail/Makefile-enigmail @@ -0,0 +1,45 @@ +#!gmake +# +# The contents of this file are subject to the Mozilla Public +# License Version 1.1 (the "MPL"); you may not use this file +# except in compliance with the MPL. You may obtain a copy of +# the MPL at http://www.mozilla.org/MPL/ +# +# Software distributed under the MPL is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the MPL for the specific language governing +# rights and limitations under the MPL. +# +# The Original Code is Enigmail. +# +# The Initial Developer of the Original Code is Ramalingam Saravanan. +# Portions created by Ramalingam Saravanan <svn@xmlterm.org> are +# Copyright (C) 2001 Ramalingam Saravanan. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the +# terms of the GNU General Public License (the "GPL"), in which case +# the provisions of the GPL are applicable instead of +# those above. If you wish to allow use of your version of this +# file only under the terms of the GPL and not to allow +# others to use your version of this file under the MPL, indicate +# your decision by deleting the provisions above and replace them +# with the notice and other provisions required by the GPL. +# If you do not delete the provisions above, a recipient +# may use your version of this file under either the MPL or the +# GPL. +# + +DEPTH = ../.. +topsrcdir = ../.. +srcdir = . +VPATH = . + +include $(DEPTH)/config/autoconf.mk + +DIRS = public src build ui package + +include $(topsrcdir)/config/config.mk + +include $(topsrcdir)/config/rules.mk diff --git a/net-www/mozilla/files/enigmail/Makefile-ipc b/net-www/mozilla/files/enigmail/Makefile-ipc new file mode 100644 index 000000000000..99c2231f3d0c --- /dev/null +++ b/net-www/mozilla/files/enigmail/Makefile-ipc @@ -0,0 +1,51 @@ +#!gmake +# +# The contents of this file are subject to the Mozilla Public +# License Version 1.1 (the "MPL"); you may not use this file +# except in compliance with the MPL. You may obtain a copy of +# the MPL at http://www.mozilla.org/MPL/ +# +# Software distributed under the MPL is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the MPL for the specific language governing +# rights and limitations under the MPL. +# +# The Original Code is protoZilla. +# +# The Initial Developer of the Original Code is Ramalingam Saravanan. +# Portions created by Ramalingam Saravanan <svn@xmlterm.org> are +# Copyright (C) 2001 Ramalingam Saravanan. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the +# terms of the GNU General Public License (the "GPL"), in which case +# the provisions of the GPL are applicable instead of +# those above. If you wish to allow use of your version of this +# file only under the terms of the GPL and not to allow +# others to use your version of this file under the MPL, indicate +# your decision by deleting the provisions above and replace them +# with the notice and other provisions required by the GPL. +# If you do not delete the provisions above, a recipient +# may use your version of this file under either the MPL or the +# GPL. +# + +DEPTH = ../.. +topsrcdir = ../.. +srcdir = . +VPATH = . + +include $(DEPTH)/config/autoconf.mk + +DIRS = public src + +ifdef BUILD_IPC +DIRS += build +endif + +ifdef ENABLE_TESTS +DIRS += tests +endif + +include $(topsrcdir)/config/rules.mk diff --git a/net-www/mozilla/files/google.src b/net-www/mozilla/files/google.src new file mode 100644 index 000000000000..c11e51bf39a2 --- /dev/null +++ b/net-www/mozilla/files/google.src @@ -0,0 +1,29 @@ +# Mozilla/Google plug-in by amitp+mozilla@google.com + +<search + name="Google" + description="Google Search" + method="GET" + action="http://www.google.com/search" + update="http://www.google.com/mozilla/google.src" + updateCheckDays=1 + queryEncoding="utf-8" + queryCharset="utf-8" +> + +<input name="q" user> +<input name="sourceid" value="mozilla-search"> +<inputnext name="start" factor="10"> +<inputprev name="start" factor="10"> +<input name="ie" value="utf-8"> +<input name="oe" value="utf-8"> + +<interpret + browserResultType="result" + charset = "UTF-8" + resultListStart="<!--a-->" + resultListEnd="<!--z-->" + resultItemStart="<!--m-->" + resultItemEnd="<!--n-->" +> +</search> diff --git a/net-www/mozilla/files/gtk2mozilla_head_patch2 b/net-www/mozilla/files/gtk2mozilla_head_patch2 new file mode 100644 index 000000000000..6b4e3da4e8eb --- /dev/null +++ b/net-www/mozilla/files/gtk2mozilla_head_patch2 @@ -0,0 +1,773 @@ +Index: build//unix/mozilla-gtkmozembed.pc.in +=================================================================== +RCS file: /cvsroot/mozilla/build/unix/mozilla-gtkmozembed.pc.in,v +retrieving revision 1.1 +diff -u -r1.1 mozilla-gtkmozembed.pc.in +--- build//unix/mozilla-gtkmozembed.pc.in 28 May 2002 20:20:40 -0000 1.1 ++++ build//unix/mozilla-gtkmozembed.pc.in 28 Jun 2002 16:08:30 -0000 +@@ -7,5 +7,5 @@ + Description: Mozilla Embedding Widget for Gtk+ + Version: %MOZILLA_VERSION% + Requires: mozilla-xpcom = %MOZILLA_VERSION% +-Libs: -L${libdir} -lgtkembedmoz -lgtksuperwin ++Libs: -L${libdir} -lgtkembedmoz + Cflags: -I${includedir}/gtkembedmoz +Index: embedding/browser/gtk//src/EmbedWindow.cpp +=================================================================== +RCS file: /cvsroot/mozilla/embedding/browser/gtk/src/EmbedWindow.cpp,v +retrieving revision 1.25 +diff -u -r1.25 EmbedWindow.cpp +--- embedding/browser/gtk//src/EmbedWindow.cpp 29 Jan 2002 21:39:31 -0000 1.25 ++++ embedding/browser/gtk//src/EmbedWindow.cpp 28 Jun 2002 16:09:15 -0000 +@@ -226,9 +226,11 @@ + { + GtkWidget* parent = GTK_WIDGET(mOwner->mOwningWidget)->parent; + ++#ifdef MOZ_WIDGET_GTK + if (GTK_IS_CONTAINER(parent)) + gtk_container_focus(GTK_CONTAINER(parent), + GTK_DIR_TAB_FORWARD); ++#endif + return NS_OK; + } + +@@ -237,9 +239,11 @@ + { + GtkWidget* parent = GTK_WIDGET(mOwner->mOwningWidget)->parent; + ++#ifdef MOZ_WIDGET_GTK + if (GTK_IS_CONTAINER(parent)) + gtk_container_focus(GTK_CONTAINER(parent), + GTK_DIR_TAB_BACKWARD); ++#endif + return NS_OK; + } + +@@ -405,7 +409,9 @@ + 0, 0, + sTipWindow->allocation.width, sTipWindow->allocation.height); + ++#ifdef MOZ_WIDGET_GTK + gtk_widget_popup(sTipWindow, aXCoords + root_x, aYCoords + root_y); ++#endif /* MOZ_WIDGET_GTK */ + + nsMemory::Free( (void*)tipString ); + +Index: embedding/browser/gtk//src/Makefile.in +=================================================================== +RCS file: /cvsroot/mozilla/embedding/browser/gtk/src/Makefile.in,v +retrieving revision 1.31 +diff -u -r1.31 Makefile.in +--- embedding/browser/gtk//src/Makefile.in 11 Apr 2002 14:30:28 -0000 1.31 ++++ embedding/browser/gtk//src/Makefile.in 28 Jun 2002 16:09:16 -0000 +@@ -56,6 +56,11 @@ + EmbedWindowCreator.cpp \ + EmbedStream.cpp + ++ifdef MOZ_ENABLE_GTK2 ++CSRCS = \ ++ gtkmozembedmarshal.c ++endif ++ + ifdef BUILD_STATIC_LIBS + # Static build stuff + DEFINES += -D_BUILD_STATIC_BIN=1 +@@ -88,12 +93,20 @@ + gtkmozembed.h \ + gtkmozembed_internal.h + ++ifdef MOZ_ENABLE_GTK + EXTRA_DSO_LDOPTS = \ + $(MOZ_COMPONENT_LIBS) \ + -lgtksuperwin \ + $(NULL) ++endif ++ ++ifdef MOZ_ENABLE_GTK2 ++EXTRA_DSO_LDOPTS = \ ++ $(MOZ_COMPONENT_LIBS) \ ++ $(NULL) ++endif + +-EXTRA_DSO_LDOPTS += $(MOZ_GTK_LDFLAGS) ++EXTRA_DSO_LDOPTS += $(MOZ_GTK_LDFLAGS) $(MOZ_GTK2_LIBS) + + include $(topsrcdir)/config/rules.mk + +@@ -108,7 +121,8 @@ + endif + endif + +-CXXFLAGS += $(MOZ_GTK_CFLAGS) ++CXXFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS) ++CFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS) + + ifdef BUILD_STATIC_LIBS + +Index: embedding/browser/gtk//src/gtkmozembed2.cpp +=================================================================== +RCS file: /cvsroot/mozilla/embedding/browser/gtk/src/gtkmozembed2.cpp,v +retrieving revision 1.23 +diff -u -r1.23 gtkmozembed2.cpp +--- embedding/browser/gtk//src/gtkmozembed2.cpp 12 Jan 2002 05:04:57 -0000 1.23 ++++ embedding/browser/gtk//src/gtkmozembed2.cpp 28 Jun 2002 16:09:21 -0000 +@@ -36,11 +36,32 @@ + #include <nsXPIDLString.h> + #include <nsReadableUtils.h> + ++#ifdef MOZ_WIDGET_GTK ++ + // so we can get callbacks from the mozarea + #include <gtkmozarea.h> + ++// so we get the right marshaler for gtk 1.2 ++#define gtkmozembed_VOID__INT_UINT \ ++ gtk_marshal_NONE__INT_INT ++#define gtkmozembed_VOID__POINTER_INT_INT \ ++ gtk_marshal_NONE__POINTER_INT_INT ++#define gtkmozembed_VOID__POINTER_INT_UINT \ ++ gtk_marshal_NONE__POINTER_INT_INT ++#define gtkmozembed_VOID__POINTER_INT_POINTER \ ++ gtk_marshal_NONE__POINTER_INT_POINTER ++ ++#endif /* MOZ_WIDGET_GTK */ ++ ++#ifdef MOZ_WIDGET_GTK2 ++ ++#include "gtkmozembedmarshal.h" ++ ++#endif /* MOZ_WIDGET_GTK2 */ ++ + class nsIDirectoryServiceProvider; + ++#ifdef MOZ_WIDGET_GTK + // Some "massaged" enum information for the GTK Type System + static GtkFlagValue gtk_moz_embed_progress_flags_values[] = { + { GTK_MOZ_EMBED_FLAG_START, +@@ -138,6 +159,7 @@ + { 0, + NULL, NULL } + }; ++#endif /* MOZ_WIDGET_GTK */ + + + // class and instance initialization +@@ -180,6 +202,7 @@ + GdkEventFocus *aGdkFocusEvent, + GtkMozEmbed *aEmbed); + ++#ifdef MOZ_WIDGET_GTK + // signal handlers for tracking the focus and and focus out events on + // the toplevel window. + +@@ -189,6 +212,7 @@ + static void + handle_toplevel_focus_out(GtkMozArea *aArea, + GtkMozEmbed *aEmbed); ++#endif /* MOZ_WIDGET_GTK */ + + // globals for this type of widget + +@@ -249,191 +273,193 @@ + moz_embed_signals[LINK_MESSAGE] = + gtk_signal_new ("link_message", + GTK_RUN_FIRST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, link_message), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + moz_embed_signals[JS_STATUS] = + gtk_signal_new ("js_status", + GTK_RUN_FIRST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, js_status), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + moz_embed_signals[LOCATION] = + gtk_signal_new ("location", + GTK_RUN_FIRST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, location), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + moz_embed_signals[TITLE] = + gtk_signal_new("title", + GTK_RUN_FIRST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, title), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + moz_embed_signals[PROGRESS] = + gtk_signal_new("progress", + GTK_RUN_FIRST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, progress), + gtk_marshal_NONE__INT_INT, + GTK_TYPE_NONE, 2, GTK_TYPE_INT, GTK_TYPE_INT); + moz_embed_signals[PROGRESS_ALL] = + gtk_signal_new("progress_all", + GTK_RUN_FIRST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, progress_all), +- gtk_marshal_NONE__POINTER_INT_INT, ++ gtkmozembed_VOID__POINTER_INT_INT, + GTK_TYPE_NONE, 3, GTK_TYPE_STRING, + GTK_TYPE_INT, GTK_TYPE_INT); + moz_embed_signals[NET_STATE] = + gtk_signal_new("net_state", + GTK_RUN_FIRST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, net_state), +- gtk_marshal_NONE__INT_INT, ++ gtkmozembed_VOID__INT_UINT, + GTK_TYPE_NONE, 2, GTK_TYPE_INT, GTK_TYPE_UINT); + moz_embed_signals[NET_STATE_ALL] = + gtk_signal_new("net_state_all", + GTK_RUN_FIRST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, net_state_all), +- gtk_marshal_NONE__POINTER_INT_INT, ++ gtkmozembed_VOID__POINTER_INT_UINT, + GTK_TYPE_NONE, 3, GTK_TYPE_STRING, + GTK_TYPE_INT, GTK_TYPE_UINT); + moz_embed_signals[NET_START] = + gtk_signal_new("net_start", + GTK_RUN_FIRST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, net_start), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + moz_embed_signals[NET_STOP] = + gtk_signal_new("net_stop", + GTK_RUN_FIRST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, net_stop), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + moz_embed_signals[NEW_WINDOW] = + gtk_signal_new("new_window", + GTK_RUN_FIRST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, new_window), + gtk_marshal_NONE__POINTER_UINT, + GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_UINT); + moz_embed_signals[VISIBILITY] = + gtk_signal_new("visibility", + GTK_RUN_FIRST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, visibility), + gtk_marshal_NONE__BOOL, + GTK_TYPE_NONE, 1, GTK_TYPE_BOOL); + moz_embed_signals[DESTROY_BROWSER] = + gtk_signal_new("destroy_browser", + GTK_RUN_FIRST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, destroy_brsr), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + moz_embed_signals[OPEN_URI] = + gtk_signal_new("open_uri", + GTK_RUN_LAST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, open_uri), + gtk_marshal_BOOL__POINTER, + GTK_TYPE_BOOL, 1, GTK_TYPE_STRING); + moz_embed_signals[SIZE_TO] = + gtk_signal_new("size_to", + GTK_RUN_LAST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, size_to), + gtk_marshal_NONE__INT_INT, + GTK_TYPE_NONE, 2, GTK_TYPE_INT, GTK_TYPE_INT); + moz_embed_signals[DOM_KEY_DOWN] = + gtk_signal_new("dom_key_down", + GTK_RUN_LAST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, dom_key_down), + gtk_marshal_BOOL__POINTER, + GTK_TYPE_BOOL, 1, GTK_TYPE_POINTER); + moz_embed_signals[DOM_KEY_PRESS] = + gtk_signal_new("dom_key_press", + GTK_RUN_LAST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, dom_key_press), + gtk_marshal_BOOL__POINTER, + GTK_TYPE_BOOL, 1, GTK_TYPE_POINTER); + moz_embed_signals[DOM_KEY_UP] = + gtk_signal_new("dom_key_up", + GTK_RUN_LAST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, dom_key_up), + gtk_marshal_BOOL__POINTER, + GTK_TYPE_BOOL, 1, GTK_TYPE_POINTER); + moz_embed_signals[DOM_MOUSE_DOWN] = + gtk_signal_new("dom_mouse_down", + GTK_RUN_LAST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, dom_mouse_down), + gtk_marshal_BOOL__POINTER, + GTK_TYPE_BOOL, 1, GTK_TYPE_POINTER); + moz_embed_signals[DOM_MOUSE_UP] = + gtk_signal_new("dom_mouse_up", + GTK_RUN_LAST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, dom_mouse_up), + gtk_marshal_BOOL__POINTER, + GTK_TYPE_BOOL, 1, GTK_TYPE_POINTER); + moz_embed_signals[DOM_MOUSE_CLICK] = + gtk_signal_new("dom_mouse_click", + GTK_RUN_LAST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, dom_mouse_click), + gtk_marshal_BOOL__POINTER, + GTK_TYPE_BOOL, 1, GTK_TYPE_POINTER); + moz_embed_signals[DOM_MOUSE_DBL_CLICK] = + gtk_signal_new("dom_mouse_dbl_click", + GTK_RUN_LAST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, dom_mouse_dbl_click), + gtk_marshal_BOOL__POINTER, + GTK_TYPE_BOOL, 1, GTK_TYPE_POINTER); + moz_embed_signals[DOM_MOUSE_OVER] = + gtk_signal_new("dom_mouse_over", + GTK_RUN_LAST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, dom_mouse_over), + gtk_marshal_BOOL__POINTER, + GTK_TYPE_BOOL, 1, GTK_TYPE_POINTER); + moz_embed_signals[DOM_MOUSE_OUT] = + gtk_signal_new("dom_mouse_out", + GTK_RUN_LAST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, dom_mouse_out), + gtk_marshal_BOOL__POINTER, + GTK_TYPE_BOOL, 1, GTK_TYPE_POINTER); + moz_embed_signals[SECURITY_CHANGE] = + gtk_signal_new("security_change", + GTK_RUN_LAST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, security_change), + gtk_marshal_NONE__POINTER_UINT, + GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_UINT); + moz_embed_signals[STATUS_CHANGE] = + gtk_signal_new("status_change", + GTK_RUN_LAST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedClass, status_change), +- gtk_marshal_NONE__POINTER_INT_POINTER, ++ gtkmozembed_VOID__POINTER_INT_POINTER, + GTK_TYPE_NONE, 3, + GTK_TYPE_POINTER, GTK_TYPE_INT, GTK_TYPE_POINTER); + ++#ifdef MOZ_WIDGET_GTK + gtk_object_class_add_signals(object_class, moz_embed_signals, + EMBED_LAST_SIGNAL); ++#endif /* MOZ_WIDGET_GTK */ + + } + +@@ -443,6 +469,8 @@ + EmbedPrivate *priv = new EmbedPrivate(); + embed->data = priv; + gtk_widget_set_name(GTK_WIDGET(embed), "gtkmozembed"); ++ ++ GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET(embed), GTK_NO_WINDOW); + } + + GtkWidget * +@@ -538,6 +566,7 @@ + embed, + GTK_OBJECT(child_widget)); + ++#ifdef MOZ_WIDGET_GTK + // connect to the toplevel focus out events for the child + GtkMozArea *mozarea = GTK_MOZAREA(child_widget); + gtk_signal_connect_while_alive(GTK_OBJECT(mozarea), +@@ -551,6 +580,7 @@ + GTK_SIGNAL_FUNC(handle_toplevel_focus_out), + embed, + GTK_OBJECT(mozarea)); ++#endif /* MOZ_WIDGET_GTK */ + } + + static void +@@ -663,6 +693,8 @@ + return FALSE; + } + ++#ifdef MOZ_WIDGET_GTK ++ + static void + handle_toplevel_focus_in (GtkMozArea *aArea, + GtkMozEmbed *aEmbed) +@@ -683,6 +715,8 @@ + embedPrivate->TopLevelFocusOut(); + } + ++#endif /* MOZ_WIDGET_GTK */ ++ + // Widget methods + + void +@@ -1011,6 +1045,8 @@ + return embedPrivate->mChromeMask; + } + ++#ifdef MOZ_WIDGET_GTK ++ + GtkType + gtk_moz_embed_progress_flags_get_type(void) + { +@@ -1059,6 +1095,8 @@ + return chrome_flags_type; + } + ++#endif /* MOZ_WIDGET_GTK */ ++ + void + gtk_moz_embed_get_nsIWebBrowser (GtkMozEmbed *embed, nsIWebBrowser **retval) + { +@@ -1183,14 +1221,16 @@ + moz_embed_single_signals[NEW_WINDOW_ORPHAN] = + gtk_signal_new("new_window_orphan", + GTK_RUN_FIRST, +- object_class->type, ++ GTK_CLASS_TYPE(klass), + GTK_SIGNAL_OFFSET(GtkMozEmbedSingleClass, + new_window_orphan), + gtk_marshal_NONE__POINTER_UINT, + GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_UINT); + ++#ifdef MOZ_WIDGET_GTK + gtk_object_class_add_signals(object_class, moz_embed_single_signals, + SINGLE_LAST_SIGNAL); ++#endif /* MOZ_WIDGET_GTK */ + } + + static void +Index: widget/src/gtk2/nsWindow.cpp +=================================================================== +RCS file: /cvsroot/mozilla/widget/src/gtk2/nsWindow.cpp,v +retrieving revision 1.33 +diff -u -r1.33 nsWindow.cpp +--- widget/src/gtk2/nsWindow.cpp 25 Jun 2002 07:07:18 -0000 1.33 ++++ widget/src/gtk2/nsWindow.cpp 28 Jun 2002 16:09:54 -0000 +@@ -261,7 +261,8 @@ + gtk_widget_destroy(GTK_WIDGET(mContainer)); + mContainer = nsnull; + } +- else if (mDrawingarea) { ++ ++ if (mDrawingarea) { + g_object_unref(mDrawingarea); + mDrawingarea = nsnull; + } + +--- /dev/null Thu Apr 11 16:25:15 2002 ++++ embedding/browser/gtk/src/gtkmozembedmarshal.txt Sat Jun 29 01:44:04 2002 +@@ -0,0 +1,4 @@ ++NONE:INT,UINT ++NONE:POINTER,INT,INT ++NONE:POINTER,INT,UINT ++NONE:POINTER,INT,POINTER +--- /dev/null Thu Apr 11 16:25:15 2002 ++++ embedding/browser/gtk/src/gtkmozembedmarshal.c Sat Jun 29 01:44:02 2002 +@@ -0,0 +1,203 @@ ++ ++#include <glib-object.h> ++ ++ ++#ifdef G_ENABLE_DEBUG ++#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) ++#define g_marshal_value_peek_char(v) g_value_get_char (v) ++#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) ++#define g_marshal_value_peek_int(v) g_value_get_int (v) ++#define g_marshal_value_peek_uint(v) g_value_get_uint (v) ++#define g_marshal_value_peek_long(v) g_value_get_long (v) ++#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) ++#define g_marshal_value_peek_int64(v) g_value_get_int64 (v) ++#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) ++#define g_marshal_value_peek_enum(v) g_value_get_enum (v) ++#define g_marshal_value_peek_flags(v) g_value_get_flags (v) ++#define g_marshal_value_peek_float(v) g_value_get_float (v) ++#define g_marshal_value_peek_double(v) g_value_get_double (v) ++#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) ++#define g_marshal_value_peek_param(v) g_value_get_param (v) ++#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) ++#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) ++#define g_marshal_value_peek_object(v) g_value_get_object (v) ++#else /* !G_ENABLE_DEBUG */ ++/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. ++ * Do not access GValues directly in your code. Instead, use the ++ * g_value_get_*() functions ++ */ ++#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int ++#define g_marshal_value_peek_char(v) (v)->data[0].v_int ++#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint ++#define g_marshal_value_peek_int(v) (v)->data[0].v_int ++#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint ++#define g_marshal_value_peek_long(v) (v)->data[0].v_long ++#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong ++#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 ++#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 ++#define g_marshal_value_peek_enum(v) (v)->data[0].v_int ++#define g_marshal_value_peek_flags(v) (v)->data[0].v_uint ++#define g_marshal_value_peek_float(v) (v)->data[0].v_float ++#define g_marshal_value_peek_double(v) (v)->data[0].v_double ++#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer ++#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer ++#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer ++#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer ++#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer ++#endif /* !G_ENABLE_DEBUG */ ++ ++ ++/* NONE:INT,UINT (/dev/stdin:1) */ ++void ++gtkmozembed_VOID__INT_UINT (GClosure *closure, ++ GValue *return_value, ++ guint n_param_values, ++ const GValue *param_values, ++ gpointer invocation_hint, ++ gpointer marshal_data) ++{ ++ typedef void (*GMarshalFunc_VOID__INT_UINT) (gpointer data1, ++ gint arg_1, ++ guint arg_2, ++ gpointer data2); ++ register GMarshalFunc_VOID__INT_UINT callback; ++ register GCClosure *cc = (GCClosure*) closure; ++ register gpointer data1, data2; ++ ++ g_return_if_fail (n_param_values == 3); ++ ++ if (G_CCLOSURE_SWAP_DATA (closure)) ++ { ++ data1 = closure->data; ++ data2 = g_value_peek_pointer (param_values + 0); ++ } ++ else ++ { ++ data1 = g_value_peek_pointer (param_values + 0); ++ data2 = closure->data; ++ } ++ callback = (GMarshalFunc_VOID__INT_UINT) (marshal_data ? marshal_data : cc->callback); ++ ++ callback (data1, ++ g_marshal_value_peek_int (param_values + 1), ++ g_marshal_value_peek_uint (param_values + 2), ++ data2); ++} ++ ++/* NONE:POINTER,INT,INT (/dev/stdin:2) */ ++void ++gtkmozembed_VOID__POINTER_INT_INT (GClosure *closure, ++ GValue *return_value, ++ guint n_param_values, ++ const GValue *param_values, ++ gpointer invocation_hint, ++ gpointer marshal_data) ++{ ++ typedef void (*GMarshalFunc_VOID__POINTER_INT_INT) (gpointer data1, ++ gpointer arg_1, ++ gint arg_2, ++ gint arg_3, ++ gpointer data2); ++ register GMarshalFunc_VOID__POINTER_INT_INT callback; ++ register GCClosure *cc = (GCClosure*) closure; ++ register gpointer data1, data2; ++ ++ g_return_if_fail (n_param_values == 4); ++ ++ if (G_CCLOSURE_SWAP_DATA (closure)) ++ { ++ data1 = closure->data; ++ data2 = g_value_peek_pointer (param_values + 0); ++ } ++ else ++ { ++ data1 = g_value_peek_pointer (param_values + 0); ++ data2 = closure->data; ++ } ++ callback = (GMarshalFunc_VOID__POINTER_INT_INT) (marshal_data ? marshal_data : cc->callback); ++ ++ callback (data1, ++ g_marshal_value_peek_pointer (param_values + 1), ++ g_marshal_value_peek_int (param_values + 2), ++ g_marshal_value_peek_int (param_values + 3), ++ data2); ++} ++ ++/* NONE:POINTER,INT,UINT (/dev/stdin:3) */ ++void ++gtkmozembed_VOID__POINTER_INT_UINT (GClosure *closure, ++ GValue *return_value, ++ guint n_param_values, ++ const GValue *param_values, ++ gpointer invocation_hint, ++ gpointer marshal_data) ++{ ++ typedef void (*GMarshalFunc_VOID__POINTER_INT_UINT) (gpointer data1, ++ gpointer arg_1, ++ gint arg_2, ++ guint arg_3, ++ gpointer data2); ++ register GMarshalFunc_VOID__POINTER_INT_UINT callback; ++ register GCClosure *cc = (GCClosure*) closure; ++ register gpointer data1, data2; ++ ++ g_return_if_fail (n_param_values == 4); ++ ++ if (G_CCLOSURE_SWAP_DATA (closure)) ++ { ++ data1 = closure->data; ++ data2 = g_value_peek_pointer (param_values + 0); ++ } ++ else ++ { ++ data1 = g_value_peek_pointer (param_values + 0); ++ data2 = closure->data; ++ } ++ callback = (GMarshalFunc_VOID__POINTER_INT_UINT) (marshal_data ? marshal_data : cc->callback); ++ ++ callback (data1, ++ g_marshal_value_peek_pointer (param_values + 1), ++ g_marshal_value_peek_int (param_values + 2), ++ g_marshal_value_peek_uint (param_values + 3), ++ data2); ++} ++ ++/* NONE:POINTER,INT,POINTER (/dev/stdin:4) */ ++void ++gtkmozembed_VOID__POINTER_INT_POINTER (GClosure *closure, ++ GValue *return_value, ++ guint n_param_values, ++ const GValue *param_values, ++ gpointer invocation_hint, ++ gpointer marshal_data) ++{ ++ typedef void (*GMarshalFunc_VOID__POINTER_INT_POINTER) (gpointer data1, ++ gpointer arg_1, ++ gint arg_2, ++ gpointer arg_3, ++ gpointer data2); ++ register GMarshalFunc_VOID__POINTER_INT_POINTER callback; ++ register GCClosure *cc = (GCClosure*) closure; ++ register gpointer data1, data2; ++ ++ g_return_if_fail (n_param_values == 4); ++ ++ if (G_CCLOSURE_SWAP_DATA (closure)) ++ { ++ data1 = closure->data; ++ data2 = g_value_peek_pointer (param_values + 0); ++ } ++ else ++ { ++ data1 = g_value_peek_pointer (param_values + 0); ++ data2 = closure->data; ++ } ++ callback = (GMarshalFunc_VOID__POINTER_INT_POINTER) (marshal_data ? marshal_data : cc->callback); ++ ++ callback (data1, ++ g_marshal_value_peek_pointer (param_values + 1), ++ g_marshal_value_peek_int (param_values + 2), ++ g_marshal_value_peek_pointer (param_values + 3), ++ data2); ++} ++ +--- /dev/null Thu Apr 11 16:25:15 2002 ++++ embedding/browser/gtk/src/gtkmozembedmarshal.h Wed Jun 26 21:06:15 2002 +@@ -0,0 +1,48 @@ ++ ++#ifndef __gtkmozembed_MARSHAL_H__ ++#define __gtkmozembed_MARSHAL_H__ ++ ++#include <glib-object.h> ++ ++G_BEGIN_DECLS ++ ++/* NONE:INT,UINT (/dev/stdin:1) */ ++extern void gtkmozembed_VOID__INT_UINT (GClosure *closure, ++ GValue *return_value, ++ guint n_param_values, ++ const GValue *param_values, ++ gpointer invocation_hint, ++ gpointer marshal_data); ++#define gtkmozembed_NONE__INT_UINT gtkmozembed_VOID__INT_UINT ++ ++/* NONE:POINTER,INT,INT (/dev/stdin:2) */ ++extern void gtkmozembed_VOID__POINTER_INT_INT (GClosure *closure, ++ GValue *return_value, ++ guint n_param_values, ++ const GValue *param_values, ++ gpointer invocation_hint, ++ gpointer marshal_data); ++#define gtkmozembed_NONE__POINTER_INT_INT gtkmozembed_VOID__POINTER_INT_INT ++ ++/* NONE:POINTER,INT,UINT (/dev/stdin:3) */ ++extern void gtkmozembed_VOID__POINTER_INT_UINT (GClosure *closure, ++ GValue *return_value, ++ guint n_param_values, ++ const GValue *param_values, ++ gpointer invocation_hint, ++ gpointer marshal_data); ++#define gtkmozembed_NONE__POINTER_INT_UINT gtkmozembed_VOID__POINTER_INT_UINT ++ ++/* NONE:POINTER,INT,POINTER (/dev/stdin:4) */ ++extern void gtkmozembed_VOID__POINTER_INT_POINTER (GClosure *closure, ++ GValue *return_value, ++ guint n_param_values, ++ const GValue *param_values, ++ gpointer invocation_hint, ++ gpointer marshal_data); ++#define gtkmozembed_NONE__POINTER_INT_POINTER gtkmozembed_VOID__POINTER_INT_POINTER ++ ++G_END_DECLS ++ ++#endif /* __gtkmozembed_MARSHAL_H__ */ ++ +Index: embedding/browser/Makefile.in +=================================================================== +RCS file: /cvsroot/mozilla/embedding/browser/Makefile.in,v +retrieving revision 1.10 +diff -u -r1.10 Makefile.in +--- embedding/browser/Makefile.in 18 Dec 2001 09:10:33 -0000 1.10 ++++ embedding/browser/Makefile.in 29 Jun 2002 15:44:54 -0000 +@@ -27,6 +27,10 @@ + + DIRS=webBrowser build chrome + ++ifdef MOZ_ENABLE_GTK2 ++DIRS += gtk ++endif ++ + ifdef MOZ_ENABLE_GTK + DIRS += gtk + endif diff --git a/net-www/mozilla/files/icon/mozilla-icon.png b/net-www/mozilla/files/icon/mozilla-icon.png Binary files differnew file mode 100644 index 000000000000..a176ed2c61af --- /dev/null +++ b/net-www/mozilla/files/icon/mozilla-icon.png diff --git a/net-www/mozilla/files/icon/mozilla.desktop b/net-www/mozilla/files/icon/mozilla.desktop new file mode 100644 index 000000000000..edbcf0aa70da --- /dev/null +++ b/net-www/mozilla/files/icon/mozilla.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Mozilla +Comment=Web Browser +Exec=/usr/bin/mozilla +Icon=mozilla-icon.png +Terminal=0 +Type=Application +Categories=Application;Network; diff --git a/net-www/mozilla/files/ipc-1.0.6-nsPipeChannel.patch b/net-www/mozilla/files/ipc-1.0.6-nsPipeChannel.patch new file mode 100644 index 000000000000..989ad6dae422 --- /dev/null +++ b/net-www/mozilla/files/ipc-1.0.6-nsPipeChannel.patch @@ -0,0 +1,16 @@ +This patch brings a critical line up to date from cvs so that +ipc-1.0.6 will compile (09 Jun 2004 agriffis) + +http://www.mozdev.org/source/browse/protozilla/ipc/ + +--- ipc/src/nsPipeChannel.cpp.agriffis 2004-05-17 02:44:43.000000000 -0400 ++++ ipc/src/nsPipeChannel.cpp 2004-06-09 13:48:51.146277360 -0400 +@@ -210,7 +210,7 @@ + if (NS_FAILED(rv)) return rv; + + nsXPIDLCString contentType; +- rv = MIMEService->GetTypeFromURI(url, contentType); ++ rv = MIMEService->GetTypeFromURI(url, getter_Copies(contentType)); + if (NS_SUCCEEDED(rv) && contentType) { + mContentType.Assign(contentType); + } diff --git a/net-www/mozilla/files/ipc-1.0.7-nsPipeChannel.patch b/net-www/mozilla/files/ipc-1.0.7-nsPipeChannel.patch new file mode 100644 index 000000000000..c6981bebcb8f --- /dev/null +++ b/net-www/mozilla/files/ipc-1.0.7-nsPipeChannel.patch @@ -0,0 +1,11 @@ +--- extensions/ipc/src/nsPipeChannel.cpp.agriffis 2004-05-23 10:10:47.000000000 -0400 ++++ extensions/ipc/src/nsPipeChannel.cpp 2004-08-07 09:51:54.069217895 -0400 +@@ -209,7 +209,7 @@ + nsCOMPtr<nsIMIMEService> MIMEService (do_GetService("@mozilla.org/mime;1", &rv)); + if (NS_FAILED(rv)) return rv; + +-#ifdef MOZ_THUNDERBIRD ++#if 1 + char *contentType = nsnull; + rv = MIMEService->GetTypeFromURI(url, (char **)&contentType); + #else diff --git a/net-www/mozilla/files/mozilla b/net-www/mozilla/files/mozilla new file mode 100644 index 000000000000..72abfac83872 --- /dev/null +++ b/net-www/mozilla/files/mozilla @@ -0,0 +1,8 @@ +#!/bin/sh + +export MOZILLA_FIVE_HOME=/usr/lib/mozilla + +if [ -f $MOZILLA_FIVE_HOME/mozilla ] +then + $MOZILLA_FIVE_HOME/mozilla "$@" +fi diff --git a/net-www/mozilla/files/mozilla-1.4-amd64.patch b/net-www/mozilla/files/mozilla-1.4-amd64.patch new file mode 100644 index 000000000000..5dd2cb2503ed --- /dev/null +++ b/net-www/mozilla/files/mozilla-1.4-amd64.patch @@ -0,0 +1,1026 @@ +diff -ruN mozilla.old/config/mkdepend/imakemdep.h mozilla/config/mkdepend/imakemdep.h +--- mozilla.old/config/mkdepend/imakemdep.h 1998-09-05 00:22:25.000000000 -0400 ++++ mozilla/config/mkdepend/imakemdep.h 2003-09-27 16:20:55.105322104 -0400 +@@ -277,6 +277,9 @@ + # ifdef __i386__ + "-D__i386__", + # endif ++# ifdef __x86_64__ ++ "-D__x86_64__", ++# endif + # ifdef __GNUC__ + "-traditional", + # endif +diff -ruN mozilla.old/directory/c-sdk/ldap/libraries/liblber/lber-int.h mozilla/directory/c-sdk/ldap/libraries/liblber/lber-int.h +--- mozilla.old/directory/c-sdk/ldap/libraries/liblber/lber-int.h 2002-03-26 16:53:23.000000000 -0500 ++++ mozilla/directory/c-sdk/ldap/libraries/liblber/lber-int.h 2003-09-27 16:20:55.104322256 -0400 +@@ -236,23 +236,22 @@ + (((_l)&0xff0000)>>8) + (((_l)&0xff000000)>>24)) + #define LBER_NTOHL(_l) LBER_HTONL(_l) + +-#elif !defined(__alpha) || defined(VMS) ++#elif !defined(__x86_64__) && (!defined(__alpha) || defined(VMS)) + + #define LBER_HTONL( l ) htonl( l ) + #define LBER_NTOHL( l ) ntohl( l ) + + #else /* __alpha */ + /* +- * htonl and ntohl on the DEC Alpha under OSF 1 seem to only swap the +- * lower-order 32-bits of a (64-bit) long, so we define correct versions +- * here. ++ * htonl and ntohl on the 64-bit UNIX platforms only swap the lower-order ++ * 32-bits of a (64-bit) long, so we define correct versions here. + */ + #define LBER_HTONL( l ) (((long)htonl( (l) & 0x00000000FFFFFFFF )) << 32 \ + | htonl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 )) + + #define LBER_NTOHL( l ) (((long)ntohl( (l) & 0x00000000FFFFFFFF )) << 32 \ + | ntohl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 )) +-#endif /* __alpha */ ++#endif /* __alpha || __x86_64__ */ + + + /* function prototypes */ +diff -ruN mozilla.old/nsprpub/configure mozilla/nsprpub/configure +--- mozilla.old/nsprpub/configure 2003-05-19 15:05:42.000000000 -0400 ++++ mozilla/nsprpub/configure 2003-09-27 16:20:55.085325144 -0400 +@@ -3729,6 +3729,9 @@ + ia64) + PR_MD_ASFILES=os_Linux_ia64.s + ;; ++ x86_64) ++ PR_MD_ASFILES=os_Linux_x86_64.s ++ ;; + m68k) + CFLAGS="$CFLAGS -m68020-60" + CXXFLAGS="$CXXFLAGS -m68020-60" +diff -ruN mozilla.old/nsprpub/configure.in mozilla/nsprpub/configure.in +--- mozilla.old/nsprpub/configure.in 2003-05-19 15:05:48.000000000 -0400 ++++ mozilla/nsprpub/configure.in 2003-09-27 16:20:55.077326360 -0400 +@@ -1218,6 +1218,9 @@ + ia64) + PR_MD_ASFILES=os_Linux_ia64.s + ;; ++ x86_64) ++ PR_MD_ASFILES=os_Linux_x86_64.s ++ ;; + m68k) + CFLAGS="$CFLAGS -m68020-60" + CXXFLAGS="$CXXFLAGS -m68020-60" +diff -ruN mozilla.old/nsprpub/pr/include/md/_linux.cfg mozilla/nsprpub/pr/include/md/_linux.cfg +--- mozilla.old/nsprpub/pr/include/md/_linux.cfg 2003-02-26 18:53:38.000000000 -0500 ++++ mozilla/nsprpub/pr/include/md/_linux.cfg 2003-09-27 16:20:55.053330008 -0400 +@@ -182,6 +182,52 @@ + #define PR_BYTES_PER_WORD_LOG2 3 + #define PR_BYTES_PER_DWORD_LOG2 3 + ++#elif defined(__x86_64__) ++ ++#define IS_LITTLE_ENDIAN 1 ++#undef IS_BIG_ENDIAN ++#define IS_64 ++ ++#define PR_BYTES_PER_BYTE 1 ++#define PR_BYTES_PER_SHORT 2 ++#define PR_BYTES_PER_INT 4 ++#define PR_BYTES_PER_INT64 8 ++#define PR_BYTES_PER_LONG 8 ++#define PR_BYTES_PER_FLOAT 4 ++#define PR_BYTES_PER_DOUBLE 8 ++#define PR_BYTES_PER_WORD 8 ++#define PR_BYTES_PER_DWORD 8 ++ ++#define PR_BITS_PER_BYTE 8 ++#define PR_BITS_PER_SHORT 16 ++#define PR_BITS_PER_INT 32 ++#define PR_BITS_PER_INT64 64 ++#define PR_BITS_PER_LONG 64 ++#define PR_BITS_PER_FLOAT 32 ++#define PR_BITS_PER_DOUBLE 64 ++#define PR_BITS_PER_WORD 64 ++ ++#define PR_BITS_PER_BYTE_LOG2 3 ++#define PR_BITS_PER_SHORT_LOG2 4 ++#define PR_BITS_PER_INT_LOG2 5 ++#define PR_BITS_PER_INT64_LOG2 6 ++#define PR_BITS_PER_LONG_LOG2 6 ++#define PR_BITS_PER_FLOAT_LOG2 5 ++#define PR_BITS_PER_DOUBLE_LOG2 6 ++#define PR_BITS_PER_WORD_LOG2 6 ++ ++#define PR_ALIGN_OF_SHORT 2 ++#define PR_ALIGN_OF_INT 4 ++#define PR_ALIGN_OF_LONG 8 ++#define PR_ALIGN_OF_INT64 8 ++#define PR_ALIGN_OF_FLOAT 4 ++#define PR_ALIGN_OF_DOUBLE 8 ++#define PR_ALIGN_OF_POINTER 8 ++#define PR_ALIGN_OF_WORD 8 ++ ++#define PR_BYTES_PER_WORD_LOG2 3 ++#define PR_BYTES_PER_DWORD_LOG2 3 ++ + #elif defined(__mc68000__) + + #undef IS_LITTLE_ENDIAN +diff -ruN mozilla.old/nsprpub/pr/include/md/_linux.h mozilla/nsprpub/pr/include/md/_linux.h +--- mozilla.old/nsprpub/pr/include/md/_linux.h 2003-02-26 18:53:39.000000000 -0500 ++++ mozilla/nsprpub/pr/include/md/_linux.h 2003-09-27 16:20:55.053330008 -0400 +@@ -49,6 +49,8 @@ + #define _PR_SI_ARCHITECTURE "alpha" + #elif defined(__ia64__) + #define _PR_SI_ARCHITECTURE "ia64" ++#elif defined(__x86_64__) ++#define _PR_SI_ARCHITECTURE "x86-64" + #elif defined(__mc68000__) + #define _PR_SI_ARCHITECTURE "m68k" + #elif defined(__sparc__) +@@ -107,6 +109,19 @@ + #define _MD_ATOMIC_SET _PR_ia64_AtomicSet + #endif + ++#if defined(__x86_64__) ++#define _PR_HAVE_ATOMIC_OPS ++#define _MD_INIT_ATOMIC() ++extern PRInt32 _PR_x86_64_AtomicIncrement(PRInt32 *val); ++#define _MD_ATOMIC_INCREMENT _PR_x86_64_AtomicIncrement ++extern PRInt32 _PR_x86_64_AtomicDecrement(PRInt32 *val); ++#define _MD_ATOMIC_DECREMENT _PR_x86_64_AtomicDecrement ++extern PRInt32 _PR_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val); ++#define _MD_ATOMIC_ADD _PR_x86_64_AtomicAdd ++extern PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval); ++#define _MD_ATOMIC_SET _PR_x86_64_AtomicSet ++#endif ++ + #define USE_SETJMP + #if defined(__GLIBC__) && __GLIBC__ >= 2 + #define _PR_POLL_AVAILABLE +diff -ruN mozilla.old/nsprpub/pr/src/io/prprf.c mozilla/nsprpub/pr/src/io/prprf.c +--- mozilla.old/nsprpub/pr/src/io/prprf.c 2003-02-26 18:53:42.000000000 -0500 ++++ mozilla/nsprpub/pr/src/io/prprf.c 2003-09-27 16:20:55.068327728 -0400 +@@ -51,7 +51,10 @@ + ** Note: on some platforms va_list is defined as an array, + ** and requires array notation. + */ +-#if (defined(LINUX) && defined(__powerpc__)) || \ ++#if (defined(LINUX) && defined(__x86_64__)) ++#include <stdarg.h> ++#define VARARGS_ASSIGN(foo, bar) __va_copy((foo), (bar)) ++#elif (defined(LINUX) && defined(__powerpc__)) || \ + (defined(LINUX) && defined(__s390__)) || \ + (defined(LINUX) && defined(__s390x__)) || \ + defined(WIN16) || defined(QNX) || \ +diff -ruN mozilla.old/nsprpub/pr/src/md/unix/os_Linux_x86_64.s mozilla/nsprpub/pr/src/md/unix/os_Linux_x86_64.s +--- mozilla.old/nsprpub/pr/src/md/unix/os_Linux_x86_64.s 1969-12-31 19:00:00.000000000 -0500 ++++ mozilla/nsprpub/pr/src/md/unix/os_Linux_x86_64.s 2003-09-27 16:20:55.068327728 -0400 +@@ -0,0 +1,91 @@ ++/ -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- ++/ ++/ The contents of this file are subject to the Mozilla Public ++/ License Version 1.1 (the "License"); you may not use this file ++/ except in compliance with the License. You may obtain a copy of ++/ the License at http://www.mozilla.org/MPL/ ++/ ++/ Software distributed under the License is distributed on an "AS ++/ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or ++/ implied. See the License for the specific language governing ++/ rights and limitations under the License. ++/ ++/ The Original Code is the Netscape Portable Runtime (NSPR). ++/ ++/ The Initial Developer of the Original Code is Netscape ++/ Communications Corporation. Portions created by Netscape are ++/ Copyright (C) 2000 Netscape Communications Corporation. All ++/ Rights Reserved. ++/ ++/ Contributor(s): ++/ ++/ Alternatively, the contents of this file may be used under the ++/ terms of the GNU General Public License Version 2 or later (the ++/ "GPL"), in which case the provisions of the GPL are applicable ++/ instead of those above. If you wish to allow use of your ++/ version of this file only under the terms of the GPL and not to ++/ allow others to use your version of this file under the MPL, ++/ indicate your decision by deleting the provisions above and ++/ replace them with the notice and other provisions required by ++/ the GPL. If you do not delete the provisions above, a recipient ++/ may use your version of this file under either the MPL or the ++/ GPL. ++/ ++ ++/ PRInt32 _PR_x86_64_AtomicIncrement(PRInt32 *val) ++/ ++/ Atomically increment the integer pointed to by 'val' and return ++/ the result of the increment. ++/ ++ .text ++ .globl _PR_x86_64_AtomicIncrement ++ .align 4 ++_PR_x86_64_AtomicIncrement: ++ movl $1, %eax ++ lock ++ xaddl %eax, (%rdi) ++ incl %eax ++ ret ++ ++/ PRInt32 _PR_x86_64_AtomicDecrement(PRInt32 *val) ++/ ++/ Atomically decrement the integer pointed to by 'val' and return ++/ the result of the decrement. ++/ ++ .text ++ .globl _PR_x86_64_AtomicDecrement ++ .align 4 ++_PR_x86_64_AtomicDecrement: ++ movl $-1, %eax ++ lock ++ xaddl %eax, (%rdi) ++ decl %eax ++ ret ++ ++/ PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval) ++/ ++/ Atomically set the integer pointed to by 'val' to the new ++/ value 'newval' and return the old value. ++ .text ++ .globl _PR_x86_64_AtomicSet ++ .align 4 ++_PR_x86_64_AtomicSet: ++ movl %esi, %eax ++ lock ++ xchgl %eax, (%rdi) ++ ret ++ ++/ PRInt32 _PR_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val) ++/ ++/ Atomically add 'val' to the integer pointed to by 'ptr' ++/ and return the result of the addition. ++/ ++ .text ++ .globl _PR_x86_64_AtomicAdd ++ .align 4 ++_PR_x86_64_AtomicAdd: ++ movl %esi, %eax ++ lock ++ xaddl %eax, (%rdi) ++ addl %esi, %eax ++ ret +diff -ruN mozilla.old/security/coreconf/Linux.mk mozilla/security/coreconf/Linux.mk +--- mozilla.old/security/coreconf/Linux.mk 2003-04-30 20:31:20.000000000 -0400 ++++ mozilla/security/coreconf/Linux.mk 2003-09-27 16:20:55.093323928 -0400 +@@ -66,6 +66,10 @@ + OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE + CPU_ARCH = ia64 + else ++ifeq ($(OS_TEST),x86_64) ++ OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE ++ CPU_ARCH = x86_64 ++else + ifeq ($(OS_TEST),sparc) + OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE + CPU_ARCH = sparc +@@ -107,6 +111,7 @@ + endif + endif + endif ++endif + + + LIBC_TAG = _glibc +diff -ruN mozilla.old/xpcom/reflect/xptcall/src/md/unix/Makefile.in mozilla/xpcom/reflect/xptcall/src/md/unix/Makefile.in +--- mozilla.old/xpcom/reflect/xptcall/src/md/unix/Makefile.in 2003-06-18 23:02:34.000000000 -0400 ++++ mozilla/xpcom/reflect/xptcall/src/md/unix/Makefile.in 2003-09-27 16:20:55.105322104 -0400 +@@ -55,6 +55,10 @@ + # Migrate other platforms here after testing + # + ifneq (,$(filter Linux,$(OS_ARCH))) ++# Linux/x86-64 ++ifeq (x86_64,$(OS_TEST)) ++CPPSRCS := xptcinvoke_x86_64_linux.cpp xptcstubs_x86_64_linux.cpp ++else + ifeq (86,$(findstring 86,$(OS_TEST))) + CPPSRCS := xptcinvoke_gcc_x86_unix.cpp xptcstubs_gcc_x86_unix.cpp + endif +@@ -66,6 +70,7 @@ + ASFILES := xptcstubs_asm_ipf64.s xptcinvoke_asm_ipf64.s + endif + endif ++endif + # + # BeOS/Intel (uses the same unixish_x86 code) + # +diff -ruN mozilla.old/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp +--- mozilla.old/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp 1969-12-31 19:00:00.000000000 -0500 ++++ mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp 2003-09-27 16:20:55.105322104 -0400 +@@ -0,0 +1,174 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++// Platform specific code to invoke XPCOM methods on native objects ++ ++#include "xptcprivate.h" ++ ++// 6 integral parameters are passed in registers ++const PRUint32 GPR_COUNT = 6; ++ ++// 8 floating point parameters are passed in SSE registers ++const PRUint32 FPR_COUNT = 8; ++ ++// Remember that these 'words' are 64-bit long ++static inline void ++invoke_count_words(PRUint32 paramCount, nsXPTCVariant * s, ++ PRUint32 & nr_gpr, PRUint32 & nr_fpr, PRUint32 & nr_stack) ++{ ++ nr_gpr = 1; // skip one GP register for 'that' ++ nr_fpr = 0; ++ nr_stack = 0; ++ ++ /* Compute number of eightbytes of class MEMORY. */ ++ for (uint32 i = 0; i < paramCount; i++, s++) { ++ if (!s->IsPtrData() ++ && (s->type == nsXPTType::T_FLOAT || s->type == nsXPTType::T_DOUBLE)) { ++ if (nr_fpr < FPR_COUNT) ++ nr_fpr++; ++ else ++ nr_stack++; ++ } ++ else { ++ if (nr_gpr < GPR_COUNT) ++ nr_gpr++; ++ else ++ nr_stack++; ++ } ++ } ++} ++ ++static void ++invoke_copy_to_stack(PRUint64 * d, PRUint32 paramCount, nsXPTCVariant * s, ++ PRUint64 * gpregs, double * fpregs) ++{ ++ PRUint32 nr_gpr = 1; // skip one GP register for 'that' ++ PRUint32 nr_fpr = 0; ++ PRUint64 value; ++ ++ for (uint32 i = 0; i < paramCount; i++, s++) { ++ if (s->IsPtrData()) ++ value = (PRUint64) s->ptr; ++ else { ++ switch (s->type) { ++ case nsXPTType::T_FLOAT: break; ++ case nsXPTType::T_DOUBLE: break; ++ case nsXPTType::T_I8: value = s->val.i8; break; ++ case nsXPTType::T_I16: value = s->val.i16; break; ++ case nsXPTType::T_I32: value = s->val.i32; break; ++ case nsXPTType::T_I64: value = s->val.i64; break; ++ case nsXPTType::T_U8: value = s->val.u8; break; ++ case nsXPTType::T_U16: value = s->val.u16; break; ++ case nsXPTType::T_U32: value = s->val.u32; break; ++ case nsXPTType::T_U64: value = s->val.u64; break; ++ case nsXPTType::T_BOOL: value = s->val.b; break; ++ case nsXPTType::T_CHAR: value = s->val.c; break; ++ case nsXPTType::T_WCHAR: value = s->val.wc; break; ++ default: value = (PRUint64) s->val.p; break; ++ } ++ } ++ ++ if (!s->IsPtrData() && s->type == nsXPTType::T_DOUBLE) { ++ if (nr_fpr < FPR_COUNT) ++ fpregs[nr_fpr++] = s->val.d; ++ else { ++ *((double *)d) = s->val.d; ++ d++; ++ } ++ } ++ else if (!s->IsPtrData() && s->type == nsXPTType::T_FLOAT) { ++ if (nr_fpr < FPR_COUNT) ++ // The value in %xmm register is already prepared to ++ // be retrieved as a float. Therefore, we pass the ++ // value verbatim, as a double without conversion. ++ fpregs[nr_fpr++] = s->val.d; ++ else { ++ *((float *)d) = s->val.f; ++ d++; ++ } ++ } ++ else { ++ if (nr_gpr < GPR_COUNT) ++ gpregs[nr_gpr++] = value; ++ else ++ *d++ = value; ++ } ++ } ++} ++ ++extern "C" ++XPTC_PUBLIC_API(nsresult) ++XPTC_InvokeByIndex(nsISupports * that, PRUint32 methodIndex, ++ PRUint32 paramCount, nsXPTCVariant * params) ++{ ++ PRUint32 nr_gpr, nr_fpr, nr_stack; ++ invoke_count_words(paramCount, params, nr_gpr, nr_fpr, nr_stack); ++ ++ // Stack, if used, must be 16-bytes aligned ++ if (nr_stack) ++ nr_stack = (nr_stack + 1) & ~1; ++ ++ // Load parameters to stack, if necessary ++ PRUint64 *stack = (PRUint64 *) __builtin_alloca(nr_stack * 8); ++ PRUint64 gpregs[GPR_COUNT]; ++ double fpregs[FPR_COUNT]; ++ invoke_copy_to_stack(stack, paramCount, params, gpregs, fpregs); ++ ++ // Load FPR registers from fpregs[] ++ register double d0 asm("xmm0"); ++ register double d1 asm("xmm1"); ++ register double d2 asm("xmm2"); ++ register double d3 asm("xmm3"); ++ register double d4 asm("xmm4"); ++ register double d5 asm("xmm5"); ++ register double d6 asm("xmm6"); ++ register double d7 asm("xmm7"); ++ ++ switch (nr_fpr) { ++#define ARG_FPR(N) \ ++ case N+1: d##N = fpregs[N]; ++ ARG_FPR(7); ++ ARG_FPR(6); ++ ARG_FPR(5); ++ ARG_FPR(4); ++ ARG_FPR(3); ++ ARG_FPR(2); ++ ARG_FPR(1); ++ ARG_FPR(0); ++ case 0:; ++#undef ARG_FPR ++ } ++ ++ // Load GPR registers from gpregs[] ++ register PRUint64 a0 asm("rdi"); ++ register PRUint64 a1 asm("rsi"); ++ register PRUint64 a2 asm("rdx"); ++ register PRUint64 a3 asm("rcx"); ++ register PRUint64 a4 asm("r8"); ++ register PRUint64 a5 asm("r9"); ++ ++ switch (nr_gpr) { ++#define ARG_GPR(N) \ ++ case N+1: a##N = gpregs[N]; ++ ARG_GPR(5); ++ ARG_GPR(4); ++ ARG_GPR(3); ++ ARG_GPR(2); ++ ARG_GPR(1); ++ case 1: a0 = (PRUint64) that; ++ case 0:; ++#undef ARG_GPR ++ } ++ ++ // Ensure that assignments to SSE registers won't be optimized away ++ asm("" :: ++ "x" (d0), "x" (d1), "x" (d2), "x" (d3), ++ "x" (d4), "x" (d5), "x" (d6), "x" (d7)); ++ ++ // Get pointer to method ++ PRUint64 methodAddress = *((PRUint64 *)that); ++ methodAddress += 8 * methodIndex; ++ methodAddress = *((PRUint64 *)methodAddress); ++ ++ typedef PRUint32 (*Method)(PRUint64, PRUint64, PRUint64, PRUint64, PRUint64, PRUint64); ++ PRUint32 result = ((Method)methodAddress)(a0, a1, a2, a3, a4, a5); ++ return result; ++} +diff -ruN mozilla.old/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp +--- mozilla.old/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp 1969-12-31 19:00:00.000000000 -0500 ++++ mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp 2003-09-27 16:20:55.106321952 -0400 +@@ -0,0 +1,206 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++ ++// Implement shared vtbl methods. ++ ++#include "xptcprivate.h" ++ ++// The Linux/x86-64 ABI passes the first 6 integral parameters and the ++// first 8 floating point parameters in registers (rdi, rsi, rdx, rcx, ++// r8, r9 and xmm0-xmm7), no stack space is allocated for these by the ++// caller. The rest of the parameters are passed in the callers stack ++// area. ++ ++const PRUint32 PARAM_BUFFER_COUNT = 16; ++const PRUint32 GPR_COUNT = 6; ++const PRUint32 FPR_COUNT = 8; ++ ++// PrepareAndDispatch() is called by SharedStub() and calls the actual method. ++// ++// - 'args[]' contains the arguments passed on stack ++// - 'gpregs[]' contains the arguments passed in integer registers ++// - 'fpregs[]' contains the arguments passed in floating point registers ++// ++// The parameters are mapped into an array of type 'nsXPTCMiniVariant' ++// and then the method gets called. ++ ++extern "C" nsresult ++PrepareAndDispatch(nsXPTCStubBase * self, PRUint32 methodIndex, ++ PRUint64 * args, PRUint64 * gpregs, double *fpregs) ++{ ++ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; ++ nsXPTCMiniVariant* dispatchParams = NULL; ++ nsIInterfaceInfo* iface_info = NULL; ++ const nsXPTMethodInfo* info; ++ PRUint32 paramCount; ++ PRUint32 i; ++ nsresult result = NS_ERROR_FAILURE; ++ ++ NS_ASSERTION(self,"no self"); ++ ++ self->GetInterfaceInfo(&iface_info); ++ NS_ASSERTION(iface_info,"no interface info"); ++ if (! iface_info) ++ return NS_ERROR_UNEXPECTED; ++ ++ iface_info->GetMethodInfo(PRUint16(methodIndex), &info); ++ NS_ASSERTION(info,"no method info"); ++ if (! info) ++ return NS_ERROR_UNEXPECTED; ++ ++ paramCount = info->GetParamCount(); ++ ++ // setup variant array pointer ++ if(paramCount > PARAM_BUFFER_COUNT) ++ dispatchParams = new nsXPTCMiniVariant[paramCount]; ++ else ++ dispatchParams = paramBuffer; ++ ++ NS_ASSERTION(dispatchParams,"no place for params"); ++ if (! dispatchParams) ++ return NS_ERROR_OUT_OF_MEMORY; ++ ++ PRUint64* ap = args; ++ PRUint32 nr_gpr = 1; // skip one GPR register for 'that' ++ PRUint32 nr_fpr = 0; ++ PRUint64 value; ++ ++ for(i = 0; i < paramCount; i++) { ++ const nsXPTParamInfo& param = info->GetParam(i); ++ const nsXPTType& type = param.GetType(); ++ nsXPTCMiniVariant* dp = &dispatchParams[i]; ++ ++ if (!param.IsOut() && type == nsXPTType::T_DOUBLE) { ++ if (nr_fpr < FPR_COUNT) ++ dp->val.d = fpregs[nr_fpr++]; ++ else ++ dp->val.d = *(double*) ap++; ++ continue; ++ } ++ else if (!param.IsOut() && type == nsXPTType::T_FLOAT) { ++ if (nr_fpr < FPR_COUNT) ++ // The value in %xmm register is already prepared to ++ // be retrieved as a float. Therefore, we pass the ++ // value verbatim, as a double without conversion. ++ dp->val.d = *(double*) ap++; ++ else ++ dp->val.f = *(float*) ap++; ++ continue; ++ } ++ else { ++ if (nr_gpr < GPR_COUNT) ++ value = gpregs[nr_gpr++]; ++ else ++ value = *ap++; ++ } ++ ++ if (param.IsOut() || !type.IsArithmetic()) { ++ dp->val.p = (void*) value; ++ continue; ++ } ++ ++ switch (type) { ++ case nsXPTType::T_I8: dp->val.i8 = (PRInt8) value; break; ++ case nsXPTType::T_I16: dp->val.i16 = (PRInt16) value; break; ++ case nsXPTType::T_I32: dp->val.i32 = (PRInt32) value; break; ++ case nsXPTType::T_I64: dp->val.i64 = (PRInt64) value; break; ++ case nsXPTType::T_U8: dp->val.u8 = (PRUint8) value; break; ++ case nsXPTType::T_U16: dp->val.u16 = (PRUint16) value; break; ++ case nsXPTType::T_U32: dp->val.u32 = (PRUint32) value; break; ++ case nsXPTType::T_U64: dp->val.u64 = (PRUint64) value; break; ++ case nsXPTType::T_BOOL: dp->val.b = (PRBool) value; break; ++ case nsXPTType::T_CHAR: dp->val.c = (char) value; break; ++ case nsXPTType::T_WCHAR: dp->val.wc = (wchar_t) value; break; ++ ++ default: ++ NS_ASSERTION(0, "bad type"); ++ break; ++ } ++ } ++ ++ result = self->CallMethod((PRUint16) methodIndex, info, dispatchParams); ++ ++ NS_RELEASE(iface_info); ++ ++ if (dispatchParams != paramBuffer) ++ delete [] dispatchParams; ++ ++ return result; ++} ++ ++#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ ++// Linux/x86-64 uses gcc >= 3.1 ++#define STUB_ENTRY(n) \ ++asm(".section \".text\"\n\t" \ ++ ".align 2\n\t" \ ++ ".if " #n " < 10\n\t" \ ++ ".globl _ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \ ++ ".type _ZN14nsXPTCStubBase5Stub" #n "Ev,@function\n" \ ++ "_ZN14nsXPTCStubBase5Stub" #n "Ev:\n\t" \ ++ ".elseif " #n " < 100\n\t" \ ++ ".globl _ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \ ++ ".type _ZN14nsXPTCStubBase6Stub" #n "Ev,@function\n" \ ++ "_ZN14nsXPTCStubBase6Stub" #n "Ev:\n\t" \ ++ ".elseif " #n " < 1000\n\t" \ ++ ".globl _ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \ ++ ".type _ZN14nsXPTCStubBase7Stub" #n "Ev,@function\n" \ ++ "_ZN14nsXPTCStubBase7Stub" #n "Ev:\n\t" \ ++ ".else\n\t" \ ++ ".err \"stub number " #n " >= 1000 not yet supported\"\n\t" \ ++ ".endif\n\t" \ ++ "movl $" #n ", %eax\n\t" \ ++ "jmp SharedStub\n\t" \ ++ ".if " #n " < 10\n\t" \ ++ ".size _ZN14nsXPTCStubBase5Stub" #n "Ev,.-_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \ ++ ".elseif " #n " < 100\n\t" \ ++ ".size _ZN14nsXPTCStubBase6Stub" #n "Ev,.-_ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \ ++ ".else\n\t" \ ++ ".size _ZN14nsXPTCStubBase7Stub" #n "Ev,.-_ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \ ++ ".endif"); ++ ++// static nsresult SharedStub(PRUint32 methodIndex) ++asm(".section \".text\"\n\t" ++ ".align 2\n\t" ++ ".type SharedStub,@function\n\t" ++ "SharedStub:\n\t" ++ // make room for gpregs (48), fpregs (64) ++ "pushq %rbp\n\t" ++ "movq %rsp,%rbp\n\t" ++ "subq $112,%rsp\n\t" ++ // save GP registers ++ "movq %rdi,-112(%rbp)\n\t" ++ "movq %rsi,-104(%rbp)\n\t" ++ "movq %rdx, -96(%rbp)\n\t" ++ "movq %rcx, -88(%rbp)\n\t" ++ "movq %r8 , -80(%rbp)\n\t" ++ "movq %r9 , -72(%rbp)\n\t" ++ "leaq -112(%rbp),%rcx\n\t" ++ // save FP registers ++ "movsd %xmm0,-64(%rbp)\n\t" ++ "movsd %xmm1,-56(%rbp)\n\t" ++ "movsd %xmm2,-48(%rbp)\n\t" ++ "movsd %xmm3,-40(%rbp)\n\t" ++ "movsd %xmm4,-32(%rbp)\n\t" ++ "movsd %xmm5,-24(%rbp)\n\t" ++ "movsd %xmm6,-16(%rbp)\n\t" ++ "movsd %xmm7, -8(%rbp)\n\t" ++ "leaq -64(%rbp),%r8\n\t" ++ // rdi has the 'self' pointer already ++ "movl %eax,%esi\n\t" ++ "leaq 16(%rbp),%rdx\n\t" ++ "call PrepareAndDispatch@plt\n\t" ++ "leave\n\t" ++ "ret\n\t" ++ ".size SharedStub,.-SharedStub"); ++ ++#define SENTINEL_ENTRY(n) \ ++nsresult nsXPTCStubBase::Sentinel##n() \ ++{ \ ++ NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ ++ return NS_ERROR_NOT_IMPLEMENTED; \ ++} ++ ++#include "xptcstubsdef.inc" ++ ++#else ++#error "can't find a compiler to use" ++#endif /* __GNUC__ */ +diff -ruN mozilla.old/xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp mozilla/xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp +--- mozilla.old/xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp 2003-02-22 23:41:18.000000000 -0500 ++++ mozilla/xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp 2003-09-27 16:21:05.754703152 -0400 +@@ -87,6 +87,19 @@ + float p17, float p18, float p19, float p20, + float *retval) = 0; + ++ NS_IMETHOD AddMixedInts(PRInt64 p1, PRInt32 p2, PRInt64 p3, PRInt32 p4, ++ PRInt32 p5, PRInt64 p6, PRInt32 p7, PRInt32 p8, ++ PRInt64 p9, PRInt32 p10, PRInt64* retval) = 0; ++ ++ NS_IMETHOD AddMixedInts2(PRInt32 p1, PRInt64 p2, PRInt32 p3, PRInt64 p4, ++ PRInt64 p5, PRInt32 p6, PRInt64 p7, PRInt64 p8, ++ PRInt32 p9, PRInt64 p10, PRInt64* retval) = 0; ++ ++ NS_IMETHOD AddMixedFloats(float p1, float p2, double p3, double p4, ++ float p5, float p6, double p7, double p8, ++ float p9, double p10, float p11, ++ double *retval) = 0; ++ + NS_IMETHOD PassTwoStrings(const char* s1, const char* s2, char** retval) = 0; + + }; +@@ -114,6 +127,19 @@ + float p5, float p6, float p7, float p8, + float p9, float p10, float* retval); + ++ NS_IMETHOD AddMixedInts(PRInt64 p1, PRInt32 p2, PRInt64 p3, PRInt32 p4, ++ PRInt32 p5, PRInt64 p6, PRInt32 p7, PRInt32 p8, ++ PRInt64 p9, PRInt32 p10, PRInt64* retval); ++ ++ NS_IMETHOD AddMixedInts2(PRInt32 p1, PRInt64 p2, PRInt32 p3, PRInt64 p4, ++ PRInt64 p5, PRInt32 p6, PRInt64 p7, PRInt64 p8, ++ PRInt32 p9, PRInt64 p10, PRInt64* retval); ++ ++ NS_IMETHOD AddMixedFloats(float p1, float p2, double p3, double p4, ++ float p5, float p6, double p7, double p8, ++ float p9, double p10, float p11, ++ double *retval); ++ + NS_IMETHOD AddManyManyFloats(float p1, float p2, float p3, float p4, + float p5, float p6, float p7, float p8, + float p9, float p10, float p11, float p12, +@@ -211,6 +237,20 @@ + } + + NS_IMETHODIMP ++InvokeTestTarget::AddMixedFloats(float p1, float p2, double p3, double p4, ++ float p5, float p6, double p7, double p8, ++ float p9, double p10, float p11, ++ double *retval) ++{ ++#ifdef DEBUG_TESTINVOKE ++ printf("%f, %f, %lf, %lf, %f, %f, %lf, %lf, %f, %lf, %f\n", ++ p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); ++#endif ++ *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10 + p11; ++ return NS_OK; ++} ++ ++NS_IMETHODIMP + InvokeTestTarget::AddManyManyFloats(float p1, float p2, float p3, float p4, + float p5, float p6, float p7, float p8, + float p9, float p10, float p11, float p12, +@@ -230,6 +270,24 @@ + } + + NS_IMETHODIMP ++InvokeTestTarget::AddMixedInts(PRInt64 p1, PRInt32 p2, PRInt64 p3, PRInt32 p4, ++ PRInt32 p5, PRInt64 p6, PRInt32 p7, PRInt32 p8, ++ PRInt64 p9, PRInt32 p10, PRInt64* retval) ++{ ++ *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10; ++ return NS_OK; ++} ++ ++NS_IMETHODIMP ++InvokeTestTarget::AddMixedInts2(PRInt32 p1, PRInt64 p2, PRInt32 p3, PRInt64 p4, ++ PRInt64 p5, PRInt32 p6, PRInt64 p7, PRInt64 p8, ++ PRInt32 p9, PRInt64 p10, PRInt64* retval) ++{ ++ *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10; ++ return NS_OK; ++} ++ ++NS_IMETHODIMP + InvokeTestTarget::PassTwoStrings(const char* s1, const char* s2, char** retval) + { + const char milk[] = "milk"; +@@ -309,14 +367,33 @@ + else + printf("\tFAILED"); + +- if(NS_SUCCEEDED(test->PassTwoStrings("moo","cow",&outS))) { +- printf(" = %s\n", outS); ++ if(NS_SUCCEEDED(test->AddMixedInts(1,2,3,4,5,6,7,8,9,10,&out64))) ++ { ++ LL_L2I(tmp32, out64); ++ printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n", (int)tmp32); ++ } ++ else ++ printf("\tFAILED"); ++ ++ if(NS_SUCCEEDED(test->AddMixedInts2(1,2,3,4,5,6,7,8,9,10,&out64))) ++ { ++ LL_L2I(tmp32, out64); ++ printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n", (int)tmp32); ++ } ++ else ++ printf("\tFAILED"); ++ ++ if(NS_SUCCEEDED(test->AddMixedFloats(1,2,3,4,5,6,7,8,9,10,11,&outD))) ++ printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 = %f\n", (double)outD); ++ else ++ printf("\tFAILED"); ++ ++ if (NS_SUCCEEDED(test->PassTwoStrings("moo","cow",&outS))) { ++ printf(" = %s\n", outS); + nsMemory::Free(outS); +- } else ++ } else + printf("\tFAILED"); + +- +- + printf("calling via invoke:\n"); + + nsXPTCVariant var[21]; +@@ -388,8 +465,8 @@ + var[2].flags = nsXPTCVariant::PTR_IS_DATA; + var[2].ptr = &var[2].val.i64; + +- if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 6, 3, var))) +- printf("\t2L * 2L = %d\n", (int)var[2].val.i64); ++ if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 6, 3, var))) ++ printf("\t2L * 2L = %d\n", (int)var[2].val.i64); + else + printf("\tFAILED"); + +@@ -559,6 +636,8 @@ + if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 10, 11, var))) + printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %ff\n", + (double) var[10].val.f); ++ else ++ printf("\tFAILED"); + + var[0].val.f = 1.0f; + var[0].type = nsXPTType::T_FLOAT; +@@ -649,6 +728,163 @@ + printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 = %ff\n", + (double) var[20].val.f); + ++ var[0].val.i64 = 1; ++ var[0].type = nsXPTType::T_I64; ++ var[0].flags = 0; ++ ++ var[1].val.i32 = 2; ++ var[1].type = nsXPTType::T_I32; ++ var[1].flags = 0; ++ ++ var[2].val.i64 = 3; ++ var[2].type = nsXPTType::T_I64; ++ var[2].flags = 0; ++ ++ var[3].val.i32 = 4; ++ var[3].type = nsXPTType::T_I32; ++ var[3].flags = 0; ++ ++ var[4].val.i32 = 5; ++ var[4].type = nsXPTType::T_I32; ++ var[4].flags = 0; ++ ++ var[5].val.i64 = 6; ++ var[5].type = nsXPTType::T_I64; ++ var[5].flags = 0; ++ ++ var[6].val.i32 = 7; ++ var[6].type = nsXPTType::T_I32; ++ var[6].flags = 0; ++ ++ var[7].val.i32 = 8; ++ var[7].type = nsXPTType::T_I32; ++ var[7].flags = 0; ++ ++ var[8].val.i64 = 9; ++ var[8].type = nsXPTType::T_I64; ++ var[8].flags = 0; ++ ++ var[9].val.i32 = 10; ++ var[9].type = nsXPTType::T_I32; ++ var[9].flags = 0; ++ ++ var[10].val.i64 = 0; ++ var[10].type = nsXPTType::T_I64; ++ var[10].flags = nsXPTCVariant::PTR_IS_DATA; ++ var[10].ptr = &var[10].val.i64; ++ ++ if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 12, 11, var))) ++ printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n", ++ (int)var[10].val.i64); ++ else ++ printf("\tFAILED"); ++ ++ var[0].val.i32 = 1; ++ var[0].type = nsXPTType::T_I32; ++ var[0].flags = 0; ++ ++ var[1].val.i64 = 2; ++ var[1].type = nsXPTType::T_I64; ++ var[1].flags = 0; ++ ++ var[2].val.i32 = 3; ++ var[2].type = nsXPTType::T_I32; ++ var[2].flags = 0; ++ ++ var[3].val.i64 = 4; ++ var[3].type = nsXPTType::T_I64; ++ var[3].flags = 0; ++ ++ var[4].val.i64 = 5; ++ var[4].type = nsXPTType::T_I64; ++ var[4].flags = 0; ++ ++ var[5].val.i32 = 6; ++ var[5].type = nsXPTType::T_I32; ++ var[5].flags = 0; ++ ++ var[6].val.i64 = 7; ++ var[6].type = nsXPTType::T_I64; ++ var[6].flags = 0; ++ ++ var[7].val.i64 = 8; ++ var[7].type = nsXPTType::T_I64; ++ var[7].flags = 0; ++ ++ var[8].val.i32 = 9; ++ var[8].type = nsXPTType::T_I32; ++ var[8].flags = 0; ++ ++ var[9].val.i64 = 10; ++ var[9].type = nsXPTType::T_I64; ++ var[9].flags = 0; ++ ++ var[10].val.i64 = 0; ++ var[10].type = nsXPTType::T_I64; ++ var[10].flags = nsXPTCVariant::PTR_IS_DATA; ++ var[10].ptr = &var[10].val.i64; ++ ++ if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 13, 11, var))) ++ printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n", ++ (int)var[10].val.i64); ++ else ++ printf("\tFAILED"); ++ ++ var[0].val.f = 1.0f; ++ var[0].type = nsXPTType::T_FLOAT; ++ var[0].flags = 0; ++ ++ var[1].val.f = 2.0f; ++ var[1].type = nsXPTType::T_FLOAT; ++ var[1].flags = 0; ++ ++ var[2].val.d = 3.0; ++ var[2].type = nsXPTType::T_DOUBLE; ++ var[2].flags = 0; ++ ++ var[3].val.d = 4.0; ++ var[3].type = nsXPTType::T_DOUBLE; ++ var[3].flags = 0; ++ ++ var[4].val.f = 5.0f; ++ var[4].type = nsXPTType::T_FLOAT; ++ var[4].flags = 0; ++ ++ var[5].val.f = 6.0f; ++ var[5].type = nsXPTType::T_FLOAT; ++ var[5].flags = 0; ++ ++ var[6].val.d = 7.0; ++ var[6].type = nsXPTType::T_DOUBLE; ++ var[6].flags = 0; ++ ++ var[7].val.d = 8.0; ++ var[7].type = nsXPTType::T_DOUBLE; ++ var[7].flags = 0; ++ ++ var[8].val.f = 9.0f; ++ var[8].type = nsXPTType::T_FLOAT; ++ var[8].flags = 0; ++ ++ var[9].val.d = 10.0; ++ var[9].type = nsXPTType::T_DOUBLE; ++ var[9].flags = 0; ++ ++ var[10].val.f = 11.0f; ++ var[10].type = nsXPTType::T_FLOAT; ++ var[10].flags = 0; ++ ++ var[11].val.d = 0.0; ++ var[11].type = nsXPTType::T_DOUBLE; ++ var[11].flags = nsXPTCVariant::PTR_IS_DATA; ++ var[11].ptr = &var[11].val.d; ++ ++ if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 14, 12, var))) ++ printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 = %f\n", ++ var[11].val.d); ++ else ++ printf("\tFAILED"); ++ + var[0].val.p = (void*)"moo"; + var[0].type = nsXPTType::T_CHAR_STR; + var[0].flags = 0; +@@ -662,12 +898,11 @@ + var[2].flags = nsXPTCVariant::PTR_IS_DATA; + var[2].ptr = &var[2].val.p; + +- if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 12, 3, var))) ++ if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 15, 3, var))) + printf(" = %s\n", var[2].val.p); + else + printf("\tFAILED"); + +- + DoMultipleInheritenceTest(); + DoMultipleInheritenceTest2(); + // Disabled by default - takes too much time on slow machines diff --git a/net-www/mozilla/files/mozilla-1.6-gcc-3.4.patch b/net-www/mozilla/files/mozilla-1.6-gcc-3.4.patch new file mode 100644 index 000000000000..9de10a1fae8c --- /dev/null +++ b/net-www/mozilla/files/mozilla-1.6-gcc-3.4.patch @@ -0,0 +1,11 @@ +--- gfx/public/nsRegion.h.old 2003-03-25 02:57:42.000000000 +0000 ++++ gfx/public/nsRegion.h 2004-04-23 02:25:09.606368256 +0100 +@@ -234,7 +234,7 @@ + void MoveInto (nsRegion& aDestRegion) + { MoveInto (aDestRegion, mRectListHead.next); } + +- nsRegion (const nsRegion& aRegion); // Prevent copying of regions ++ public:nsRegion (const nsRegion& aRegion); // Prevent copying of regions + nsRegion& operator = (const nsRegion& aRegion); + }; + diff --git a/net-www/mozilla/files/mozilla-1.7-amd64.patch b/net-www/mozilla/files/mozilla-1.7-amd64.patch new file mode 100644 index 000000000000..2007573551fd --- /dev/null +++ b/net-www/mozilla/files/mozilla-1.7-amd64.patch @@ -0,0 +1,749 @@ +diff -ruN mozilla.old/config/mkdepend/imakemdep.h mozilla/config/mkdepend/imakemdep.h +--- mozilla.old/config/mkdepend/imakemdep.h 1998-09-05 00:22:25.000000000 -0400 ++++ mozilla/config/mkdepend/imakemdep.h 2003-09-27 16:20:55.105322104 -0400 +@@ -277,6 +277,9 @@ + # ifdef __i386__ + "-D__i386__", + # endif ++# ifdef __x86_64__ ++ "-D__x86_64__", ++# endif + # ifdef __GNUC__ + "-traditional", + # endif +diff -ruN mozilla.old/xpcom/reflect/xptcall/src/md/unix/Makefile.in mozilla/xpcom/reflect/xptcall/src/md/unix/Makefile.in +--- mozilla.old/xpcom/reflect/xptcall/src/md/unix/Makefile.in 2003-06-18 23:02:34.000000000 -0400 ++++ mozilla/xpcom/reflect/xptcall/src/md/unix/Makefile.in 2003-09-27 16:20:55.105322104 -0400 +@@ -55,6 +55,10 @@ + # Migrate other platforms here after testing + # + ifneq (,$(filter Linux,$(OS_ARCH))) ++# Linux/x86-64 ++ifeq (x86_64,$(OS_TEST)) ++CPPSRCS := xptcinvoke_x86_64_linux.cpp xptcstubs_x86_64_linux.cpp ++else + ifeq (86,$(findstring 86,$(OS_TEST))) + CPPSRCS := xptcinvoke_gcc_x86_unix.cpp xptcstubs_gcc_x86_unix.cpp + endif +@@ -66,6 +70,7 @@ + ASFILES := xptcstubs_asm_ipf64.s xptcinvoke_asm_ipf64.s + endif + endif ++endif + # + # BeOS/Intel (uses the same unixish_x86 code) + # +diff -ruN mozilla.old/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp +--- mozilla.old/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp 1969-12-31 19:00:00.000000000 -0500 ++++ mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp 2003-09-27 16:20:55.105322104 -0400 +@@ -0,0 +1,174 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++// Platform specific code to invoke XPCOM methods on native objects ++ ++#include "xptcprivate.h" ++ ++// 6 integral parameters are passed in registers ++const PRUint32 GPR_COUNT = 6; ++ ++// 8 floating point parameters are passed in SSE registers ++const PRUint32 FPR_COUNT = 8; ++ ++// Remember that these 'words' are 64-bit long ++static inline void ++invoke_count_words(PRUint32 paramCount, nsXPTCVariant * s, ++ PRUint32 & nr_gpr, PRUint32 & nr_fpr, PRUint32 & nr_stack) ++{ ++ nr_gpr = 1; // skip one GP register for 'that' ++ nr_fpr = 0; ++ nr_stack = 0; ++ ++ /* Compute number of eightbytes of class MEMORY. */ ++ for (uint32 i = 0; i < paramCount; i++, s++) { ++ if (!s->IsPtrData() ++ && (s->type == nsXPTType::T_FLOAT || s->type == nsXPTType::T_DOUBLE)) { ++ if (nr_fpr < FPR_COUNT) ++ nr_fpr++; ++ else ++ nr_stack++; ++ } ++ else { ++ if (nr_gpr < GPR_COUNT) ++ nr_gpr++; ++ else ++ nr_stack++; ++ } ++ } ++} ++ ++static void ++invoke_copy_to_stack(PRUint64 * d, PRUint32 paramCount, nsXPTCVariant * s, ++ PRUint64 * gpregs, double * fpregs) ++{ ++ PRUint32 nr_gpr = 1; // skip one GP register for 'that' ++ PRUint32 nr_fpr = 0; ++ PRUint64 value; ++ ++ for (uint32 i = 0; i < paramCount; i++, s++) { ++ if (s->IsPtrData()) ++ value = (PRUint64) s->ptr; ++ else { ++ switch (s->type) { ++ case nsXPTType::T_FLOAT: break; ++ case nsXPTType::T_DOUBLE: break; ++ case nsXPTType::T_I8: value = s->val.i8; break; ++ case nsXPTType::T_I16: value = s->val.i16; break; ++ case nsXPTType::T_I32: value = s->val.i32; break; ++ case nsXPTType::T_I64: value = s->val.i64; break; ++ case nsXPTType::T_U8: value = s->val.u8; break; ++ case nsXPTType::T_U16: value = s->val.u16; break; ++ case nsXPTType::T_U32: value = s->val.u32; break; ++ case nsXPTType::T_U64: value = s->val.u64; break; ++ case nsXPTType::T_BOOL: value = s->val.b; break; ++ case nsXPTType::T_CHAR: value = s->val.c; break; ++ case nsXPTType::T_WCHAR: value = s->val.wc; break; ++ default: value = (PRUint64) s->val.p; break; ++ } ++ } ++ ++ if (!s->IsPtrData() && s->type == nsXPTType::T_DOUBLE) { ++ if (nr_fpr < FPR_COUNT) ++ fpregs[nr_fpr++] = s->val.d; ++ else { ++ *((double *)d) = s->val.d; ++ d++; ++ } ++ } ++ else if (!s->IsPtrData() && s->type == nsXPTType::T_FLOAT) { ++ if (nr_fpr < FPR_COUNT) ++ // The value in %xmm register is already prepared to ++ // be retrieved as a float. Therefore, we pass the ++ // value verbatim, as a double without conversion. ++ fpregs[nr_fpr++] = s->val.d; ++ else { ++ *((float *)d) = s->val.f; ++ d++; ++ } ++ } ++ else { ++ if (nr_gpr < GPR_COUNT) ++ gpregs[nr_gpr++] = value; ++ else ++ *d++ = value; ++ } ++ } ++} ++ ++extern "C" ++XPTC_PUBLIC_API(nsresult) ++XPTC_InvokeByIndex(nsISupports * that, PRUint32 methodIndex, ++ PRUint32 paramCount, nsXPTCVariant * params) ++{ ++ PRUint32 nr_gpr, nr_fpr, nr_stack; ++ invoke_count_words(paramCount, params, nr_gpr, nr_fpr, nr_stack); ++ ++ // Stack, if used, must be 16-bytes aligned ++ if (nr_stack) ++ nr_stack = (nr_stack + 1) & ~1; ++ ++ // Load parameters to stack, if necessary ++ PRUint64 *stack = (PRUint64 *) __builtin_alloca(nr_stack * 8); ++ PRUint64 gpregs[GPR_COUNT]; ++ double fpregs[FPR_COUNT]; ++ invoke_copy_to_stack(stack, paramCount, params, gpregs, fpregs); ++ ++ // Load FPR registers from fpregs[] ++ register double d0 asm("xmm0"); ++ register double d1 asm("xmm1"); ++ register double d2 asm("xmm2"); ++ register double d3 asm("xmm3"); ++ register double d4 asm("xmm4"); ++ register double d5 asm("xmm5"); ++ register double d6 asm("xmm6"); ++ register double d7 asm("xmm7"); ++ ++ switch (nr_fpr) { ++#define ARG_FPR(N) \ ++ case N+1: d##N = fpregs[N]; ++ ARG_FPR(7); ++ ARG_FPR(6); ++ ARG_FPR(5); ++ ARG_FPR(4); ++ ARG_FPR(3); ++ ARG_FPR(2); ++ ARG_FPR(1); ++ ARG_FPR(0); ++ case 0:; ++#undef ARG_FPR ++ } ++ ++ // Load GPR registers from gpregs[] ++ register PRUint64 a0 asm("rdi"); ++ register PRUint64 a1 asm("rsi"); ++ register PRUint64 a2 asm("rdx"); ++ register PRUint64 a3 asm("rcx"); ++ register PRUint64 a4 asm("r8"); ++ register PRUint64 a5 asm("r9"); ++ ++ switch (nr_gpr) { ++#define ARG_GPR(N) \ ++ case N+1: a##N = gpregs[N]; ++ ARG_GPR(5); ++ ARG_GPR(4); ++ ARG_GPR(3); ++ ARG_GPR(2); ++ ARG_GPR(1); ++ case 1: a0 = (PRUint64) that; ++ case 0:; ++#undef ARG_GPR ++ } ++ ++ // Ensure that assignments to SSE registers won't be optimized away ++ asm("" :: ++ "x" (d0), "x" (d1), "x" (d2), "x" (d3), ++ "x" (d4), "x" (d5), "x" (d6), "x" (d7)); ++ ++ // Get pointer to method ++ PRUint64 methodAddress = *((PRUint64 *)that); ++ methodAddress += 8 * methodIndex; ++ methodAddress = *((PRUint64 *)methodAddress); ++ ++ typedef PRUint32 (*Method)(PRUint64, PRUint64, PRUint64, PRUint64, PRUint64, PRUint64); ++ PRUint32 result = ((Method)methodAddress)(a0, a1, a2, a3, a4, a5); ++ return result; ++} +diff -ruN mozilla.old/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp +--- mozilla.old/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp 1969-12-31 19:00:00.000000000 -0500 ++++ mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp 2003-09-27 16:20:55.106321952 -0400 +@@ -0,0 +1,206 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++ ++// Implement shared vtbl methods. ++ ++#include "xptcprivate.h" ++ ++// The Linux/x86-64 ABI passes the first 6 integral parameters and the ++// first 8 floating point parameters in registers (rdi, rsi, rdx, rcx, ++// r8, r9 and xmm0-xmm7), no stack space is allocated for these by the ++// caller. The rest of the parameters are passed in the callers stack ++// area. ++ ++const PRUint32 PARAM_BUFFER_COUNT = 16; ++const PRUint32 GPR_COUNT = 6; ++const PRUint32 FPR_COUNT = 8; ++ ++// PrepareAndDispatch() is called by SharedStub() and calls the actual method. ++// ++// - 'args[]' contains the arguments passed on stack ++// - 'gpregs[]' contains the arguments passed in integer registers ++// - 'fpregs[]' contains the arguments passed in floating point registers ++// ++// The parameters are mapped into an array of type 'nsXPTCMiniVariant' ++// and then the method gets called. ++ ++extern "C" nsresult ++PrepareAndDispatch(nsXPTCStubBase * self, PRUint32 methodIndex, ++ PRUint64 * args, PRUint64 * gpregs, double *fpregs) ++{ ++ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; ++ nsXPTCMiniVariant* dispatchParams = NULL; ++ nsIInterfaceInfo* iface_info = NULL; ++ const nsXPTMethodInfo* info; ++ PRUint32 paramCount; ++ PRUint32 i; ++ nsresult result = NS_ERROR_FAILURE; ++ ++ NS_ASSERTION(self,"no self"); ++ ++ self->GetInterfaceInfo(&iface_info); ++ NS_ASSERTION(iface_info,"no interface info"); ++ if (! iface_info) ++ return NS_ERROR_UNEXPECTED; ++ ++ iface_info->GetMethodInfo(PRUint16(methodIndex), &info); ++ NS_ASSERTION(info,"no method info"); ++ if (! info) ++ return NS_ERROR_UNEXPECTED; ++ ++ paramCount = info->GetParamCount(); ++ ++ // setup variant array pointer ++ if(paramCount > PARAM_BUFFER_COUNT) ++ dispatchParams = new nsXPTCMiniVariant[paramCount]; ++ else ++ dispatchParams = paramBuffer; ++ ++ NS_ASSERTION(dispatchParams,"no place for params"); ++ if (! dispatchParams) ++ return NS_ERROR_OUT_OF_MEMORY; ++ ++ PRUint64* ap = args; ++ PRUint32 nr_gpr = 1; // skip one GPR register for 'that' ++ PRUint32 nr_fpr = 0; ++ PRUint64 value; ++ ++ for(i = 0; i < paramCount; i++) { ++ const nsXPTParamInfo& param = info->GetParam(i); ++ const nsXPTType& type = param.GetType(); ++ nsXPTCMiniVariant* dp = &dispatchParams[i]; ++ ++ if (!param.IsOut() && type == nsXPTType::T_DOUBLE) { ++ if (nr_fpr < FPR_COUNT) ++ dp->val.d = fpregs[nr_fpr++]; ++ else ++ dp->val.d = *(double*) ap++; ++ continue; ++ } ++ else if (!param.IsOut() && type == nsXPTType::T_FLOAT) { ++ if (nr_fpr < FPR_COUNT) ++ // The value in %xmm register is already prepared to ++ // be retrieved as a float. Therefore, we pass the ++ // value verbatim, as a double without conversion. ++ dp->val.d = *(double*) ap++; ++ else ++ dp->val.f = *(float*) ap++; ++ continue; ++ } ++ else { ++ if (nr_gpr < GPR_COUNT) ++ value = gpregs[nr_gpr++]; ++ else ++ value = *ap++; ++ } ++ ++ if (param.IsOut() || !type.IsArithmetic()) { ++ dp->val.p = (void*) value; ++ continue; ++ } ++ ++ switch (type) { ++ case nsXPTType::T_I8: dp->val.i8 = (PRInt8) value; break; ++ case nsXPTType::T_I16: dp->val.i16 = (PRInt16) value; break; ++ case nsXPTType::T_I32: dp->val.i32 = (PRInt32) value; break; ++ case nsXPTType::T_I64: dp->val.i64 = (PRInt64) value; break; ++ case nsXPTType::T_U8: dp->val.u8 = (PRUint8) value; break; ++ case nsXPTType::T_U16: dp->val.u16 = (PRUint16) value; break; ++ case nsXPTType::T_U32: dp->val.u32 = (PRUint32) value; break; ++ case nsXPTType::T_U64: dp->val.u64 = (PRUint64) value; break; ++ case nsXPTType::T_BOOL: dp->val.b = (PRBool) value; break; ++ case nsXPTType::T_CHAR: dp->val.c = (char) value; break; ++ case nsXPTType::T_WCHAR: dp->val.wc = (wchar_t) value; break; ++ ++ default: ++ NS_ASSERTION(0, "bad type"); ++ break; ++ } ++ } ++ ++ result = self->CallMethod((PRUint16) methodIndex, info, dispatchParams); ++ ++ NS_RELEASE(iface_info); ++ ++ if (dispatchParams != paramBuffer) ++ delete [] dispatchParams; ++ ++ return result; ++} ++ ++#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ ++// Linux/x86-64 uses gcc >= 3.1 ++#define STUB_ENTRY(n) \ ++asm(".section \".text\"\n\t" \ ++ ".align 2\n\t" \ ++ ".if " #n " < 10\n\t" \ ++ ".globl _ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \ ++ ".type _ZN14nsXPTCStubBase5Stub" #n "Ev,@function\n" \ ++ "_ZN14nsXPTCStubBase5Stub" #n "Ev:\n\t" \ ++ ".elseif " #n " < 100\n\t" \ ++ ".globl _ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \ ++ ".type _ZN14nsXPTCStubBase6Stub" #n "Ev,@function\n" \ ++ "_ZN14nsXPTCStubBase6Stub" #n "Ev:\n\t" \ ++ ".elseif " #n " < 1000\n\t" \ ++ ".globl _ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \ ++ ".type _ZN14nsXPTCStubBase7Stub" #n "Ev,@function\n" \ ++ "_ZN14nsXPTCStubBase7Stub" #n "Ev:\n\t" \ ++ ".else\n\t" \ ++ ".err \"stub number " #n " >= 1000 not yet supported\"\n\t" \ ++ ".endif\n\t" \ ++ "movl $" #n ", %eax\n\t" \ ++ "jmp SharedStub\n\t" \ ++ ".if " #n " < 10\n\t" \ ++ ".size _ZN14nsXPTCStubBase5Stub" #n "Ev,.-_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \ ++ ".elseif " #n " < 100\n\t" \ ++ ".size _ZN14nsXPTCStubBase6Stub" #n "Ev,.-_ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \ ++ ".else\n\t" \ ++ ".size _ZN14nsXPTCStubBase7Stub" #n "Ev,.-_ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \ ++ ".endif"); ++ ++// static nsresult SharedStub(PRUint32 methodIndex) ++asm(".section \".text\"\n\t" ++ ".align 2\n\t" ++ ".type SharedStub,@function\n\t" ++ "SharedStub:\n\t" ++ // make room for gpregs (48), fpregs (64) ++ "pushq %rbp\n\t" ++ "movq %rsp,%rbp\n\t" ++ "subq $112,%rsp\n\t" ++ // save GP registers ++ "movq %rdi,-112(%rbp)\n\t" ++ "movq %rsi,-104(%rbp)\n\t" ++ "movq %rdx, -96(%rbp)\n\t" ++ "movq %rcx, -88(%rbp)\n\t" ++ "movq %r8 , -80(%rbp)\n\t" ++ "movq %r9 , -72(%rbp)\n\t" ++ "leaq -112(%rbp),%rcx\n\t" ++ // save FP registers ++ "movsd %xmm0,-64(%rbp)\n\t" ++ "movsd %xmm1,-56(%rbp)\n\t" ++ "movsd %xmm2,-48(%rbp)\n\t" ++ "movsd %xmm3,-40(%rbp)\n\t" ++ "movsd %xmm4,-32(%rbp)\n\t" ++ "movsd %xmm5,-24(%rbp)\n\t" ++ "movsd %xmm6,-16(%rbp)\n\t" ++ "movsd %xmm7, -8(%rbp)\n\t" ++ "leaq -64(%rbp),%r8\n\t" ++ // rdi has the 'self' pointer already ++ "movl %eax,%esi\n\t" ++ "leaq 16(%rbp),%rdx\n\t" ++ "call PrepareAndDispatch@plt\n\t" ++ "leave\n\t" ++ "ret\n\t" ++ ".size SharedStub,.-SharedStub"); ++ ++#define SENTINEL_ENTRY(n) \ ++nsresult nsXPTCStubBase::Sentinel##n() \ ++{ \ ++ NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ ++ return NS_ERROR_NOT_IMPLEMENTED; \ ++} ++ ++#include "xptcstubsdef.inc" ++ ++#else ++#error "can't find a compiler to use" ++#endif /* __GNUC__ */ +diff -ruN mozilla.old/xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp mozilla/xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp +--- mozilla.old/xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp 2003-02-22 23:41:18.000000000 -0500 ++++ mozilla/xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp 2003-09-27 16:21:05.754703152 -0400 +@@ -87,6 +87,19 @@ + float p17, float p18, float p19, float p20, + float *retval) = 0; + ++ NS_IMETHOD AddMixedInts(PRInt64 p1, PRInt32 p2, PRInt64 p3, PRInt32 p4, ++ PRInt32 p5, PRInt64 p6, PRInt32 p7, PRInt32 p8, ++ PRInt64 p9, PRInt32 p10, PRInt64* retval) = 0; ++ ++ NS_IMETHOD AddMixedInts2(PRInt32 p1, PRInt64 p2, PRInt32 p3, PRInt64 p4, ++ PRInt64 p5, PRInt32 p6, PRInt64 p7, PRInt64 p8, ++ PRInt32 p9, PRInt64 p10, PRInt64* retval) = 0; ++ ++ NS_IMETHOD AddMixedFloats(float p1, float p2, double p3, double p4, ++ float p5, float p6, double p7, double p8, ++ float p9, double p10, float p11, ++ double *retval) = 0; ++ + NS_IMETHOD PassTwoStrings(const char* s1, const char* s2, char** retval) = 0; + + }; +@@ -114,6 +127,19 @@ + float p5, float p6, float p7, float p8, + float p9, float p10, float* retval); + ++ NS_IMETHOD AddMixedInts(PRInt64 p1, PRInt32 p2, PRInt64 p3, PRInt32 p4, ++ PRInt32 p5, PRInt64 p6, PRInt32 p7, PRInt32 p8, ++ PRInt64 p9, PRInt32 p10, PRInt64* retval); ++ ++ NS_IMETHOD AddMixedInts2(PRInt32 p1, PRInt64 p2, PRInt32 p3, PRInt64 p4, ++ PRInt64 p5, PRInt32 p6, PRInt64 p7, PRInt64 p8, ++ PRInt32 p9, PRInt64 p10, PRInt64* retval); ++ ++ NS_IMETHOD AddMixedFloats(float p1, float p2, double p3, double p4, ++ float p5, float p6, double p7, double p8, ++ float p9, double p10, float p11, ++ double *retval); ++ + NS_IMETHOD AddManyManyFloats(float p1, float p2, float p3, float p4, + float p5, float p6, float p7, float p8, + float p9, float p10, float p11, float p12, +@@ -211,6 +237,20 @@ + } + + NS_IMETHODIMP ++InvokeTestTarget::AddMixedFloats(float p1, float p2, double p3, double p4, ++ float p5, float p6, double p7, double p8, ++ float p9, double p10, float p11, ++ double *retval) ++{ ++#ifdef DEBUG_TESTINVOKE ++ printf("%f, %f, %lf, %lf, %f, %f, %lf, %lf, %f, %lf, %f\n", ++ p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); ++#endif ++ *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10 + p11; ++ return NS_OK; ++} ++ ++NS_IMETHODIMP + InvokeTestTarget::AddManyManyFloats(float p1, float p2, float p3, float p4, + float p5, float p6, float p7, float p8, + float p9, float p10, float p11, float p12, +@@ -230,6 +270,24 @@ + } + + NS_IMETHODIMP ++InvokeTestTarget::AddMixedInts(PRInt64 p1, PRInt32 p2, PRInt64 p3, PRInt32 p4, ++ PRInt32 p5, PRInt64 p6, PRInt32 p7, PRInt32 p8, ++ PRInt64 p9, PRInt32 p10, PRInt64* retval) ++{ ++ *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10; ++ return NS_OK; ++} ++ ++NS_IMETHODIMP ++InvokeTestTarget::AddMixedInts2(PRInt32 p1, PRInt64 p2, PRInt32 p3, PRInt64 p4, ++ PRInt64 p5, PRInt32 p6, PRInt64 p7, PRInt64 p8, ++ PRInt32 p9, PRInt64 p10, PRInt64* retval) ++{ ++ *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10; ++ return NS_OK; ++} ++ ++NS_IMETHODIMP + InvokeTestTarget::PassTwoStrings(const char* s1, const char* s2, char** retval) + { + const char milk[] = "milk"; +@@ -309,14 +367,33 @@ + else + printf("\tFAILED"); + +- if(NS_SUCCEEDED(test->PassTwoStrings("moo","cow",&outS))) { +- printf(" = %s\n", outS); ++ if(NS_SUCCEEDED(test->AddMixedInts(1,2,3,4,5,6,7,8,9,10,&out64))) ++ { ++ LL_L2I(tmp32, out64); ++ printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n", (int)tmp32); ++ } ++ else ++ printf("\tFAILED"); ++ ++ if(NS_SUCCEEDED(test->AddMixedInts2(1,2,3,4,5,6,7,8,9,10,&out64))) ++ { ++ LL_L2I(tmp32, out64); ++ printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n", (int)tmp32); ++ } ++ else ++ printf("\tFAILED"); ++ ++ if(NS_SUCCEEDED(test->AddMixedFloats(1,2,3,4,5,6,7,8,9,10,11,&outD))) ++ printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 = %f\n", (double)outD); ++ else ++ printf("\tFAILED"); ++ ++ if (NS_SUCCEEDED(test->PassTwoStrings("moo","cow",&outS))) { ++ printf(" = %s\n", outS); + nsMemory::Free(outS); +- } else ++ } else + printf("\tFAILED"); + +- +- + printf("calling via invoke:\n"); + + nsXPTCVariant var[21]; +@@ -388,8 +465,8 @@ + var[2].flags = nsXPTCVariant::PTR_IS_DATA; + var[2].ptr = &var[2].val.i64; + +- if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 6, 3, var))) +- printf("\t2L * 2L = %d\n", (int)var[2].val.i64); ++ if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 6, 3, var))) ++ printf("\t2L * 2L = %d\n", (int)var[2].val.i64); + else + printf("\tFAILED"); + +@@ -559,6 +636,8 @@ + if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 10, 11, var))) + printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %ff\n", + (double) var[10].val.f); ++ else ++ printf("\tFAILED"); + + var[0].val.f = 1.0f; + var[0].type = nsXPTType::T_FLOAT; +@@ -649,6 +728,163 @@ + printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 = %ff\n", + (double) var[20].val.f); + ++ var[0].val.i64 = 1; ++ var[0].type = nsXPTType::T_I64; ++ var[0].flags = 0; ++ ++ var[1].val.i32 = 2; ++ var[1].type = nsXPTType::T_I32; ++ var[1].flags = 0; ++ ++ var[2].val.i64 = 3; ++ var[2].type = nsXPTType::T_I64; ++ var[2].flags = 0; ++ ++ var[3].val.i32 = 4; ++ var[3].type = nsXPTType::T_I32; ++ var[3].flags = 0; ++ ++ var[4].val.i32 = 5; ++ var[4].type = nsXPTType::T_I32; ++ var[4].flags = 0; ++ ++ var[5].val.i64 = 6; ++ var[5].type = nsXPTType::T_I64; ++ var[5].flags = 0; ++ ++ var[6].val.i32 = 7; ++ var[6].type = nsXPTType::T_I32; ++ var[6].flags = 0; ++ ++ var[7].val.i32 = 8; ++ var[7].type = nsXPTType::T_I32; ++ var[7].flags = 0; ++ ++ var[8].val.i64 = 9; ++ var[8].type = nsXPTType::T_I64; ++ var[8].flags = 0; ++ ++ var[9].val.i32 = 10; ++ var[9].type = nsXPTType::T_I32; ++ var[9].flags = 0; ++ ++ var[10].val.i64 = 0; ++ var[10].type = nsXPTType::T_I64; ++ var[10].flags = nsXPTCVariant::PTR_IS_DATA; ++ var[10].ptr = &var[10].val.i64; ++ ++ if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 12, 11, var))) ++ printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n", ++ (int)var[10].val.i64); ++ else ++ printf("\tFAILED"); ++ ++ var[0].val.i32 = 1; ++ var[0].type = nsXPTType::T_I32; ++ var[0].flags = 0; ++ ++ var[1].val.i64 = 2; ++ var[1].type = nsXPTType::T_I64; ++ var[1].flags = 0; ++ ++ var[2].val.i32 = 3; ++ var[2].type = nsXPTType::T_I32; ++ var[2].flags = 0; ++ ++ var[3].val.i64 = 4; ++ var[3].type = nsXPTType::T_I64; ++ var[3].flags = 0; ++ ++ var[4].val.i64 = 5; ++ var[4].type = nsXPTType::T_I64; ++ var[4].flags = 0; ++ ++ var[5].val.i32 = 6; ++ var[5].type = nsXPTType::T_I32; ++ var[5].flags = 0; ++ ++ var[6].val.i64 = 7; ++ var[6].type = nsXPTType::T_I64; ++ var[6].flags = 0; ++ ++ var[7].val.i64 = 8; ++ var[7].type = nsXPTType::T_I64; ++ var[7].flags = 0; ++ ++ var[8].val.i32 = 9; ++ var[8].type = nsXPTType::T_I32; ++ var[8].flags = 0; ++ ++ var[9].val.i64 = 10; ++ var[9].type = nsXPTType::T_I64; ++ var[9].flags = 0; ++ ++ var[10].val.i64 = 0; ++ var[10].type = nsXPTType::T_I64; ++ var[10].flags = nsXPTCVariant::PTR_IS_DATA; ++ var[10].ptr = &var[10].val.i64; ++ ++ if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 13, 11, var))) ++ printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n", ++ (int)var[10].val.i64); ++ else ++ printf("\tFAILED"); ++ ++ var[0].val.f = 1.0f; ++ var[0].type = nsXPTType::T_FLOAT; ++ var[0].flags = 0; ++ ++ var[1].val.f = 2.0f; ++ var[1].type = nsXPTType::T_FLOAT; ++ var[1].flags = 0; ++ ++ var[2].val.d = 3.0; ++ var[2].type = nsXPTType::T_DOUBLE; ++ var[2].flags = 0; ++ ++ var[3].val.d = 4.0; ++ var[3].type = nsXPTType::T_DOUBLE; ++ var[3].flags = 0; ++ ++ var[4].val.f = 5.0f; ++ var[4].type = nsXPTType::T_FLOAT; ++ var[4].flags = 0; ++ ++ var[5].val.f = 6.0f; ++ var[5].type = nsXPTType::T_FLOAT; ++ var[5].flags = 0; ++ ++ var[6].val.d = 7.0; ++ var[6].type = nsXPTType::T_DOUBLE; ++ var[6].flags = 0; ++ ++ var[7].val.d = 8.0; ++ var[7].type = nsXPTType::T_DOUBLE; ++ var[7].flags = 0; ++ ++ var[8].val.f = 9.0f; ++ var[8].type = nsXPTType::T_FLOAT; ++ var[8].flags = 0; ++ ++ var[9].val.d = 10.0; ++ var[9].type = nsXPTType::T_DOUBLE; ++ var[9].flags = 0; ++ ++ var[10].val.f = 11.0f; ++ var[10].type = nsXPTType::T_FLOAT; ++ var[10].flags = 0; ++ ++ var[11].val.d = 0.0; ++ var[11].type = nsXPTType::T_DOUBLE; ++ var[11].flags = nsXPTCVariant::PTR_IS_DATA; ++ var[11].ptr = &var[11].val.d; ++ ++ if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 14, 12, var))) ++ printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 = %f\n", ++ var[11].val.d); ++ else ++ printf("\tFAILED"); ++ + var[0].val.p = (void*)"moo"; + var[0].type = nsXPTType::T_CHAR_STR; + var[0].flags = 0; +@@ -662,12 +898,11 @@ + var[2].flags = nsXPTCVariant::PTR_IS_DATA; + var[2].ptr = &var[2].val.p; + +- if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 12, 3, var))) ++ if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 15, 3, var))) + printf(" = %s\n", var[2].val.p); + else + printf("\tFAILED"); + +- + DoMultipleInheritenceTest(); + DoMultipleInheritenceTest2(); + // Disabled by default - takes too much time on slow machines diff --git a/net-www/mozilla/files/mozilla-alpha-xpcom-subs-fix.patch b/net-www/mozilla/files/mozilla-alpha-xpcom-subs-fix.patch new file mode 100644 index 000000000000..c7f95467438a --- /dev/null +++ b/net-www/mozilla/files/mozilla-alpha-xpcom-subs-fix.patch @@ -0,0 +1,139 @@ +--- mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_alpha.cpp 2002-04-10 05:37:38.000000000 +0200 ++++ mozilla-alpha/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_alpha.cpp 2002-10-06 10:44:59.000000000 +0200 +@@ -20,6 +20,7 @@ + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): ++ * Glen Nakamura <glen@imodulo.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or +@@ -37,16 +38,14 @@ + + /* Platform specific code to invoke XPCOM methods on native objects */ + +-/* contributed by Glen Nakamura <glen.nakamura@usa.net> */ +- + #include "xptcprivate.h" + + /* Prototype specifies unmangled function name and disables unused warning */ +-static void ++void + invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount, nsXPTCVariant* s) + __asm__("invoke_copy_to_stack") __attribute__((unused)); + +-static void ++void + invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount, nsXPTCVariant* s) + { + const PRUint8 NUM_ARG_REGS = 6-1; // -1 for "this" pointer +@@ -163,7 +162,11 @@ + "bis $16,$16,$1\n\t" /* load "this" */ + "ldq $2,16($15)\n\t" /* load "methodIndex" */ + "ldq $1,0($1)\n\t" /* load vtable */ ++#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ ++ "s8addq $2,$31,$2\n\t" /* vtable index = "methodIndex" * 8 */ ++#else /* not G++ V3 ABI */ + "s8addq $2,16,$2\n\t" /* vtable index = "methodIndex" * 8 + 16 */ ++#endif /* G++ V3 ABI */ + "addq $1,$2,$1\n\t" + "ldq $27,0($1)\n\t" /* load address of function */ + "jsr $26,($27),0\n\t" /* call virtual function */ +@@ -176,4 +179,3 @@ + "ret $31,($26),1\n\t" + ".end XPTC_InvokeByIndex" + ); +- +--- mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_alpha.cpp 2002-04-10 05:37:42.000000000 +0200 ++++ mozilla-alpha/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_alpha.cpp 2002-10-06 10:45:10.000000000 +0200 +@@ -20,6 +20,7 @@ + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): ++ * Glen Nakamura <glen@imodulo.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or +@@ -37,16 +38,14 @@ + + /* Implement shared vtbl methods. */ + +-/* contributed by Glen Nakamura <glen.nakamura@usa.net> */ +- + #include "xptcprivate.h" + + /* Prototype specifies unmangled function name and disables unused warning */ +-static nsresult ++nsresult + PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, PRUint64* args) + __asm__("PrepareAndDispatch") __attribute__((unused)); + +-static nsresult ++nsresult + PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, PRUint64* args) + { + const PRUint8 PARAM_BUFFER_COUNT = 16; +@@ -188,23 +187,45 @@ + * nsresult nsXPTCStubBase::Stub##n() + * Sets register $1 to "methodIndex" and jumps to SharedStub. + */ ++#define STUB_MANGLED_ENTRY(n, symbol) \ ++ "#### Stub"#n" ####" "\n\t" \ ++ ".text" "\n\t" \ ++ ".align 5" "\n\t" \ ++ ".globl " symbol "\n\t" \ ++ ".ent " symbol "\n" \ ++symbol ":" "\n\t" \ ++ ".frame $30,0,$26,0" "\n\t" \ ++ "ldgp $29,0($27)" "\n" \ ++"$" symbol "..ng:" "\n\t" \ ++ ".prologue 1" "\n\t" \ ++ "lda $1,"#n "\n\t" \ ++ "br $31,$SharedStub..ng" "\n\t" \ ++ ".end " symbol ++ ++#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ ++ ++#define STUB_ENTRY(n) \ ++__asm__( \ ++ ".if "#n" < 10" "\n\t" \ ++ STUB_MANGLED_ENTRY(n, "_ZN14nsXPTCStubBase5Stub"#n"Ev") "\n\t" \ ++ ".elseif "#n" < 100" "\n\t" \ ++ STUB_MANGLED_ENTRY(n, "_ZN14nsXPTCStubBase6Stub"#n"Ev") "\n\t" \ ++ ".elseif "#n" < 1000" "\n\t" \ ++ STUB_MANGLED_ENTRY(n, "_ZN14nsXPTCStubBase7Stub"#n"Ev") "\n\t" \ ++ ".else" "\n\t" \ ++ ".err \"Stub"#n" >= 1000 not yet supported.\"" "\n\t" \ ++ ".endif" \ ++ ); ++ ++#else /* not G++ V3 ABI */ ++ + #define STUB_ENTRY(n) \ + __asm__( \ +- "#### Stub"#n" ####\n" \ +-".text\n\t" \ +- ".align 5\n\t" \ +- ".globl Stub"#n"__14nsXPTCStubBase\n\t" \ +- ".ent Stub"#n"__14nsXPTCStubBase\n" \ +-"Stub"#n"__14nsXPTCStubBase:\n\t" \ +- ".frame $30,0,$26,0\n\t" \ +- "ldgp $29,0($27)\n" \ +-"$Stub"#n"__14nsXPTCStubBase..ng:\n\t" \ +- ".prologue 1\n\t" \ +- "lda $1,"#n"\n\t" \ +- "br $31,$SharedStub..ng\n\t" \ +- ".end Stub"#n"__14nsXPTCStubBase" \ ++ STUB_MANGLED_ENTRY(n, "Stub"#n"__14nsXPTCStubBase") \ + ); + ++#endif /* G++ V3 ABI */ ++ + #define SENTINEL_ENTRY(n) \ + nsresult nsXPTCStubBase::Sentinel##n() \ + { \ +@@ -213,4 +234,3 @@ + } + + #include "xptcstubsdef.inc" +- diff --git a/net-www/mozilla/files/mozilla-ft-bytecode.patch b/net-www/mozilla/files/mozilla-ft-bytecode.patch new file mode 100644 index 000000000000..35246f7c15b3 --- /dev/null +++ b/net-www/mozilla/files/mozilla-ft-bytecode.patch @@ -0,0 +1,11 @@ +--- mozilla/other-licenses/freetype/include/freetype/config/ftoption.h.foo Thu Apr 25 21:37:15 2002 ++++ mozilla/other-licenses/freetype/include/freetype/config/ftoption.h Thu Apr 25 21:37:32 2002 +@@ -375,7 +375,7 @@ + /* By undefining this, you will only compile the code necessary to load */ + /* TrueType glyphs without hinting. */ + /* */ +-#undef TT_CONFIG_OPTION_BYTECODE_INTERPRETER ++#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER + + + /*************************************************************************/ diff --git a/net-www/mozilla/files/mozilla-new-freetype2.patch b/net-www/mozilla/files/mozilla-new-freetype2.patch new file mode 100644 index 000000000000..ce703ddf83d7 --- /dev/null +++ b/net-www/mozilla/files/mozilla-new-freetype2.patch @@ -0,0 +1,28 @@ +--- mozilla/other-licenses/Xft/fontconfig/src/fccharset.c Tue May 28 23:06:14 2002 ++++ mozilla.azarah/other-licenses/Xft/fontconfig/src/fccharset.c Tue May 28 23:49:49 2002 +@@ -998,6 +998,7 @@ + const FcCharMap *map; + int o; + int i; ++ int *mytmpvalue; + FT_UInt glyph; + + fcs = FcCharSetCreate (); +@@ -1043,7 +1044,7 @@ + if (FT_Get_Char_Index (face, 0)) + ucs4 = 0; + else +- ucs4 = FT_Get_Next_Char (face, 0); ++ ucs4 = FT_Get_Next_Char (face, 0, mytmpvalue); + + for (;;) + { +@@ -1070,7 +1071,7 @@ + } + ucs4++; + } +- ucs4 = FT_Get_Next_Char (face, ucs4 - 1); ++ ucs4 = FT_Get_Next_Char (face, ucs4 - 1, mytmpvalue); + if (!ucs4) + break; + } diff --git a/net-www/mozilla/files/mozilla-rebuild-databases.pl b/net-www/mozilla/files/mozilla-rebuild-databases.pl new file mode 100644 index 000000000000..686387c9dff9 --- /dev/null +++ b/net-www/mozilla/files/mozilla-rebuild-databases.pl @@ -0,0 +1,99 @@ +#!/usr/bin/perl + +use File::Path; +use File::Copy; +use File::Glob ":glob"; +use POSIX ":sys_wait_h"; + +$timeout = 60; + +%{ENV}->{"MOZILLA_FIVE_HOME"}="/usr/lib/mozilla"; +%{ENV}->{"LD_LIBRARY_PATH"}="/usr/lib/mozilla"; + +umask 022; + +if ( -f "/usr/lib/mozilla/regxpcom" ) +{ + # remove all of the old files + rmtree("/usr/lib/mozilla/chrome/overlayinfo"); + unlink </usr/lib/mozilla/chrome/*.rdf>; + unlink("/usr/lib/mozilla/component.reg"); + unlink("/usr/lib/mozilla/components/compreg.dat"); + unlink("/usr/lib/mozilla/components/xpti.dat"); + + # create a new clean path + mkpath("/usr/lib/mozilla/chrome/overlayinfo"); + + # rebuild the installed-chrome.txt file from the installed + # languages + if ( -f "/usr/lib/mozilla/chrome/lang/installed-chrome.txt" ) { + rebuild_lang_files(); + } + + # run regxpcom + $pid = fork(); + + # I am the child. + if ($pid == 0) { + exec("/usr/lib/mozilla/regxpcom > /dev/null 2> /dev/null"); + } + # I am the parent. + else { + my $timepassed = 0; + do { + $kid = waitpid($pid, &WNOHANG); + sleep(1); + $timepassed++; + } until $kid == -1 || $timepassed > $timeout; + + # should we kill? + if ($timepassed > $timeout) { + kill (9, $pid); + # kill -9 can leave threads hanging around + system("/usr/bin/killall -9 regxpcom"); + } + } + + # and run regchrome for good measure + $pid = fork(); + + # I am the child. + if ($pid == 0) { + exec("/usr/lib/mozilla/regchrome > /dev/null 2> /dev/null"); + } + # I am the parent. + else { + my $timepassed = 0; + do { + $kid = waitpid($pid, &WNOHANG); + sleep(1); + $timepassed++; + } until $kid == -1 || $timepassed > $timeout; + + # should we kill? + if ($timepassed > $timeout) { + kill (9, $pid); + # kill -9 can leave threads hanging around + system("/usr/bin/killall -9 regchrome"); + } + } + +} + + +sub rebuild_lang_files { + unlink("/usr/lib/mozilla/chrome/installed-chrome.txt"); + + open (OUTPUT, "+>", "/usr/lib/mozilla/chrome/installed-chrome.txt")|| + die("Failed to open installed-chrome.txt: $!\n"); + + copy("/usr/lib/mozilla/chrome/lang/installed-chrome.txt", + \*OUTPUT); + + foreach (bsd_glob("/usr/lib/mozilla/chrome/lang/lang-*.txt")) { + copy($_, \*OUTPUT); + } + + copy("/usr/lib/mozilla/chrome/lang/default.txt", + \*OUTPUT); +} diff --git a/net-www/mozilla/files/mozilla-xft-unix-prefs.patch b/net-www/mozilla/files/mozilla-xft-unix-prefs.patch new file mode 100644 index 000000000000..9e8ba6751a25 --- /dev/null +++ b/net-www/mozilla/files/mozilla-xft-unix-prefs.patch @@ -0,0 +1,30 @@ +--- unix.js.orig Wed May 1 18:50:25 2002 ++++ unix.js Wed May 1 19:30:44 2002 +@@ -225,21 +225,21 @@ + pref("font.scale.outline.min", 6); + + // TrueType +-pref("font.FreeType2.enable", false); ++pref("font.FreeType2.enable", true); + pref("font.freetype2.shared-library", "libfreetype.so.6"); + // if libfreetype was built without hinting compiled in + // it is best to leave hinting off +-pref("font.FreeType2.autohinted", false); +-pref("font.FreeType2.unhinted", true); ++pref("font.FreeType2.autohinted", false); ++pref("font.FreeType2.unhinted", false); + // below a certian pixel size anti-aliased fonts produce poor results + pref("font.antialias.min", 10); + pref("font.embedded_bitmaps.max", 1000000); + pref("font.scale.tt_bitmap.dark_text.min", 64); + pref("font.scale.tt_bitmap.dark_text.gain", "0.8"); + // sample prefs for TrueType font dirs +-//pref("font.directory.truetype.1", "/u/sam/tt_font"); +-//pref("font.directory.truetype.2", "/u/sam/tt_font2"); +-//pref("font.directory.truetype.3", "/u/sam/tt_font3"); ++pref("font.directory.truetype.1", "/usr/share/fonts/truetype"); ++pref("font.directory.truetype.2", "/usr/X11R6/lib/X11/fonts/TTF"); ++pref("font.directory.truetype.3", "/usr/X11R6/lib/X11/fonts/truetype"); + + // below a certian pixel size anti-aliased bitmat scaled fonts + // produce poor results diff --git a/net-www/mozilla/files/mozilla.sh b/net-www/mozilla/files/mozilla.sh new file mode 100644 index 000000000000..55a5b5f848f0 --- /dev/null +++ b/net-www/mozilla/files/mozilla.sh @@ -0,0 +1,266 @@ +#!/bin/bash +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# + +## +## Usage: +## +## $ mozilla +## +## This script is meant to run a mozilla program from the mozilla +## rpm installation. +## +## The script will setup all the environment voodoo needed to make +## mozilla work. + +## Faster startup +#export XPCOM_CHECK_THREADSAFE=0 + +cmdname=`basename $0` + +## don't leave any core files around +ulimit -c 0 + +## +## Variables +## +MOZ_DIST_BIN="/usr/lib/mozilla" +MOZ_PROGRAM="/usr/lib/mozilla/mozilla-bin" +MOZ_CLIENT_PROGRAM="/usr/lib/mozilla/mozilla-xremote-client" + +## +## Set MOZILLA_FIVE_HOME +## +MOZILLA_FIVE_HOME="/usr/lib/mozilla" + +export MOZILLA_FIVE_HOME + +## +## Set LD_PRELOAD for old plugins +## +if [ -f /usr/lib/mozilla/libc++mem.so ] +then + if [ "$LD_PRELOAD" ] + then + LD_PRELOAD="/usr/lib/mozilla/libc++mem.so $LD_PRELOAD" + else + LD_PRELOAD=/usr/lib/mozilla/libc++mem.so + fi + export LD_PRELOAD +fi + +## +## Set LD_LIBRARY_PATH +## +if [ "$LD_LIBRARY_PATH" ] +then + LD_LIBRARY_PATH="/usr/lib/mozilla:/usr/lib/mozilla/plugins:$LD_LIBRARY_PATH" +else + LD_LIBRARY_PATH="/usr/lib/mozilla:/usr/lib/mozilla/plugins" +fi + +export LD_LIBRARY_PATH + +## +## Make sure that we set the plugin path for backwards compatibility +## Set MOZ_PLUGIN_PATH to $HOME/.mozilla/plugins if not set +## +export MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins + +if [ "$HOME" ]; then + export MOZ_PLUGIN_PATH="$MOZ_PLUGIN_PATH:$HOME/.mozilla/plugins" +fi + +## +## Set FONTCONFIG_PATH for Xft/fontconfig +## +FONTCONFIG_PATH="/etc/fonts:${MOZILLA_FIVE_HOME}/res/Xft" +export FONTCONFIG_PATH + +## +## Autodetect language +## +grep -q $HOME/.mozilla $HOME/.mozilla/appreg > /dev/null 2>/dev/null +SET_LANG=$? +if [ "$HOME" -a "$LANG" -a "$SET_LANG" != "0" ]; then + MOZ_LANG=`grep -E "^$LANG[[:space:]]" $MOZILLA_FIVE_HOME/chrome/locale.alias | tr -s [:blank:] | cut -f 2` + for i in "$@";do + [ "$i" = "-UILocale" ] && MOZ_LANG="" + done + if [ "$MOZ_LANG" -a -r "$MOZILLA_FIVE_HOME/chrome/$MOZ_LANG.jar" ]; then + MOZ_LANG="-UILocale $MOZ_LANG" + else + unset MOZ_LANG + fi +fi + +# Figure out if we need to ser LD_ASSUME_KERNEL for older versions of the JVM. + +function set_jvm_vars() { + + # see if the jvm exists in either of the locations + if [ -L /usr/lib/mozilla/plugins/javaplugin_oji.so ]; then + JVM_ORIG_LINK=/usr/lib/mozilla/plugins/javaplugin_oji.so + fi + + if [ -L /usr/lib/mozilla/plugins/libjavaplugin_oji.so ]; then + JVM_ORIG_LINK=/usr/lib/mozilla/plugins/libjavaplugin_oji.so + fi + + if [ -z "$JVM_ORIG_LINK" ]; then + return; + fi + + JVM_LINK=`perl -e "print readlink('$JVM_ORIG_LINK')"` + + # is it relative? if so append the full path + + echo "${JVM_LINK}" | grep -e "^/" 2>&1 > /dev/null + + if [ "$?" -ne "0" ]; then + JVM_LINK=/usr/lib/mozilla/plugins/${JVM_LINK} + fi + + JVM_BASE=`basename $JVM_LINK` + JVM_DIR=`echo $JVM_LINK | sed -e s/$JVM_BASE//g` + JVM_COMMAND=$JVM_DIR/java + if [ ! -r $JVM_COMMAND ]; then + JVM_DIR=${JVM_DIR}../../../bin/ + JVM_COMMAND=$JVM_DIR/java + # does the command exist? + if [ ! -r "$JVM_COMMAND" ]; then + return + fi + fi + + # export this temporarily - it seems to work with old and new + # versions of the JVM. + export LD_ASSUME_KERNEL=2.2.5 + + # get the version + JVM_VERSION=`$JVM_COMMAND -version 2>&1` + + unset LD_ASSUME_KERNEL + + JVM_VERSION=`echo $JVM_VERSION | grep version | cut -f 3 -d " " | sed -e 's/\"//g'` + + case "$JVM_VERSION" in + (1.3.0*) + # bad JVM + export LD_ASSUME_KERNEL=2.2.5 + ;; + esac +} + +function check_running() { + if [ -x $MOZ_CLIENT_PROGRAM ]; then + $MOZ_CLIENT_PROGRAM 'ping()' 2>/dev/null >/dev/null + RETURN_VAL=$? + if [ "$RETURN_VAL" -eq "2" ]; then + echo 0 + return 0 + else + echo 1 + return 1 + fi + else + echo 0 + return 0 + fi +} + +function open_mail() { + if [ "${ALREADY_RUNNING}" -eq "1" ]; then + exec $MOZ_CLIENT_PROGRAM 'xfeDoCommand(openInbox)' \ + 2>/dev/null >/dev/null + else + exec $MOZ_PROGRAM $MOZ_LANG "$@" + fi +} + +function open_compose() { + if [ "${ALREADY_RUNNING}" -eq "1" ]; then + exec $MOZ_CLIENT_PROGRAM 'xfeDoCommand(composeMessage)' \ + 2>/dev/null >/dev/null + else + exec $MOZ_PROGRAM $MOZ_LANG "$@" + fi +} + +# OK, here's where all the real work gets done + +# set our JVM vars +set_jvm_vars + +# check to see if there's an already running instance or not +ALREADY_RUNNING=`check_running` + +# If there is no command line argument at all then try to open a new +# window in an already running instance. +if [ "${ALREADY_RUNNING}" -eq "1" ] && [ -z "$1" ]; then + exec $MOZ_CLIENT_PROGRAM "xfeDoCommand(openBrowser)" 2>/dev/null >/dev/null +fi + +# if there's no command line argument and there's not a running +# instance then just fire up a new copy of the browser +if [ -z "$1" ]; then + exec $MOZ_PROGRAM $MOZ_LANG 2>/dev/null >/dev/null +fi + +unset RETURN_VAL + +# If there's a command line argument but it doesn't begin with a - +# it's probably a url. Try to send it to a running instance. +USE_EXIST=0 +NEW_WINDOW= +opt="$1" +case "$opt" in + -mail) + open_mail ${1+"$@"} + ;; + -compose) + open_compose ${1+"$@"} + ;; + -*) ;; + *) USE_EXIST=1 ;; +esac + + othersopt= + optlast= + for i in "$@";do optlast=$i;done #last arg + for i in "$@";do [[ $i == $optlast ]] && break; othersopt="$othersopt $i";done #others arg + #???: needs check if othersopt begin with -* ? + + if [[ $optlast != *:/* && -e $optlast ]];then + [[ $optlast != /* ]] && optlast=file://$PWD/$optlast + elif [[ $optlast == *:/* || -n $othersopt ]];then #???? like before... + NEW_WINDOW=1 + fi + +if [ "${USE_EXIST}" -eq "1" ] && [ "${ALREADY_RUNNING}" -eq "1" ]; then + if [[ -z $NEW_WINDOW ]];then + exec $MOZ_CLIENT_PROGRAM $othersopt "openurl($optlast)" 2>/dev/null >/dev/null + else + exec $MOZ_CLIENT_PROGRAM $othersopt "openurl($optlast,new-window)" 2>/dev/null >/dev/null + fi +fi + +exec $MOZ_PROGRAM $MOZ_LANG $othersopt "$optlast" diff --git a/net-www/mozilla/files/xft.js b/net-www/mozilla/files/xft.js new file mode 100644 index 000000000000..ac10eea8d401 --- /dev/null +++ b/net-www/mozilla/files/xft.js @@ -0,0 +1,3 @@ +// pref to override the default UI font because we're using xft +pref("font.uifont.name", "sans"); +pref("font.uifont.pointheight", 10); |