Bye bye gtk1 and xlib (part 1 of 2). b=326152 r+sr=roc
authormats.palmgren@bredband.net
Mon, 30 Apr 2007 16:52:44 -0700
changeset 944 ea840f4667c4ac3d00b7b215762da0dbea3a3790
parent 943 586d3b48896832b47c7aa1022bed4d071e29ec7b
child 945 7f960a6f94b8c73e3820736ceaa0390b8d1bdd02
push idunknown
push userunknown
push dateunknown
bugs326152
milestone1.9a5pre
Bye bye gtk1 and xlib (part 1 of 2). b=326152 r+sr=roc
browser/app/Makefile.in
browser/base/content/browser.js
browser/branding/unofficial/Makefile.in
config/autoconf.mk.in
config/config.mk
config/rules.mk
config/static-config.mk
configure.in
embedding/browser/gtk/src/EmbedEventListener.cpp
embedding/browser/gtk/src/EmbedPrivate.cpp
embedding/browser/gtk/src/EmbedPrivate.h
embedding/browser/gtk/src/EmbedWindow.cpp
embedding/browser/gtk/src/Makefile.in
embedding/browser/gtk/src/gtkmozembed.h
embedding/browser/gtk/src/gtkmozembed2.cpp
embedding/browser/gtk/src/gtkmozembed_common.cpp
embedding/browser/gtk/src/gtkmozembed_download.cpp
embedding/browser/gtk/src/gtkmozembed_glue.cpp
embedding/browser/gtk/tests/Makefile.in
embedding/browser/gtk/tests/TestGtkEmbed.cpp
embedding/components/build/Makefile.in
embedding/components/printingui/src/Makefile.in
gfx/src/Makefile.in
gfx/src/gtk/Makefile.in
gfx/src/gtk/nsDeviceContextGTK.cpp
gfx/src/gtk/nsDrawingSurfaceGTK.cpp
gfx/src/gtk/nsFontMetricsXft.cpp
gfx/src/gtk/nsGCCache.cpp
gfx/src/gtk/nsGCCache.h
gfx/src/gtk/nsGdkUtils.cpp
gfx/src/gtk/nsGfxFactoryGTK.cpp
gfx/src/gtk/nsRegionGTK.h
layout/build/Makefile.in
layout/generic/nsObjectFrame.cpp
modules/plugin/Makefile.in
modules/plugin/base/src/Makefile.in
modules/plugin/base/src/ns4xPlugin.cpp
modules/plugin/base/src/ns4xPluginInstance.cpp
modules/plugin/base/src/ns4xPluginInstance.h
modules/plugin/base/src/nsPluginHostImpl.cpp
modules/plugin/base/src/nsPluginsDirUnix.cpp
modules/plugin/samples/default/unix/Makefile.in
modules/plugin/samples/simple/Makefile.in
modules/staticmod/Makefile.in
other-licenses/branding/firefox/Makefile.in
toolkit/components/alerts/Makefile.in
toolkit/components/build/Makefile.in
toolkit/components/remote/Makefile.in
toolkit/library/Makefile.in
toolkit/library/libxul-config.mk
toolkit/library/nsStaticXULComponents.cpp
toolkit/mozapps/installer/package-name.mk
toolkit/toolkit-tiers.mk
toolkit/xre/nsAppRunner.cpp
webshell/public/Makefile.in
webshell/public/webshell.pkg
widget/public/Makefile.in
widget/src/Makefile.in
widget/src/gtk2/nsNativeThemeGTK.cpp
widget/src/gtkxtbin/Makefile.in
widget/src/xpwidgets/Makefile.in
xpfe/bootstrap/Makefile.in
xpfe/bootstrap/nsAppRunner.cpp
xpfe/bootstrap/showOSAlert.cpp
xpfe/components/alerts/Makefile.in
xpfe/components/build/Makefile.in
xpinstall/wizard/unix/src2/nsComponentsDlg.cpp
xpinstall/wizard/unix/src2/nsInstallDlg.cpp
xpinstall/wizard/unix/src2/nsLicenseDlg.cpp
xpinstall/wizard/unix/src2/nsSetupTypeDlg.cpp
xpinstall/wizard/unix/src2/nsWelcomeDlg.cpp
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -125,17 +125,17 @@ LIBS += \
 	$(EXTRA_DSO_LIBS) \
 	$(MOZ_JS_LIBS) \
 	$(XPCOM_LIBS) \
 	$(NSPR_LIBS) \
 	$(TK_LIBS) \
 	$(NULL)
 
 # Add explicit X11 dependency when building against X11 toolkits
-ifneq (,$(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 LIBS += $(XLDFLAGS) $(XLIBS)
 ifdef MOZ_ENABLE_CAIRO_GFX
 LIBS += $(ZLIB_LIBS)
 endif
 endif
 
 ifdef MOZ_JPROF
 LIBS += -ljprof
@@ -283,17 +283,17 @@ libs:: $(MOZ_APP_NAME)
 install:: $(MOZ_APP_NAME)
 	$(SYSINSTALL) $< $(DESTDIR)$(bindir)
 
 GARBAGE += $(MOZ_APP_NAME)
 GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, firefox.js)
 
 endif
 
-ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 
 ICON_FILES	= \
 		$(DIST)/branding/mozicon128.png \
 		$(DIST)/branding/mozicon50.xpm \
 		$(DIST)/branding/mozicon16.xpm \
 		$(DIST)/branding/document.png \
 		$(NULL)
 
@@ -323,17 +323,17 @@ endif
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 	cp $(srcdir)/macbuild/firefox.icns  $(DIST)/branding/firefox.icns
 	cp $(srcdir)/macbuild/document.icns  $(DIST)/branding/document.icns
 	cp $(srcdir)/macbuild/dsstore $(DIST)/branding/dsstore
 	cp $(srcdir)/macbuild/background.png $(DIST)/branding/background.png
 	cp $(srcdir)/macbuild/disk.icns $(DIST)/branding/disk.icns
 	cp $(srcdir)/macbuild/license.r $(DIST)/branding/license.r
 endif
-ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 	cp $(srcdir)/mozicon128.png $(DIST)/branding/mozicon128.png
 	cp $(srcdir)/mozicon16.xpm $(DIST)/branding/mozicon16.xpm
 	cp $(srcdir)/mozicon50.xpm $(DIST)/branding/mozicon50.xpm
 	cp $(srcdir)/document.png $(DIST)/branding/document.png
 endif
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 	cp $(srcdir)/default.xpm   $(DIST)/branding/default.xpm	
 endif
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -863,19 +863,16 @@ function BrowserStartup()
       defaultHeight = 450;
     }
     else {
       // Create a narrower window for large or wide-aspect displays, to suggest
       // side-by-side page view.
       if ((screen.availWidth / 2) >= 800)
         defaultWidth = (screen.availWidth / 2) - 20;
       defaultHeight = screen.availHeight - 10;
-#ifdef MOZ_WIDGET_GTK
-#define USE_HEIGHT_ADJUST
-#endif
 #ifdef MOZ_WIDGET_GTK2
 #define USE_HEIGHT_ADJUST
 #endif
 #ifdef USE_HEIGHT_ADJUST
       // On X, we're not currently able to account for the size of the window
       // border.  Use 28px as a guess (titlebar + bottom window border)
       defaultHeight -= 28;
 #endif
--- a/browser/branding/unofficial/Makefile.in
+++ b/browser/branding/unofficial/Makefile.in
@@ -26,17 +26,17 @@ BROWSER_APP_FILES = \
 	mozicon50.xpm \
 	firefox.ico \
 	document.ico \
 	$(NULL)
 
 export::
 	$(NSINSTALL) -D $(DIST)/branding
 	cp $(addprefix $(srcdir)/, $(BROWSER_APP_FILES)) $(DIST)/branding/
-ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 	cp $(srcdir)/document.png  $(DIST)/branding/document.png
 	$(NSINSTALL) -D $(DIST)/install
 	cp $(srcdir)/header.png    $(DIST)/install/header.png
 	cp $(srcdir)/watermark.png $(DIST)/install/watermark.png
 endif
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 	cp $(srcdir)/firefox.icns  $(DIST)/branding/firefox.icns
 	cp $(srcdir)/document.icns $(DIST)/branding/document.icns
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -451,37 +451,29 @@ TK_LIBS		= @TK_LIBS@
 MOZ_TOOLKIT_REGISTRY_CFLAGS = \
 	$(TK_CFLAGS)
 
 CAIRO_FT_CFLAGS		= @CAIRO_FT_CFLAGS@
 
 MOZ_ENABLE_CAIRO_GFX	= @MOZ_ENABLE_CAIRO_GFX@
 MOZ_ENABLE_CAIRO_FT	= @MOZ_ENABLE_CAIRO_FT@
 MOZ_ENABLE_GLITZ        = @MOZ_ENABLE_GLITZ@
-MOZ_ENABLE_GTK		= @MOZ_ENABLE_GTK@
 MOZ_ENABLE_GTK2		= @MOZ_ENABLE_GTK2@
-MOZ_ENABLE_XLIB		= @MOZ_ENABLE_XLIB@
 MOZ_ENABLE_QT		= @MOZ_ENABLE_QT@
 MOZ_ENABLE_PHOTON	= @MOZ_ENABLE_PHOTON@
 MOZ_ENABLE_COCOA	= @MOZ_ENABLE_COCOA@
 MOZ_ENABLE_XREMOTE	= @MOZ_ENABLE_XREMOTE@
 
-MOZ_GTK_CFLAGS		= @MOZ_GTK_CFLAGS@
-MOZ_GTK_LDFLAGS		= @MOZ_GTK_LDFLAGS@
-
 MOZ_GTK2_CFLAGS		= @MOZ_GTK2_CFLAGS@
 MOZ_GTK2_LIBS		= @MOZ_GTK2_LIBS@
 
 MOZ_DBUS_GLIB_CFLAGS    = @MOZ_DBUS_GLIB_CFLAGS@
 MOZ_DBUS_GLIB_LIBS      = @MOZ_DBUS_GLIB_LIBS@
 MOZ_ENABLE_DBUS         = @MOZ_ENABLE_DBUS@
 
-MOZ_XLIB_CFLAGS		= @MOZ_XLIB_CFLAGS@
-MOZ_XLIB_LDFLAGS	= @MOZ_XLIB_LDFLAGS@
-
 MOZ_QT_CFLAGS		= @MOZ_QT_CFLAGS@
 MOZ_QT_LDFLAGS		= @MOZ_QT_LDFLAGS@
 
 MOZ_XPRINT_CFLAGS	= @MOZ_XPRINT_CFLAGS@
 MOZ_XPRINT_LDFLAGS	= @MOZ_XPRINT_LDFLAGS@
 MOZ_ENABLE_XPRINT	= @MOZ_ENABLE_XPRINT@
 
 MOZ_ENABLE_FREETYPE2   = @MOZ_ENABLE_FREETYPE2@
--- a/config/config.mk
+++ b/config/config.mk
@@ -469,17 +469,17 @@ endif
 ifdef USE_EXTENSION_MANIFEST
 MAKE_JARS_FLAGS += -e
 endif
 
 ifeq ($(OS_TARGET),WIN95)
 MAKE_JARS_FLAGS += -l
 endif
 
-ifneq (,$(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 MAKE_JARS_FLAGS += -x
 endif
 
 ifdef CROSS_COMPILE
 MAKE_JARS_FLAGS += -o $(OS_ARCH)
 endif
 
 TAR_CREATE_FLAGS = -cvhf
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -1854,22 +1854,22 @@ endif
 
 ifneq (,$(filter flat symlink,$(MOZ_CHROME_FILE_FORMAT)))
 _JAR_REGCHROME_DISABLE_JAR=1
 else
 _JAR_REGCHROME_DISABLE_JAR=0
 endif
 
 REGCHROME = $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/add-chrome.pl \
-	$(if $(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)),-x) \
+	$(if $(filter gtk2,$(MOZ_WIDGET_TOOLKIT)),-x) \
 	$(if $(CROSS_COMPILE),-o $(OS_ARCH)) $(FINAL_TARGET)/chrome/installed-chrome.txt \
 	$(_JAR_REGCHROME_DISABLE_JAR)
 
 REGCHROME_INSTALL = $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/add-chrome.pl \
-	$(if $(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)),-x) \
+	$(if $(filter gtk2,$(MOZ_WIDGET_TOOLKIT)),-x) \
 	$(if $(CROSS_COMPILE),-o $(OS_ARCH)) $(DESTDIR)$(mozappdir)/chrome/installed-chrome.txt \
 	$(_JAR_REGCHROME_DISABLE_JAR)
 
 
 ################################################################################
 # Testing frameworks support
 ################################################################################
 
--- a/config/static-config.mk
+++ b/config/static-config.mk
@@ -92,26 +92,20 @@ STATIC_EXTRA_LIBS	+= $(MOZ_CAIRO_LIBS)
 endif
 endif
 endif
 
 ifdef MOZ_ENABLE_XINERAMA
 STATIC_EXTRA_LIBS	+= $(MOZ_XINERAMA_LIBS)
 endif
 
-ifneq  (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2)$(MOZ_ENABLE_XLIB))
+ifneq  (,$(MOZ_ENABLE_GTK2))
 STATIC_EXTRA_LIBS	+= $(XLDFLAGS) $(XT_LIBS)
 endif
 
-ifeq ($(MOZ_WIDGET_TOOLKIT),xlib)
-STATIC_EXTRA_LIBS	+= \
-		$(MOZ_XIE_LIBS) \
-		$(NULL)
-endif
-
 ifdef MOZ_ENABLE_XPRINT
 STATIC_EXTRA_LIBS	+= $(MOZ_XPRINT_LDFLAGS)
 endif
 
 ifdef MOZ_ENABLE_XFT
 STATIC_EXTRA_LIBS	+= $(MOZ_XFT_LIBS)
 endif
 
--- a/configure.in
+++ b/configure.in
@@ -4610,26 +4610,16 @@ cairo-beos)
 cairo-os2)
     MOZ_WIDGET_TOOLKIT=os2
     MOZ_GFX_TOOLKIT=cairo
     MOZ_ENABLE_CAIRO_GFX=1
     TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
     TK_LIBS='$(MOZ_CAIRO_LIBS)'
     ;;
 
-cairo-xlib)
-    MOZ_WIDGET_TOOLKIT=xlib
-    MOZ_GFX_TOOLKIT=cairo
-    MOZ_ENABLE_CAIRO_GFX=1
-	MOZ_ENABLE_XLIB=1
-	TK_CFLAGS='$(MOZ_XLIB_CFLAGS) $(MOZ_CAIRO_FLAGS)'
-	TK_LIBS='$(MOZ_XLIB_LDFLAGS) $(MOZ_CAIRO_LIBS)'
-	AC_DEFINE(MOZ_WIDGET_XLIB)
-    ;;
-
 cairo-mac|cairo-cocoa)
     if test "$MOZ_WIDGET_TOOLKIT" = "cairo-cocoa"; then
         MOZ_WIDGET_TOOLKIT=cocoa
         AC_DEFINE(MOZ_WIDGET_COCOA)
         MOZ_ENABLE_COCOA=1
     else
         MOZ_WIDGET_TOOLKIT=mac
     fi
@@ -4646,37 +4636,21 @@ cairo-mac|cairo-cocoa)
     ;;
 esac
 
 if test "$MOZ_ENABLE_XREMOTE"; then
     AC_DEFINE(MOZ_ENABLE_XREMOTE)
 fi
 
 if test "$COMPILE_ENVIRONMENT"; then
-if test "$MOZ_ENABLE_GTK"
-then
-    AM_PATH_GTK($GTK_VERSION,,
-    AC_MSG_ERROR(Test for GTK failed.))
-
-    MOZ_GTK_LDFLAGS=$GTK_LIBS
-    MOZ_GTK_CFLAGS=$GTK_CFLAGS
-fi
-
 if test "$MOZ_ENABLE_GTK2"
 then
     PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= 1.3.7 gdk-x11-2.0 glib-2.0 gobject-2.0)
 fi
 
-if test "$MOZ_ENABLE_XLIB"
-then
-    MOZ_XLIB_CFLAGS="$X_CFLAGS"
-    MOZ_XLIB_LDFLAGS="$XLDFLAGS"
-    MOZ_XLIB_LDFLAGS="$MOZ_XLIB_LDFLAGS $XEXT_LIBS $X11_LIBS"
-fi
-
 if test "$MOZ_ENABLE_QT"
 then
     MOZ_ARG_WITH_STRING(qtdir,
     [  --with-qtdir=\$dir       Specify Qt directory ],
     [ QTDIR=$withval])
 
     if test -z "$QTDIR"; then
       QTDIR="/usr"
@@ -4778,45 +4752,37 @@ fi
 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
 
 AC_SUBST(GTK_CONFIG)
 AC_SUBST(TK_CFLAGS)
 AC_SUBST(TK_LIBS)
 
-AC_SUBST(MOZ_ENABLE_GTK)
-AC_SUBST(MOZ_ENABLE_XLIB)
 AC_SUBST(MOZ_ENABLE_GTK2)
 AC_SUBST(MOZ_ENABLE_QT)
 AC_SUBST(MOZ_ENABLE_PHOTON)
 AC_SUBST(MOZ_ENABLE_COCOA)
 AC_SUBST(MOZ_ENABLE_CAIRO_GFX)
 AC_SUBST(MOZ_ENABLE_GLITZ)
 AC_SUBST(MOZ_ENABLE_XREMOTE)
-AC_SUBST(MOZ_GTK_CFLAGS)
-AC_SUBST(MOZ_GTK_LDFLAGS)
 AC_SUBST(MOZ_GTK2_CFLAGS)
 AC_SUBST(MOZ_GTK2_LIBS)
-AC_SUBST(MOZ_XLIB_CFLAGS)
-AC_SUBST(MOZ_XLIB_LDFLAGS)
 AC_SUBST(MOZ_QT_CFLAGS)
 AC_SUBST(MOZ_QT_LDFLAGS)
 
 AC_SUBST(MOC)
 
 if test "$MOZ_ENABLE_CAIRO_GFX"
 then
     AC_DEFINE(MOZ_THEBES)
     AC_DEFINE(MOZ_CAIRO_GFX)
 fi
 
-if test "$MOZ_ENABLE_GTK" \
-|| test "$MOZ_ENABLE_QT" \
-|| test "$MOZ_ENABLE_XLIB" \
+if test "$MOZ_ENABLE_QT" \
 || test "$MOZ_ENABLE_GTK2"
 then
     AC_DEFINE(MOZ_X11)
     MOZ_X11=1
 fi
 AC_SUBST(MOZ_X11)
 
 dnl ========================================================
@@ -5232,19 +5198,18 @@ AC_SUBST(MOZ_DBUS_GLIB_LIBS)
 dnl ========================================================
 dnl = Setting MOZ_EXTRA_X11CONVERTERS turns on additional 
 dnl = converters in intl/uconv that are used only by X11 gfx 
 dnl = implementations. By default, it's undefined so that 
 dnl = those converters are not built on other platforms/toolkits. 
 dnl = (see bug 180851)
 dnl ========================================================
 
-if (test "$MOZ_ENABLE_GTK"  || test "$MOZ_ENABLE_GTK2") \
+if test "$MOZ_ENABLE_GTK2" \
 && test "$MOZ_ENABLE_COREXFONTS" \
-|| test "$MOZ_ENABLE_XLIB" \
 || test "$MOZ_ENABLE_XPRINT" 
 then
     AC_DEFINE(MOZ_EXTRA_X11CONVERTERS)
     MOZ_EXTRA_X11CONVERTERS=1
 fi
 AC_SUBST(MOZ_EXTRA_X11CONVERTERS)
 
 dnl ========================================================
@@ -7034,19 +6999,16 @@ then
       LDFLAGS=`echo $LDFLAGS|sed -e "s?-Wl,-syslibroot,${MACOS_SDK_DIR}??g"`
       changequote([,])
       unset NEXT_ROOT
     fi
 
     if test "$MOZ_ENABLE_GTK2"; then
         PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0 glib-2.0 gobject-2.0, _LIBIDL_FOUND=1,_LIBIDL_FOUND=)
     fi
-    if test "$MOZ_ENABLE_GTK"; then
-        AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
-    fi
     dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
     dnl to either libIDL1 or libIDL2.
     if test -z "$_LIBIDL_FOUND"; then
         AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
         if test -z "$_LIBIDL_FOUND"; then
             PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
         fi
     fi
--- a/embedding/browser/gtk/src/EmbedEventListener.cpp
+++ b/embedding/browser/gtk/src/EmbedEventListener.cpp
@@ -84,19 +84,17 @@ NS_INTERFACE_MAP_BEGIN(EmbedEventListene
 NS_INTERFACE_MAP_END
 
 nsresult
 EmbedEventListener::Init(EmbedPrivate *aOwner)
 {
   mOwner = aOwner;
   mCtxInfo = nsnull;
   mClickCount = 1;
-#ifdef MOZ_WIDGET_GTK2
   mCtxInfo = new EmbedContextMenuInfo(aOwner);
-#endif
   mOwner->mNeedFav = PR_TRUE;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 EmbedEventListener::HandleLink(nsIDOMNode* node)
 {
   nsresult rv;
@@ -158,31 +156,30 @@ EmbedEventListener::HandleLink(nsIDOMNod
   return NS_OK;
 }
 
 NS_IMETHODIMP
 EmbedEventListener::HandleEvent(nsIDOMEvent* aDOMEvent)
 {
   nsString eventType;
   aDOMEvent->GetType(eventType);
-#ifdef MOZ_WIDGET_GTK2
+
   if (eventType.EqualsLiteral("focus"))
     if (mCtxInfo->GetFormControlType(aDOMEvent)) {
       if (mCtxInfo->mEmbedCtxType & GTK_MOZ_EMBED_CTX_INPUT) {
         gint return_val = FALSE;
         gtk_signal_emit(GTK_OBJECT(mOwner->mOwningWidget),
                         moz_embed_signals[DOM_FOCUS],
                         (void *)aDOMEvent, &return_val);
         if (return_val) {
           aDOMEvent->StopPropagation();
           aDOMEvent->PreventDefault();
         }
       }
     }
-#endif
 
   if (eventType.EqualsLiteral("DOMLinkAdded")) {
 
     nsresult rv;
     nsCOMPtr<nsIDOMEventTarget> eventTarget;
 
     aDOMEvent->GetTarget(getter_AddRefs(eventTarget));
     nsCOMPtr<nsIDOMNode> node = do_QueryInterface(eventTarget, &rv);
@@ -336,19 +333,17 @@ EmbedEventListener::MouseDown(nsIDOMEven
   } else {
     mClickCount = 1;
     sLongPressTimer = g_timeout_add(mLongMPressDelay, sLongMPress, mOwner->mOwningWidget);
     ((nsIDOMMouseEvent*)mouseEvent)->GetScreenX(&sX);
     ((nsIDOMMouseEvent*)mouseEvent)->GetScreenY(&sY);
   }
 
   // handling event internally.
-#ifdef MOZ_WIDGET_GTK2
   HandleSelection(mouseEvent);
-#endif
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 EmbedEventListener::MouseUp(nsIDOMEvent* aDOMEvent)
 {
   nsCOMPtr<nsIDOMMouseEvent> mouseEvent;
@@ -534,40 +529,35 @@ EmbedEventListener::MouseMove(nsIDOMEven
     if (ABS(subX) > 10 || ABS(subY) > 10 || (sIsScrolling && sMPressed)) {
       if (!sIsScrolling) {
         gint return_val = FALSE;
         gtk_signal_emit(GTK_OBJECT(mOwner->mOwningWidget),
                         moz_embed_signals[DOM_MOUSE_SCROLL],
                         (void *)mouseEvent, &return_val);
         if (!return_val) {
           sIsScrolling = PR_TRUE;
-#ifdef MOZ_WIDGET_GTK2
           if (mCtxInfo)
             rv = mCtxInfo->GetElementForScroll(aDOMEvent);
-#endif
         } else {
           sMPressed = PR_FALSE;
           sIsScrolling = PR_FALSE;
         }
       }
       if (sIsScrolling)
       {
         if (sLongPressTimer)
           g_source_remove(sLongPressTimer);
-#ifdef MOZ_WIDGET_GTK2
         if (mCtxInfo->mNSHHTMLElementSc) {
           PRInt32 x, y;
           mCtxInfo->mNSHHTMLElementSc->GetScrollTop(&y);
           mCtxInfo->mNSHHTMLElementSc->GetScrollLeft(&x);
 #ifdef MOZ_SCROLL_TOP_LEFT_HACK
           rv = mCtxInfo->mNSHHTMLElementSc->ScrollTopLeft(y - subY, x - subX);
 #endif
-        } else
-#endif
-        {
+        } else {
           rv = NS_ERROR_UNEXPECTED;
         }
         if (rv == NS_ERROR_UNEXPECTED) {
           nsCOMPtr<nsIDOMWindow> DOMWindow;
           nsIWebBrowser *webBrowser = nsnull;
           gtk_moz_embed_get_nsIWebBrowser(mOwner->mOwningWidget, &webBrowser);
           webBrowser->GetContentDOMWindow(getter_AddRefs(DOMWindow));
           DOMWindow->ScrollBy(-subX, -subY);
@@ -587,30 +577,29 @@ EmbedEventListener::DragMove(nsIDOMEvent
   return NS_OK;
 }
 
 NS_IMETHODIMP
 EmbedEventListener::Focus(nsIDOMEvent* aEvent)
 {
   nsString eventType;
   aEvent->GetType(eventType);
-#ifdef MOZ_WIDGET_GTK2
+
   if (eventType.EqualsLiteral("focus") &&
       mCtxInfo->GetFormControlType(aEvent) &&
       mCtxInfo->mEmbedCtxType & GTK_MOZ_EMBED_CTX_INPUT) {
     gint return_val = FALSE;
     gtk_signal_emit(GTK_OBJECT(mOwner->mOwningWidget),
                     moz_embed_signals[DOM_FOCUS],
                     (void *)aEvent, &return_val);
     if (return_val) {
       aEvent->StopPropagation();
       aEvent->PreventDefault();
     }
   }
-#endif
 
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 EmbedEventListener::Blur(nsIDOMEvent* aEvent)
 {
@@ -641,17 +630,17 @@ EmbedEventListener::Blur(nsIDOMEvent* aE
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 EmbedEventListener::HandleSelection(nsIDOMMouseEvent* aDOMMouseEvent)
 {
   nsresult rv;
-#ifdef MOZ_WIDGET_GTK2
+
   /* This function gets called everytime that a mousedown or a mouseup
    * event occurs.
    */
   nsCOMPtr<nsIDOMNSEvent> nsevent(do_QueryInterface(aDOMMouseEvent));
 
   nsCOMPtr<nsIDOMEventTarget> target;
   rv = nsevent->GetOriginalTarget(getter_AddRefs(target));
   if (NS_FAILED(rv))
@@ -724,17 +713,17 @@ EmbedEventListener::HandleSelection(nsID
     }
 
     /* If 1 click was done (despite the event type), sets the last context's
      * selection controller with current one
      */
     if (mClickCount == 1)
       mLastSelCon = mCurSelCon;
   } // mouseup
-#endif
+
   return rv;
 }
 
 nsresult
 EmbedEventListener::NewURI(nsIURI **result,
                             const char *spec)
 {
   nsresult rv;
@@ -758,17 +747,16 @@ EmbedEventListener::GetIOService(nsIIOSe
   if (!mgr) return NS_ERROR_FAILURE;
 
   rv = mgr->GetServiceByContractID("@mozilla.org/network/io-service;1",
                                    NS_GET_IID(nsIIOService),
                                    (void **)ioService);
   return rv;
 }
 
-#ifdef MOZ_WIDGET_GTK2
 void
 EmbedEventListener::GeneratePixBuf()
 {
   GdkPixbuf *pixbuf = NULL;
   pixbuf = gdk_pixbuf_new_from_file(::gFavLocation, NULL);
   if (!pixbuf) {
     gtk_signal_emit(GTK_OBJECT(mOwner->mOwningWidget),
                     moz_embed_signals[ICON_CHANGED],
@@ -794,17 +782,16 @@ EmbedEventListener::GeneratePixBuf()
 
   gtk_signal_emit(GTK_OBJECT(mOwner->mOwningWidget),
                   moz_embed_signals[ICON_CHANGED],
                   pixbuf );
   //mOwner->mNeedFav = PR_FALSE;
   NS_Free(::gFavLocation);
   gFavLocation = nsnull;
 }
-#endif
 
 void
 EmbedEventListener::GetFaviconFromURI(const char* aURI)
 {
   gchar *file_name = NS_strdup(aURI);
   gchar *favicon_uri = NS_strdup(aURI);
 
   gint i = 0;
@@ -887,37 +874,35 @@ EmbedEventListener::GetFaviconFromURI(co
   rv = target_file->Exists(&isExist);
   if (NS_SUCCEEDED(rv) && !isExist) {
     rv = persist->SaveURI(uri, nsnull, nsnull, nsnull, "", target_file);
     if (NS_FAILED(rv)) {
       return;
     }
   }
   else {
-#ifdef MOZ_WIDGET_GTK2
     GeneratePixBuf();
-#endif
   }
 
 }
 
 NS_IMETHODIMP
 EmbedEventListener::OnStateChange(nsIWebProgress *aWebProgress,
                                   nsIRequest *aRequest,
                                   PRUint32 aStateFlags,
                                   nsresult aStatus)
 {
   /* if (!(aStateFlags & (STATE_STOP | STATE_IS_NETWORK | STATE_IS_DOCUMENT))){*/
-#ifdef MOZ_WIDGET_GTK2
+
   if (aStateFlags & STATE_STOP)
     /* FINISH DOWNLOADING */
     /* XXX sometimes this==0x0 and it cause crash in GeneratePixBuf, need workaround check for this */
     if (NS_SUCCEEDED(aStatus) && this)
       GeneratePixBuf();
-#endif
+
   return NS_OK;
 }
 
 NS_IMETHODIMP
 EmbedEventListener::OnProgressChange(nsIWebProgress *aWebProgress,
                                      nsIRequest *aRequest,
                                      PRInt32 aCurSelfProgress,
                                      PRInt32 aMaxSelfProgress,
--- a/embedding/browser/gtk/src/EmbedPrivate.cpp
+++ b/embedding/browser/gtk/src/EmbedPrivate.cpp
@@ -84,29 +84,25 @@
 
 // all of our local includes
 #include "EmbedPrivate.h"
 #include "EmbedWindow.h"
 #include "EmbedProgress.h"
 #include "EmbedContentListener.h"
 #include "EmbedEventListener.h"
 #include "EmbedWindowCreator.h"
-#ifdef MOZ_WIDGET_GTK2
 #include "GtkPromptService.h"
 #include "nsICookiePromptService.h"
 #include "EmbedCertificates.h"
 #include "EmbedDownloadMgr.h"
 #ifdef MOZ_GTKPASSWORD_INTERFACE
 #include "EmbedPasswordMgr.h"
 #endif
 #include "EmbedGlobalHistory.h"
 #include "EmbedFilePicker.h"
-#else
-#include "nsNativeCharsetUtils.h"
-#endif
 
 #ifdef MOZ_ACCESSIBILITY_ATK
 #include "nsIAccessibilityService.h"
 #include "nsIAccessible.h"
 #include "nsIDOMDocument.h"
 #endif
 #include "nsIDocument.h"
 #include "nsIDOMNSHTMLElement.h"
@@ -125,17 +121,16 @@
 
 //#include "nsICache.h"
 #include "nsICacheService.h"
 #include "nsICacheSession.h"
 //#include "nsICacheListener.h"
 static NS_DEFINE_CID(kCacheServiceCID,           NS_CACHESERVICE_CID);
 static nsICacheService* sCacheService;
 
-#ifdef MOZ_WIDGET_GTK2
 static EmbedCommon* sEmbedCommon = nsnull;
 
 /* static */
 EmbedCommon*
 EmbedCommon::GetInstance()
 {
   if (!sEmbedCommon)
   {
@@ -165,17 +160,16 @@ EmbedCommon::DeleteInstance()
 }
 
 nsresult
 EmbedCommon::Init(void)
 {
     mCommon = NULL;
     return NS_OK;
 }
-#endif
 
 PRUint32     EmbedPrivate::sWidgetCount = 0;
 char        *EmbedPrivate::sPath        = nsnull;
 char        *EmbedPrivate::sCompPath    = nsnull;
 nsVoidArray *EmbedPrivate::sWindowList  = nsnull;
 nsILocalFile *EmbedPrivate::sProfileDir  = nsnull;
 nsISupports  *EmbedPrivate::sProfileLock = nsnull;
 GtkWidget   *EmbedPrivate::sOffscreenWindow = 0;
@@ -261,17 +255,16 @@ GTKEmbedDirectoryProvider::GetFiles(cons
     dp2(do_QueryInterface(EmbedPrivate::sAppFileLocProvider));
 
   if (!dp2)
     return NS_ERROR_FAILURE;
 
   return dp2->GetFiles(aKey, aResult);
 }
 
-#ifdef MOZ_WIDGET_GTK2
 NS_GENERIC_FACTORY_CONSTRUCTOR(GtkPromptService)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(EmbedCertificates, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(EmbedDownloadMgr)
 #ifdef MOZ_GTKPASSWORD_INTERFACE
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(EmbedPasswordMgr, EmbedPasswordMgr::GetInstance)
 NS_GENERIC_FACTORY_CONSTRUCTOR(EmbedSignonPrompt)
 #endif
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(EmbedGlobalHistory, EmbedGlobalHistory::GetInstance)
@@ -388,22 +381,16 @@ static const nsModuleComponentInfo defau
     EMBED_FILEPICKER_CONTRACTID,
     EmbedFilePickerConstructor
   },
 };
 
 const nsModuleComponentInfo *EmbedPrivate::sAppComps = defaultAppComps;
 int   EmbedPrivate::sNumAppComps = sizeof(defaultAppComps) / sizeof(nsModuleComponentInfo);
 
-#else
-
-const nsModuleComponentInfo *EmbedPrivate::sAppComps = nsnull;
-int   EmbedPrivate::sNumAppComps = 0;
-
-#endif
 
 EmbedPrivate::EmbedPrivate(void)
 {
   mOwningWidget     = nsnull;
   mWindow           = nsnull;
   mProgress         = nsnull;
   mContentListener  = nsnull;
   mEventListener    = nsnull;
@@ -595,42 +582,39 @@ EmbedPrivate::Hide(void)
   nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(webBrowser);
   baseWindow->SetVisibility(PR_FALSE);
 }
 
 #include "nsIDOMScreen.h"
 void
 EmbedPrivate::Resize(PRUint32 aWidth, PRUint32 aHeight)
 {
-#ifdef MOZ_WIDGET_GTK2
   PRInt32 sub   = 0;
   PRInt32 diff  = 0;
 
   if (mDoResizeEmbed){
     EmbedContextMenuInfo * ctx_menu = mEventListener->GetContextInfo();
     gint x, y, width, height, depth;
     gdk_window_get_geometry(gtk_widget_get_parent_window(GTK_WIDGET(mOwningWidget)),&x,&y,&width,&height,&depth);
 
     if (ctx_menu) {
       if (height < ctx_menu->mFormRect.y + ctx_menu->mFormRect.height) {
         sub = ctx_menu->mFormRect.y - height + ctx_menu->mFormRect.height;
         diff = height - aHeight;
       }
     }
   }
-#endif
+
   mWindow->SetDimensions(nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION |
                           nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER,
                           0, 0, aWidth, aHeight);
 
-#ifdef MOZ_WIDGET_GTK2
   if (sub > 0 && diff >= 0){
     SetScrollTop(sub + diff);
   }
-#endif
 }
 
 void
 EmbedPrivate::Destroy(void)
 {
   // This flag might have been set from
   // EmbedWindow::DestroyBrowserWindow() as well if someone used a
   // window.close() or something or some other script action to close
@@ -679,25 +663,17 @@ EmbedPrivate::Destroy(void)
 
   mMozWindowWidget = 0;
   mNeedFav = PR_TRUE;
 }
 
 void
 EmbedPrivate::SetURI(const char *aURI)
 {
-#ifdef MOZ_WIDGET_GTK
-  // XXX: Even though NS_CopyNativeToUnicode is not designed for non-filenames,
-  // we know that it will do "the right thing" on UNIX.
-  NS_CopyNativeToUnicode(nsDependentCString(aURI), mURI);
-#endif
-
-#ifdef MOZ_WIDGET_GTK2
   mURI.Assign(NS_ConvertUTF8toUTF16(aURI));
-#endif
 }
 
 void
 EmbedPrivate::LoadCurrentURI(void)
 {
   if (!mURI.IsEmpty()) {
     nsCOMPtr<nsPIDOMWindow> piWin;
     GetPIDOMWindow(getter_AddRefs(piWin));
@@ -843,19 +819,17 @@ EmbedPrivate::PopStartup(void)
     if (EmbedPrivate::sAppFileLocProvider) {
       NS_RELEASE(EmbedPrivate::sAppFileLocProvider);
       EmbedPrivate::sAppFileLocProvider = nsnull;
     }
 
     // shut down XPCOM/Embedding
     XRE_TermEmbedding();
 
-#ifdef MOZ_WIDGET_GTK2
     EmbedGlobalHistory::DeleteInstance();
-#endif
   }
 }
 
 /* static */
 void EmbedPrivate::SetPath(const char *aPath)
 {
   if (sPath)
     free(sPath);
@@ -1019,23 +993,21 @@ EmbedPrivate::ContentStateChange(void)
 
   GetListener();
 
   if (!mEventReceiver)
     return;
 
   AttachListeners();
 
-#ifdef MOZ_WIDGET_GTK2
 #ifdef MOZ_GTKPASSWORD_INTERFACE
   EmbedPasswordMgr *passwordManager = EmbedPasswordMgr::GetInstance();
   if (passwordManager)
     passwordManager->mFormAttachCount = PR_FALSE;
 #endif
-#endif
 }
 
 void
 EmbedPrivate::ContentFinishedLoading(void)
 {
   if (mIsChrome) {
     // We're done loading.
     mChromeLoaded = PR_TRUE;
@@ -1058,17 +1030,16 @@ EmbedPrivate::ContentFinishedLoading(voi
     // and since we're done loading show the window, assuming that the
     // visibility flag has been set.
     PRBool visibility;
     mWindow->GetVisibility(&visibility);
     if (visibility)
       mWindow->SetVisibility(PR_TRUE);
   }
 
-#ifdef MOZ_WIDGET_GTK2
 #ifdef MOZ_GTKPASSWORD_INTERFACE
   EmbedPasswordMgr *passwordManager = EmbedPasswordMgr::GetInstance();
   if (passwordManager && passwordManager->mFormAttachCount) {
 
     GList *list_full = NULL, *users_list = NULL;
     gint retval = -1;
 
     if (gtk_moz_embed_common_get_logins(NS_ConvertUTF16toUTF8(mURI).get(), &list_full)) {
@@ -1097,122 +1068,54 @@ EmbedPrivate::ContentFinishedLoading(voi
       if (retval != -1) {
         passwordManager->InsertLogin((const gchar*)g_list_nth_data(users_list, retval));
       }
       g_list_free(users_list);
     }
     passwordManager->mFormAttachCount = PR_FALSE;
   }
 #endif
-#endif
 }
 
-#ifdef MOZ_WIDGET_GTK
-// handle focus in and focus out events
-void
-EmbedPrivate::TopLevelFocusIn(void)
-{
-  if (mIsDestroyed)
-    return;
-
-  nsCOMPtr<nsPIDOMWindow> piWin;
-  GetPIDOMWindow(getter_AddRefs(piWin));
-
-  if (!piWin)
-    return;
-
-  nsIFocusController *focusController = piWin->GetRootFocusController();
-  if (focusController)
-    focusController->SetActive(PR_TRUE);
-}
-
-void
-EmbedPrivate::TopLevelFocusOut(void)
-{
-  if (mIsDestroyed)
-    return;
-
-  nsCOMPtr<nsPIDOMWindow> piWin;
-  GetPIDOMWindow(getter_AddRefs(piWin));
-
-  if (!piWin)
-    return;
-
-  nsIFocusController *focusController = piWin->GetRootFocusController();
-  if (focusController)
-    focusController->SetActive(PR_FALSE);
-}
-#endif /* MOZ_WIDGET_GTK */
-
 void
 EmbedPrivate::ChildFocusIn(void)
 {
   if (mIsDestroyed)
     return;
 
-#ifdef MOZ_WIDGET_GTK2
   nsresult rv;
   nsCOMPtr<nsIWebBrowser> webBrowser;
   rv = mWindow->GetWebBrowser(getter_AddRefs(webBrowser));
   if (NS_FAILED(rv))
     return;
 
   nsCOMPtr<nsIWebBrowserFocus> webBrowserFocus(do_QueryInterface(webBrowser));
   if (!webBrowserFocus)
     return;
 
   webBrowserFocus->Activate();
-#endif /* MOZ_WIDGET_GTK2 */
-
-#ifdef MOZ_WIDGET_GTK
-  nsCOMPtr<nsPIDOMWindow> piWin;
-  GetPIDOMWindow(getter_AddRefs(piWin));
-
-  if (!piWin)
-    return;
-
-  piWin->Activate();
-#endif /* MOZ_WIDGET_GTK */
 }
 
 void
 EmbedPrivate::ChildFocusOut(void)
 {
   if (mIsDestroyed)
     return;
 
-#ifdef MOZ_WIDGET_GTK2
   nsresult rv;
   nsCOMPtr<nsIWebBrowser> webBrowser;
   rv = mWindow->GetWebBrowser(getter_AddRefs(webBrowser));
   if (NS_FAILED(rv))
     return;
 
   nsCOMPtr<nsIWebBrowserFocus> webBrowserFocus(do_QueryInterface(webBrowser));
   if (!webBrowserFocus)
     return;
 
   webBrowserFocus->Deactivate();
-#endif /* MOZ_WIDGET_GTK2 */
-
-#ifdef MOZ_WIDGET_GTK
-  nsCOMPtr<nsPIDOMWindow> piWin;
-  GetPIDOMWindow(getter_AddRefs(piWin));
-
-  if (!piWin)
-    return;
-
-  piWin->Deactivate();
-
-  // but the window is still active until the toplevel gets a focus
-  // out
-  nsIFocusController *focusController = piWin->GetRootFocusController();
-  if (focusController)
-    focusController->SetActive(PR_TRUE);
-#endif /* MOZ_WIDGET_GTK */
 }
 
 // Get the event listener for the chrome event handler.
 
 void
 EmbedPrivate::GetListener(void)
 {
   if (mEventReceiver)
@@ -1841,28 +1744,26 @@ EmbedPrivate::HasFrames  (PRUint32 *numb
   return rv;
 }
 
 nsresult
 EmbedPrivate::GetMIMEInfo(const char **aMime, nsIDOMNode *aDOMNode)
 {
   NS_ENSURE_ARG_POINTER(aMime);
   nsresult rv;
-#ifdef MOZ_WIDGET_GTK2
   if (aDOMNode && mEventListener) {
     EmbedContextMenuInfo * ctx = mEventListener->GetContextInfo();
     if (!ctx)
       return NS_ERROR_FAILURE;
     nsCOMPtr<imgIRequest> request;
     rv = ctx->GetImageRequest(getter_AddRefs(request), aDOMNode);
     if (request)
       rv = request->GetMimeType((char**)aMime);
     return rv;
   }
-#endif
 
   nsCOMPtr<nsIWebBrowser> webBrowser;
   rv = mWindow->GetWebBrowser(getter_AddRefs(webBrowser));
 
   nsCOMPtr<nsIDOMWindow> DOMWindow;
   rv = webBrowser->GetContentDOMWindow(getter_AddRefs(DOMWindow));
 
   nsCOMPtr<nsIDOMDocument> doc;
--- a/embedding/browser/gtk/src/EmbedPrivate.h
+++ b/embedding/browser/gtk/src/EmbedPrivate.h
@@ -138,23 +138,16 @@ class EmbedPrivate {
   void        ContentStateChange    (void);
 
   // This is an upcall from the progress listener when content is
   // finished loading.  We have this so that if it's chrome content
   // that we can size to content properly and show ourselves if
   // visibility is set.
   void        ContentFinishedLoading(void);
 
-#ifdef MOZ_WIDGET_GTK
-  // these let the widget code know when the toplevel window gets and
-  // looses focus.
-  void        TopLevelFocusIn (void);
-  void        TopLevelFocusOut(void);
-#endif
-
   // these are when the widget itself gets focus in and focus out
   // events
   void        ChildFocusIn (void);
   void        ChildFocusOut(void);
   PRBool      ClipBoardAction(GtkMozEmbedClipboard type);
   char*       GetEncoding ();
   nsresult    SetEncoding (const char *encoding);
   PRBool      FindText(const char *exp, PRBool  reverse,
--- a/embedding/browser/gtk/src/EmbedWindow.cpp
+++ b/embedding/browser/gtk/src/EmbedWindow.cpp
@@ -238,57 +238,37 @@ EmbedWindow::ExitModalEventLoop(nsresult
   return NS_OK;
 }
 
 // nsIWebBrowserChromeFocus
 
 NS_IMETHODIMP
 EmbedWindow::FocusNextElement()
 {
-#ifdef MOZ_WIDGET_GTK
-  GtkWidget* parent = GTK_WIDGET(mOwner->mOwningWidget)->parent;
-
-  if (GTK_IS_CONTAINER(parent))
-    gtk_container_focus(GTK_CONTAINER(parent),
-                        GTK_DIR_TAB_FORWARD);
-#endif
-
-#ifdef MOZ_WIDGET_GTK2
   GtkWidget *toplevel;
   toplevel = gtk_widget_get_toplevel(GTK_WIDGET(mOwner->mOwningWidget));
   if (!GTK_WIDGET_TOPLEVEL(toplevel))
     return NS_OK;
 
   g_signal_emit_by_name(G_OBJECT(toplevel), "move_focus",
       GTK_DIR_TAB_FORWARD);
-#endif
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 EmbedWindow::FocusPrevElement()
 {
-#ifdef MOZ_WIDGET_GTK
-  GtkWidget* parent = GTK_WIDGET(mOwner->mOwningWidget)->parent;
-
-  if (GTK_IS_CONTAINER(parent))
-    gtk_container_focus(GTK_CONTAINER(parent),
-                        GTK_DIR_TAB_BACKWARD);
-#endif
-
-#ifdef MOZ_WIDGET_GTK2
   GtkWidget *toplevel;
   toplevel = gtk_widget_get_toplevel(GTK_WIDGET(mOwner->mOwningWidget));
   if (!GTK_WIDGET_TOPLEVEL(toplevel))
     return NS_OK;
 
   g_signal_emit_by_name(G_OBJECT(toplevel), "move_focus",
       GTK_DIR_TAB_BACKWARD);
-#endif
 
   return NS_OK;
 }
 
 // nsIEmbeddingSiteWindow
 
 NS_IMETHODIMP
 EmbedWindow::SetDimensions(PRUint32 aFlags, PRInt32 aX, PRInt32 aY,
@@ -404,23 +384,17 @@ tooltips_paint_window(GtkWidget *window)
 }
 
 NS_IMETHODIMP
 EmbedWindow::OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords,
          const PRUnichar *aTipText)
 {
   nsAutoString tipText(aTipText);
 
-#ifdef MOZ_WIDGET_GTK
-  const char* tipString = ToNewCString(tipText);
-#endif
-
-#ifdef MOZ_WIDGET_GTK2
   const char* tipString = ToNewUTF8String(tipText);
-#endif
 
   if (sTipWindow)
     gtk_widget_destroy(sTipWindow);
 
   // get the root origin for this content window
   nsCOMPtr<nsIWidget> mainWidget;
   mBaseWindow->GetMainWidget(getter_AddRefs(mainWidget));
   GdkWindow *window;
@@ -464,20 +438,16 @@ EmbedWindow::OnShowTooltip(PRInt32 aXCoo
   gtk_container_set_border_width(GTK_CONTAINER(sTipWindow), 4);
   // set the coords for the widget
   gtk_widget_set_uposition(sTipWindow, aXCoords + root_x,
          aYCoords + root_y);
 
   // and show it.
   gtk_widget_show_all(sTipWindow);
 
-#ifdef MOZ_WIDGET_GTK
-  gtk_widget_popup(sTipWindow, aXCoords + root_x, aYCoords + root_y); */
-#endif /* MOZ_WIDGET_GTK */
-
   nsMemory::Free((void*)tipString);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 EmbedWindow::OnHideTooltip(void)
 {
--- a/embedding/browser/gtk/src/Makefile.in
+++ b/embedding/browser/gtk/src/Makefile.in
@@ -176,17 +176,17 @@ EXPORTS		= \
 ifdef MOZ_ENABLE_GTK2
 EXPORTS		+= \
 		gtkmozembed_common.h \
 		gtkmozembed_download.h \
 		$(NULL)
 endif
 
 ifdef MOZ_GTKEMBED_DYN
-ifneq (,$(filter gtk gtk2 qt xlib,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2 qt,$(MOZ_WIDGET_TOOLKIT)))
 EXTRA_DSO_LDOPTS += \
 		$(DIST)/lib/libxpcomglue_s.$(LIB_SUFFIX) \
 		$(MOZ_COMPONENT_LIBS) \
 		$(MOZ_GTK2_LIBS) \
 		$(NULL)
 
 #Any Idea what can be used instead -lxul in FF configuration?
 ifndef MOZ_ENABLE_LIBXUL
@@ -205,18 +205,18 @@ ifndef GNU_CC
 # /wherever/workshop-5.0/SC5.0/include/CC/std/time.h
 # causes most of these compiles to fail with:
 # line 29: Error: Multiple declaration for std::tm.
 # So, this gets around the problem.
 DEFINES         += -D_TIME_H=1
 endif
 endif
 
-CXXFLAGS        += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS)
-CFLAGS          += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS)
+CXXFLAGS        += $(MOZ_GTK2_CFLAGS)
+CFLAGS          += $(MOZ_GTK2_CFLAGS)
 ifdef MOZ_GNOMEVFS_CFLAGS
 CXXFLAGS        += $(MOZ_GNOMEVFS_CFLAGS)
 CFLAGS          += $(MOZ_GNOMEVFS_CFLAGS)
 endif
 DEFINES         += -D_IMPL_GTKMOZEMBED
 
 
 MARSHAL_FILE = gtkmozembedmarshal
--- a/embedding/browser/gtk/src/gtkmozembed.h
+++ b/embedding/browser/gtk/src/gtkmozembed.h
@@ -92,19 +92,17 @@ extern "C" {
 typedef struct _GtkMozHistoryItem GtkMozHistoryItem;
 struct _GtkMozHistoryItem
 {
   const gchar *title; /** < URL title */
   const gchar *url;   /** < URL */
   long accessed;      /** < The last time that the URL was accessed */
 };
 
-#ifdef MOZ_WIDGET_GTK2
 #include "gtkmozembed_common.h"
-#endif
 
 #define GTK_TYPE_MOZ_EMBED             (gtk_moz_embed_get_type())
 #define GTK_MOZ_EMBED(obj)             GTK_CHECK_CAST((obj), GTK_TYPE_MOZ_EMBED, GtkMozEmbed)
 #define GTK_MOZ_EMBED_CLASS(klass)     GTK_CHECK_CLASS_CAST((klass), GTK_TYPE_MOZ_EMBED, GtkMozEmbedClass)
 #define GTK_IS_MOZ_EMBED(obj)          GTK_CHECK_TYPE((obj), GTK_TYPE_MOZ_EMBED)
 #define GTK_IS_MOZ_EMBED_CLASS(klass)  GTK_CHECK_CLASS_TYPE((klass), GTK_TYPE_MOZ_EMBED)
 
 typedef struct _GtkMozEmbed      GtkMozEmbed;
--- a/embedding/browser/gtk/src/gtkmozembed2.cpp
+++ b/embedding/browser/gtk/src/gtkmozembed2.cpp
@@ -75,63 +75,21 @@
 #include "nsXPIDLString.h"
 #include "nsReadableUtils.h"
 #else
 #include "nsStringAPI.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 #endif
 
-#ifdef MOZ_WIDGET_GTK2
-
 #include "gtkmozembedmarshal.h"
 
 #define NEW_TOOLKIT_STRING(x) g_strdup(NS_ConvertUTF16toUTF8(x).get())
 #define GET_OBJECT_CLASS_TYPE(x) G_OBJECT_CLASS_TYPE(x)
 
-#endif /* MOZ_WIDGET_GTK2 */
-
-#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__STRING_INT_INT \
-  gtk_marshal_NONE__POINTER_INT_INT
-#define gtkmozembed_VOID__STRING_INT_UINT \
-  gtk_marshal_NONE__POINTER_INT_INT
-#define gtkmozembed_VOID__POINTER_INT_POINTER \
-  gtk_marshal_NONE__POINTER_INT_POINTER
-#define gtkmozembed_BOOL__STRING \
-  gtk_marshal_BOOL__POINTER
-#define gtkmozembed_VOID__STRING_STRING \
-  gtk_marshal_NONE__STRING_STRING
-#define gtkmozembed_VOID__STRING_STRING_STRING_POINTER \
-  gtk_marshal_NONE__STRING_STRING_STRING_POINTER
-#define gtkmozembed_BOOL__STRING_STRING \
-  gtk_marshal_BOOL__STRING_STRING
-#define gtkmozembed_BOOL__STRING_STRING_STRING_POINTER \
-  gtk_marshal_BOOL__STRING_STRING_STRING_POINTER
-#define gtkmozembed_INT__STRING_STRING_UINT_STRING_STRING_STRING_STRING_POINTER \
-  gtk_marshal_INT__STRING_STRING_UINT_STRING_STRING_STRING_STRING_POINTER
-#define gtkmozembed_BOOL__STRING_STRING_POINTER_STRING_POINTER \
-  gtk_marshal_BOOL__STRING_STRING_POINTER_STRING_POINTER
-
-#define gtkmozembed_BOOL__STRING_STRING_POINTER_INT \
-  gtk_marshal_BOOL__STRING_STRING_POINTER_INT
-#define G_SIGNAL_TYPE_STATIC_SCOPE 0
-
-#define NEW_TOOLKIT_STRING(x) g_strdup(NS_LossyConvertUTF16toASCII(x).get())
-#define GET_OBJECT_CLASS_TYPE(x) (GTK_OBJECT_CLASS(x)->type)
-
-#endif /* MOZ_WIDGET_GTK */
-
 class nsIDirectoryServiceProvider;
 
 // class and instance initialization
 
 static void
 gtk_moz_embed_class_init(GtkMozEmbedClass *klass);
 
 static void
@@ -168,30 +126,16 @@ handle_child_focus_in(GtkWidget     *aWi
                       GdkEventFocus *aGdkFocusEvent,
                       GtkMozEmbed   *aEmbed);
 
 static gint
 handle_child_focus_out(GtkWidget     *aWidget,
                        GdkEventFocus *aGdkFocusEvent,
                        GtkMozEmbed   *aEmbed);
 
-#ifdef MOZ_WIDGET_GTK
-// signal handlers for tracking the focus in and and focus out events
-// on the toplevel window.
-
-static void
-handle_toplevel_focus_in(GtkMozArea    *aArea,
-                         GtkMozEmbed   *aEmbed);
-
-static void
-handle_toplevel_focus_out(GtkMozArea    *aArea,
-                          GtkMozEmbed   *aEmbed);
-
-#endif /* MOZ_WIDGET_GTK */
-
 // globals for this type of widget
 
 static GtkBinClass *embed_parent_class;
 
 guint moz_embed_signals[EMBED_LAST_SIGNAL] = { 0 };
 
 // GtkObject + class-related functions
 
@@ -484,17 +428,16 @@ gtk_moz_embed_class_init(GtkMozEmbedClas
                    GTK_TYPE_BOOL, 1, GTK_TYPE_POINTER);
   moz_embed_signals[DOM_FOCUS_OUT] =
     gtk_signal_new("dom_focus_out",
                    GTK_RUN_LAST,
                    GET_OBJECT_CLASS_TYPE(klass),
                    GTK_SIGNAL_OFFSET(GtkMozEmbedClass, dom_focus_out),
                    gtk_marshal_BOOL__POINTER,
                    GTK_TYPE_BOOL, 1, GTK_TYPE_POINTER);
-#ifdef MOZ_WIDGET_GTK2
   moz_embed_signals[ALERT] =
     gtk_signal_new("alert",
                    GTK_RUN_FIRST,
                    GET_OBJECT_CLASS_TYPE(klass),
                    GTK_SIGNAL_OFFSET(GtkMozEmbedClass, alert),
                    gtkmozembed_VOID__STRING_STRING,
                    GTK_TYPE_NONE, 2,
                    GTK_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE,
@@ -642,36 +585,27 @@ gtk_moz_embed_class_init(GtkMozEmbedClas
                    GTK_RUN_LAST,
                    GET_OBJECT_CLASS_TYPE(klass),
                    GTK_SIGNAL_OFFSET(GtkMozEmbedClass, rss_request),
                    gtkmozembed_VOID__STRING_STRING,
                    GTK_TYPE_NONE,
                    2,
                    GTK_TYPE_STRING, GTK_TYPE_STRING);
 
-#endif
-
-#ifdef MOZ_WIDGET_GTK
-  gtk_object_class_add_signals(object_class, moz_embed_signals,
-                               EMBED_LAST_SIGNAL);
-#endif /* MOZ_WIDGET_GTK */
-
 }
 
 static void
 gtk_moz_embed_init(GtkMozEmbed *embed)
 {
   EmbedPrivate *priv = new EmbedPrivate();
   embed->data = priv;
   embed->common = NULL;
   gtk_widget_set_name(GTK_WIDGET(embed), "gtkmozembed");
 
-#ifdef MOZ_WIDGET_GTK2
   GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(embed), GTK_NO_WINDOW);
-#endif
 }
 
 GtkWidget *
 gtk_moz_embed_new(void)
 {
   return GTK_WIDGET(gtk_type_new(gtk_moz_embed_get_type()));
 }
 
@@ -761,32 +695,16 @@ gtk_moz_embed_realize(GtkWidget *widget)
                                  GTK_SIGNAL_FUNC(handle_child_focus_out),
                                  embed,
                                  GTK_OBJECT(child_widget));
   gtk_signal_connect_while_alive(GTK_OBJECT(child_widget),
                                  "focus_in_event",
                                  GTK_SIGNAL_FUNC(handle_child_focus_in),
                                  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),
-                                 "toplevel_focus_in",
-                                 GTK_SIGNAL_FUNC(handle_toplevel_focus_in),
-                                 embed,
-                                 GTK_OBJECT(mozarea));
-
-  gtk_signal_connect_while_alive(GTK_OBJECT(mozarea),
-                                 "toplevel_focus_out",
-                                 GTK_SIGNAL_FUNC(handle_toplevel_focus_out),
-                                 embed,
-                                 GTK_OBJECT(mozarea));
-#endif /* MOZ_WIDGET_GTK */
 }
 
 static void
 gtk_moz_embed_unrealize(GtkWidget *widget)
 {
   GtkMozEmbed  *embed;
   EmbedPrivate *embedPrivate;
 
@@ -903,38 +821,16 @@ handle_child_focus_out(GtkWidget     *aW
 
   embedPrivate = (EmbedPrivate *)aEmbed->data;
 
   embedPrivate->ChildFocusOut();
 
   return PR_FALSE;
 }
 
-#ifdef MOZ_WIDGET_GTK
-void
-handle_toplevel_focus_in(GtkMozArea    *aArea,
-                         GtkMozEmbed   *aEmbed)
-{
-  EmbedPrivate   *embedPrivate;
-  embedPrivate = (EmbedPrivate *)aEmbed->data;
-
-  embedPrivate->TopLevelFocusIn();
-}
-
-void
-handle_toplevel_focus_out(GtkMozArea    *aArea,
-                          GtkMozEmbed   *aEmbed)
-{
-  EmbedPrivate   *embedPrivate;
-  embedPrivate = (EmbedPrivate *)aEmbed->data;
-
-  embedPrivate->TopLevelFocusOut();
-}
-#endif /* MOZ_WIDGET_GTK */
-
 // Widget methods
 
 void
 gtk_moz_embed_push_startup(void)
 {
   EmbedPrivate::PushStartup();
 }
 
@@ -1382,21 +1278,16 @@ gtk_moz_embed_single_class_init(GtkMozEm
                    GTK_RUN_FIRST,
                    GET_OBJECT_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
 gtk_moz_embed_single_init(GtkMozEmbedSingle *embed)
 {
   // this is a placeholder for later in case we need to stash data at
   // a later data and maintain backwards compatibility.
   embed->data = nsnull;
@@ -1522,17 +1413,16 @@ gtk_moz_embed_set_encoding(GtkMozEmbed *
   return;
 }
 
 guint
 gtk_moz_embed_get_context_info(GtkMozEmbed *embed, gpointer event, gpointer *node,
                                gint *x, gint *y, gint *docindex,
                                const gchar **url, const gchar **objurl, const gchar **docurl)
 {
-#ifdef MOZ_WIDGET_GTK2
   EmbedPrivate *embedPrivate;
   g_return_val_if_fail(embed != NULL, GTK_MOZ_EMBED_CTX_NONE);
   g_return_val_if_fail(GTK_IS_MOZ_EMBED(embed), GTK_MOZ_EMBED_CTX_NONE);
   embedPrivate = (EmbedPrivate *)embed->data;
 
   if (!event) {
     nsIWebBrowser *webBrowser = nsnull;
     gtk_moz_embed_get_nsIWebBrowser(GTK_MOZ_EMBED(embed), &webBrowser);
@@ -1564,35 +1454,34 @@ gtk_moz_embed_get_context_info(GtkMozEmb
     }
     if (ctx_menu->mEmbedCtxType & GTK_MOZ_EMBED_CTX_IMAGE) {
       *objurl = ToNewUTF8String(ctx_menu->mCtxImgHref);
     }
     *docurl = ToNewUTF8String(ctx_menu->mCtxURI);
     *node = ctx_menu->mEventNode;
     return ctx_menu->mEmbedCtxType;
   }
-#endif
+
   return 0;
 }
 
 const gchar*
 gtk_moz_embed_get_selection(GtkMozEmbed *embed)
 {
   EmbedPrivate *embedPrivate;
   g_return_val_if_fail(embed != NULL, NULL);
   g_return_val_if_fail(GTK_IS_MOZ_EMBED(embed), NULL);
   embedPrivate = (EmbedPrivate *)embed->data;
-#ifdef MOZ_WIDGET_GTK2
   if (embedPrivate->mEventListener) {
     EmbedContextMenuInfo * ctx_menu = embedPrivate->mEventListener->GetContextInfo();
     if (!ctx_menu)
       return NULL;
     return ctx_menu->GetSelectedText();
   }
-#endif
+
   return NULL;
 }
 gboolean
 gtk_moz_embed_insert_text(GtkMozEmbed *embed, const gchar *string, gpointer node)
 {
   EmbedPrivate *embedPrivate;
   g_return_val_if_fail(embed != NULL, FALSE);
   g_return_val_if_fail(GTK_IS_MOZ_EMBED(embed), FALSE);
@@ -1692,18 +1581,16 @@ gtk_moz_embed_get_doc_info(GtkMozEmbed *
   g_return_val_if_fail(embed != NULL, FALSE);
   g_return_val_if_fail(GTK_IS_MOZ_EMBED(embed), FALSE);
   EmbedPrivate *embedPrivate;
   embedPrivate = (EmbedPrivate *)embed->data;
 
   if (!embedPrivate || !embedPrivate->mEventListener)
     return FALSE;
 
-#ifdef MOZ_WIDGET_GTK2
-
   if (file_type) {
     embedPrivate->GetMIMEInfo(file_type, (nsIDOMNode*)node);
   }
 
   if (width && height) {
     nsString imgSrc;
     EmbedContextMenuInfo * ctx_menu = embedPrivate->mEventListener->GetContextInfo();
     if (ctx_menu)
@@ -1719,17 +1606,16 @@ gtk_moz_embed_get_doc_info(GtkMozEmbed *
   if (file_size && location && *location != nsnull) {
     nsCOMPtr<nsICacheEntryDescriptor> descriptor;
     nsresult rv;
     rv = embedPrivate->GetCacheEntry("HTTP", *location, nsICache::ACCESS_READ, PR_FALSE, getter_AddRefs(descriptor));
     if (descriptor) {
       rv = descriptor->GetDataSize(file_size);
     }
   }
-#endif
 
   return TRUE;
 }
 
 gint
 gtk_moz_embed_get_shistory_list(GtkMozEmbed *embed, GtkMozHistoryItem **GtkHI,
                                 guint type)
 {
--- a/embedding/browser/gtk/src/gtkmozembed_common.cpp
+++ b/embedding/browser/gtk/src/gtkmozembed_common.cpp
@@ -84,45 +84,20 @@
 
 //for security
 #include "nsIWebProgressListener.h"
 
 //for cache
 #include "nsICacheService.h"
 #include "nsICache.h"
 
-#ifdef MOZ_WIDGET_GTK2
 #include "gtkmozembedmarshal.h"
 #define NEW_TOOLKIT_STRING(x) g_strdup(NS_ConvertUTF16toUTF8(x).get())
 #define GET_TOOLKIT_STRING(x) NS_ConvertUTF16toUTF8(x).get()
 #define GET_OBJECT_CLASS_TYPE(x) G_OBJECT_CLASS_TYPE(x)
-#endif /* MOZ_WIDGET_GTK2 */
-
-#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__STRING_INT_INT \
-  gtk_marshal_NONE__POINTER_INT_INT
-#define gtkmozembed_VOID__STRING_INT_UINT \
-  gtk_marshal_NONE__POINTER_INT_INT
-#define gtkmozembed_VOID__POINTER_INT_POINTER \
-  gtk_marshal_NONE__POINTER_INT_POINTER
-#define gtkmozembed_BOOL__STRING \
-  gtk_marshal_BOOL__POINTER
-#define gtkmozembed_VOID__INT_INT_BOOLEAN \
-  gtk_marshal_NONE__INT_INT_BOOLEAN
-
-#define G_SIGNAL_TYPE_STATIC_SCOPE 0
-#define NEW_TOOLKIT_STRING(x) g_strdup(NS_LossyConvertUTF16toASCII(x).get())
-#define GET_TOOLKIT_STRING(x) NS_LossyConvertUTF16toASCII(x).get()
-#define GET_OBJECT_CLASS_TYPE(x) (GTK_OBJECT_CLASS(x)->type)
-#endif /* MOZ_WIDGET_GTK */
 
 #define UNACCEPTABLE_CRASHY_GLIB_ALLOCATION(newed) PR_BEGIN_MACRO \
   /* OOPS this code is using a glib allocation function which     \
    * will cause the application to crash when it runs out of      \
    * memory. This is not cool. either g_try methods should be     \
    * used or malloc, or new (note that gecko /will/ be replacing  \
    * its operator new such that new will not throw exceptions).   \
    * XXX please fix me.                                           \
@@ -292,20 +267,16 @@ gtk_moz_embed_common_class_init(GtkMozEm
                       modal_dialog),
                    gtkmozembed_INT__STRING_STRING_INT_INT_INT_INT,
                    G_TYPE_INT,
                    6,
                    G_TYPE_STRING, G_TYPE_STRING,
                    G_TYPE_INT, G_TYPE_INT,
                    G_TYPE_INT, G_TYPE_INT);
   */
-#ifdef MOZ_WIDGET_GTK
-    gtk_object_class_add_signals(object_class, moz_embed_common_signals,
-                                 COMMON_LAST_SIGNAL);
-#endif /* MOZ_WIDGET_GTK */
 }
 
 static void
 gtk_moz_embed_common_init(GtkMozEmbedCommon *common)
 {
   // this is a placeholder for later in case we need to stash data at
   // a later data and maintain backwards compatibility.
   common->data = nsnull;
--- a/embedding/browser/gtk/src/gtkmozembed_download.cpp
+++ b/embedding/browser/gtk/src/gtkmozembed_download.cpp
@@ -52,44 +52,20 @@
 // for strings
 #ifdef MOZILLA_INTERNAL_API
 #include "nsXPIDLString.h"
 #include "nsReadableUtils.h"
 #else
 #include "nsStringAPI.h"
 #endif
 
-#ifdef MOZ_WIDGET_GTK2
 #include "gtkmozembedmarshal.h"
 #define NEW_TOOLKIT_STRING(x) g_strdup(NS_ConvertUTF16toUTF8(x).get())
 #define GET_TOOLKIT_STRING(x) NS_ConvertUTF16toUTF8(x).get()
 #define GET_OBJECT_CLASS_TYPE(x) G_OBJECT_CLASS_TYPE(x)
-#endif /* MOZ_WIDGET_GTK2 */
-
-#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__STRING_INT_INT \
-  gtk_marshal_NONE__POINTER_INT_INT
-#define gtkmozembed_VOID__STRING_INT_UINT \
-  gtk_marshal_NONE__POINTER_INT_INT
-#define gtkmozembed_VOID__POINTER_INT_POINTER \
-  gtk_marshal_NONE__POINTER_INT_POINTER
-#define gtkmozembed_BOOL__STRING \
-  gtk_marshal_BOOL__POINTER
-#define gtkmozembed_VOID__INT_INT_BOOLEAN \
-  gtk_marshal_NONE__INT_INT_BOOLEAN
-#define G_SIGNAL_TYPE_STATIC_SCOPE 0
-#define NEW_TOOLKIT_STRING(x) g_strdup(NS_LossyConvertUTF16toASCII(x).get())
-#define GET_TOOLKIT_STRING(x) NS_LossyConvertUTF16toASCII(x).get()
-#define GET_OBJECT_CLASS_TYPE(x) (GTK_OBJECT_CLASS(x)->type)
-#endif /* MOZ_WIDGET_GTK */
 
 static void gtk_moz_embed_download_set_latest_object(GtkObject *o);
 static GtkObject *latest_download_object = nsnull;
 
 // class and instance initialization
 guint moz_embed_download_signals[DOWNLOAD_LAST_SIGNAL] = { 0 };
 static void gtk_moz_embed_download_class_init(GtkMozEmbedDownloadClass *klass);
 static void gtk_moz_embed_download_init(GtkMozEmbedDownload *embed);
@@ -167,21 +143,16 @@ gtk_moz_embed_download_class_init(GtkMoz
                    GET_OBJECT_CLASS_TYPE(klass),
                    GTK_SIGNAL_OFFSET(GtkMozEmbedDownloadClass, progress),
                    gtkmozembed_VOID__ULONG_ULONG_ULONG,
                    GTK_TYPE_NONE,
                    3,
                    G_TYPE_ULONG,
                    G_TYPE_ULONG,
                    G_TYPE_ULONG);
-
-#ifdef MOZ_WIDGET_GTK
-  gtk_object_class_add_signals(object_class, moz_embed_download_signals,
-                               DOWNLOAD_LAST_SIGNAL);
-#endif /* MOZ_WIDGET_GTK */
 }
 
 static void
 gtk_moz_embed_download_init(GtkMozEmbedDownload *download)
 {
   // this is a placeholder for later in case we need to stash data at
   // a later data and maintain backwards compatibility.
   download->data = nsnull;
--- a/embedding/browser/gtk/src/gtkmozembed_glue.cpp
+++ b/embedding/browser/gtk/src/gtkmozembed_glue.cpp
@@ -38,27 +38,24 @@
  * ***** END LICENSE BLOCK ***** */
 
 // This file is an implementation file, meant to be #included in a
 // single C++ file of an embedding application. It is called after
 // XPCOMGlueStartup to glue the gtkmozembed functions.
 
 #include "gtkmozembed.h"
 #include "gtkmozembed_internal.h"
-#ifdef MOZ_WIDGET_GTK2
 #include "gtkmozembed_common.h"
 #include "gtkmozembed_download.h"
-#endif
 #include "nsXPCOMGlue.h"
 
 #ifndef XPCOM_GLUE
 #error This file only makes sense when XPCOM_GLUE is defined.
 #endif
 
-#ifdef MOZ_WIDGET_GTK2
 #define GTKMOZEMBED2_FUNCTIONS \
   GTKF(gtk_moz_embed_download_get_type) \
   GTKF(gtk_moz_embed_download_new) \
   GTKF(gtk_moz_embed_common_get_type) \
   GTKF(gtk_moz_embed_common_new) \
   GTKF(gtk_moz_embed_common_set_pref) \
   GTKF(gtk_moz_embed_common_get_pref) \
   GTKF(gtk_moz_embed_common_save_prefs) \
@@ -75,18 +72,16 @@
   GTKF(gtk_moz_embed_insert_text) \
   GTKF(gtk_moz_embed_common_nsx509_to_raw) \
   GTKF(gtk_moz_embed_common_observe) \
   GTKF(gtk_moz_embed_get_shistory_list) \
   GTKF(gtk_moz_embed_get_shistory_index) \
   GTKF(gtk_moz_embed_shistory_goto_index) \
   GTKF(gtk_moz_embed_get_server_cert) \
   GTKF(gtk_moz_embed_get_nsIWebBrowser)
-#else
-#define GTKMOZEMBED2_FUNCTIONS
 #endif
 
 #define GTKMOZEMBED_FUNCTIONS \
   GTKF(gtk_moz_embed_get_type) \
   GTKF(gtk_moz_embed_new) \
   GTKF(gtk_moz_embed_push_startup) \
   GTKF(gtk_moz_embed_pop_startup) \
   GTKF(gtk_moz_embed_set_path) \
--- a/embedding/browser/gtk/tests/Makefile.in
+++ b/embedding/browser/gtk/tests/Makefile.in
@@ -57,38 +57,32 @@ CPPSRCS         = \
 SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=)
 
 # ENABLE_GNOME=1
 
 ifdef ENABLE_GNOME
 CPPSRCS	       += TestGtkEmbedMDI.cpp
 endif
 
-ifdef MOZ_ENABLE_GTK
-LIBS		+= \
-		-lgtksuperwin \
-		$(NULL)
-endif
-
 ifdef MOZ_ENABLE_GTK2
 LIBS		+= \
 		$(XLDFLAGS) \
 		$(XLIBS) \
 		$(NULL)
 endif
 
 include $(topsrcdir)/config/config.mk
 
 include $(topsrcdir)/config/rules.mk
 
 LIBS += $(XPCOM_STANDALONE_GLUE_LDOPTS)
 
 DEFINES += -DXPCOM_GLUE
 
-CXXFLAGS	+= $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS)
+CXXFLAGS	+= $(MOZ_GTK2_CFLAGS)
 
 ifdef ENABLE_GNOME
 CXXFLAGS	+= `gnome-config --cflags gnomeui`
 EXTRA_LIBS	+= `gnome-config --libs gnomeui`
 endif
 
 EXTRA_LIBS	+= \
 		$(TK_LIBS) \
--- a/embedding/browser/gtk/tests/TestGtkEmbed.cpp
+++ b/embedding/browser/gtk/tests/TestGtkEmbed.cpp
@@ -349,28 +349,21 @@ new_gtk_browser(guint32 chromeMask)
   browser->toolbarHBox = gtk_hbox_new(FALSE, 0);
   // add that hbox to the vbox
   gtk_box_pack_start(GTK_BOX(browser->topLevelVBox), 
 		     browser->toolbarHBox,
 		     FALSE, // expand
 		     FALSE, // fill
 		     0);    // padding
   // new horiz toolbar with buttons + icons
-#ifdef MOZ_WIDGET_GTK
-  browser->toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL,
-				     GTK_TOOLBAR_BOTH);
-#endif /* MOZ_WIDGET_GTK */
-
-#ifdef MOZ_WIDGET_GTK2
   browser->toolbar = gtk_toolbar_new();
   gtk_toolbar_set_orientation(GTK_TOOLBAR(browser->toolbar),
 			      GTK_ORIENTATION_HORIZONTAL);
   gtk_toolbar_set_style(GTK_TOOLBAR(browser->toolbar),
 			GTK_TOOLBAR_BOTH);
-#endif /* MOZ_WIDGET_GTK2 */
 
   // add it to the hbox
   gtk_box_pack_start(GTK_BOX(browser->toolbarHBox), browser->toolbar,
 		   FALSE, // expand
 		   FALSE, // fill
 		   0);    // padding
   // new back button
   browser->backButton =
--- a/embedding/components/build/Makefile.in
+++ b/embedding/components/build/Makefile.in
@@ -117,17 +117,17 @@ ifdef MOZ_PROFILESHARING
 SHARED_LIBRARY_LIBS += $(DIST)/lib/$(LIB_PREFIX)profilesharingsetup_s.$(LIB_SUFFIX)
 LOCAL_INCLUDES += -I$(srcdir)/../profilesharingsetup/src
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
 LOCAL_INCLUDES += -I$(srcdir)/../printingui/src/os2 
 endif
 
-ifneq (,$(filter gtk gtk2 xlib beos photon qt, $(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2 beos photon qt, $(MOZ_WIDGET_TOOLKIT)))
 LOCAL_INCLUDES += -I$(srcdir)/../printingui/src/unixshared 
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 LOCAL_INCLUDES += -I$(srcdir)/../printingui/src/win 
 ifneq ($(OS_ARCH), WINCE)
 OS_LIBS	+= $(call EXPAND_LIBNAME,winspool comdlg32)
 endif
--- a/embedding/components/printingui/src/Makefile.in
+++ b/embedding/components/printingui/src/Makefile.in
@@ -37,17 +37,17 @@
 
 DEPTH		= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-ifneq (,$(filter gtk gtk2 xlib photon qt beos,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2 photon qt beos,$(MOZ_WIDGET_TOOLKIT)))
 PLATFORM_DIR += unixshared
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
 PLATFORM_DIR = os2
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
--- a/gfx/src/Makefile.in
+++ b/gfx/src/Makefile.in
@@ -70,39 +70,33 @@ endif
 ifdef MOZ_ENABLE_POSTSCRIPT
 DIRS        += psshared
 ifndef MOZ_ENABLE_CAIRO_GFX
 DIRS        += ps
 endif
 endif
 
 # Build xlibrgb only for X toolkits and/or Xprint
-ifneq (,$(filter xlib,$(MOZ_WIDGET_TOOLKIT))$(MOZ_ENABLE_XLIB)$(MOZ_ENABLE_XPRINT))
+ifneq (,$(MOZ_ENABLE_XPRINT))
 DIRS        += xlibrgb
 endif
 
 ifdef MOZ_ENABLE_XPRINT
 DIRS        += xprintutil xprint 
 endif
 
 ifdef MOZ_ENABLE_CAIRO_GFX
 DIRS        += thebes
 else
- ifdef MOZ_ENABLE_GTK
- DIRS        += gtk
- endif
  ifdef MOZ_ENABLE_GTK2
  DIRS        += gtk
  endif
  ifdef MOZ_ENABLE_QT
  DIRS        += qt
  endif
- ifdef MOZ_ENABLE_XLIB
- DIRS        += xlib
- endif
  ifdef MOZ_ENABLE_PHOTON
  DIRS        += photon
  endif
  ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
  DIRS	     += mac
  endif
  ifneq (,$(filter windows beos os2 mac,$(MOZ_WIDGET_TOOLKIT)))
  DIRS        += $(MOZ_WIDGET_TOOLKIT)
@@ -121,17 +115,17 @@ CPPSRCS = \
         nsTransform2D.cpp \
         nsScriptableRegion.cpp \
         $(NULL)
 
 ifeq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT)))
 REQUIRES += uconv
 endif
 
-ifneq (,$(filter gtk gtk2 xlib beos windows os2,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2 beos windows os2,$(MOZ_WIDGET_TOOLKIT)))
 CPPSRCS += imgScaler.cpp
 endif
 
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 CPPSRCS += \
         mac/nsRegionPool.cpp \
         $(NULL)
 endif
--- a/gfx/src/gtk/Makefile.in
+++ b/gfx/src/gtk/Makefile.in
@@ -113,22 +113,16 @@ CPPSRCS		+= \
 endif
 
 ifdef MOZ_ENABLE_PANGO
 CPPSRCS		+= \
 		nsFontMetricsPango.cpp \
 		mozilla-decoder.cpp
 endif
 
-ifdef MOZ_ENABLE_GTK
-CPPSRCS 	+= \
-		nsRegionGTK.cpp \
-		$(NULL)
-endif
-
 ifdef MOZ_ENABLE_GTK2
 CPPSRCS		+= \
 		nsRegionGTK2.cpp \
 		$(NULL)
 endif
 
 GARBAGE         += $(X11SHARED_LCPPSRCS) $(XPU_LCSRCS) $(wildcard *.$(OBJ_SUFFIX))
 
@@ -140,34 +134,22 @@ endif
 EXTRA_DSO_LDOPTS = ../shared/$(LIB_PREFIX)gfxshared_s.$(LIB_SUFFIX)
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef MOZ_ENABLE_XINERAMA
 GFX_XINERAMA_LIBS += $(MOZ_XINERAMA_LIBS)
 endif
 
-ifdef MOZ_ENABLE_GTK
-EXTRA_DSO_LDOPTS += \
-		$(LIBS_DIR) \
-		-lgkgfx \
-		$(GFX_XINERAMA_LIBS) \
-		-lgtksuperwin \
-		$(MOZ_COMPONENT_LIBS) \
-		$(MOZ_JS_LIBS) \
-		$(MOZ_UNICHARUTIL_LIBS) \
-		$(NULL)
-endif
-
 ifdef MOZ_ENABLE_XFT
 EXTRA_DSO_LDOPTS += $(FT2_LIBS)
 
 libs:: fontEncoding.properties pangoFontEncoding.properties
 	$(INSTALL) $^ $(DIST)/bin/res/fonts
- 
+
 install:: fontEncoding.properties pangoFontEncoding.properties
 	$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/res/fonts
 endif
 
 ifdef MOZ_ENABLE_GTK2
 EXTRA_DSO_LDOPTS += \
 		$(LIBS_DIR) \
 		-lgkgfx \
@@ -177,19 +159,19 @@ EXTRA_DSO_LDOPTS += \
 		$(MOZ_COMPONENT_LIBS) \
 		$(NULL)
 endif
 
 ifdef MOZ_ENABLE_PANGO
 EXTRA_DSO_LDOPTS += $(MOZ_PANGO_LIBS)
 endif
 
-EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(MOZ_GTK_LDFLAGS) $(MOZ_XFT_LIBS) $(MOZ_GTK2_LIBS)
-CXXFLAGS	+= $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS)
-CFLAGS		+= $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS)
+EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(MOZ_XFT_LIBS) $(MOZ_GTK2_LIBS)
+CXXFLAGS	+= $(MOZ_GTK2_CFLAGS)
+CFLAGS		+= $(MOZ_GTK2_CFLAGS)
 
 ifeq ($(OS_ARCH), SunOS)
 ifndef GNU_CC
 # When using Sun's WorkShop compiler, including
 # /wherever/workshop-5.0/SC5.0/include/CC/std/time.h
 # causes most of these compiles to fail with:
 # line 29: Error: Multiple declaration for std::tm.
 # So, this gets around the problem.
--- a/gfx/src/gtk/nsDeviceContextGTK.cpp
+++ b/gfx/src/gtk/nsDeviceContextGTK.cpp
@@ -56,20 +56,16 @@
 #include "nsIDeviceContextXPrint.h"
 #endif /* USE_XPRINT */
 
 #include "nsFontMetricsUtils.h"
 
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
 
-#ifdef MOZ_WIDGET_GTK
-#include "gdksuperwin.h"
-#endif /* MOZ_WIDGET_GTK */
-
 #ifdef MOZ_WIDGET_GTK2
 #include <pango/pango.h>
 #include <pango/pangox.h>
 #include <pango/pango-fontmap.h>
 #endif
 
 #ifdef MOZ_ENABLE_XFT
 #include "nsFontMetricsUtils.h"
@@ -83,21 +79,16 @@ static PRInt32 GetXftDPI(void);
 
 #include "nsIDeviceContextSpec.h"
 
 static PRInt32 GetOSDPI(void);
 
 #define GDK_DEFAULT_FONT1 "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1"
 #define GDK_DEFAULT_FONT2 "-*-fixed-medium-r-*-*-*-120-*-*-*-*-*-*"
 
-#ifdef MOZ_WIDGET_GTK
-// this is specific to gtk 1.2
-extern NS_IMPORT_(GdkFont *) default_font;
-#endif /* MOZ_WIDGET_GTK */
-
 /**
  * A singleton instance of nsSystemFontsGTK is created by the first
  * device context and destroyed by the module destructor.
  */
 class nsSystemFontsGTK {
 
   public:
     nsSystemFontsGTK(float aPixelsToTwips);
@@ -175,35 +166,16 @@ NS_IMETHODIMP nsDeviceContextGTK::Init(n
   // XXXRight now this will only get the primary monitor.
 
   if (!mScreenManager)
     mScreenManager = do_GetService("@mozilla.org/gfx/screenmanager;1");
   if (!mScreenManager) {
     return NS_ERROR_FAILURE;
   }
 
-#ifdef MOZ_WIDGET_GTK
-
-  if (aNativeWidget) {
-    // superwin?
-    if (GDK_IS_SUPERWIN(aNativeWidget)) {
-      mDeviceWindow = GDK_SUPERWIN(aNativeWidget)->shell_window;
-    }
-    // gtk widget?
-    else if (GTK_IS_WIDGET(aNativeWidget)) {
-      mDeviceWindow = GTK_WIDGET(aNativeWidget)->window;
-    }
-    // must be a bin_window
-    else {
-      mDeviceWindow = NS_STATIC_CAST(GdkWindow *, aNativeWidget);
-    }
-  }
-
-#endif /* MOZ_WIDGET_GTK */
-
 #ifdef MOZ_WIDGET_GTK2
 
   if (aNativeWidget) {
     // can only be a gdk window
     if (GDK_IS_WINDOW(aNativeWidget))
       mDeviceWindow = GDK_WINDOW(aNativeWidget);
     else 
       NS_WARNING("unsupported native widget type!");
@@ -752,17 +724,17 @@ ListFontProps(XFontStruct *aFont, Displa
     ::XFree(atomName);
     if (cardName)
       ::XFree(cardName);
   }
   printf("\n\n");
 }
 #endif
 
-#if defined(MOZ_ENABLE_COREXFONTS) || defined(MOZ_WIDGET_GTK)
+#if defined(MOZ_ENABLE_COREXFONTS)
 
 #define LOCATE_MINUS(pos, str)  { \
    pos = str.FindChar('-'); \
    if (pos < 0) \
      return ; \
   }
 #define NEXT_MINUS(pos, str) { \
    pos = str.FindChar('-', pos+1); \
@@ -793,144 +765,17 @@ AppendFontFFREName(nsString& aString, co
     NEXT_MINUS(pos2, nameStr);
   }
 
   // remove everything in between
   nameStr.Cut(pos1, pos2-pos1);
 
   aString.AppendWithConversion(nameStr.get());
 }
-#endif /* MOZ_ENABLE_COREXFONTS || MOZ_WIDGET_GTK*/
-
-#ifdef MOZ_WIDGET_GTK
-static void
-AppendFontName(XFontStruct* aFontStruct, nsString& aString, Display *aDisplay)
-{
-  unsigned long pr = 0;
-  // we first append the FFRE name to reconstruct font more faithfully
-  unsigned long font_atom = gdk_atom_intern("FONT", FALSE);
-  if (::XGetFontProperty(aFontStruct, font_atom, &pr) && pr) {
-    char* xlfdName = ::XGetAtomName(aDisplay, pr);
-    AppendFontFFREName(aString, xlfdName);
-    ::XFree(xlfdName);
-  }
- 
-  aString.Append(PRUnichar(','));
-
-  // next, we need to append family name to cover more encodings.
-  if ((::XGetFontProperty(aFontStruct, XA_FAMILY_NAME, &pr) ||
-       ::XGetFontProperty(aFontStruct, XA_FULL_NAME, &pr)) &&
-      pr) {
-    char *fontName = ::XGetAtomName(aDisplay, pr);
-    aString.AppendWithConversion(fontName);
-    ::XFree(fontName);
-  }
-}
-
-static PRUint16
-GetFontWeight(XFontStruct* aFontStruct, Display *aDisplay)
-{
-  PRUint16 weight = NS_FONT_WEIGHT_NORMAL;
-
-  // WEIGHT_NAME seems more reliable than WEIGHT, where 10 can mean
-  // anything.  Check both, and make it bold if either says so.
-  unsigned long pr = 0;
-  Atom weightName = ::XInternAtom(aDisplay, "WEIGHT_NAME", True);
-  if (weightName != None) {
-    if (::XGetFontProperty(aFontStruct, weightName, &pr) && pr) {
-      char *weightString = ::XGetAtomName(aDisplay, pr);
-      if (nsCRT::strcasecmp(weightString, "bold") == 0)
-        weight = NS_FONT_WEIGHT_BOLD;
-      ::XFree(weightString);
-    }
-  }
-
-  pr = 0;
-  if (::XGetFontProperty(aFontStruct, XA_WEIGHT, &pr) && pr > 10 )
-    weight = NS_FONT_WEIGHT_BOLD;
-
-  return weight;
-}
-
-static nscoord
-GetFontSize(XFontStruct *aFontStruct, float aPixelsToTwips)
-{
-  unsigned long pr = 0;
-  Atom pixelSizeAtom = ::XInternAtom(GDK_DISPLAY(), "PIXEL_SIZE", 0);
-  if (!::XGetFontProperty(aFontStruct, pixelSizeAtom, &pr) || !pr)
-    return DEFAULT_TWIP_FONT_SIZE;
-  return NSIntPixelsToTwips(pr, aPixelsToTwips);
-}
-
-nsresult
-nsSystemFontsGTK::GetSystemFontInfo(GtkWidget *aWidget, nsFont* aFont,
-                                    float aPixelsToTwips) const
-{
-  GtkStyle *style = gtk_widget_get_style(aWidget);
-
-  GdkFont *theFont = style->font;
-
-  aFont->style       = NS_FONT_STYLE_NORMAL;
-  aFont->weight      = NS_FONT_WEIGHT_NORMAL;
-  aFont->decorations = NS_FONT_DECORATION_NONE;
-  
-  // do we have the default_font defined by GTK/GDK then
-  // we use it, if not then we load helvetica, if not then
-  // we load fixed font else we error out.
-  if (!theFont)
-    theFont = default_font; // GTK default font
-
-  if (!theFont)
-    theFont = ::gdk_font_load( GDK_DEFAULT_FONT1 );
-  
-  if (!theFont)
-    theFont = ::gdk_font_load( GDK_DEFAULT_FONT2 );
-  
-  if (!theFont)
-    return NS_ERROR_FAILURE;
-
-  Display *fontDisplay = GDK_FONT_XDISPLAY(theFont);
-  if (theFont->type == GDK_FONT_FONT) {
-    XFontStruct *fontStruct =
-        NS_STATIC_CAST(XFontStruct*, GDK_FONT_XFONT(theFont));
-
-    aFont->name.Truncate();
-    AppendFontName(fontStruct, aFont->name, fontDisplay);
-    aFont->weight = GetFontWeight(fontStruct, fontDisplay);
-    aFont->size = GetFontSize(fontStruct, aPixelsToTwips);
-  } else {
-    NS_ASSERTION(theFont->type == GDK_FONT_FONTSET,
-                 "theFont->type can only have two values");
-
-    XFontSet fontSet = NS_REINTERPRET_CAST(XFontSet, GDK_FONT_XFONT(theFont));
-    XFontStruct **fontStructs;
-    char **fontNames;
-    int numFonts = ::XFontsOfFontSet(fontSet, &fontStructs, &fontNames);
-    if (numFonts == 0)
-      return NS_ERROR_FAILURE;
-
-    // Use the weight and size from the first font, but append all
-    // the names.
-    aFont->weight = GetFontWeight(*fontStructs, fontDisplay);
-    aFont->size = GetFontSize(*fontStructs, aPixelsToTwips);
-    nsString& fontName = aFont->name;
-    fontName.Truncate();
-    for (;;) {
-      // we need to append FFRE name instead of family name in this case
-      AppendFontFFREName(fontName, *fontNames);
-      ++fontNames;
-      --numFonts;
-      if (numFonts == 0)
-        break;
-      fontName.Append(PRUnichar(','));
-    }
-  }
-  return NS_OK;
-}
-#endif /* MOZ_WIDGET_GTK */
+#endif /* MOZ_ENABLE_COREXFONTS */
 
 #ifdef MOZ_WIDGET_GTK2
 
 #ifdef MOZ_ENABLE_COREXFONTS
 static void xlfd_from_pango_font_description(GtkWidget *aWidget,
                                              const PangoFontDescription *aFontDesc,
                                              nsString& aFontName);
 #endif /* MOZ_ENABLE_COREXFONTS */
@@ -985,37 +830,16 @@ nsSystemFontsGTK::GetSystemFontInfo(GtkW
   aFont->size = NSFloatPointsToTwips(size);
   
   pango_font_description_free(desc);
 
   return NS_OK;
 }
 #endif /* MOZ_WIDGET_GTK2 */
 
-#ifdef MOZ_WIDGET_GTK
-/* static */
-PRInt32
-GetOSDPI(void)
-{
-
-#ifdef MOZ_ENABLE_XFT
-  // try to get it from xft
-  if (NS_IsXftEnabled()) {
-    PRInt32 xftdpi = GetXftDPI();
-    if (xftdpi)
-      return xftdpi;
-  }
-#endif /* MOZ_ENABLE_XFT */
-
-  // Set OSVal to what the operating system thinks the logical resolution is.
-  float screenWidthIn = float(::gdk_screen_width_mm()) / 25.4f;
-  return NSToCoordRound(float(::gdk_screen_width()) / screenWidthIn);
-}
-#endif /* MOZ_WIDGET_GTK */
-
 #ifdef MOZ_WIDGET_GTK2
 /* static */
 PRInt32
 GetOSDPI(void)
 {
   GtkSettings *settings = gtk_settings_get_default();
 
   // first try to get the gtk2 dpi
--- a/gfx/src/gtk/nsDrawingSurfaceGTK.cpp
+++ b/gfx/src/gtk/nsDrawingSurfaceGTK.cpp
@@ -267,21 +267,16 @@ NS_IMETHODIMP nsDrawingSurfaceGTK :: Get
 nsresult nsDrawingSurfaceGTK :: Init(GdkDrawable *aDrawable, GdkGC *aGC)
 {
   if (mGC)
     gdk_gc_unref(mGC);
 
   mGC = gdk_gc_ref(aGC);
   mPixmap = aDrawable;
 
-#ifdef MOZ_WIDGET_GTK
-  mWidth  = ((GdkWindowPrivate*)aDrawable)->width;
-  mHeight = ((GdkWindowPrivate*)aDrawable)->height;
-#endif /* MOZ_WIDGET_GTK */
-
 #ifdef MOZ_WIDGET_GTK2
   gint width = 0;
   gint height = 0;
   gdk_drawable_get_size(aDrawable, &width, &height);
   mWidth = width;
   mHeight = height;
 #endif /* MOZ_WIDGET_GTK2 */
 
--- a/gfx/src/gtk/nsFontMetricsXft.cpp
+++ b/gfx/src/gtk/nsFontMetricsXft.cpp
@@ -1527,21 +1527,16 @@ nsFontMetricsXft::PrepareToDraw(nsRender
 
     // avoid setting the clip, if possible
     if (!lastRegion || !clipRegion || !lastRegion->IsEqual(*clipRegion)) {
         aSurface->SetLastXftClip(clipRegion);
 
         GdkRegion *rgn = nsnull;
         clipRegion->GetNativeRegion((void *&)rgn);
 
-#ifdef MOZ_WIDGET_GTK
-        GdkRegionPrivate  *priv = (GdkRegionPrivate *)rgn;
-        XftDrawSetClip(*aDraw, priv->xregion);
-#endif
-
 #ifdef MOZ_WIDGET_GTK2
         GdkRegionSetXftClip(rgn, *aDraw);
 #endif
     }
 }
 
 nsresult
 nsFontMetricsXft::DrawStringCallback(const FcChar32 *aString, PRUint32 aLen,
--- a/gfx/src/gtk/nsGCCache.cpp
+++ b/gfx/src/gtk/nsGCCache.cpp
@@ -130,28 +130,16 @@ nsGCCache::ReportStats() {
               int total = hits + GCCacheStats.misses;
               float percent = float(float(hits) / float(total));
               percent *= 100;
               fprintf(stderr, "\n\thits: %d, misses: %d, hit percent: %f%%\n", 
                       hits, GCCacheStats.misses, percent);
               );
 }
 
-#ifdef MOZ_WIDGET_GTK
-
-GdkRegion *
-nsGCCache::gdk_region_copy(GdkRegion *region)
-{
-  if (!copyRegion) copyRegion = gdk_region_new();
-
-  return gdk_regions_union(region, copyRegion);
-}
-
-#endif
-
 /* Dispose of entries matching the given flags, compressing the GC cache */
 void nsGCCache::Flush(unsigned long flags)
 {
   while (!PR_CLIST_IS_EMPTY(&GCCache)) {
     PRCList *head = PR_LIST_HEAD(&GCCache);
     if (head == &GCCache)
       break;
     GCCacheEntry *entry = (GCCacheEntry *)head;
@@ -208,22 +196,17 @@ GdkGC *nsGCCache::GetGC(GdkWindow *windo
   if (!entry->gc) {
     // No old GC, greate new
     entry->gc = gdk_gc_new_with_values(window, gcv, flags);
     entry->flags = flags;
     entry->gcv = *gcv;
     entry->clipRegion = NULL;
     //printf("creating new gc=%X\n",entry->gc); 
   }
-#ifdef MOZ_WIDGET_GTK
-  else if ( ((GdkGCPrivate*)entry->gc)->ref_count > 1 ) {
-#endif /* MOZ_WIDGET_GTK */
-#ifdef MOZ_WIDGET_GTK2
   else if ( G_OBJECT(entry->gc)->ref_count > 1 ) {
-#endif /* MOZ_WIDGET_GTK2 */
     // Old GC still in use, create new
     gdk_gc_unref(entry->gc);
     entry->gc=gdk_gc_new_with_values(window, gcv, flags);
     entry->flags = flags;
     entry->gcv = *gcv;
     entry->clipRegion = NULL;
     //printf("creating new (use)gc=%X\n",entry->gc); 
   }
@@ -236,18 +219,16 @@ GdkGC *nsGCCache::GetGC(GdkWindow *windo
     if (entry->clipRegion)
       gdk_gc_set_clip_region(entry->gc, entry->clipRegion);
     /* XXX what if it fails? */
   }
   
   return gdk_gc_ref(entry->gc);
 }
 
-#ifdef MOZ_WIDGET_GTK2
-
 void nsGCCache::ReuseGC(GCCacheEntry *entry, GdkGCValues *gcv, GdkGCValuesMask flags)
 {
   // We have old GC, reuse it and check what
   // we have to change
 
   GdkGCValues xvalues;
   int xvalues_mask = 0;
 
@@ -282,113 +263,8 @@ void nsGCCache::ReuseGC(GCCacheEntry *en
 
   if (xvalues_mask != 0) {
     gdk_gc_set_values(entry->gc, &xvalues, (GdkGCValuesMask)xvalues_mask);
   }
 
   entry->flags = flags;
   entry->gcv = *gcv;
 }
-
-#else /* MOZ_WIDGET_GTK and friends */
-
-void nsGCCache::ReuseGC(GCCacheEntry *entry, GdkGCValues *gcv, GdkGCValuesMask flags)
-{
-  // We have old GC, reuse it and check what
-  // we have to change
-
-  XGCValues xvalues;
-  unsigned long xvalues_mask=0;
-
-  if (entry->clipRegion) {
-    // set it to none here and then set the clip region with
-    // gdk_gc_set_clip_region in GetGC()
-    xvalues.clip_mask = None;
-    xvalues_mask |= GCClipMask;
-    gdk_region_destroy(entry->clipRegion);
-    entry->clipRegion = NULL;
-  }
-
-  if (entry->gcv.foreground.pixel != gcv->foreground.pixel) {
-    xvalues.foreground = gcv->foreground.pixel;
-    xvalues_mask |= GCForeground;
-  }
-
-  if (entry->gcv.function != gcv->function) {
-    switch (gcv->function) {
-    case GDK_COPY:
-      xvalues.function = GXcopy;
-      break;
-    case GDK_INVERT:
-      xvalues.function = GXinvert;
-      break;
-    case GDK_XOR:
-      xvalues.function = GXxor;
-      break;
-    case GDK_CLEAR:
-      xvalues.function = GXclear;
-      break;
-    case GDK_AND:
-      xvalues.function = GXand;
-      break;
-    case GDK_AND_REVERSE:
-      xvalues.function = GXandReverse;
-      break;
-    case GDK_AND_INVERT:
-      xvalues.function = GXandInverted;
-      break;
-    case GDK_NOOP:
-      xvalues.function = GXnoop;
-      break;
-    case GDK_OR:
-      xvalues.function = GXor;
-      break;
-    case GDK_EQUIV:
-      xvalues.function = GXequiv;
-      break;
-    case GDK_OR_REVERSE:
-      xvalues.function = GXorReverse;
-      break;
-    case GDK_COPY_INVERT:
-      xvalues.function = GXcopyInverted;
-      break;
-    case GDK_OR_INVERT:
-      xvalues.function = GXorInverted;
-      break;
-    case GDK_NAND:
-      xvalues.function = GXnand;
-      break;
-    case GDK_SET:
-      xvalues.function = GXset;
-      break;
-    }
-    xvalues_mask |= GCFunction;
-  }
-
-  if(entry->gcv.font != gcv->font && flags & GDK_GC_FONT) {
-    xvalues.font =  ((XFontStruct *)GDK_FONT_XFONT(gcv->font))->fid;
-    xvalues_mask |= GCFont;
-  }
-
-  if (entry->gcv.line_style != gcv->line_style) {
-    switch (gcv->line_style) {
-    case GDK_LINE_SOLID:
-      xvalues.line_style = LineSolid;
-      break;
-    case GDK_LINE_ON_OFF_DASH:
-      xvalues.line_style = LineOnOffDash;
-      break;
-    case GDK_LINE_DOUBLE_DASH:
-      xvalues.line_style = LineDoubleDash;
-      break;
-    }
-    xvalues_mask |= GCLineStyle;
-  }
-
-  if (xvalues_mask != 0) {
-    XChangeGC(GDK_GC_XDISPLAY(entry->gc), GDK_GC_XGC(entry->gc),
-              xvalues_mask, &xvalues);
-  }
-  entry->flags = flags;
-  entry->gcv = *gcv;
-}
-
-#endif /* MOZ_WIDGET_GTK */
--- a/gfx/src/gtk/nsGCCache.h
+++ b/gfx/src/gtk/nsGCCache.h
@@ -76,19 +76,16 @@ class nsGCCache
   GdkGC *GetGC(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMask flags, GdkRegion *clipRegion);
   
 private:
   void ReuseGC(GCCacheEntry *entry, GdkGCValues *gcv, GdkGCValuesMask flags);
   PRCList GCCache;
   PRCList GCFreeList;
   void free_cache_entry(PRCList *clist);
   void move_cache_entry(PRCList *clist);
-#ifdef MOZ_WIDGET_GTK
-  static GdkRegion * gdk_region_copy(GdkRegion *region);
-#endif
   static GdkRegion *copyRegion;
   void ReportStats();
 
   DEBUG_METER(
               struct {
                 int hits[GC_CACHE_SIZE];
                 int misses;
                 int reclaim;
--- a/gfx/src/gtk/nsGdkUtils.cpp
+++ b/gfx/src/gtk/nsGdkUtils.cpp
@@ -44,89 +44,48 @@ void
 my_gdk_draw_text(GdkDrawable *drawable,
                  GdkFont     *font,
                  GdkGC       *gc,
                  gint         x,
                  gint         y,
                  const gchar *text,
                  gint         text_length)
 {
-#ifdef MOZ_WIDGET_GTK
-  GdkWindowPrivate *drawable_private;
-  GdkFontPrivate *font_private;
-  GdkGCPrivate *gc_private;
-#endif /* MOZ_WIDGET_GTK */
-
   g_return_if_fail (drawable != NULL);
   g_return_if_fail (font != NULL);
   g_return_if_fail (gc != NULL);
   g_return_if_fail (text != NULL);
 
-#ifdef MOZ_WIDGET_GTK
-  drawable_private = (GdkWindowPrivate*) drawable;
-  if (drawable_private->destroyed)
-    return;
-
-  gc_private = (GdkGCPrivate*) gc;
-  font_private = (GdkFontPrivate*) font;
-#endif /* MOZ_WIDGET_GTK */
-#ifdef MOZ_WIDGET_GTK2
   if (GDK_IS_WINDOW(drawable) && GDK_WINDOW_OBJECT(drawable)->destroyed)
     return;
-#endif /* MOZ_WIDGET_GTK2 */
 
   if (font->type == GDK_FONT_FONT)
   {
-#ifdef MOZ_WIDGET_GTK
-    XFontStruct *xfont = (XFontStruct *) font_private->xfont;
-#endif /* MOZ_WIDGET_GTK */
-#ifdef MOZ_WIDGET_GTK2
     XFontStruct *xfont = (XFontStruct *) GDK_FONT_XFONT(font);
-#endif /* MOZ_WIDGET_GTK2 */
 
     // gdk does this... we don't need it..
     //    XSetFont(drawable_private->xdisplay, gc_private->xgc, xfont->fid);
 
     // We clamp the sizes down to 32768 which is the maximum width of
     // a window.  Even if a font was 1 pixel high and started at the
     // left, the maximum size of a draw request could only be 32k.
 
     if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
     {
-#ifdef MOZ_WIDGET_GTK
-      XDrawString (drawable_private->xdisplay, drawable_private->xwindow,
-                   gc_private->xgc, x, y, text, MIN(text_length, 32768));
-#endif /* MOZ_WIDGET_GTK */
-#ifdef MOZ_WIDGET_GTK2
       XDrawString (GDK_WINDOW_XDISPLAY(drawable), GDK_DRAWABLE_XID(drawable),
                    GDK_GC_XGC(gc), x, y, text, MIN(text_length, 32768));
-#endif /* MOZ_WIDGET_GTK2 */
     }
     else
     {
-#ifdef MOZ_WIDGET_GTK
-      XDrawString16 (drawable_private->xdisplay, drawable_private->xwindow,
-                     gc_private->xgc, x, y, (XChar2b *) text, 
-                     MIN((text_length / 2), 32768));
-#endif /* MOZ_WIDGET_GTK */
-#ifdef MOZ_WIDGET_GTK2
       XDrawString16 (GDK_WINDOW_XDISPLAY(drawable), GDK_DRAWABLE_XID(drawable),
                      GDK_GC_XGC(gc), x, y, (XChar2b *) text, 
                      MIN((text_length / 2), 32768));
-#endif /* MOZ_WIDGET_GTK2 */
     }
   }
   else if (font->type == GDK_FONT_FONTSET)
   {
-#ifdef MOZ_WIDGET_GTK
-    XFontSet fontset = (XFontSet) font_private->xfont;
-    XmbDrawString (drawable_private->xdisplay, drawable_private->xwindow,
-                   fontset, gc_private->xgc, x, y, text, text_length);
-#endif /* MOZ_WIDGET_GTK */
-#ifdef MOZ_WIDGET_GTK2
     XFontSet fontset = (XFontSet) GDK_FONT_XFONT(font);
     XmbDrawString (GDK_WINDOW_XDISPLAY(drawable), GDK_DRAWABLE_XID(drawable),
                    fontset, GDK_GC_XGC(gc), x, y, text, text_length);
-#endif /* MOZ_WIDGET_GTK2 */
   }
   else
     g_error("undefined font type\n");
 }
--- a/gfx/src/gtk/nsGfxFactoryGTK.cpp
+++ b/gfx/src/gtk/nsGfxFactoryGTK.cpp
@@ -289,15 +289,12 @@ nsGfxGTKModuleCtor(nsIModule *self)
 
 PR_STATIC_CALLBACK(void)
 nsGfxGTKModuleDtor(nsIModule *self)
 {
   nsRenderingContextGTK::Shutdown();
   nsDeviceContextGTK::Shutdown();
   nsImageGTK::Shutdown();
   nsGCCache::Shutdown();
-#ifdef MOZ_WIDGET_GTK
-  nsRegionGTK::Shutdown();
-#endif
 }
 
 NS_IMPL_NSGETMODULE_WITH_CTOR_DTOR(nsGfxGTKModule, components,
                                    nsGfxGTKModuleCtor, nsGfxGTKModuleDtor)
--- a/gfx/src/gtk/nsRegionGTK.h
+++ b/gfx/src/gtk/nsRegionGTK.h
@@ -48,19 +48,16 @@ class nsRegionGTK : public nsIRegion
 {
 public:
   nsRegionGTK();
   virtual ~nsRegionGTK();
 
   NS_DECL_ISUPPORTS
 
   virtual nsresult Init();
-#ifdef MOZ_WIDGET_GTK
-  static void Shutdown();
-#endif
 
   virtual void SetTo(const nsIRegion &aRegion);
   virtual void SetTo(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
   virtual void Intersect(const nsIRegion &aRegion);
   virtual void Intersect(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
   virtual void Union(const nsIRegion &aRegion);
   virtual void Union(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
   virtual void Subtract(const nsIRegion &aRegion);
@@ -71,26 +68,14 @@ public:
   virtual void Offset(PRInt32 aXOffset, PRInt32 aYOffset);
   virtual PRBool ContainsRect(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
   NS_IMETHOD GetRects(nsRegionRectSet **aRects);
   NS_IMETHOD FreeRects(nsRegionRectSet *aRects);
   NS_IMETHOD GetNativeRegion(void *&aRegion) const;
   NS_IMETHOD GetRegionComplexity(nsRegionComplexity &aComplexity) const;
   NS_IMETHOD GetNumRects(PRUint32 *aRects) const;
 
-protected:
-#ifdef MOZ_WIDGET_GTK
-  GdkRegion *gdk_region_copy(GdkRegion *region);
-  GdkRegion *gdk_region_from_rect(PRInt32 aX, PRInt32 aY,
-                                  PRInt32 aWidth, PRInt32 aHeight);
-
-private:
-  inline GdkRegion *GetCopyRegion();
-  inline void SetRegionEmpty();
-
-  static GdkRegion *copyRegion;
-#endif
 private:
 
   GdkRegion *mRegion;
 };
 
 #endif  // nsRegionGTK_h___ 
--- a/layout/build/Makefile.in
+++ b/layout/build/Makefile.in
@@ -214,22 +214,16 @@ endif
 EXTRA_DSO_LDOPTS = \
 		$(LIBS_DIR) \
 		$(EXTRA_DSO_LIBS) \
 		$(MOZ_UNICHARUTIL_LIBS) \
 		$(MOZ_COMPONENT_LIBS) \
 		$(MOZ_JS_LIBS) \
 		$(NULL)
 
-ifdef MOZ_ENABLE_XLIB
-EXTRA_DSO_LDOPTS += \
-		-lxlibrgb \
-		$(NULL)
-endif
-
 ifdef NS_TRACE_MALLOC
 EXTRA_DSO_LIBS	+= tracemalloc
 endif
 
 ifdef MOZ_ENABLE_CAIRO_GFX
 EXTRA_DSO_LIBS += thebes
 else
 ifdef MOZ_ENABLE_CANVAS
@@ -248,17 +242,17 @@ endif
 
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 EXTRA_DSO_LDOPTS += \
 	$(TK_LIBS) \
 	$(NULL)
 endif
 
 # Add explicit X11 dependency when building against X11 toolkits
-ifneq (,$(filter gtk gtk2 qt xlib,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2 qt,$(MOZ_WIDGET_TOOLKIT)))
 EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS)
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES	+= -I$(srcdir)/../base \
 		   -I$(srcdir)/../generic \
 		   -I$(srcdir)/../forms \
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -634,17 +634,17 @@ nsObjectFrame::GetDesiredSize(nsPresCont
                               aReflowState.mComputedMaxWidth);
     }
     if (aMetrics.height == NS_UNCONSTRAINEDSIZE) {
       aMetrics.height = PR_MIN(PR_MAX(nsPresContext::CSSPixelsToAppUnits(EMBED_DEF_HEIGHT),
                                       aReflowState.mComputedMinHeight),
                                aReflowState.mComputedMaxHeight);
     }
 
-#if defined (MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_GTK2) || defined (MOZ_WIDGET_XLIB)  
+#if defined (MOZ_WIDGET_GTK2)
     // We need to make sure that the size of the object frame does not
     // exceed the maximum size of X coordinates.  See bug #225357 for
     // more information.  In theory Gtk2 can handle large coordinates,
     // but underlying plugins can't.
     aMetrics.height = PR_MIN(aPresContext->DevPixelsToAppUnits(PR_INT16_MAX), aMetrics.height);
     aMetrics.width = PR_MIN(aPresContext->DevPixelsToAppUnits(PR_INT16_MAX), aMetrics.width);
 #endif
   }
--- a/modules/plugin/Makefile.in
+++ b/modules/plugin/Makefile.in
@@ -46,32 +46,23 @@ MODULE		= plugin
 
 DIRS		= base/public 
 
 ifdef MOZ_PLUGINS
 DIRS		+= base/src 
 
 ifndef MINIMO
 
-ifneq (,$(filter gtk gtk2 xlib ,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2 ,$(MOZ_WIDGET_TOOLKIT)))
 TOOL_DIRS += samples/unixprinting
 endif
 
 # These subdirs rely on GTK libraries and header files, it is not
 #  buildable on other non-GTK unix builds
 
-ifdef MOZ_ENABLE_GTK
-TOOL_DIRS += samples/default/unix
-
-ifdef ENABLE_TESTS
-TOOL_DIRS += samples/simple
-endif
-
-endif
-
 ifdef MOZ_ENABLE_GTK2
 TOOL_DIRS += samples/default/unix
 endif
 
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 TOOL_DIRS += samples/default/windows
--- a/modules/plugin/base/src/Makefile.in
+++ b/modules/plugin/base/src/Makefile.in
@@ -74,22 +74,19 @@ REQUIRES	= xpcom \
 		  docshell \
 		  windowwatcher \
 		  imglib2 \
 		  layout \
 		  js \
 		  locale \
 		  $(NULL)
 
-ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 REQUIRES	+= gtkxtbin
 endif
-ifeq ($(MOZ_WIDGET_TOOLKIT),xlib)
-REQUIRES	+= xlibxtbin xlibrgb
-endif
 
 CPPSRCS		= \
 		ns4xPlugin.cpp \
 		ns4xPluginInstance.cpp \
 		nsPluginHostImpl.cpp \
 		nsPluginModule.cpp \
 		nsPluginInstancePeer.cpp \
 		nsPluginDirServiceProvider.cpp \
@@ -155,32 +152,20 @@ ifeq ($(OS_ARCH), OpenVMS)
 DEFINES		+= -DGENERIC_MOTIF_REDEFINES
 OS_CXXFLAGS	+= -Wc,warn=disa=NOSIMPINT
 endif
 
 ifeq ($(OS_ARCH),OS2)
 ADD_TO_DEF_FILE = cat < $(srcdir)/extradefs.os2 >> $(DEF_FILE)
 endif
 
-ifdef MOZ_ENABLE_GTK
-CXXFLAGS        += $(MOZ_GTK_CFLAGS)
-CFLAGS          += $(MOZ_GTK_CFLAGS)
-EXTRA_DSO_LDOPTS += -lgtkxtbin -lgtksuperwin $(XLDFLAGS) $(XT_LIBS) $(MOZ_GTK_LDFLAGS)
-endif		#MOZ_ENABLE_GTK
-
 ifdef MOZ_ENABLE_GTK2
 CXXFLAGS        += $(MOZ_GTK2_CFLAGS)
 CFLAGS          += $(MOZ_GTK2_CFLAGS)
 EXTRA_DSO_LDOPTS += -lgtkxtbin $(XLDFLAGS) $(XT_LIBS) $(MOZ_GTK2_LIBS) $(XLIBS)
 endif           #MOZ_ENABLE_GTK2
 
-ifdef MOZ_ENABLE_XLIB
-EXTRA_DSO_LDOPTS += -lxlibxtbin -lxlibrgb $(XLDFLAGS) $(XT_LIBS) $(XLIBS)
-CXXFLAGS        += $(MOZ_XLIB_CFLAGS)
-CFLAGS          += $(MOZ_XLIB_CFLAGS)
-endif		#MOZ_ENABLE_XLIB
-
 ifdef MOZ_ENABLE_QT
 EXTRA_DSO_LDOPTS += $(MOZ_QT_LDFLAGS)
 CXXFLAGS        += $(MOZ_QT_CFLAGS)
 CFLAGS          += $(MOZ_QT_CFLAGS)
 endif		#MOZ_ENABLE_QT
 
--- a/modules/plugin/base/src/ns4xPlugin.cpp
+++ b/modules/plugin/base/src/ns4xPlugin.cpp
@@ -69,22 +69,16 @@
 
 #include "nsIXPConnect.h"
 
 #if defined(XP_MACOSX)
 #include <Resources.h>
 #endif
 
 //needed for nppdf plugin
-#ifdef MOZ_WIDGET_GTK
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-#include "gtkxtbin.h"
-#endif
-
 #ifdef MOZ_WIDGET_GTK2
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
 #include "gtk2xtbin.h"
 #endif
 
 #include "nsJSNPRuntime.h"
 
@@ -1824,18 +1818,16 @@ NPError NP_EXPORT
       ns4xPluginInstance *inst = (ns4xPluginInstance *) npp->ndata;
       NPBool rtv = PR_FALSE;
       inst->GetValue((nsPluginInstanceVariable)NPPVpluginNeedsXEmbed, &rtv);
       if (rtv) {
         (*(Display **)result) = GDK_DISPLAY();
         return NPERR_NO_ERROR;
       }
     }
-#endif
-#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GTK2)
     // adobe nppdf calls XtGetApplicationNameAndClass(display,
     // &instance, &class) we have to init Xt toolkit before get
     // XtDisplay just call gtk_xtbin_new(w,0) once
     static GtkWidget *gtkXtBinHolder = 0;
     if (!gtkXtBinHolder) {
       gtkXtBinHolder = gtk_xtbin_new(GDK_ROOT_PARENT(),0);
       // it crashes on destroy, let it leak
       // gtk_widget_destroy(gtkXtBinHolder);
@@ -1936,20 +1928,16 @@ NPError NP_EXPORT
       (*(nsIDOMWindow**)result) = domWindow;
 
       return NPERR_NO_ERROR;
     }
     return NPERR_GENERIC_ERROR;
   }
 
   case NPNVToolkit: {
-#ifdef MOZ_WIDGET_GTK
-    *((NPNToolkitType*)result) = NPNVGtk12;
-#endif
-
 #ifdef MOZ_WIDGET_GTK2
     *((NPNToolkitType*)result) = NPNVGtk2;
 #endif
 
     if (*(NPNToolkitType*)result)
         return NPERR_NO_ERROR;
 
     return NPERR_GENERIC_ERROR;
--- a/modules/plugin/base/src/ns4xPluginInstance.cpp
+++ b/modules/plugin/base/src/ns4xPluginInstance.cpp
@@ -54,34 +54,22 @@
 #include "nsIDocument.h"
 
 #include "nsJSNPRuntime.h"
 
 #ifdef XP_OS2
 #include "nsILegacyPluginWrapperOS2.h"
 #endif
 
-#ifdef MOZ_WIDGET_GTK
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-#include "gtkxtbin.h"
-#endif
-
 #ifdef MOZ_WIDGET_GTK2
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
 #include "gtk2xtbin.h"
 #endif
 
-#ifdef MOZ_WIDGET_XLIB
-#include "xlibxtbin.h"
-#include "xlibrgb.h"
-#endif
-
-
 ////////////////////////////////////////////////////////////////////////
 // CID's && IID's
 static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID); // needed for NS_TRY_SAFE_CALL
 static NS_DEFINE_IID(kIPluginStreamListenerIID, NS_IPLUGINSTREAMLISTENER_IID);
 
 ///////////////////////////////////////////////////////////////////////////////
 // ns4xPluginStreamListener Methods
 
@@ -827,23 +815,19 @@ ns4xPluginInstance::ns4xPluginInstance(N
 }
 
 
 ///////////////////////////////////////////////////////////////////////////////
 ns4xPluginInstance::~ns4xPluginInstance(void)
 {
   PLUGIN_LOG(PLUGIN_LOG_BASIC, ("ns4xPluginInstance dtor: this=%p\n",this));
 
-#if defined(MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_GTK2)
+#if defined (MOZ_WIDGET_GTK2)
   if (mXtBin)
     gtk_widget_destroy(mXtBin);
-#elif defined(MOZ_WIDGET_XLIB)
-  if (mXlibXtBin) {
-    delete mXlibXtBin;
-  }
 #endif
 
   // clean the stream list if any
   for(nsInstanceStream *is = mStreams; is != nsnull;) {
     nsInstanceStream * next = is->mNext;
     delete is;
     is = next;
   }
@@ -858,20 +842,18 @@ ns4xPluginInstance::IsStarted(void)
 }
 
 
 ////////////////////////////////////////////////////////////////////////
 NS_IMETHODIMP ns4xPluginInstance::Initialize(nsIPluginInstancePeer* peer)
 {
   PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("ns4xPluginInstance::Initialize this=%p\n",this));
 
-#if defined (MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_GTK2)
+#if defined (MOZ_WIDGET_GTK2)
   mXtBin = nsnull;
-#elif defined(MOZ_WIDGET_XLIB)
-  mXlibXtBin = nsnull;
 #endif
   return InitializePlugin(peer);
 }
 
 ////////////////////////////////////////////////////////////////////////
 NS_IMETHODIMP ns4xPluginInstance::GetPeer(nsIPluginInstancePeer* *resultingPeer)
 {
   *resultingPeer = mPeer;
@@ -880,31 +862,16 @@ NS_IMETHODIMP ns4xPluginInstance::GetPee
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////
 NS_IMETHODIMP ns4xPluginInstance::Start(void)
 {
   PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("ns4xPluginInstance::Start this=%p\n",this));
 
-#ifdef MOZ_WIDGET_XLIB
-  if (mXlibXtBin == nsnull)
-    mXlibXtBin = new xtbin();
-
-  if (mXlibXtBin == nsnull)
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  if (!mXlibXtBin->xtbin_initialized())
-    mXlibXtBin->xtbin_init();
-
-#ifdef NS_DEBUG
-  printf("Made new XtBin: %p, %d\n", mXlibXtBin, mXlibXtBin->xtbin_initialized());
-#endif
-#endif
-
   if(mStarted)
     return NS_OK;
   else
     return InitializePlugin(mPeer); 
 }
 
 
 ////////////////////////////////////////////////////////////////////////
@@ -918,26 +885,21 @@ NS_IMETHODIMP ns4xPluginInstance::Stop(v
   if (mPopupStates.Count() > 0) {
     nsCOMPtr<nsPIDOMWindow> window = GetDOMWindow();
 
     if (window) {
       window->PopPopupControlState(openAbused);
     }
   }
 
-#if defined(MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_GTK2)
+#if defined (MOZ_WIDGET_GTK2)
   if (mXtBin) {
     gtk_widget_destroy(mXtBin);
     mXtBin = 0;
   }
-#elif defined(MOZ_WIDGET_XLIB)
-  if (mXlibXtBin) {
-    mXlibXtBin->xtbin_destroy();
-    mXlibXtBin = 0;
-  }
 #endif
 
   if(!mStarted)
     return NS_OK;
 
   if (fCallbacks->destroy == NULL)
     return NS_ERROR_FAILURE; // XXX right error?
 
@@ -1138,27 +1100,27 @@ NS_IMETHODIMP ns4xPluginInstance::Destro
   // destruction is handled in the Stop call
   return NS_OK;
 }
 
 
 ////////////////////////////////////////////////////////////////////////
 NS_IMETHODIMP ns4xPluginInstance::SetWindow(nsPluginWindow* window)
 {
-#if defined(MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_GTK2) || defined(MOZ_WIDGET_XLIB)
+#if defined (MOZ_WIDGET_GTK2)
   NPSetWindowCallbackStruct *ws;
 #endif
 
   // XXX 4.x plugins don't want a SetWindow(NULL).
   if (!window || !mStarted)
     return NS_OK;
   
   NPError error;
   
-#if defined (MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_GTK2)
+#if defined (MOZ_WIDGET_GTK2)
   PRBool isXembed = PR_FALSE;
   // bug 108337, flash plugin on linux doesn't like window->width <= 0
   if ((PRInt32) window->width <= 0 || (PRInt32) window->height <= 0)
     return NS_OK;
 
   // We need to test if this is an xembed window before doing checks
   // below, as they might be used on the first pass or on later passes
   // when we resize the plugin window.
@@ -1257,79 +1219,16 @@ NS_IMETHODIMP ns4xPluginInstance::SetWin
   if (!isXembed) {
     // And now point the NPWindow structures window 
     // to the actual X window
     window->window = (nsPluginPort *)GTK_XTBIN(mXtBin)->xtwindow;
     
     gtk_xtbin_resize(mXtBin, window->width, window->height);
   }
   
-#elif defined(MOZ_WIDGET_XLIB)
-
-
-  // Allocate and fill out the ws_info data
-  if (!window->ws_info) {
-#ifdef NS_DEBUG
-    printf("About to create new ws_info...\n");
-#endif
-
-    // allocate a new NPSetWindowCallbackStruct structure at ws_info
-    window->ws_info = (NPSetWindowCallbackStruct *)PR_MALLOC(sizeof(NPSetWindowCallbackStruct));
-
-    if (!window->ws_info)
-      return NS_ERROR_OUT_OF_MEMORY;
-
-    ws = (NPSetWindowCallbackStruct *)window->ws_info;
-
-#if 1
-     /* See comment above in GTK+ port ... */
-     if (mXlibXtBin) {
-       delete mXlibXtBin;
-       mXlibXtBin = nsnull;
-     }
-#endif
-
-      if (!mXlibXtBin) {
-        mXlibXtBin = new xtbin();
-        // Check to see if creating mXlibXtBin failed for some reason.
-        // if it did, we can't go any further.
-        if (!mXlibXtBin)
-          return NS_ERROR_FAILURE;
-      } 
-      
-    if (window->window) {
-#ifdef NS_DEBUG
-      printf("About to create new xtbin of %i X %i from %08x...\n",
-             window->width, window->height, window->window);
-#endif
-
-      mXlibXtBin->xtbin_new((Window)window->window);
-      mXlibXtBin->xtbin_resize(0, 0, window->width, window->height);
-#ifdef NS_DEBUG
-      printf("About to show xtbin(%p)...\n", mXlibXtBin); fflush(NULL);
-#endif
-      mXlibXtBin->xtbin_realize();
-    }
-    
-    /* Set window attributes */
-    XlibRgbHandle *xlibRgbHandle = xxlib_find_handle(XXLIBRGB_DEFAULT_HANDLE);
-    Display *xdisplay = xxlib_rgb_get_display(xlibRgbHandle);
-
-    /* Fill in window info structure */
-    ws->type     = 0;
-    ws->depth    = xxlib_rgb_get_depth(xlibRgbHandle);
-    ws->display  = xdisplay;
-    ws->visual   = xxlib_rgb_get_visual(xlibRgbHandle);
-    ws->colormap = xxlib_rgb_get_cmap(xlibRgbHandle);
-    XFlush(ws->display);
-  } // !window->ws_info
-
-  // And now point the NPWindow structures window 
-  // to the actual X window
-  window->window = (nsPluginPort *)mXlibXtBin->xtbin_xtwindow();
 #endif // MOZ_WIDGET
 
   if (fCallbacks->setwindow) {
     // XXX Turns out that NPPluginWindow and NPWindow are structurally
     // identical (on purpose!), so there's no need to make a copy.
 
     PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("ns4xPluginInstance::SetWindow (about to call it) this=%p\n",this));
 
--- a/modules/plugin/base/src/ns4xPluginInstance.h
+++ b/modules/plugin/base/src/ns4xPluginInstance.h
@@ -58,20 +58,18 @@
 #include "nsIPluginInstanceInternal.h"
 
 #include "npupp.h"
 #ifdef OJI
 #include "jri.h"
 #endif
 #include "prlink.h"  // for PRLibrary
 
-#if defined (MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_GTK2)
+#if defined (MOZ_WIDGET_GTK2)
 #include <gtk/gtk.h>
-#elif defined (MOZ_WIDGET_XLIB)
-#include "xlibxtbin.h"
 #endif
 
 ////////////////////////////////////////////////////////////////////////
 
 class ns4xPluginStreamListener;
 class nsPIDOMWindow;
 
 struct nsInstanceStream
@@ -171,24 +169,22 @@ protected:
 
     /**
      * A pointer to the plugin's callback functions. This information
      * is actually stored in the plugin class (<b>nsPluginClass</b>),
      * and is common for all plugins of the class.
      */
     NPPluginFuncs* fCallbacks;
 
-#if defined (MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_GTK2)
+#if defined (MOZ_WIDGET_GTK2)
    /**
     * Special GtkXtBin widget that encapsulates the Xt toolkit
     * within a Gtk Application
     */
    GtkWidget *mXtBin;
-#elif defined (MOZ_WIDGET_XLIB)
-   xtbin *mXlibXtBin;
 #endif
 
     /**
      * The 4.x-style structure used to communicate between the plugin
      * instance and the browser.
      */
     NPP_t fNPP;
 
--- a/modules/plugin/base/src/nsPluginHostImpl.cpp
+++ b/modules/plugin/base/src/nsPluginHostImpl.cpp
@@ -169,22 +169,20 @@
 #include "nsIDocShell.h"
 #include "nsPluginNativeWindow.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIContentPolicy.h"
 #include "nsContentPolicyUtils.h"
 #include "nsContentErrors.h"
 
 #ifdef XP_UNIX
-#if defined(MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_GTK2)
+#if defined (MOZ_WIDGET_GTK2)
 #include <gdk/gdkx.h> // for GDK_DISPLAY()
 #elif defined(MOZ_WIDGET_QT)
 #include <qwindowdefs.h> // for qt_xdisplay()
-#elif defined(MOZ_WIDGET_XLIB)
-#include "xlibrgb.h" // for xlib_rgb_get_display()
 #endif
 #endif
 
 #ifdef XP_MACOSX
 #include <Carbon/Carbon.h> // for ::UseInputWindow()
 #include <mach-o/loader.h>
 #include <mach-o/fat.h>
 #endif
@@ -2630,22 +2628,20 @@ NS_IMETHODIMP nsPluginHostImpl::GetValue
 {
   nsresult rv = NS_OK;
 
   NS_ENSURE_ARG_POINTER(aValue);
 
 #if defined(XP_UNIX) && !defined(XP_MACOSX) && defined(MOZ_X11)
   if (nsPluginManagerVariable_XDisplay == aVariable) {
     Display** value = NS_REINTERPRET_CAST(Display**, aValue);
-#if defined(MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_GTK2)
+#if defined (MOZ_WIDGET_GTK2)
     *value = GDK_DISPLAY();
 #elif defined(MOZ_WIDGET_QT)
     *value = qt_xdisplay();
-#elif defined(MOZ_WIDGET_XLIB)
-    *value = xxlib_rgb_get_display(xxlib_find_handle(XXLIBRGB_DEFAULT_HANDLE));
 #endif
     if (!(*value)) {
       return NS_ERROR_FAILURE;
     }
   }
 #endif
   if (nsPluginManagerVariable_SupportsXEmbed == aVariable) {
 #ifdef MOZ_WIDGET_GTK2
@@ -6795,17 +6791,17 @@ nsresult nsPluginStreamListenerPeer::Ser
   mInstance->GetPeer(getter_AddRefs(peer));
   if (peer) {
     nsCOMPtr<nsPIPluginInstancePeer> privpeer(do_QueryInterface(peer));
     nsCOMPtr<nsIPluginInstanceOwner> owner;
     privpeer->GetOwner(getter_AddRefs(owner));
     if (owner) {
       nsPluginWindow    *window = nsnull;
       owner->GetWindow(window);
-#if defined (MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_GTK2)
+#if defined (MOZ_WIDGET_GTK2)
       // Should call GetPluginPort() here.
       // This part is copied from nsPluginInstanceOwner::GetPluginPort(). 
       nsCOMPtr<nsIWidget> widget;
       ((nsPluginNativeWindow*)window)->GetPluginWidget(getter_AddRefs(widget));
       if (widget) {
         window->window = (nsPluginPort*) widget->GetNativeData(NS_NATIVE_PLUGIN_PORT);
       }
 #endif
--- a/modules/plugin/base/src/nsPluginsDirUnix.cpp
+++ b/modules/plugin/base/src/nsPluginsDirUnix.cpp
@@ -78,17 +78,17 @@
 #elif defined(SOLARIS)
 #define DEFAULT_X11_PATH "/usr/openwin/lib/"
 #elif defined(LINUX)
 #define DEFAULT_X11_PATH "/usr/X11R6/lib/"
 #else
 #define DEFAULT_X11_PATH ""
 #endif
 
-#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GTK2)
+#if defined(MOZ_WIDGET_GTK2)
 
 #define PLUGIN_MAX_LEN_OF_TMP_ARR 512
 
 static void DisplayPR_LoadLibraryErrorMessage(const char *libName)
 {
     char errorMsg[PLUGIN_MAX_LEN_OF_TMP_ARR] = "Cannot get error from NSPR.";
     if (PR_GetErrorTextLength() < (int) sizeof(errorMsg))
         PR_GetErrorText(errorMsg);
@@ -243,17 +243,17 @@ static void LoadExtraSharedLibs()
                 // otherwise it'll decrease performance by calling popen() in SearchForSoname
                 // every time for each bogus name
                 prefs->SetCharPref(sonamesListFromPref, (const char *)sonameListToSave);
             }
             PL_strfree(sonameList);
         }
     }
 }
-#endif //MOZ_WIDGET_GTK || MOZ_WIDGET_GTK2
+#endif //MOZ_WIDGET_GTK2
 
 
 
 ///////////////////////////////////////////////////////////////////////////
 
 /* nsPluginsDir implementation */
 
 PRBool nsPluginsDir::IsPluginFile(nsIFile* file)
@@ -377,17 +377,17 @@ nsresult nsPluginFile::LoadPlugin(PRLibr
         return rv;
 
     if (StringBeginsWith(leafName, NS_LITERAL_CSTRING("libjavaplugin_oji")))
         SetJavaLibPath(path);
 #endif
 
     libSpec.value.pathname = path.get();
 
-#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GTK2)
+#if defined(MOZ_WIDGET_GTK2)
 
     ///////////////////////////////////////////////////////////
     // Normally, Mozilla isn't linked against libXt and libXext
     // since it's a Gtk/Gdk application.  On the other hand,
     // legacy plug-ins expect the libXt and libXext symbols
     // to already exist in the global name space.  This plug-in
     // wrapper is linked against libXt and libXext, but since
     // we never call on any of these libraries, plug-ins still
@@ -408,17 +408,17 @@ nsresult nsPluginFile::LoadPlugin(PRLibr
         LoadExtraSharedLibs();
         // try reload plugin once more
         pLibrary = outLibrary = PR_LoadLibraryWithFlags(libSpec, 0);
         if (!pLibrary)
             DisplayPR_LoadLibraryErrorMessage(libSpec.value.pathname);
     }
 #else
     pLibrary = outLibrary = PR_LoadLibraryWithFlags(libSpec, 0);
-#endif  // MOZ_WIDGET_GTK || MOZ_WIDGET_GTK2
+#endif  // MOZ_WIDGET_GTK2
 
 #ifdef NS_DEBUG
     printf("LoadPlugin() %s returned %lx\n", 
            libSpec.value.pathname, (unsigned long)pLibrary);
 #endif
     
     return NS_OK;
 }
--- a/modules/plugin/samples/default/unix/Makefile.in
+++ b/modules/plugin/samples/default/unix/Makefile.in
@@ -66,22 +66,16 @@ FORCE_USE_PIC	= 1
 NO_DIST_INSTALL = 1
 NO_INSTALL = 1
 
 include $(topsrcdir)/config/rules.mk
 
 EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS) $(XT_LIBS) \
 		$(NULL)
 
-ifdef MOZ_ENABLE_GTK
-EXTRA_DSO_LDOPTS += $(MOZ_GTK_LDFLAGS)
-CXXFLAGS	+= $(MOZ_GTK_CFLAGS)
-CFLAGS		+= $(MOZ_GTK_CFLAGS)
-endif
-
 ifdef MOZ_ENABLE_GTK2
 EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS) $(XLDFLAGS) $(XLIBS)
 CXXFLAGS	+= $(MOZ_GTK2_CFLAGS)
 CFLAGS		+= $(MOZ_GTK2_CFLAGS)
 endif
 
 ifeq ($(OS_ARCH), OpenVMS)
 DEFINES		+= -DGENERIC_MOTIF_REDEFINES
--- a/modules/plugin/samples/simple/Makefile.in
+++ b/modules/plugin/samples/simple/Makefile.in
@@ -66,21 +66,20 @@ XPIDLSRCS	= nsISimplePluginInstance.idl
 CPPSRCS		= npsimple.cpp
 
 LOCAL_INCLUDES	= -I$(srcdir)/.. -I$(srcdir)/../../public -I$(XPIDL_GEN_DIR)
 
 EXTRA_DSO_LDOPTS += \
 	-L$(DIST)/lib \
 	-lgtksuperwin \
 	$(MOZ_COMPONENT_LIBS) \
-	$(MOZ_GTK_LDFLAGS) \
 	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
-CXXFLAGS	+= $(MOZ_TOOLKIT_REGISTRY_CFLAGS) $(MOZ_GTK_CFLAGS)
+CXXFLAGS	+= $(MOZ_TOOLKIT_REGISTRY_CFLAGS)
 
 libs::
 	$(INSTALL) $(srcdir)/samples/embed-test.html $(DIST)/bin/res/samples
 
 install::
 	$(SYSINSTALL) $(IFLAGS1) $(srcdir)/samples/embed-test.html $(DESTDIR)$(mozappdir)/res/samples
 
--- a/modules/staticmod/Makefile.in
+++ b/modules/staticmod/Makefile.in
@@ -86,17 +86,17 @@ OS_LIBS += $(call EXPAND_LIBNAME,comctl3
 ifdef GNU_CC
 OS_LIBS += $(call EXPAND_LIBNAME,winmm wsock32 gdi32)
 endif
 ifdef MOZ_ENABLE_CAIRO_GFX
 OS_LIBS += $(call EXPAND_LIBNAME, usp10)
 endif
 endif
 
-ifneq  (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2)$(MOZ_ENABLE_XLIB))
+ifneq  (,$(MOZ_ENABLE_GTK2))
 OS_LIBS += $(XLDFLAGS) $(XT_LIBS)
 endif
 
 OS_LIBS += $(TK_LIBS)
 
 GARBAGE += module_list.h
 
 LOCAL_INCLUDES += -I.
--- a/other-licenses/branding/firefox/Makefile.in
+++ b/other-licenses/branding/firefox/Makefile.in
@@ -26,17 +26,17 @@ BROWSER_APP_FILES = \
 	mozicon50.xpm \
 	firefox.ico \
 	document.ico \
 	$(NULL)
 
 export::
 	$(NSINSTALL) -D $(DIST)/branding
 	cp $(addprefix $(srcdir)/, $(BROWSER_APP_FILES)) $(DIST)/branding/
-ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 	cp $(srcdir)/document.png  $(DIST)/branding/document.png
 	$(NSINSTALL) -D $(DIST)/install
 	cp $(srcdir)/header.png    $(DIST)/install/header.png
 	cp $(srcdir)/watermark.png $(DIST)/install/watermark.png
 endif
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 	cp $(srcdir)/firefox.icns  $(DIST)/branding/firefox.icns
 	cp $(srcdir)/document.icns $(DIST)/branding/document.icns
--- a/toolkit/components/alerts/Makefile.in
+++ b/toolkit/components/alerts/Makefile.in
@@ -40,17 +40,17 @@ DEPTH   = ../../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH   = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 DIRS    = public 
 
-ifneq (,$(filter $(MOZ_WIDGET_TOOLKIT),windows gtk gtk2))
+ifneq (,$(filter $(MOZ_WIDGET_TOOLKIT),windows gtk2))
 DIRS += src
 endif
 
 #ifneq (,$(filter mac cocoa, $(MOZ_WIDGET_TOOLKIT)))
 #DIRS += src/mac
 #endif
 
 include $(topsrcdir)/config/rules.mk
--- a/toolkit/components/build/Makefile.in
+++ b/toolkit/components/build/Makefile.in
@@ -45,17 +45,17 @@ include $(DEPTH)/config/autoconf.mk
 MODULE = toolkitcomps
 LIBRARY_NAME = toolkitcomps
 SHORT_LIBNAME = tkitcmps
 EXPORT_LIBRARY = 1
 IS_COMPONENT = 1
 MODULE_NAME = nsToolkitCompsModule
 LIBXUL_LIBRARY = 1
 
-ifneq (,$(filter $(MOZ_WIDGET_TOOLKIT),windows gtk gtk2))
+ifneq (,$(filter $(MOZ_WIDGET_TOOLKIT),windows gtk2))
 ALERTS_SERVICE=1
 DEFINES += -DALERTS_SERVICE
 endif
 #ifneq (,$(filter cocoa, $(MOZ_WIDGET_TOOLKIT)))
 #ALERTS_SERVICE_MAC=1
 #DEFINES += -DALERTS_SERVICE_MAC
 #endif
 
--- a/toolkit/components/remote/Makefile.in
+++ b/toolkit/components/remote/Makefile.in
@@ -64,26 +64,26 @@ REQUIRES = \
 	dom \
 	content \
 	layout \
 	docshell \
 	$(NULL)
 
 XPIDLSRCS = nsIRemoteService.idl
 
-ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 CPPSRCS += nsGTKRemoteService.cpp
 endif
 
 ifeq (photon,$(MOZ_WIDGET_TOOLKIT))
 CPPSRCS += nsPhMozRemoteHelper.cpp
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS) $(TK_LIBS)
 CXXFLAGS += $(TK_CFLAGS)
 
 # Add explicit X11 dependency when building against X11 toolkits
-ifneq (,$(filter gtk gtk2 qt xlib,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2 qt,$(MOZ_WIDGET_TOOLKIT)))
 EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS)
 endif
 
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -72,17 +72,17 @@ ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
 CPPSRCS += dlldeps-xul.cpp
 endif
 
 ifeq ($(OS_ARCH),OS2)
 CPPSRCS += dlldeps-xul.cpp
 endif
 
 # dependent libraries
-ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2))
+ifneq (,$(MOZ_ENABLE_GTK2))
 SHARED_LIBRARY_LIBS += \
   $(DEPTH)/embedding/browser/gtk/src/$(LIB_PREFIX)gtkembedmoz.$(LIB_SUFFIX)
 endif
 
 SHARED_LIBRARY_LIBS += \
 	$(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) \
 	$(NULL)
 
@@ -169,20 +169,16 @@ EXTRA_DSO_LDOPTS += $(EXTRA_DSO_LIBS)
 
 ifdef MOZ_ENABLE_LIBXUL
 include $(srcdir)/libxul-rules.mk
 else
 EXTRA_DSO_LDOPTS += \
 	$(MOZ_COMPONENT_LIBS) \
 	$(MOZ_JS_LIBS) \
 	$(NULL)
-
-ifdef MOZ_ENABLE_GTK
-EXTRA_DSO_LDOPTS += -L$(DIST)/lib -lgtksuperwin
-endif
 endif
 
 DEFINES += -DIMPL_XREAPI
 
 EXTRA_DSO_LDOPTS += $(NSPR_LIBS)
 
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 CXXFLAGS	+= $(TK_CFLAGS)
@@ -194,18 +190,18 @@ EXTRA_DSO_LDOPTS += \
 	$(TK_LIBS) \
 	$(NULL)
 endif
 
 ifdef MOZ_ENABLE_XINERAMA
 EXTRA_DSO_LDOPTS += $(MOZ_XINERAMA_LIBS)
 endif
 
-ifneq (,$(filter gtk gtk2 qt xlib,$(MOZ_WIDGET_TOOLKIT)))
-EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(MOZ_GTK_LDFLAGS) $(MOZ_XFT_LIBS) $(MOZ_GTK2_LIBS) $(XT_LIBS)
+ifneq (,$(filter gtk2 qt,$(MOZ_WIDGET_TOOLKIT)))
+EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(MOZ_XFT_LIBS) $(MOZ_GTK2_LIBS) $(XT_LIBS)
 endif
 
 ifdef MOZ_ENABLE_XFT
 EXTRA_DSO_LDOPTS += $(FT2_LIBS)
 endif
 
 ifdef MOZ_ENABLE_STARTUP_NOTIFICATION
 EXTRA_DSO_LDOPTS += $(MOZ_STARTUP_NOTIFICATION_LIBS)
--- a/toolkit/library/libxul-config.mk
+++ b/toolkit/library/libxul-config.mk
@@ -227,43 +227,34 @@ COMPONENT_LIBS += \
 	pippki \
 	$(NULL)
 endif
 
 ifdef MOZ_MATHML
 COMPONENT_LIBS += ucvmath
 endif
 
-ifneq (,$(filter xlib,$(MOZ_WIDGET_TOOLKIT))$(MOZ_ENABLE_XLIB)$(MOZ_ENABLE_XPRINT))
+ifneq (,$(MOZ_ENABLE_XPRINT))
 STATIC_LIBS += xlibrgb
 endif
 
 ifdef MOZ_ENABLE_XPRINT
 DEFINES += -DMOZ_ENABLE_XPRINT
 STATIC_LIBS += xprintutil
 COMPONENTS_LIBS += gfxxprint
 endif
 
-ifdef MOZ_ENABLE_XLIB
-STATIC_LIBS += xlibxtbin
-endif
-
-ifdef MOZ_ENABLE_GTK
-STATIC_LIBS += gtksuperwin
-COMPONENT_LIBS += widget_gtk
-endif
-
 ifdef MOZ_ENABLE_GTK2
 COMPONENT_LIBS += widget_gtk2
 ifdef MOZ_PREF_EXTENSIONS
 COMPONENT_LIBS += system-pref
 endif
 endif
 
-ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2))
+ifneq (,$(MOZ_ENABLE_GTK2))
 STATIC_LIBS += gtkxtbin
 endif
 
 ifdef MOZ_IPCD
 DEFINES += -DMOZ_IPCD
 COMPONENT_LIBS += ipcdc
 endif
 
@@ -293,25 +284,22 @@ else # Platform-specific GFX layer
   COMPONENT_LIBS += gfx_os2
   endif
   ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
   COMPONENT_LIBS += gfx_mac
   endif
   ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
   COMPONENT_LIBS += widget_qt
   endif
-  ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
+  ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
   COMPONENT_LIBS += gfx_gtk
   endif
   ifdef MOZ_ENABLE_QT
   COMPONENT_LIBS += gfx_qt
   endif
-  ifdef MOZ_ENABLE_XLIB
-  COMPONENT_LIBS += gfx_xlib
-  endif
   ifdef MOZ_ENABLE_PHOTON
   COMPONENT_LIBS += gfx_photon
   endif
 endif
 
 ifeq (windows,$(MOZ_WIDGET_TOOLKIT))
 COMPONENT_LIBS += gkwidget
 endif
@@ -323,19 +311,16 @@ COMPONENT_LIBS += wdgtos2
 endif
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 COMPONENT_LIBS += widget_mac
 endif
 ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
 COMPONENT_LIBS += widget_qt
 endif
 
-ifdef MOZ_ENABLE_XLIB
-COMPONENT_LIBS += widget_xlib
-endif
 ifdef MOZ_ENABLE_PHOTON
 COMPONENT_LIBS += widget_photon
 endif
 
 ifdef MOZ_OJI
 STATIC_LIBS += jsj
 COMPONENT_LIBS += oji
 endif
--- a/toolkit/library/nsStaticXULComponents.cpp
+++ b/toolkit/library/nsStaticXULComponents.cpp
@@ -77,22 +77,20 @@
 #define IPC_MODULE MODULE(ipcdclient)
 #else
 #define IPC_MODULE
 #endif
 
 #ifdef MOZ_CAIRO_GFX
 #  define GFX_MODULES MODULE(nsGfxModule)
 #else
-#  if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GTK2)
+#  if defined(MOZ_WIDGET_GTK2)
 #    define GFX_MODULES MODULE(nsGfxGTKModule)
 #  elif defined(MOZ_WIDGET_QT)
 #    define GFX_MODULES MODULE(nsGfxQtModule)
-#  elif defined(MOZ_WIDGET_XLIB)
-#    define GFX_MODULES MODULE(nsGfxXlibModule)
 #  elif defined(MOZ_WIDGET_PHOTON)
 #    define GFX_MODULES MODULE(nsGfxPhModule)
 #  elif defined(XP_WIN)
 #    define GFX_MODULES MODULE(nsGfxModule)
 #  elif defined(XP_MACOSX)
 #    define GFX_MODULES MODULE(nsGfxMacModule)
 #  elif defined(XP_BEOS)
 #    define GFX_MODULES MODULE(nsGfxBeOSModule)
@@ -106,22 +104,18 @@
 #ifdef XP_WIN
 #  define WIDGET_MODULES MODULE(nsWidgetModule)
 #elif defined(XP_MACOSX)
 #  define WIDGET_MODULES MODULE(nsWidgetMacModule)
 #elif defined(XP_BEOS)
 #  define WIDGET_MODULES MODULE(nsWidgetBeOSModule)
 #elif defined(XP_OS2)
 #  define WIDGET_MODULES MODULE(nsWidgetOS2Module)
-#elif defined(MOZ_WIDGET_GTK)
-#  define WIDGET_MODULES MODULE(nsWidgetGTKModule)
 #elif defined(MOZ_WIDGET_GTK2)
 #  define WIDGET_MODULES MODULE(nsWidgetGtk2Module)
-#elif defined(MOZ_WIDGET_XLIB)
-#  define WIDGET_MODULES MODULE(nsWidgetXLIBModule)
 #elif defined(MOZ_WIDGET_PHOTON)
 #  define WIDGET_MODULES MODULE(nsWidgetPhModule)
 #elif defined(MOZ_WIDGET_QT)
 #  define WIDGET_MODULES MODULE(nsWidgetQtModule)
 #else
 #  error Unknown widget module.
 #endif
 
--- a/toolkit/mozapps/installer/package-name.mk
+++ b/toolkit/mozapps/installer/package-name.mk
@@ -54,20 +54,15 @@ ifeq ($(OS_ARCH),Darwin)
 MOZ_PKG_PLATFORM := mac
 endif
 ifeq ($(TARGET_OS),linux-gnu)
 MOZ_PKG_PLATFORM := linux-$(TARGET_CPU)
 endif
 ifeq ($(OS_ARCH),OS2)
 MOZ_PKG_PLATFORM := os2
 endif
-
-# GTK2 is the default, so we mark gtk1 builds
-ifeq ($(MOZ_WIDGET_TOOLKIT),gtk)
-MOZ_PKG_PLATFORM := $(MOZ_PKG_PLATFORM)-gtk1
-endif
 endif #MOZ_PKG_PLATFORM
 
 ifdef MOZ_PKG_SPECIAL
 MOZ_PKG_PLATFORM := $(MOZ_PKG_PLATFORM)-$(MOZ_PKG_SPECIAL)
 endif
 
 PKG_BASENAME = $(MOZ_PKG_APPNAME)-$(MOZ_PKG_VERSION).$(AB_CD).$(MOZ_PKG_PLATFORM)
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -76,24 +76,16 @@ ifdef NS_TRACE_MALLOC
 tier_gecko_dirs += tools/trace-malloc/lib
 endif
 
 tier_gecko_dirs += \
 		js/src/xpconnect \
 		intl/chardet \
 		$(NULL)
 
-ifdef MOZ_ENABLE_XLIB
-tier_gecko_dirs	+= gfx/src/xlibrgb widget/src/xlibxtbin
-endif
-
-ifdef MOZ_ENABLE_GTK
-tier_gecko_dirs	+= widget/src/gtksuperwin widget/src/gtkxtbin
-endif
-
 ifdef MOZ_ENABLE_GTK2
 tier_gecko_dirs     += widget/src/gtkxtbin
 endif
 
 ifdef MOZ_IPCD
 tier_gecko_dirs += ipc/ipcd
 endif
 
@@ -239,17 +231,17 @@ endif
 
 # JavaXPCOM JNI code is compiled into libXUL
 ifdef MOZ_JAVAXPCOM
 tier_toolkit_dirs += extensions/java/xpcom/src
 endif
 
 ifndef BUILD_STATIC_LIBS
 ifdef MOZ_XUL_APP
-ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2))
+ifneq (,$(MOZ_ENABLE_GTK2))
 tier_toolkit_dirs += embedding/browser/gtk
 endif
 endif
 endif
 
 ifdef MOZ_XUL_APP
 ifndef BUILD_STATIC_LIBS
 tier_toolkit_dirs += toolkit/library
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -265,20 +265,18 @@ extern "C" {
 #endif
 
 int    gArgc;
 char **gArgv;
 
 static int    gRestartArgc;
 static char **gRestartArgv;
 
-#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GTK2)
+#if defined(MOZ_WIDGET_GTK2)
 #include <gtk/gtk.h>
-#endif //MOZ_WIDGET_GTK || MOZ_WIDGET_GTK2
-#if defined(MOZ_WIDGET_GTK2)
 #include "nsGTKToolkit.h"
 #endif
 
 #if defined(MOZ_WIDGET_QT)
 #include <qapplication.h>
 #endif
 
 // Save the path of the given file to the specified environment variable.
@@ -1018,41 +1016,16 @@ static void DumpArbitraryHelp()
 // But when this is called we have no components etc. These strings must either be
 // here, or in a native resource file.
 static void
 DumpHelp()
 {
   printf("Usage: %s [ options ... ] [URL]\n"
          "       where options include:\n\n", gArgv[0]);
 
-#ifdef MOZ_WIDGET_GTK
-  /* insert gtk options above moz options, like any other gtk app
-   *
-   * note: this isn't a very cool way to do things -- i'd rather get
-   * these straight from a user's gtk version -- but it seems to be
-   * what most gtk apps do. -dr
-   */
-  printf("GTK options\n"
-         "\t--gdk-debug=FLAGS\t\tGdk debugging flags to set\n"
-         "\t--gdk-no-debug=FLAGS\t\tGdk debugging flags to unset\n"
-         "\t--gtk-debug=FLAGS\t\tGtk+ debugging flags to set\n"
-         "\t--gtk-no-debug=FLAGS\t\tGtk+ debugging flags to unset\n"
-         "\t--gtk-module=MODULE\t\tLoad an additional Gtk module\n"
-         "\t-install\t\tInstall a private colormap\n");
-
-#endif /* MOZ_WIDGET_GTK */
-#if MOZ_WIDGET_XLIB
-  printf("Xlib options\n"
-         "\t-display=DISPLAY\t\tX display to use\n"
-         "\t-visual=VISUALID\t\tX visual to use\n"
-         "\t-install_colormap\t\tInstall own colormap\n"
-         "\t-sync\t\tMake X calls synchronous\n"
-         "\t-no-xshm\t\tDon't use X shared memory extension\n");
-
-#endif /* MOZ_WIDGET_XLIB */
 #ifdef MOZ_X11
   printf("X11 options\n"
          "\t--display=DISPLAY\t\tX display to use\n"
          "\t--sync\t\tMake X calls synchronous\n"
          "\t--no-xshm\t\tDon't use X shared memory extension\n"
          "\t--xim-preedit=STYLE\n"
          "\t--xim-status=STYLE\n");
 #endif
@@ -2441,66 +2414,57 @@ XRE_main(int argc, char* argv[], const n
           (do_GetService("@mozilla.org/chrome/chrome-registry;1"));
         NS_ENSURE_TRUE(chromeReg, 1);
 
         chromeReg->CheckForNewChrome();
       }
       return 0;
     }
 
-#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GTK2) || defined(MOZ_ENABLE_XREMOTE)
+#if defined(MOZ_WIDGET_GTK2) || defined(MOZ_ENABLE_XREMOTE)
     // Stash DESKTOP_STARTUP_ID in malloc'ed memory because gtk_init will clear it.
 #define HAVE_DESKTOP_STARTUP_ID
     const char* desktopStartupIDEnv = PR_GetEnv("DESKTOP_STARTUP_ID");
     nsCAutoString desktopStartupID;
     if (desktopStartupIDEnv) {
       desktopStartupID.Assign(desktopStartupIDEnv);
     }
 #endif
 
-#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GTK2)
+#if defined(MOZ_WIDGET_GTK2)
     // setup for private colormap.  Ideally we'd like to do this
     // in nsAppShell::Create, but we need to get in before gtk
     // has been initialized to make sure everything is running
     // consistently.
     if (CheckArg("install"))
       gdk_rgb_set_install(TRUE);
 
-    // Initialize GTK+1/2 here for splash
-#if defined(MOZ_WIDGET_GTK)
-    gtk_set_locale();
-#endif
+    // Initialize GTK here for splash
     gtk_init(&gArgc, &gArgv);
 
-#if defined(MOZ_WIDGET_GTK2)
     // g_set_application_name () is only defined in glib2.2 and higher.
     _g_set_application_name_fn _g_set_application_name =
       (_g_set_application_name_fn)FindFunction("g_set_application_name");
     if (_g_set_application_name) {
       _g_set_application_name(gAppData->name);
     }
     _gtk_window_set_auto_startup_notification_fn _gtk_window_set_auto_startup_notification =
       (_gtk_window_set_auto_startup_notification_fn)FindFunction("gtk_window_set_auto_startup_notification");
     if (_gtk_window_set_auto_startup_notification) {
       _gtk_window_set_auto_startup_notification(PR_FALSE);
     }
-#endif
 
     gtk_widget_set_default_visual(gdk_rgb_get_visual());
     gtk_widget_set_default_colormap(gdk_rgb_get_cmap());
-#endif /* MOZ_WIDGET_GTK || MOZ_WIDGET_GTK2 */
+#endif /* MOZ_WIDGET_GTK2 */
 
 #if defined(MOZ_WIDGET_QT)
     QApplication qapp(argc, argv);
 #endif
 
-    // #if defined(MOZ_WIDGET_XLIB)
-    // XXXtimeless fix me! How do we get a Display from here to nsAppShell.cpp ?
-    // #endif
-    
     // Call the code to install our handler
 #ifdef MOZ_JPROF
     setupProfilingStuff();
 #endif
 
     // Try to allocate "native app support."
     nsCOMPtr<nsINativeAppSupport> nativeApp;
     rv = NS_CreateNativeAppSupport(getter_AddRefs(nativeApp));
--- a/webshell/public/Makefile.in
+++ b/webshell/public/Makefile.in
@@ -42,18 +42,16 @@ VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= webshell
 XPIDL_MODULE = webshell_idls
 
 PACKAGE_FILE = webshell.pkg
 PACKAGE_VARS += \
-		MOZ_ENABLE_GTK \
-		MOZ_ENABLE_XLIB \
 		$(NULL)
 
 SDK_XPIDLSRCS = \
         nsIClipboardCommands.idl \
         $(NULL)
 
 XPIDLSRCS = \
         nsIRefreshURI.idl \
--- a/webshell/public/webshell.pkg
+++ b/webshell/public/webshell.pkg
@@ -4,15 +4,9 @@
 #if ENABLE_TESTS
 [gecko-tests]
 dist/bin/viewer@BINS@
 #if OS_ARCH!=OS2
 #if OS_ARCH!=WINNT
 dist/bin/mozilla-viewer.sh
 #endif
 #endif
-#if MOZ_ENABLE_GTK
-dist/bin/viewer_gtk
 #endif
-#if MOZ_ENABLE_XLIB
-dist/bin/viewer_xlib
-#endif
-#endif
--- a/widget/public/Makefile.in
+++ b/widget/public/Makefile.in
@@ -75,21 +75,17 @@ endif
 ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
 EXPORTS		+= nsIDragSessionOS2.h
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),beos)
 EXPORTS		+= nsIDragSessionBeOS.h
 endif
 
-ifeq ($(MOZ_WIDGET_TOOLKIT),xlib)
-EXPORTS		+= nsIDragSessionXlib.h
-endif
-
-ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 EXPORTS		+= nsIDragSessionGTK.h
 endif
 
 XPIDLSRCS	= \
 		nsIAppShell.idl \
 		nsIFilePicker.idl \
 		nsIToolkit.idl \
 		nsISound.idl \
--- a/widget/src/Makefile.in
+++ b/widget/src/Makefile.in
@@ -41,19 +41,17 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE  = widget
 
 PACKAGE_FILE = widget.pkg
 PACKAGE_VARS += \
-	MOZ_ENABLE_GTK \
 	MOZ_ENABLE_GTK2 \
-	MOZ_ENABLE_XLIB \
 	MOZ_ENABLE_PHOTON \
 	MOZ_ENABLE_XREMOTE \
 	$(NULL)
 
 DIRS		= xpwidgets support
 
 ifneq (,$(filter beos os2 mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 DIRS		+= $(MOZ_WIDGET_TOOLKIT)
@@ -65,32 +63,21 @@ endif
 
 #
 # Don't build the DSO under the 'build' directory as windows does.
 #
 # The DSOs get built in the toolkit dir itself.  Do this so that 
 # multiple implementations of widget can be built on the same
 # source tree.
 #
-ifdef MOZ_ENABLE_GTK
-DIRS		+= gtksuperwin
-DIRS		+= gtkxtbin
-DIRS		+= gtk
-endif
-
 ifdef MOZ_ENABLE_GTK2
 DIRS		+= gtk2
 DIRS		+= gtkxtbin
 endif
 
-ifdef MOZ_ENABLE_XLIB
-DIRS		+= xlibxtbin
-DIRS		+= xlib
-endif
-
 ifdef MOZ_ENABLE_QT
 DIRS		+= qt
 endif
 
 ifdef MOZ_ENABLE_PHOTON
 DIRS		+= photon
 endif
 
--- a/widget/src/gtk2/nsNativeThemeGTK.cpp
+++ b/widget/src/gtk2/nsNativeThemeGTK.cpp
@@ -81,26 +81,16 @@ nsNativeThemeGTK::nsNativeThemeGTK()
 
   // We have to call moz_gtk_shutdown before the event loop stops running.
   nsCOMPtr<nsIObserverService> obsServ =
     do_GetService("@mozilla.org/observer-service;1");
   obsServ->AddObserver(this, "xpcom-shutdown", PR_FALSE);
 
   memset(mDisabledWidgetTypes, 0, sizeof(mDisabledWidgetTypes));
   memset(mSafeWidgetStates, 0, sizeof(mSafeWidgetStates));
-
-#ifdef MOZ_WIDGET_GTK
-  // Look up the symbol for gtk_style_get_prop_experimental
-  PRLibrary* gtkLibrary;
-  PRFuncPtr stylePropFunc = PR_FindFunctionSymbolAndLibrary("gtk_style_get_prop_experimental", &gtkLibrary);
-  if (stylePropFunc) {
-    moz_gtk_enable_style_props((style_prop_t) stylePropFunc);
-    PR_UnloadLibrary(gtkLibrary);
-  }
-#endif
 }
 
 nsNativeThemeGTK::~nsNativeThemeGTK() {
 }
 
 NS_IMETHODIMP
 nsNativeThemeGTK::Observe(nsISupports *aSubject, const char *aTopic,
                           const PRUnichar *aData)
@@ -1027,27 +1017,25 @@ nsNativeThemeGTK::ThemeSupportsWidget(ns
   case NS_THEME_SCALE_THUMB_VERTICAL:
     // case NS_THEME_SCALE_THUMB_START:
     // case NS_THEME_SCALE_THUMB_END:
     // case NS_THEME_SCALE_TICK:
   case NS_THEME_CHECKBOX_CONTAINER:
   case NS_THEME_RADIO_CONTAINER:
   case NS_THEME_CHECKBOX_LABEL:
   case NS_THEME_RADIO_LABEL:
-#ifdef MOZ_WIDGET_GTK2
   case NS_THEME_MENUBAR:
   case NS_THEME_MENUPOPUP:
   case NS_THEME_MENUITEM:
   case NS_THEME_CHECKMENUITEM:
   case NS_THEME_RADIOMENUITEM:
   case NS_THEME_WINDOW:
   case NS_THEME_DIALOG:
   case NS_THEME_DROPDOWN:
   case NS_THEME_DROPDOWN_TEXT:
-#endif
     return !IsWidgetStyled(aPresContext, aFrame, aWidgetType);
   }
 
   return PR_FALSE;
 }
 
 NS_IMETHODIMP_(PRBool)
 nsNativeThemeGTK::WidgetIsContainer(PRUint8 aWidgetType)
--- a/widget/src/gtkxtbin/Makefile.in
+++ b/widget/src/gtkxtbin/Makefile.in
@@ -53,38 +53,26 @@ PACKAGE_FILE = gtkxtbin.pkg
 
 ifdef MOZ_ENABLE_GTK2
 CSRCS		= \
 		gtk2xtbin.c \
 		$(NULL)
 EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS) $(XLDFLAGS) $(XT_LIBS) $(XLIBS)
 endif
 
-ifdef MOZ_ENABLE_GTK
-CSRCS           = \
-                gtkxtbin.c \
-		$(NULL)
-EXTRA_DSO_LDOPTS += $(MOZ_GTK_LDFLAGS) $(XT_LIBS)
-endif
-
-
 EXPORTS         = gtkxtbin.h gtk2xtbin.h 
 
 REQUIRES	= xpcom
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef MOZ_ENABLE_GTK2
 CFLAGS		+= $(MOZ_GTK2_CFLAGS)
 endif
 
-ifdef MOZ_ENABLE_GTK
-CFLAGS		+= $(MOZ_GTK_CFLAGS)
-endif
-
 DEFINES		+= -D_IMPL_GTKXTBIN_API -DUSE_XIM
 
 ifeq ($(OS_ARCH), OpenVMS)
 DEFINES		+= -DGENERIC_MOTIF_REDEFINES
 endif
 
 INCLUDES	+= \
 		-I$(srcdir) \
--- a/widget/src/xpwidgets/Makefile.in
+++ b/widget/src/xpwidgets/Makefile.in
@@ -89,17 +89,17 @@ ifneq (,$(filter beos os2 mac qt cocoa w
 CPPSRCS += nsBaseClipboard.cpp
 endif
 
 ifneq (,$(filter beos gtk2 os2 mac qt cocoa photon windows,$(MOZ_WIDGET_TOOLKIT)))
 CPPSRCS += nsBaseFilePicker.cpp
 REQUIRES += docshell view intl
 endif
 
-ifneq (,$(filter gtk gtk2 qt windows mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2 qt windows mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 CPPSRCS += nsNativeTheme.cpp
 endif
 
 LOCAL_INCLUDES	= \
 		-I$(srcdir)/../$(MOZ_WIDGET_TOOLKIT) \
 		-I$(srcdir) \
 		$(NULL)
 
--- a/xpfe/bootstrap/Makefile.in
+++ b/xpfe/bootstrap/Makefile.in
@@ -240,38 +240,30 @@ RESFILE = splashos2.res
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
 CPPSRCS += nsNativeAppSupportMac.cpp
 CPPSRCS += nsNativeAppSupportBase.cpp
 LIBS	+= $(TK_LIBS)
 endif
 
-ifeq ($(MOZ_WIDGET_TOOLKIT),gtk)
-SPLASH_XPM = $(srcdir)/splash.xpm
-CPPSRCS += nsNativeAppSupportGtk.cpp \
-	   nsNativeAppSupportBase.cpp
-DEFINES += -DSPLASH_XPM=\"$(SPLASH_XPM)\"
-LIBS += $(MOZ_GTK_LDFLAGS)
-endif
-
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 SPLASH_XPM = $(srcdir)/splash.xpm
 CPPSRCS += nsNativeAppSupportGtk.cpp \
 	   nsNativeAppSupportBase.cpp
 DEFINES += -DSPLASH_XPM=\"$(SPLASH_XPM)\"
 LIBS += $(MOZ_GTK2_LIBS)
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
 LIBS += $(MOZ_QT_LDFLAGS)
 endif
 
 # Add explicit X11 dependency when building against X11 toolkits
-ifneq (,$(filter gtk gtk2 qt xlib,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter gtk2 qt,$(MOZ_WIDGET_TOOLKIT)))
 LIBS += $(XLDFLAGS) $(XLIBS)
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 REQUIRES += xpconnect intl appcomps
 ifdef MOZ_PHOENIX
 REQUIRES += winhooks
 endif
@@ -279,17 +271,17 @@ endif
 RCINCLUDE = splash.rc
 CPPSRCS += nsNativeAppSupportWin.cpp nsNativeAppSupportBase.cpp
 OS_LIBS	+= $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
 endif
 
 ifndef MOZ_SUITE
 # Suite icons are all contained within /suite/branding
 
-ifneq (,$(filter windows os2 gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter windows os2 gtk2,$(MOZ_WIDGET_TOOLKIT)))
 ifneq (,$(filter windows os2,$(MOZ_WIDGET_TOOLKIT)))
 ICON_SUFFIX=.ico
 else
 ICON_SUFFIX=.xpm
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 ICON_DIR=gtk
@@ -328,20 +320,16 @@ DESKTOP_ICONS += \
 	image-file \
 	jpeg-file \
 	script-file \
 	xml-file \
 	xul-file \
 	$(NULL)
 endif
 
-ifeq ($(ICON_DIR),gtk)
-DESKTOP_ICONS_SMALL=$(patsubst %,%16,$(DESKTOP_ICONS))
-endif
-
 DESKTOP_ICON_FILES = $(addsuffix $(ICON_SUFFIX), $(DESKTOP_ICONS) $(DESKTOP_ICONS_SMALL))
 
 GARBAGE	+= $(addprefix $(DIST)/bin/chrome/icons/default/,$(DESKTOP_ICON_FILES))
 
 all::
 
 libs:: $(addprefix icons/$(ICON_DIR)/,$(DESKTOP_ICON_FILES))
 	$(INSTALL) $^ $(DIST)/bin/chrome/icons/default
@@ -376,20 +364,16 @@ ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH
 export:: $(STACKWALK_CPPSRCS)
 	$(INSTALL) $^ .
 endif
 
 ifdef BUILD_STATIC_LIBS
 include $(topsrcdir)/config/static-rules.mk
 endif
 
-ifeq ($(MOZ_WIDGET_TOOLKIT),gtk)
-$(PROGRAM): $(SPLASH_XPM)
-endif
-
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 ifdef BUILD_STATIC_LIBS
 LIBS	+= -framework QuickTime -framework IOKit
 endif
 
 endif
 
 ifeq ($(OS_ARCH),WINNT)
--- a/xpfe/bootstrap/nsAppRunner.cpp
+++ b/xpfe/bootstrap/nsAppRunner.cpp
@@ -285,26 +285,26 @@ static void InitializeMacOSXApp(int argc
 #if defined(MOZ_WIDGET_QT)
 #include <qapplication.h>
 #endif
 
 #ifdef MOZ_X11
 #include <X11/Xlib.h>
 #endif /* MOZ_X11 */
 
-#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GTK2)
+#if defined(MOZ_WIDGET_GTK2)
 #include <gtk/gtk.h>
-#endif //MOZ_WIDGET_GTK || MOZ_WIDGET_GTK2
+#endif
 
 #include "nsNativeAppSupport.h"
 
 /*********************************************/
 // Default implemenations for nativeAppSupport
 // If your platform implements these functions if def out this code.
-#if !defined(MOZ_WIDGET_COCOA) && !defined(MOZ_WIDGET_PHOTON) && !defined( XP_WIN) && !defined(XP_OS2) && !defined(MOZ_WIDGET_GTK) && !defined(MOZ_WIDGET_GTK2)
+#if !defined(MOZ_WIDGET_COCOA) && !defined(MOZ_WIDGET_PHOTON) && !defined( XP_WIN) && !defined(XP_OS2) && !defined(MOZ_WIDGET_GTK2)
 
 nsresult NS_CreateSplashScreen(nsISplashScreen **aResult)
 {
     nsresult rv = NS_OK;
     if (aResult) {
         *aResult = nsnull;
     } else {
         rv = NS_ERROR_NULL_POINTER;
@@ -329,17 +329,17 @@ PRBool NS_CanRun()
 //       nsISplashScreen interface directly.  At some point
 //       this function will return an instance of
 //       nsNativeAppSupportBase which will use the older
 //       "splash screen" interface.  The code below will
 //       then rely on nsINativeAppSupport and its use of
 //       nsISplashScreen will be removed.
 //
 
-#if !defined(XP_WIN) && !defined(XP_OS2)&& !defined( XP_BEOS ) && !defined(MOZ_WIDGET_GTK) && !defined(MOZ_WIDGET_GTK2) && !defined(XP_MAC) && (!defined(XP_MACOSX) || defined(MOZ_WIDGET_COCOA))
+#if !defined(XP_WIN) && !defined(XP_OS2)&& !defined( XP_BEOS ) && !defined(MOZ_WIDGET_GTK2) && !defined(XP_MAC) && (!defined(XP_MACOSX) || defined(MOZ_WIDGET_COCOA))
 
 nsresult NS_CreateNativeAppSupport(nsINativeAppSupport **aResult)
 {
     nsresult rv = NS_OK;
     if (aResult) {
         *aResult = nsnull;
     } else {
         rv = NS_ERROR_NULL_POINTER;
@@ -1241,42 +1241,16 @@ static nsresult main1(int argc, char* ar
 // English text needs to go into a dtd file.
 // But when this is called we have no components etc. These strings must either be
 // here, or in a native resource file.
 static void DumpHelp(char *appname)
 {
   printf("Usage: %s [ options ... ] [URL]\n"
          "       where options include:\n\n", appname);
 
-#ifdef MOZ_WIDGET_GTK
-  /* insert gtk options above moz options, like any other gtk app
-   *
-   * note: this isn't a very cool way to do things -- i'd rather get
-   * these straight from a user's gtk version -- but it seems to be
-   * what most gtk apps do. -dr
-   */
-  printf("GTK options\n"
-         "\t--gdk-debug=FLAGS\t\tGdk debugging flags to set\n"
-         "\t--gdk-no-debug=FLAGS\t\tGdk debugging flags to unset\n"
-         "\t--gtk-debug=FLAGS\t\tGtk+ debugging flags to set\n"
-         "\t--gtk-no-debug=FLAGS\t\tGtk+ debugging flags to unset\n"
-         "\t--gtk-module=MODULE\t\tLoad an additional Gtk module\n"
-         "\t-install\t\tInstall a private colormap\n");
-
-  /* end gtk toolkit options */
-#endif /* MOZ_WIDGET_GTK */
-#if MOZ_WIDGET_XLIB
-  printf("Xlib options\n"
-         "\t-display=DISPLAY\t\tX display to use\n"
-         "\t-visual=VISUALID\t\tX visual to use\n"
-         "\t-install_colormap\t\tInstall own colormap\n"
-         "\t-sync\t\tMake X calls synchronous\n"
-         "\t-no-xshm\t\tDon't use X shared memory extension\n");
-
-#endif /* MOZ_WIDGET_XLIB */
 #ifdef MOZ_X11
   printf("X11 options\n"
          "\t--display=DISPLAY\t\tX display to use\n"
          "\t--sync\t\tMake X calls synchronous\n"
          "\t--no-xshm\t\tDon't use X shared memory extension\n"
          "\t--xim-preedit=STYLE\n"
          "\t--xim-status=STYLE\n");
 #endif
@@ -1571,75 +1545,63 @@ int main(int argc, char* argv[])
   // They should% return quick, so we deal with them here.
   if (HandleDumpArguments(argc, argv))
     return 0;
 
 #ifdef NS_TRACE_MALLOC
   argc = NS_TraceMallocStartupArgs(argc, argv);
 #endif
 
-#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GTK2) || defined(MOZ_X11)
-  int i;
-#endif
-
 #ifdef MOZ_X11
   /* Init threadsafe mode of Xlib API on demand
    * (currently this is only for testing, future builds may use this by
    * default) */
   PRBool x11threadsafe;
   const char *xInitThreads = PR_GetEnv("MOZILLA_X11_XINITTHREADS");
   if (xInitThreads && *xInitThreads)
     x11threadsafe = PR_TRUE;
   else {
     x11threadsafe = PR_FALSE;
-    for (i = 1; i < argc; ++i)
+    for (int i = 1; i < argc; ++i)
       if (PL_strcmp(argv[i], "-xinitthreads") == 0) {
         x11threadsafe = PR_TRUE;
         break;
       }
   }
   if (x11threadsafe) {
     if (XInitThreads() == False) {
       fprintf(stderr, "%s: XInitThreads failure.", argv[0]);
       exit(EXIT_FAILURE);
     }
   }
 #endif /* MOZ_X11 */
 
-#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GTK2)
+#if defined(MOZ_WIDGET_GTK2)
   // setup for private colormap.  Ideally we'd like to do this
   // in nsAppShell::Create, but we need to get in before gtk
   // has been initialized to make sure everything is running
   // consistently.
-  for (i=1; i<argc; i++)
+  for (int i=1; i<argc; i++)
     if ((PL_strcasecmp(argv[i], "-install") == 0)
         || (PL_strcasecmp(argv[i], "--install") == 0)) {
       gdk_rgb_set_install(TRUE);
       break;
     }
 
-  // Initialize GTK+1/2 here for splash
-#if defined(MOZ_WIDGET_GTK)
-  gtk_set_locale();
-#endif
+  // Initialize GTK here for splash
   gtk_init(&argc, &argv);
 
   gtk_widget_set_default_visual(gdk_rgb_get_visual());
   gtk_widget_set_default_colormap(gdk_rgb_get_cmap());
-#endif /* MOZ_WIDGET_GTK || MOZ_WIDGET_GTK2 */
+#endif /* MOZ_WIDGET_GTK2 */
 
 #if defined(MOZ_WIDGET_QT)
   QApplication qapp(argc, argv);
 #endif
 
-// #if defined(MOZ_WIDGET_XLIB)
-// XXXtimeless fix me! Because we don't have external shared libs holding global
-// refs, there isn't an easy way to get a Display from here to the widget component.
-// #endif
-    
   // Call the code to install our handler
 #ifdef MOZ_JPROF
   setupProfilingStuff();
 #endif
     
 
 #ifdef XPCOM_GLUE
   NS_TIMELINE_MARK("GRE_Startup...");
--- a/xpfe/bootstrap/showOSAlert.cpp
+++ b/xpfe/bootstrap/showOSAlert.cpp
@@ -41,148 +41,24 @@
 #include "nscore.h"
 
 //defines and includes for previous installation cleanup process
 #if defined (XP_WIN)
 #include <windows.h>
 #elif defined (XP_MAC)
 #include <Dialogs.h>
 #include <TextUtils.h>
-#elif defined (MOZ_WIDGET_GTK)
-#include <gtk/gtk.h>
 #elif defined (XP_OS2)
 #define INCL_DOS
 #define INCL_WIN
 #include <os2.h>
 #endif
 
 extern "C" void ShowOSAlert(const char* aMessage);
 
-#if defined (MOZ_WIDGET_GTK)
-
-static int sbAlertDone = 0;
-
-/**
- * ns_gtk_alert_OK_callback
- *
- * Private callback function for the OK button on the alert.
- *
- * @param aWidget   the button widget
- * @param aData     the alert dialog passed in for destruction
- */
-void
-ns_gtk_alert_OK_callback(GtkWidget *aWidget, gpointer aData)
-{
-    GtkWidget *alertDlg = (GtkWidget *) aData;
-
-    if (!alertDlg)
-        return;
-
-    gtk_widget_destroy(alertDlg);
-    sbAlertDone = 1;
-}
-
-/**
- * NS_gtk_alert
- *
- * Displays an alert with a message and an OK button in a modal 
- * dialog that is centered on the screen.  Assumes gtk_main has 
- * been called or explicit event queue flushing is being performed.
- *
- * @param aMessage   [required] the message to display in the alert
- * @param aTitle     [optional] the alert dialog title;
- *                              passing NULL defaults the title to ""
- * @param aOKBtnText [optional] the text on the OK button;
- *                              parametrized for i18n purposes;
- *                              passing NULL defaults the button text to "OK"
- * @return int error code       returns 0 for SUCCESS;
- *                              returns -1 for param error;
- *                              returns -2 for widget creation error
- */
-int
-NS_gtk_alert(const char *aMessage, const char *aTitle, const char *aOKBtnText)
-{
-#ifdef DEBUG_dbragg
-    printf ("\n*** Now inside NS_gtk_alert *** \n");
-#endif 
-
-    GtkWidget *alertDlg = NULL;
-    GtkWidget *okBtn = NULL;
-    GtkWidget *msgLabel = NULL;
-    GtkWidget *packerLbl = NULL;
-    GtkWidget *packerBtn = NULL;
-    const char *okBtnText = aOKBtnText;
-    const char *title = aTitle;
-
-    if (!aMessage)
-        return -1;
-    if (!aOKBtnText)
-        okBtnText = "OK";
-    if (!aTitle)
-        title = " ";
-
-#ifdef DEBUG_dbragg
-    printf("title is: %s\n", title);
-#endif
-
-    alertDlg = gtk_dialog_new();
-    msgLabel = gtk_label_new(aMessage);
-    if (msgLabel)
-      gtk_label_set_line_wrap(GTK_LABEL(msgLabel), TRUE);
-    okBtn = gtk_button_new_with_label(okBtnText);
-    packerLbl = gtk_packer_new();
-    packerBtn = gtk_packer_new();
-    sbAlertDone = 0;
-
-    if (alertDlg && msgLabel && okBtn && packerBtn && packerLbl)
-    {
-        // pack widgets in dialog 
-        gtk_packer_set_default_border_width(GTK_PACKER(packerLbl), 20);
-        gtk_packer_add_defaults(GTK_PACKER(packerLbl), msgLabel, 
-            GTK_SIDE_BOTTOM, GTK_ANCHOR_CENTER, GTK_FILL_X);
-        gtk_packer_set_default_border_width(GTK_PACKER(packerBtn), 0);
-        gtk_packer_add_defaults(GTK_PACKER(packerBtn), okBtn, 
-            GTK_SIDE_BOTTOM, GTK_ANCHOR_CENTER, GTK_FILL_Y);
-        gtk_container_add(GTK_CONTAINER(GTK_DIALOG(alertDlg)->vbox), 
-            packerLbl);
-        gtk_container_add(GTK_CONTAINER(GTK_DIALOG(alertDlg)->action_area),
-            packerBtn);
-
-        gtk_window_set_modal(GTK_WINDOW(alertDlg), TRUE);
-        gtk_window_set_title(GTK_WINDOW(alertDlg), title);
-        gtk_window_set_position(GTK_WINDOW(alertDlg), GTK_WIN_POS_CENTER);
-
-        // register callback for OK button
-        gtk_signal_connect(GTK_OBJECT(okBtn), "clicked", 
-            GTK_SIGNAL_FUNC(ns_gtk_alert_OK_callback), alertDlg);
-        GTK_WIDGET_SET_FLAGS(okBtn, GTK_CAN_DEFAULT);
-        gtk_widget_grab_default(okBtn);
-
-        // show dialog
-        gtk_widget_show(msgLabel);
-        gtk_widget_show(packerLbl);
-        gtk_widget_show(okBtn);
-        gtk_widget_show(packerBtn);
-        gtk_widget_show(alertDlg);
-    }
-    else
-    {
-        return -2;
-    }
-
-    while (!sbAlertDone)
-    {
-        while (gtk_events_pending())
-            gtk_main_iteration();
-    }
-
-    return 0;
-}
-#endif //MOZ_WIDGET_GTK
-
 
 // The maximum allowed length of aMessage is 255 characters!
 void ShowOSAlert(const char* aMessage)
 {
 #ifdef DEBUG_dbragg
 printf("\n****Inside ShowOSAlert ***\n");	
 #endif 
 
@@ -193,18 +69,16 @@ printf("\n****Inside ShowOSAlert ***\n")
     strncpy(message_copy, aMessage, copy_len);
     message_copy[copy_len] = 0;
 
 #if defined (XP_WIN)
     MessageBox(NULL, message_copy, NULL, MB_OK | MB_ICONERROR | MB_SETFOREGROUND );
 #elif (XP_MAC)
     short buttonClicked;
     StandardAlert(kAlertStopAlert, c2pstr(message_copy), nil, nil, &buttonClicked);
-#elif defined (MOZ_WIDGET_GTK)
-    NS_gtk_alert(message_copy, NULL, "OK");
 #elif defined (XP_OS2)
     /* Set our app to be a PM app before attempting Win calls */
     PPIB ppib;
     PTIB ptib;
     DosGetInfoBlocks(&ptib, &ppib);
     ppib->pib_ultype = 3;
     HAB hab = WinInitialize(0);
     HMQ hmq = WinCreateMsgQueue(hmq,0);
--- a/xpfe/components/alerts/Makefile.in
+++ b/xpfe/components/alerts/Makefile.in
@@ -39,14 +39,14 @@ DEPTH   = ../../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH   = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 DIRS    = public
 
-ifneq (,$(filter $(MOZ_WIDGET_TOOLKIT),windows gtk gtk2))
+ifneq (,$(filter $(MOZ_WIDGET_TOOLKIT),windows gtk2))
 DIRS += src
 endif
 
 include $(topsrcdir)/config/rules.mk
 
--- a/xpfe/components/build/Makefile.in
+++ b/xpfe/components/build/Makefile.in
@@ -48,17 +48,17 @@ EXPORT_LIBRARY = 1
 IS_COMPONENT	= 1
 MODULE_NAME	= application
 LIBXUL_LIBRARY	= 1
 
 PACKAGE_FILE = appcomps.pkg
 PACKAGE_VARS += MOZ_PHOENIX
 
 ifndef MOZ_XUL_APP
-ifneq (,$(filter $(MOZ_WIDGET_TOOLKIT),windows gtk gtk2))
+ifneq (,$(filter $(MOZ_WIDGET_TOOLKIT),windows gtk2))
 ALERTS_SERVICE=1
 DEFINES += -DALERTS_SERVICE
 endif
 endif
 
 REQUIRES	= xpcom \
 		  string \
 		  content \
--- a/xpinstall/wizard/unix/src2/nsComponentsDlg.cpp
+++ b/xpinstall/wizard/unix/src2/nsComponentsDlg.cpp
@@ -58,57 +58,42 @@ nsComponentsDlg::~nsComponentsDlg()
     XI_IF_FREE(mMsg0);
     XI_IF_DELETE(mCompList);
 }
 
 void
 nsComponentsDlg::Back(GtkWidget *aWidget, gpointer aData)
 {
     DUMP("Back");
-    if (aData != gCtx->cdlg) return;
-#ifdef MOZ_WIDGET_GTK
-    if (gCtx->bMoving)
-    {
-        gCtx->bMoving = FALSE;
+    if (aData != gCtx->cdlg)
         return;
-    }
-#endif
 
     // hide this notebook page
     gCtx->cdlg->Hide();
 
     gCtx->sdlg->Show();
 
     // don't set bMoving since setuptype has no "back"
 }
 
 void
 nsComponentsDlg::Next(GtkWidget *aWidget, gpointer aData)
 {
     DUMP("Next");
-    if (aData != gCtx->cdlg) return;
-#ifdef MOZ_WIDGET_GTK
-    if (gCtx->bMoving)
-    {
-        gCtx->bMoving = FALSE;
+    if (aData != gCtx->cdlg)
         return;
-    }
-#endif
 
     if (OK != nsSetupTypeDlg::VerifyDiskSpace())
         return;
 
     // hide this notebook page
     gCtx->cdlg->Hide();
 
     // show the next dlg
     gCtx->idlg->Show();
-#ifdef MOZ_WIDGET_GTK
-    gCtx->bMoving = TRUE;
-#endif
 }
 
 int
 nsComponentsDlg::Parse(nsINIParser *aParser)
 {
     int err = OK;
     char *showDlg = NULL;
     int bufsize = 0;
--- a/xpinstall/wizard/unix/src2/nsInstallDlg.cpp
+++ b/xpinstall/wizard/unix/src2/nsInstallDlg.cpp
@@ -93,58 +93,42 @@ nsInstallDlg::~nsInstallDlg()
 {
     XI_IF_FREE(mMsg0);  
 }
 
 void
 nsInstallDlg::Back(GtkWidget *aWidget, gpointer aData)
 {
     DUMP("Back");
-    if (aData != gCtx->idlg) return;
-#ifdef MOZ_WIDGET_GTK
-    if (gCtx->bMoving)
-    {
-        gCtx->bMoving = FALSE;
+    if (aData != gCtx->idlg)
         return;
-    }
-#endif
 
     // hide this notebook page
     gCtx->idlg->Hide();
 
     // show the last dlg
     if (gCtx->opt->mSetupType == (gCtx->sdlg->GetNumSetupTypes() - 1))
     {
         gCtx->cdlg->Show();
         // only set bMoving for component dlg since setuptype has no "back"
-#ifdef MOZ_WIDGET_GTK
-        gCtx->bMoving = TRUE;
-#endif
     }
     else
     {
         gCtx->sdlg->Show();
     }
 }
 
 void
 nsInstallDlg::Next(GtkWidget *aWidget, gpointer aData)
 {
     DUMP("Next");
     GtkWidget *pauseLabel, *resumeLabel;
 
-    if (aData != gCtx->idlg) return;
-#ifdef MOZ_WIDGET_GTK
-    if (gCtx->bMoving)
-    {
-        gCtx->bMoving = FALSE;
-        DUMP("Moving done!");
+    if (aData != gCtx->idlg)
         return;
-    }
-#endif
 
     // initialize progress bar cleanly
     if (gCtx->opt->mMode != nsXIOptions::MODE_SILENT) {
         gtk_progress_set_activity_mode(GTK_PROGRESS(sMajorProgBar), FALSE);
         gtk_progress_bar_update(GTK_PROGRESS_BAR(sMajorProgBar), (gfloat) 0);
         gtk_label_set_text(GTK_LABEL(sMajorLabel), "");
 
         if (bDownload)
@@ -200,19 +184,16 @@ nsInstallDlg::Next(GtkWidget *aWidget, g
         if (!bDLCancel)
             PerformInstall();
     }
 
     // mode auto has no call to gtk_main()
     if (gCtx->opt->mMode == nsXIOptions::MODE_DEFAULT)
         gtk_main_quit();
     
-#ifdef MOZ_WIDGET_GTK
-    gCtx->bMoving = TRUE;
-#endif
     return;
 }
 
 int
 nsInstallDlg::Parse(nsINIParser *aParser)
 {
     int err = OK;
     int bufsize = 0;
--- a/xpinstall/wizard/unix/src2/nsLicenseDlg.cpp
+++ b/xpinstall/wizard/unix/src2/nsLicenseDlg.cpp
@@ -50,50 +50,34 @@ nsLicenseDlg::~nsLicenseDlg()
 {
     XI_IF_FREE(mLicenseFile);
 }
 
 void
 nsLicenseDlg::Back(GtkWidget *aWidget, gpointer aData)
 {
     DUMP("Back");
-    if (aData != gCtx->ldlg) return;
-#ifdef MOZ_WIDGET_GTK
-    if (gCtx->bMoving) 
-    {
-        gCtx->bMoving = FALSE;
+    if (aData != gCtx->ldlg)
         return;
-    }
-#endif
-    
     gtk_main_quit();
     return;
 }
 
 void
 nsLicenseDlg::Next(GtkWidget *aWidget, gpointer aData)
 {
     DUMP("Next");
-    if (aData != gCtx->ldlg) return;
-#ifdef MOZ_WIDGET_GTK
-    if (gCtx->bMoving) 
-    {
-        gCtx->bMoving = FALSE;
+    if (aData != gCtx->ldlg)
         return;
-    }
-#endif
 
     // hide this notebook page
     gCtx->ldlg->Hide();
 
     // show the next dlg
     gCtx->sdlg->Show();
-#ifdef MOZ_WIDGET_GTK
-    gCtx->bMoving = TRUE;
-#endif
 }
 
 int
 nsLicenseDlg::Parse(nsINIParser *aParser)
 {
     int err = OK;
     int bufsize = 0;
     char *showDlg = NULL;
@@ -156,41 +140,17 @@ nsLicenseDlg::Show()
         // read the license file contents into memory
         licenseContents = GetLicenseContents();
         if (!licenseContents)
         {
             err = ErrorHandler(E_EMPTY_LICENSE);
             goto BAIL;
         }
 
-#if defined(MOZ_WIDGET_GTK)
-        // create a new scrollable textarea and add it to the table
-        GtkWidget *text = gtk_text_new(NULL, NULL);
-        GdkFont *font = gdk_font_load( LICENSE_FONT );
-        gtk_text_set_editable(GTK_TEXT(text), FALSE);
-        gtk_text_set_word_wrap(GTK_TEXT(text), TRUE);
-        gtk_text_set_line_wrap(GTK_TEXT(text), TRUE);
-        gtk_table_attach(GTK_TABLE(mTable), text, 1, 2, 0, 1,
-            static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND),
-            static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND),
-			0, 0);
-        gtk_text_freeze(GTK_TEXT(text));
-        gtk_text_insert (GTK_TEXT(text), font, &text->style->black, NULL,
-                          licenseContents, -1);
-        gtk_text_thaw(GTK_TEXT(text));
-        gtk_widget_show(text);
-
-        // Add a vertical scrollbar to the GtkText widget 
-        GtkWidget *vscrollbar = gtk_vscrollbar_new (GTK_TEXT (text)->vadj);
-        gtk_table_attach(GTK_TABLE(mTable), vscrollbar, 2, 3, 0, 1,
-            GTK_FILL,
-			static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_SHRINK | GTK_FILL),
-			0, 0);
-        gtk_widget_show(vscrollbar);
-#elif defined(MOZ_WIDGET_GTK2)
+#if defined(MOZ_WIDGET_GTK2)
         GtkWidget *text = gtk_scrolled_window_new (NULL, NULL);
         GtkWidget *textview = gtk_text_view_new();
         GtkTextBuffer *textbuffer;
 
         textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
         gtk_text_buffer_set_text (textbuffer, licenseContents, -1);
         gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (text),
             GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
--- a/xpinstall/wizard/unix/src2/nsSetupTypeDlg.cpp
+++ b/xpinstall/wizard/unix/src2/nsSetupTypeDlg.cpp
@@ -85,24 +85,18 @@ nsSetupTypeDlg::~nsSetupTypeDlg()
 
     XI_IF_FREE(mMsg0)
 }
 
 void 
 nsSetupTypeDlg::Next(GtkWidget *aWidget, gpointer aData)
 {
     DUMP("Next");
-    if (aData && aData != gCtx->sdlg) return;
-#ifdef MOZ_WIDGET_GTK
-    if (gCtx->bMoving)
-    {
-        gCtx->bMoving = FALSE;
+    if (aData && aData != gCtx->sdlg)
         return;
-    }
-#endif
 
     // verify selected destination directory exists
     if (OK != nsSetupTypeDlg::VerifyDestination())
         return;
 
     // old installation may exist: delete it
     if (OK != nsSetupTypeDlg::DeleteOldInst())
         return;
@@ -135,25 +129,16 @@ nsSetupTypeDlg::Next(GtkWidget *aWidget,
         {
             gCtx->idlg->Show();
         }
         if (gCtx->opt->mMode != nsXIOptions::MODE_DEFAULT)
         {
             gCtx->idlg->Next((GtkWidget *)NULL, (gpointer) gCtx->idlg);
         }
     }
-
-#ifdef MOZ_WIDGET_GTK
-    // When Next() is not invoked from a signal handler, the caller passes
-    // aData as NULL so we know not to do the bMoving hack. 
-    if (aData)
-    {
-        gCtx->bMoving = TRUE;
-    }
-#endif
 }
 
 int
 nsSetupTypeDlg::Parse(nsINIParser *aParser)
 {
     int err = OK;
     int bufsize = 0;
     char *showDlg = NULL;
--- a/xpinstall/wizard/unix/src2/nsWelcomeDlg.cpp
+++ b/xpinstall/wizard/unix/src2/nsWelcomeDlg.cpp
@@ -52,33 +52,24 @@ nsWelcomeDlg::~nsWelcomeDlg()
     if (mReadmeFile)
         free (mReadmeFile);
 }
 
 void
 nsWelcomeDlg::Next(GtkWidget *aWidget, gpointer aData)
 {
     DUMP("Next");
-    if (aData != gCtx->wdlg) return;
-#ifdef MOZ_WIDGET_GTK
-    if (gCtx->bMoving) 
-    {
-        gCtx->bMoving = FALSE;
+    if (aData != gCtx->wdlg)
         return;
-    }
-#endif
 
     // hide this notebook page
     gCtx->wdlg->Hide();
 
     // show the next dlg
     gCtx->ldlg->Show();
-#ifdef MOZ_WIDGET_GTK
-    gCtx->bMoving = TRUE;
-#endif
 }
 
 int
 nsWelcomeDlg::Parse(nsINIParser *aParser)
 {
     int err = OK;
     int bufsize = 0;
     char *showDlg = NULL;
@@ -142,38 +133,17 @@ nsWelcomeDlg::Show()
         readmeContents = GetReadmeContents();
         if (!readmeContents)
         {
             err = ErrorHandler(E_EMPTY_README);
             goto BAIL;
         }
 
         // create a new scrollable textarea and add it to the table
-#if defined(MOZ_WIDGET_GTK)
-        GtkWidget *text = gtk_text_new(NULL, NULL);
-        GdkFont *font = gdk_font_load( README_FONT );
-        gtk_text_set_editable(GTK_TEXT(text), FALSE);
-        gtk_table_attach(GTK_TABLE(mTable), text, 1, 2, 0, 1,
-                       static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND),
-                       static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND),
-                       0, 0);
-        gtk_text_freeze(GTK_TEXT(text));
-        gtk_text_insert (GTK_TEXT(text), font, &text->style->black, NULL,
-                       readmeContents, -1);
-        gtk_text_thaw(GTK_TEXT(text));
-        gtk_text_set_word_wrap(GTK_TEXT(text), TRUE);
-        gtk_widget_show(text);
-
-        // Add a vertical scrollbar to the GtkText widget 
-        GtkWidget *vscrollbar = gtk_vscrollbar_new (GTK_TEXT (text)->vadj);
-        gtk_table_attach(GTK_TABLE(mTable), vscrollbar, 2, 3, 0, 1, GTK_FILL,
-                       static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_SHRINK | GTK_FILL),
-                       0, 0);
-        gtk_widget_show(vscrollbar);
-#elif defined(MOZ_WIDGET_GTK2)
+#if defined(MOZ_WIDGET_GTK2)
         GtkWidget *text = gtk_scrolled_window_new (NULL, NULL);
         GtkWidget *textview = gtk_text_view_new();
         GtkTextBuffer *textbuffer;
 
         textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
         gtk_text_buffer_set_text (textbuffer, readmeContents, -1);
         gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (text),
                        GTK_POLICY_AUTOMATIC,