From 7261c8520d3e728b80417f7ff45498a2f7d97acc Mon Sep 17 00:00:00 2001 From: Oleg Romashin Date: Fri, 15 Aug 2008 09:31:55 +0300 Subject: [PATCH] Removed old embedding API Removed old GLITZ stuff --- embedding/browser/qt/Makefile.in | 17 - embedding/browser/qt/qgeckoembed.pkg | 3 - embedding/browser/qt/src/EmbedContentListener.cpp | 161 ----- embedding/browser/qt/src/EmbedContentListener.h | 64 -- embedding/browser/qt/src/EmbedEventListener.cpp | 271 -------- embedding/browser/qt/src/EmbedEventListener.h | 89 --- embedding/browser/qt/src/EmbedGlobalHistory.cpp | 74 -- embedding/browser/qt/src/EmbedGlobalHistory.h | 66 -- embedding/browser/qt/src/EmbedModules.cpp | 56 -- embedding/browser/qt/src/EmbedProgress.cpp | 191 ------ embedding/browser/qt/src/EmbedProgress.h | 68 -- embedding/browser/qt/src/EmbedStream.cpp | 315 --------- embedding/browser/qt/src/EmbedStream.h | 84 --- embedding/browser/qt/src/EmbedWindow.cpp | 467 ------------- embedding/browser/qt/src/EmbedWindow.h | 102 --- embedding/browser/qt/src/EmbedWindowCreator.cpp | 99 --- embedding/browser/qt/src/EmbedWindowCreator.h | 55 -- embedding/browser/qt/src/Makefile.in | 103 --- embedding/browser/qt/src/QtPromptService.cpp | 509 -------------- embedding/browser/qt/src/QtPromptService.h | 62 -- embedding/browser/qt/src/alert.ui | 217 ------ embedding/browser/qt/src/config/qtconfig.mk | 26 - embedding/browser/qt/src/config/qtrules.mk | 15 - embedding/browser/qt/src/confirm.ui | 271 -------- embedding/browser/qt/src/prompt.ui | 291 -------- embedding/browser/qt/src/qgeckoembed.cpp | 781 ---------------------- embedding/browser/qt/src/qgeckoembed.h | 226 ------- embedding/browser/qt/src/qgeckoglobals.cpp | 397 ----------- embedding/browser/qt/src/qgeckoglobals.h | 98 --- embedding/browser/qt/src/select.ui | 229 ------- embedding/browser/qt/src/ui_alert.h | 159 ----- embedding/browser/qt/src/ui_confirm.h | 178 ----- embedding/browser/qt/src/ui_prompt.h | 196 ------ embedding/browser/qt/src/ui_select.h | 170 ----- embedding/browser/qt/src/ui_userpass.h | 221 ------ embedding/browser/qt/src/userpass.ui | 335 ---------- embedding/browser/qt/tests/Makefile.in | 103 --- embedding/browser/qt/tests/TestQGeckoEmbed.cpp | 61 -- embedding/browser/qt/tests/back.png | Bin 1523 -> 0 bytes embedding/browser/qt/tests/back.png.uu | 37 - embedding/browser/qt/tests/fileopen.png | Bin 1249 -> 0 bytes embedding/browser/qt/tests/fileopen.png.uu | 31 - embedding/browser/qt/tests/forward.png | Bin 1537 -> 0 bytes embedding/browser/qt/tests/forward.png.uu | 38 -- embedding/browser/qt/tests/mainwindow.cpp | 161 ----- embedding/browser/qt/tests/mainwindow.h | 39 -- embedding/browser/qt/tests/reload.png | Bin 1450 -> 0 bytes embedding/browser/qt/tests/reload.png.uu | 36 - embedding/browser/qt/tests/stop.png | Bin 1498 -> 0 bytes embedding/browser/qt/tests/stop.png.uu | 37 - gfx/src/thebes/Makefile.in | 3 - gfx/thebes/public/Makefile.in | 3 - toolkit/library/Makefile.in | 7 - toolkit/toolkit-tiers.mk | 18 - 54 files changed, 7240 deletions(-) delete mode 100644 embedding/browser/qt/Makefile.in delete mode 100644 embedding/browser/qt/qgeckoembed.pkg delete mode 100644 embedding/browser/qt/src/EmbedContentListener.cpp delete mode 100644 embedding/browser/qt/src/EmbedContentListener.h delete mode 100644 embedding/browser/qt/src/EmbedEventListener.cpp delete mode 100644 embedding/browser/qt/src/EmbedEventListener.h delete mode 100644 embedding/browser/qt/src/EmbedGlobalHistory.cpp delete mode 100644 embedding/browser/qt/src/EmbedGlobalHistory.h delete mode 100644 embedding/browser/qt/src/EmbedModules.cpp delete mode 100644 embedding/browser/qt/src/EmbedProgress.cpp delete mode 100644 embedding/browser/qt/src/EmbedProgress.h delete mode 100644 embedding/browser/qt/src/EmbedStream.cpp delete mode 100644 embedding/browser/qt/src/EmbedStream.h delete mode 100644 embedding/browser/qt/src/EmbedWindow.cpp delete mode 100644 embedding/browser/qt/src/EmbedWindow.h delete mode 100644 embedding/browser/qt/src/EmbedWindowCreator.cpp delete mode 100644 embedding/browser/qt/src/EmbedWindowCreator.h delete mode 100644 embedding/browser/qt/src/Makefile.in delete mode 100644 embedding/browser/qt/src/QtPromptService.cpp delete mode 100644 embedding/browser/qt/src/QtPromptService.h delete mode 100644 embedding/browser/qt/src/alert.ui delete mode 100644 embedding/browser/qt/src/config/qtconfig.mk delete mode 100644 embedding/browser/qt/src/config/qtrules.mk delete mode 100644 embedding/browser/qt/src/confirm.ui delete mode 100644 embedding/browser/qt/src/prompt.ui delete mode 100644 embedding/browser/qt/src/qgeckoembed.cpp delete mode 100644 embedding/browser/qt/src/qgeckoembed.h delete mode 100644 embedding/browser/qt/src/qgeckoglobals.cpp delete mode 100644 embedding/browser/qt/src/qgeckoglobals.h delete mode 100644 embedding/browser/qt/src/select.ui delete mode 100644 embedding/browser/qt/src/ui_alert.h delete mode 100644 embedding/browser/qt/src/ui_confirm.h delete mode 100644 embedding/browser/qt/src/ui_prompt.h delete mode 100644 embedding/browser/qt/src/ui_select.h delete mode 100644 embedding/browser/qt/src/ui_userpass.h delete mode 100644 embedding/browser/qt/src/userpass.ui delete mode 100644 embedding/browser/qt/tests/Makefile.in delete mode 100644 embedding/browser/qt/tests/TestQGeckoEmbed.cpp delete mode 100755 embedding/browser/qt/tests/back.png delete mode 100644 embedding/browser/qt/tests/back.png.uu delete mode 100755 embedding/browser/qt/tests/fileopen.png delete mode 100644 embedding/browser/qt/tests/fileopen.png.uu delete mode 100755 embedding/browser/qt/tests/forward.png delete mode 100644 embedding/browser/qt/tests/forward.png.uu delete mode 100644 embedding/browser/qt/tests/mainwindow.cpp delete mode 100644 embedding/browser/qt/tests/mainwindow.h delete mode 100755 embedding/browser/qt/tests/reload.png delete mode 100644 embedding/browser/qt/tests/reload.png.uu delete mode 100755 embedding/browser/qt/tests/stop.png delete mode 100644 embedding/browser/qt/tests/stop.png.uu diff --git a/embedding/browser/qt/Makefile.in b/embedding/browser/qt/Makefile.in deleted file mode 100644 index 028a860a8c..0000000000 --- a/embedding/browser/qt/Makefile.in +++ /dev/null @@ -1,17 +0,0 @@ -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = qgeckoembed -DIRS=src - -ifdef ENABLE_TESTS -TOOL_DIRS += tests -endif - -PACKAGE_FILE = qgeckoembed.pkg - -include $(topsrcdir)/config/rules.mk diff --git a/embedding/browser/qt/qgeckoembed.pkg b/embedding/browser/qt/qgeckoembed.pkg deleted file mode 100644 index ffbbf8cb9d..0000000000 --- a/embedding/browser/qt/qgeckoembed.pkg +++ /dev/null @@ -1,3 +0,0 @@ -[qeckoembed] -dist/bin/@DLLP@qeckoembed@DLLS@ -dist/bin/TestQeckoEmbed diff --git a/embedding/browser/qt/src/EmbedContentListener.cpp b/embedding/browser/qt/src/EmbedContentListener.cpp deleted file mode 100644 index aeeb38361d..0000000000 --- a/embedding/browser/qt/src/EmbedContentListener.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include -//#include -#include - -#include "nsIURI.h" - -#include "EmbedContentListener.h" -#include "qgeckoembed.h" - -#include "nsServiceManagerUtils.h" -#include "nsIWebNavigationInfo.h" -#include "nsDocShellCID.h" - -EmbedContentListener::EmbedContentListener(QGeckoEmbed *aOwner) -{ - mOwner = aOwner; -} - -EmbedContentListener::~EmbedContentListener() -{ -} - -NS_IMPL_ISUPPORTS2(EmbedContentListener, - nsIURIContentListener, - nsISupportsWeakReference) - -NS_IMETHODIMP -EmbedContentListener::OnStartURIOpen(nsIURI *aURI, - PRBool *aAbortOpen) -{ - nsresult rv; - - nsCAutoString specString; - rv = aURI->GetSpec(specString); - - if (NS_FAILED(rv)) - return rv; - - //we stop loading here because we want to pass the - //control to kio to check for mimetypes and all the other jazz - bool abort = false; - mOwner->startURIOpen(specString.get(), abort); - *aAbortOpen = abort; - - return NS_OK; -} - -NS_IMETHODIMP -EmbedContentListener::DoContent(const char *aContentType, - PRBool aIsContentPreferred, - nsIRequest *aRequest, - nsIStreamListener **aContentHandler, - PRBool *aAbortProcess) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -EmbedContentListener::IsPreferred(const char *aContentType, - char **aDesiredContentType, - PRBool *aCanHandleContent) -{ - return CanHandleContent(aContentType, PR_TRUE, aDesiredContentType, - aCanHandleContent); -} - -NS_IMETHODIMP -EmbedContentListener::CanHandleContent(const char *aContentType, - PRBool aIsContentPreferred, - char **aDesiredContentType, - PRBool *_retval) -{ - *_retval = PR_FALSE; - *aDesiredContentType = nsnull; - qDebug("HANDLING:"); - - if (aContentType) { - nsCOMPtr webNavInfo( - do_GetService(NS_WEBNAVIGATION_INFO_CONTRACTID)); - if (webNavInfo) { - PRUint32 canHandle; - nsresult rv = 0; -/* -FIXME - nsresult rv = - webNavInfo->IsTypeSupported(nsDependentCString(aContentType), - mOwner ? - mOwner->d->navigation.get() : - nsnull, - &canHandle);*/ - NS_ENSURE_SUCCESS(rv, rv); - *_retval = (canHandle != nsIWebNavigationInfo::UNSUPPORTED); - } - } - - qDebug("\tCan handle content %s: %d", aContentType, *_retval); - return NS_OK; -} - -NS_IMETHODIMP -EmbedContentListener::GetLoadCookie(nsISupports **aLoadCookie) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -EmbedContentListener::SetLoadCookie(nsISupports *aLoadCookie) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -EmbedContentListener::GetParentContentListener(nsIURIContentListener **aParent) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -EmbedContentListener::SetParentContentListener(nsIURIContentListener *aParent) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - diff --git a/embedding/browser/qt/src/EmbedContentListener.h b/embedding/browser/qt/src/EmbedContentListener.h deleted file mode 100644 index 5a76bcfdfe..0000000000 --- a/embedding/browser/qt/src/EmbedContentListener.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Lars Knoll - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef EMBEDCONTENTLISTENER_H -#define EMBEDCONTENTLISTENER_H - -#include -#include - -class QGeckoEmbed; - -class EmbedContentListener : public nsIURIContentListener, - public nsSupportsWeakReference -{ -public: - - EmbedContentListener(QGeckoEmbed *aOwner); - ~EmbedContentListener(); - - NS_DECL_ISUPPORTS - - NS_DECL_NSIURICONTENTLISTENER - -private: - QGeckoEmbed *mOwner; -}; - -#endif diff --git a/embedding/browser/qt/src/EmbedEventListener.cpp b/embedding/browser/qt/src/EmbedEventListener.cpp deleted file mode 100644 index 9ab54f250d..0000000000 --- a/embedding/browser/qt/src/EmbedEventListener.cpp +++ /dev/null @@ -1,271 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "EmbedEventListener.h" - -#include -#include - -#include "nsIDOMKeyEvent.h" -#include "nsIDOMUIEvent.h" - -#include "EmbedEventListener.h" -#include "qgeckoembed.h" - -EmbedEventListener::EmbedEventListener(QGeckoEmbed *aOwner) -{ - mOwner = aOwner; -} - -EmbedEventListener::~EmbedEventListener() -{ - -} - -NS_IMPL_ADDREF(EmbedEventListener) -NS_IMPL_RELEASE(EmbedEventListener) -NS_INTERFACE_MAP_BEGIN(EmbedEventListener) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMKeyListener) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEventListener, nsIDOMKeyListener) - NS_INTERFACE_MAP_ENTRY(nsIDOMKeyListener) - NS_INTERFACE_MAP_ENTRY(nsIDOMMouseListener) - NS_INTERFACE_MAP_ENTRY(nsIDOMUIListener) -NS_INTERFACE_MAP_END - -NS_IMETHODIMP -EmbedEventListener::HandleEvent(nsIDOMEvent* aEvent) -{ - return NS_OK; -} - -NS_IMETHODIMP -EmbedEventListener::KeyDown(nsIDOMEvent* aDOMEvent) -{ - nsCOMPtr keyEvent; - keyEvent = do_QueryInterface(aDOMEvent); - if (!keyEvent) - return NS_OK; - - // Return FALSE to this function to mark the event as not - // consumed ? - bool returnVal = mOwner->domKeyDownEvent(keyEvent); - - if (returnVal) { - aDOMEvent->StopPropagation(); - aDOMEvent->PreventDefault(); - } - return NS_OK; -} - -NS_IMETHODIMP -EmbedEventListener::KeyUp(nsIDOMEvent* aDOMEvent) -{ - nsCOMPtr keyEvent; - keyEvent = do_QueryInterface(aDOMEvent); - if (!keyEvent) - return NS_OK; - // return FALSE to this function to mark this event as not - // consumed... - - bool returnVal = mOwner->domKeyUpEvent(keyEvent); - if (returnVal) { - aDOMEvent->StopPropagation(); - aDOMEvent->PreventDefault(); - } - - return NS_OK; -} - -NS_IMETHODIMP -EmbedEventListener::KeyPress(nsIDOMEvent* aDOMEvent) -{ - nsCOMPtr keyEvent; - keyEvent = do_QueryInterface(aDOMEvent); - if (!keyEvent) - return NS_OK; - - // return FALSE to this function to mark this event as not - // consumed... - bool returnVal = mOwner->domKeyPressEvent(keyEvent); - if (returnVal) { - aDOMEvent->StopPropagation(); - aDOMEvent->PreventDefault(); - } - return NS_OK; -} - -NS_IMETHODIMP -EmbedEventListener::MouseDown(nsIDOMEvent* aDOMEvent) -{ - nsCOMPtr mouseEvent; - mouseEvent = do_QueryInterface(aDOMEvent); - if (!mouseEvent) - return NS_OK; - // return FALSE to this function to mark this event as not - // consumed... - - bool returnVal = mOwner->domMouseDownEvent(mouseEvent); - if (returnVal) { - aDOMEvent->StopPropagation(); - aDOMEvent->PreventDefault(); - } - - return NS_OK; -} - -NS_IMETHODIMP -EmbedEventListener::MouseUp(nsIDOMEvent* aDOMEvent) -{ - nsCOMPtr mouseEvent; - mouseEvent = do_QueryInterface(aDOMEvent); - if (!mouseEvent) - return NS_OK; - // Return FALSE to this function to mark the event as not - // consumed... - - bool returnVal = mOwner->domMouseUpEvent(mouseEvent); - if (returnVal) { - aDOMEvent->StopPropagation(); - aDOMEvent->PreventDefault(); - } - return NS_OK; -} - -NS_IMETHODIMP -EmbedEventListener::MouseClick(nsIDOMEvent* aDOMEvent) -{ - nsCOMPtr mouseEvent; - mouseEvent = do_QueryInterface(aDOMEvent); - if (!mouseEvent) - return NS_OK; - // Return FALSE to this function to mark the event as not - // consumed... - bool returnVal = mOwner->domMouseClickEvent(mouseEvent); - if (returnVal) { - aDOMEvent->StopPropagation(); - aDOMEvent->PreventDefault(); - } - return NS_OK; -} - -NS_IMETHODIMP -EmbedEventListener::MouseDblClick(nsIDOMEvent* aDOMEvent) -{ - nsCOMPtr mouseEvent; - mouseEvent = do_QueryInterface(aDOMEvent); - if (!mouseEvent) - return NS_OK; - // return FALSE to this function to mark this event as not - // consumed... - bool returnVal = mOwner->domMouseDblClickEvent(mouseEvent); - if (returnVal) { - aDOMEvent->StopPropagation(); - aDOMEvent->PreventDefault(); - } - return NS_OK; -} - -NS_IMETHODIMP -EmbedEventListener::MouseOver(nsIDOMEvent* aDOMEvent) -{ - nsCOMPtr mouseEvent; - mouseEvent = do_QueryInterface(aDOMEvent); - if (!mouseEvent) - return NS_OK; - // return FALSE to this function to mark this event as not - // consumed... - bool returnVal = mOwner->domMouseOverEvent(mouseEvent); - if (returnVal) { - aDOMEvent->StopPropagation(); - aDOMEvent->PreventDefault(); - } - return NS_OK; -} - -NS_IMETHODIMP -EmbedEventListener::MouseOut(nsIDOMEvent* aDOMEvent) -{ - nsCOMPtr mouseEvent; - mouseEvent = do_QueryInterface(aDOMEvent); - if (!mouseEvent) - return NS_OK; - // return FALSE to this function to mark this event as not - // consumed... - bool returnVal = mOwner->domMouseOutEvent(mouseEvent); - if (returnVal) { - aDOMEvent->StopPropagation(); - aDOMEvent->PreventDefault(); - } - return NS_OK; -} - -NS_IMETHODIMP -EmbedEventListener::Activate(nsIDOMEvent* aDOMEvent) -{ - nsCOMPtr uiEvent = do_QueryInterface(aDOMEvent); - if (!uiEvent) - return NS_OK; - // return NS_OK to this function to mark this event as not - // consumed... - - return mOwner->domActivateEvent(uiEvent); -} - -NS_IMETHODIMP -EmbedEventListener::FocusIn(nsIDOMEvent* aDOMEvent) -{ - nsCOMPtr uiEvent = do_QueryInterface(aDOMEvent); - if (!uiEvent) - return NS_OK; - // return NS_OK to this function to mark this event as not - // consumed... - - return mOwner->domFocusInEvent(uiEvent); -} - -NS_IMETHODIMP -EmbedEventListener::FocusOut(nsIDOMEvent* aDOMEvent) -{ - nsCOMPtr uiEvent = do_QueryInterface(aDOMEvent); - if (!uiEvent) - return NS_OK; - // return NS_OK to this function to mark this event as not - // consumed... - - return mOwner->domFocusOutEvent(uiEvent); -} diff --git a/embedding/browser/qt/src/EmbedEventListener.h b/embedding/browser/qt/src/EmbedEventListener.h deleted file mode 100644 index 9b7e1d81d3..0000000000 --- a/embedding/browser/qt/src/EmbedEventListener.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Lars Knoll - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef EMBEDEVENTLISTENER_H -#define EMBEDEVENTLISTENER_H - -#include -#include -#include - -class QGeckoEmbed; - -class EmbedEventListener : public nsIDOMKeyListener, - public nsIDOMMouseListener, - public nsIDOMUIListener -{ -public: - EmbedEventListener(QGeckoEmbed *q); - ~EmbedEventListener(); - - NS_DECL_ISUPPORTS - - // nsIDOMEventListener - - NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent); - - // nsIDOMKeyListener - - NS_IMETHOD KeyDown(nsIDOMEvent* aDOMEvent); - NS_IMETHOD KeyUp(nsIDOMEvent* aDOMEvent); - NS_IMETHOD KeyPress(nsIDOMEvent* aDOMEvent); - - // nsIDOMMouseListener - - NS_IMETHOD MouseDown(nsIDOMEvent* aDOMEvent); - NS_IMETHOD MouseUp(nsIDOMEvent* aDOMEvent); - NS_IMETHOD MouseClick(nsIDOMEvent* aDOMEvent); - NS_IMETHOD MouseDblClick(nsIDOMEvent* aDOMEvent); - NS_IMETHOD MouseOver(nsIDOMEvent* aDOMEvent); - NS_IMETHOD MouseOut(nsIDOMEvent* aDOMEvent); - - // nsIDOMUIListener - - NS_IMETHOD Activate(nsIDOMEvent* aDOMEvent); - NS_IMETHOD FocusIn(nsIDOMEvent* aDOMEvent); - NS_IMETHOD FocusOut(nsIDOMEvent* aDOMEvent); - -private: - - QGeckoEmbed *mOwner; -}; - -#endif diff --git a/embedding/browser/qt/src/EmbedGlobalHistory.cpp b/embedding/browser/qt/src/EmbedGlobalHistory.cpp deleted file mode 100644 index 6bcfec4016..0000000000 --- a/embedding/browser/qt/src/EmbedGlobalHistory.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "EmbedGlobalHistory.h" - -#include - -/* Implementation file */ -NS_IMPL_ISUPPORTS1(EmbedGlobalHistory, nsIGlobalHistory) - -EmbedGlobalHistory::EmbedGlobalHistory() -{ - /* member initializers and constructor code */ -} - -EmbedGlobalHistory::~EmbedGlobalHistory() -{ - /* destructor code */ -} - -/* void addPage (in string aURL); */ -NS_IMETHODIMP EmbedGlobalHistory::AddPage(const char *aURL) -{ - qDebug("here"); - return NS_ERROR_NOT_IMPLEMENTED; -} - -/* boolean isVisited (in string aURL); */ -NS_IMETHODIMP EmbedGlobalHistory::IsVisited(const char *aURL, PRBool *_retval) -{ - qDebug("HERE"); - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP EmbedGlobalHistory::Init() -{ - qDebug("initing embedglobal"); - return NS_OK; -} diff --git a/embedding/browser/qt/src/EmbedGlobalHistory.h b/embedding/browser/qt/src/EmbedGlobalHistory.h deleted file mode 100644 index 92ef2955fc..0000000000 --- a/embedding/browser/qt/src/EmbedGlobalHistory.h +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Lars Knoll - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef EMBEDGLOBALHISTORY_H -#define EMBEDGLOBALHISTORY_H - -#include "nsIGlobalHistory.h" - -#define NS_EMBEDGLOBALHISTORY_CID \ - { 0x2f977d51, 0x5485, 0x11d4, \ - { 0x87, 0xe2, 0x00, 0x10, 0xa4, 0xe7, 0x5e, 0xf2 } } - -/* Header file */ -class EmbedGlobalHistory : public nsIGlobalHistory -{ -public: - EmbedGlobalHistory(); - - NS_DECL_ISUPPORTS - NS_DECL_NSIGLOBALHISTORY - - NS_IMETHOD Init(); - - - -private: - ~EmbedGlobalHistory(); -}; - -#endif diff --git a/embedding/browser/qt/src/EmbedModules.cpp b/embedding/browser/qt/src/EmbedModules.cpp deleted file mode 100644 index 4d317c24a7..0000000000 --- a/embedding/browser/qt/src/EmbedModules.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "nsIGenericFactory.h" -#include "EmbedGlobalHistory.h" -#include "nsIGlobalHistory.h" - -#if 0 -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(EmbedGlobalHistory, Init) - -static const nsModuleComponentInfo components[] = -{ - { "Global History", - NS_EMBEDGLOBALHISTORY_CID, - "@mozilla.org/browser/global-history;1", - EmbedGlobalHistoryConstructor, - } -}; - -NS_IMPL_NSGETMODULE(QtComponents, components) -#endif diff --git a/embedding/browser/qt/src/EmbedProgress.cpp b/embedding/browser/qt/src/EmbedProgress.cpp deleted file mode 100644 index d272e76fae..0000000000 --- a/embedding/browser/qt/src/EmbedProgress.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Lars Knoll - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "EmbedProgress.h" - -#include "qgeckoembed.h" - -//#include -#include -#include -#include - -#include "nsIURI.h" -#include "nsCRT.h" -#include "nsStringGlue.h" - -EmbedProgress::EmbedProgress(QGeckoEmbed *aOwner) -{ - qDebug("XXX EMBEDPROGRSS"); - mOwner = aOwner; -} - -EmbedProgress::~EmbedProgress() -{ - qDebug("#########################################################################################"); -} - -NS_IMPL_ISUPPORTS2(EmbedProgress, - nsIWebProgressListener, - nsISupportsWeakReference) - -NS_IMETHODIMP -EmbedProgress::OnStateChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - PRUint32 aStateFlags, - nsresult aStatus) -{ - // give the widget a chance to attach any listeners - mOwner->contentStateChanged(); - // if we've got the start flag, emit the signal - if ((aStateFlags & STATE_IS_NETWORK) && - (aStateFlags & STATE_START)) - { - qDebug("net start"); - emit mOwner->netStart(); - } - - //XXX: emit state all here - - if ((aStateFlags & STATE_IS_NETWORK) && - (aStateFlags & STATE_STOP)) { - //qDebug("progress: --stop"); - emit mOwner->netStop(); - mOwner->contentFinishedLoading(); - } - - return NS_OK; -} - -NS_IMETHODIMP -EmbedProgress::OnProgressChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - PRInt32 aCurSelfProgress, - PRInt32 aMaxSelfProgress, - PRInt32 aCurTotalProgress, - PRInt32 aMaxTotalProgress) -{ -#if 0 - nsString tmpString; - RequestToURIString(aRequest, tmpString); - // is it the same as the current uri? - if (mOwner->mURI.Equals(tmpString)) - mOwner->progressAll(QString(tmpString.get()), aCurTotalProgress, aMaxTotalProgress); -#endif - //qDebug("progress self: %d %d", aCurSelfProgress, aMaxSelfProgress); - - mOwner->progress(aCurTotalProgress, aMaxTotalProgress); - return NS_OK; -} - -NS_IMETHODIMP -EmbedProgress::OnLocationChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - nsIURI *aLocation) -{ - nsCAutoString newURI; - NS_ENSURE_ARG_POINTER(aLocation); - aLocation->GetSpec(newURI); - - // Make sure that this is the primary frame change and not - // just a subframe. - PRBool isSubFrameLoad = PR_FALSE; - if (aWebProgress) { - nsCOMPtr domWindow; - nsCOMPtr topDomWindow; - - aWebProgress->GetDOMWindow(getter_AddRefs(domWindow)); - - // get the root dom window - if (domWindow) - domWindow->GetTop(getter_AddRefs(topDomWindow)); - - if (domWindow != topDomWindow) - isSubFrameLoad = PR_TRUE; - } - - if (!isSubFrameLoad) - emit mOwner->locationChanged(newURI.get()); - - return NS_OK; -} - -NS_IMETHODIMP -EmbedProgress::OnStatusChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - nsresult aStatus, - const PRUnichar *aMessage) -{ - QString message = QString::fromUtf16(aMessage); - emit mOwner->linkMessage(message); - - return NS_OK; -} - -NS_IMETHODIMP -EmbedProgress::OnSecurityChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - PRUint32 aState) -{ - //FIXME: - //emit mOwner->securityChange(aRequest, aState); - - return NS_OK; -} - -/* static */ -void -EmbedProgress::RequestToURIString(nsIRequest *aRequest, nsString &aString) -{ - // is it a channel - nsCOMPtr channel; - channel = do_QueryInterface(aRequest); - if (!channel) - return; - - nsCOMPtr uri; - channel->GetURI(getter_AddRefs(uri)); - if (!uri) - return; - - nsCAutoString uriString; - uri->GetSpec(uriString); - - CopyUTF8toUTF16(uriString, aString); -} diff --git a/embedding/browser/qt/src/EmbedProgress.h b/embedding/browser/qt/src/EmbedProgress.h deleted file mode 100644 index 3071c34934..0000000000 --- a/embedding/browser/qt/src/EmbedProgress.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Lars Knoll - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef EMBEDPROGRESS_H -#define EMBEDPROGRESS_H - -#include -#include - -#include "nsStringGlue.h" - -class QGeckoEmbed; - -class EmbedProgress : public nsIWebProgressListener, - public nsSupportsWeakReference -{ -public: - EmbedProgress(QGeckoEmbed *aOwner); - ~EmbedProgress(); - - NS_DECL_ISUPPORTS - - NS_DECL_NSIWEBPROGRESSLISTENER - -private: - - static void RequestToURIString(nsIRequest *aRequest, nsString &aString); - - QGeckoEmbed *mOwner; -}; - -#endif diff --git a/embedding/browser/qt/src/EmbedStream.cpp b/embedding/browser/qt/src/EmbedStream.cpp deleted file mode 100644 index c0b2ab33d3..0000000000 --- a/embedding/browser/qt/src/EmbedStream.cpp +++ /dev/null @@ -1,315 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Lars Knoll - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include -#include -#include -#include -#include -#include -#include - -#include "nsXPCOMCID.h" -#include "nsICategoryManager.h" - -#include "nsIContentViewer.h" - -#include "EmbedStream.h" -#include "qgeckoembed.h" -#include "EmbedWindow.h" -//#include "nsReadableUtils.h" - -// nsIInputStream interface - -NS_IMPL_ISUPPORTS1(EmbedStream, nsIInputStream) - - EmbedStream::EmbedStream() -{ - mOwner = nsnull; - mOffset = 0; - mDoingStream = PR_FALSE; -} - -EmbedStream::~EmbedStream() -{ -} - -void -EmbedStream::InitOwner(QGeckoEmbed *aOwner) -{ - mOwner = aOwner; -} - -NS_METHOD -EmbedStream::Init(void) -{ - nsresult rv = NS_OK; - - nsCOMPtr bufInStream; - nsCOMPtr bufOutStream; - - rv = NS_NewPipe(getter_AddRefs(bufInStream), - getter_AddRefs(bufOutStream)); - - if (NS_FAILED(rv)) return rv; - - mInputStream = bufInStream; - mOutputStream = bufOutStream; - return NS_OK; -} - -NS_METHOD -EmbedStream::OpenStream(const char *aBaseURI, const char *aContentType) -{ - qDebug("==================> OpenStream: %s (%s)", aBaseURI, aContentType); - NS_ENSURE_ARG_POINTER(aBaseURI); - NS_ENSURE_ARG_POINTER(aContentType); - - nsresult rv = NS_OK; - - // if we're already doing a stream then close the current one - if (mDoingStream) - CloseStream(); - - // set our state - mDoingStream = PR_TRUE; - - // initialize our streams - rv = Init(); - if (NS_FAILED(rv)) - return rv; - - // get the content area of our web browser - nsCOMPtr browser; - - - mOwner->window()->GetWebBrowser(getter_AddRefs(browser)); - - // get the viewer container - nsCOMPtr viewerContainer; - viewerContainer = do_GetInterface(browser); - - // create a new uri object - nsCOMPtr uri; - nsCAutoString spec(aBaseURI); - rv = NS_NewURI(getter_AddRefs(uri), spec.get()); - - if (NS_FAILED(rv)) - return rv; - - // create a new load group - rv = NS_NewLoadGroup(getter_AddRefs(mLoadGroup), nsnull); - if (NS_FAILED(rv)) - return rv; - - // create a new input stream channel - rv = NS_NewInputStreamChannel(getter_AddRefs(mChannel), uri, - this, - nsDependentCString(aContentType)); - if (NS_FAILED(rv)) - return rv; - - // set the channel's load group - rv = mChannel->SetLoadGroup(mLoadGroup); - if (NS_FAILED(rv)) - return rv; - - // find a document loader for this content type - - nsCString docLoaderContractID; - nsCOMPtr catMan(do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv)); - if (NS_FAILED(rv)) - return rv; - rv = catMan->GetCategoryEntry("Gecko-Content-Viewers", aContentType, - getter_Copies(docLoaderContractID)); - if (NS_FAILED(rv)) - return rv; - - nsCOMPtr docLoaderFactory; - docLoaderFactory = do_GetService(docLoaderContractID.get(), &rv); - if (NS_FAILED(rv)) - return rv; - - // ok, create an instance of the content viewer for that command and - // mime type - nsCOMPtr contentViewer; - rv = docLoaderFactory->CreateInstance("view", mChannel, mLoadGroup, - aContentType, viewerContainer, - nsnull, - getter_AddRefs(mStreamListener), - getter_AddRefs(contentViewer)); - if (NS_FAILED(rv)) - return rv; - - // set the container viewer container for this content view - rv = contentViewer->SetContainer(viewerContainer); - if (NS_FAILED(rv)) - return rv; - - // embed this sucker - rv = viewerContainer->Embed(contentViewer, "view", nsnull); - if (NS_FAILED(rv)) - return rv; - - // start our request - nsCOMPtr request = do_QueryInterface(mChannel); - rv = mStreamListener->OnStartRequest(request, NULL); - if (NS_FAILED(rv)) - return rv; - - return NS_OK; -} - -NS_METHOD -EmbedStream::AppendToStream(const char *aData, PRInt32 aLen) -{ - nsresult rv; - - // append the data - rv = Append(aData, aLen); - if (NS_FAILED(rv)) - return rv; - - // notify our listeners - nsCOMPtr request = do_QueryInterface(mChannel); - rv = mStreamListener->OnDataAvailable(request, - NULL, - static_cast(this), - mOffset, /* offset */ - aLen); /* len */ - // move our counter - mOffset += aLen; - if (NS_FAILED(rv)) - return rv; - - return NS_OK; -} - -NS_METHOD -EmbedStream::CloseStream(void) -{ - nsresult rv = NS_OK; - - NS_ENSURE_STATE(mDoingStream); - mDoingStream = PR_FALSE; - - nsCOMPtr request = do_QueryInterface(mChannel, &rv); - if (NS_FAILED(rv)) - goto loser; - - rv = mStreamListener->OnStopRequest(request, NULL, NS_OK); - if (NS_FAILED(rv)) - return rv; - - loser: - mLoadGroup = nsnull; - mChannel = nsnull; - mStreamListener = nsnull; - mOffset = 0; - - return rv; -} - -NS_METHOD -EmbedStream::Append(const char *aData, PRUint32 aLen) -{ - nsresult rv = NS_OK; - PRUint32 bytesWritten = 0; - rv = mOutputStream->Write(aData, aLen, &bytesWritten); - if (NS_FAILED(rv)) - return rv; - - NS_ASSERTION(bytesWritten == aLen, - "underlying byffer couldn't handle the write"); - return rv; -} - -NS_IMETHODIMP -EmbedStream::Available(PRUint32 *_retval) -{ - return mInputStream->Available(_retval); -} - -NS_IMETHODIMP -EmbedStream::Read(char * aBuf, PRUint32 aCount, PRUint32 *_retval) -{ - return mInputStream->Read(aBuf, aCount, _retval); -} - -NS_IMETHODIMP EmbedStream::Close(void) -{ - return mInputStream->Close(); -} - -NS_IMETHODIMP -EmbedStream::ReadSegments(nsWriteSegmentFun aWriter, void * aClosure, - PRUint32 aCount, PRUint32 *_retval) -{ - char *readBuf = (char *)nsMemory::Alloc(aCount); - PRUint32 nBytes; - - if (!readBuf) - return NS_ERROR_OUT_OF_MEMORY; - - nsresult rv = mInputStream->Read(readBuf, aCount, &nBytes); - - *_retval = 0; - - if (NS_SUCCEEDED(rv)) { - PRUint32 writeCount = 0; - rv = aWriter(this, aClosure, readBuf, 0, nBytes, &writeCount); - - // XXX writeCount may be less than nBytes!! This is the wrong - // way to synthesize ReadSegments. - NS_ASSERTION(writeCount == nBytes, "data loss"); - - // errors returned from the writer end here! - rv = NS_OK; - } - - nsMemory::Free(readBuf); - - return rv; -} - -NS_IMETHODIMP -EmbedStream::IsNonBlocking(PRBool *aNonBlocking) -{ - return mInputStream->IsNonBlocking(aNonBlocking); -} diff --git a/embedding/browser/qt/src/EmbedStream.h b/embedding/browser/qt/src/EmbedStream.h deleted file mode 100644 index 5b0a830886..0000000000 --- a/embedding/browser/qt/src/EmbedStream.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Lars Knoll - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include -#include -#include -#include -#include -#include -#include - -class QGeckoEmbed; - -class EmbedStream : public nsIInputStream -{ -public: - - EmbedStream(); - ~EmbedStream(); - - void InitOwner (QGeckoEmbed *aOwner); - NS_METHOD Init (void); - - NS_METHOD OpenStream (const char *aBaseURI, const char *aContentType); - NS_METHOD AppendToStream (const char *aData, PRInt32 aLen); - NS_METHOD CloseStream (void); - - NS_METHOD Append (const char *aData, PRUint32 aLen); - - // nsISupports - NS_DECL_ISUPPORTS - // nsIInputStream - NS_DECL_NSIINPUTSTREAM - -private: - nsCOMPtr mOutputStream; - nsCOMPtr mInputStream; - - nsCOMPtr mLoadGroup; - nsCOMPtr mChannel; - nsCOMPtr mStreamListener; - - PRUint32 mOffset; - PRBool mDoingStream; - - QGeckoEmbed *mOwner; - -}; diff --git a/embedding/browser/qt/src/EmbedWindow.cpp b/embedding/browser/qt/src/EmbedWindow.cpp deleted file mode 100644 index 7c15fa0939..0000000000 --- a/embedding/browser/qt/src/EmbedWindow.cpp +++ /dev/null @@ -1,467 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Lars Knoll - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "EmbedWindow.h" - -#include "qgeckoembed.h" - -#include -#include -#include -#include -#include "nsIWidget.h" -#include "nsIWebNavigation.h" -//#include "nsReadableUtils.h" -#include "nsStringGlue.h" -#include "nsIDOMNode.h" -#include "nsIDOMElement.h" -#include "nsIDOMEvent.h" - -#include -#include -#include -#include -#include -#include -#include - -class MozTipLabel : public QLabel -{ -public: - MozTipLabel( QWidget* parent) - : QLabel( "toolTipTip", parent, Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool | Qt::X11BypassWindowManagerHint) - { - setMargin(1); - //setAutoMask( FALSE ); - setFrameStyle( QFrame::Plain | QFrame::Box ); - setLineWidth( 1 ); - setAlignment( Qt::AlignLeft | Qt::AlignTop ); - setIndent(0); -// polish(); - adjustSize(); - setFont(QToolTip::font()); - setPalette(QToolTip::palette()); - } -}; - - -EmbedWindow::EmbedWindow() - : mOwner(nsnull), - mVisibility(PR_FALSE), - mIsModal(PR_FALSE), - tooltip(0) -{ -} - -EmbedWindow::~EmbedWindow(void) -{ - ExitModalEventLoop(PR_FALSE); - if (tooltip) - delete tooltip; -} - -void -EmbedWindow::Init(QGeckoEmbed *aOwner) -{ - // save our owner for later - mOwner = aOwner; - - // create our nsIWebBrowser object and set up some basic defaults. - mWebBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID); - if (!mWebBrowser) { - //log an error - return; - } - - mWebBrowser->SetContainerWindow(static_cast(this)); - - nsCOMPtr item = do_QueryInterface(mWebBrowser); - item->SetItemType(nsIDocShellTreeItem::typeContentWrapper); - -} - -nsresult -EmbedWindow::CreateWindow(void) -{ - nsresult rv; - - // Get the base window interface for the web browser object and - // create the window. - mBaseWindow = do_QueryInterface(mWebBrowser); - rv = mBaseWindow->InitWindow(mOwner, - nsnull, - 0, 0, - mOwner->width(), - mOwner->height()); - if (NS_FAILED(rv)) - return rv; - - rv = mBaseWindow->Create(); - if (NS_FAILED(rv)) - return rv; - - return NS_OK; -} - -void -EmbedWindow::ReleaseChildren(void) -{ - ExitModalEventLoop(PR_FALSE); - - mBaseWindow->Destroy(); - mBaseWindow = 0; - mWebBrowser = 0; -} - -// nsISupports - -NS_IMPL_ADDREF(EmbedWindow) - NS_IMPL_RELEASE(EmbedWindow) - - NS_INTERFACE_MAP_BEGIN(EmbedWindow) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowserChrome) - NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome) - NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChromeFocus) - NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow) - NS_INTERFACE_MAP_ENTRY(nsITooltipListener) - NS_INTERFACE_MAP_ENTRY(nsIContextMenuListener) - NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor) - NS_INTERFACE_MAP_END - -// nsIWebBrowserChrome - -NS_IMETHODIMP -EmbedWindow::SetStatus(PRUint32 aStatusType, const PRUnichar *aStatus) -{ - switch (aStatusType) { - case STATUS_SCRIPT: - { - mOwner->emitScriptStatus(QString::fromUtf16(aStatus)); - } - break; - case STATUS_SCRIPT_DEFAULT: - // Gee, that's nice. - break; - case STATUS_LINK: - { - mLinkMessage = aStatus; - mOwner->emitLinkStatus(QString::fromUtf16(aStatus)); - } - break; - } - return NS_OK; -} - -NS_IMETHODIMP -EmbedWindow::GetWebBrowser(nsIWebBrowser **aWebBrowser) -{ - *aWebBrowser = mWebBrowser; - NS_IF_ADDREF(*aWebBrowser); - return NS_OK; -} - -NS_IMETHODIMP -EmbedWindow::SetWebBrowser(nsIWebBrowser *aWebBrowser) -{ - mWebBrowser = aWebBrowser; - return NS_OK; -} - -NS_IMETHODIMP -EmbedWindow::GetChromeFlags(PRUint32 *aChromeFlags) -{ - *aChromeFlags = mOwner->chromeMask(); - return NS_OK; -} - -NS_IMETHODIMP -EmbedWindow::SetChromeFlags(PRUint32 aChromeFlags) -{ - mOwner->setChromeMask(aChromeFlags); - return NS_OK; -} - -NS_IMETHODIMP -EmbedWindow::DestroyBrowserWindow(void) -{ - emit mOwner->destroyBrowser(); - - return NS_OK; -} - -NS_IMETHODIMP -EmbedWindow::SizeBrowserTo(PRInt32 aCX, PRInt32 aCY) -{ - emit mOwner->sizeTo(aCX, aCY); - return NS_OK; -} - -NS_IMETHODIMP -EmbedWindow::ShowAsModal(void) -{ - qDebug("setting modal"); - mIsModal = PR_TRUE; - //qApp->eventLoop()->enterLoop(); - return NS_OK; -} - -NS_IMETHODIMP -EmbedWindow::IsWindowModal(PRBool *_retval) -{ - *_retval = mIsModal; - return NS_OK; -} - -NS_IMETHODIMP -EmbedWindow::ExitModalEventLoop(nsresult aStatus) -{ - qDebug("exiting modal"); - //qApp->eventLoop()->exitLoop(); - return NS_OK; -} - -// nsIWebBrowserChromeFocus - -NS_IMETHODIMP -EmbedWindow::FocusNextElement() -{ - //FIXME: - //i think gecko handles that internally - //mOwner->focusNextPrevChild(TRUE); - return NS_OK; -} - -NS_IMETHODIMP -EmbedWindow::FocusPrevElement() -{ - //FIXME: same story as above - //mOwner->focusNextPrevChild(FALSE); - return NS_OK; -} - -// nsIEmbeddingSiteWindow - -NS_IMETHODIMP -EmbedWindow::SetDimensions(PRUint32 aFlags, PRInt32 aX, PRInt32 aY, - PRInt32 aCX, PRInt32 aCY) -{ - if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION && - (aFlags & (nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER | - nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER))) { - return mBaseWindow->SetPositionAndSize(aX, aY, aCX, aCY, PR_TRUE); - } - else if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION) { - return mBaseWindow->SetPosition(aX, aY); - } - else if (aFlags & (nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER | - nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER)) { - return mBaseWindow->SetSize(aCX, aCY, PR_TRUE); - } - return NS_ERROR_INVALID_ARG; -} - -NS_IMETHODIMP -EmbedWindow::GetDimensions(PRUint32 aFlags, PRInt32 *aX, - PRInt32 *aY, PRInt32 *aCX, PRInt32 *aCY) -{ - if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION && - (aFlags & (nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER | - nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER))) { - return mBaseWindow->GetPositionAndSize(aX, aY, aCX, aCY); - } - else if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION) { - return mBaseWindow->GetPosition(aX, aY); - } - else if (aFlags & (nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER | - nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER)) { - return mBaseWindow->GetSize(aCX, aCY); - } - return NS_ERROR_INVALID_ARG; -} - -NS_IMETHODIMP -EmbedWindow::SetFocus(void) -{ - // XXX might have to do more here. - return mBaseWindow->SetFocus(); -} - -NS_IMETHODIMP -EmbedWindow::GetTitle(PRUnichar **aTitle) -{ - *aTitle = ToNewUnicode(mTitle); - return NS_OK; -} - -NS_IMETHODIMP -EmbedWindow::SetTitle(const PRUnichar *aTitle) -{ - mTitle = aTitle; - emit mOwner->windowTitleChanged(QString::fromUtf16(aTitle)); - return NS_OK; -} - -NS_IMETHODIMP -EmbedWindow::GetSiteWindow(void **aSiteWindow) -{ - *aSiteWindow = static_cast(mOwner); - return NS_OK; -} - -NS_IMETHODIMP -EmbedWindow::GetVisibility(PRBool *aVisibility) -{ - *aVisibility = mVisibility; - return NS_OK; -} - -NS_IMETHODIMP -EmbedWindow::SetVisibility(PRBool aVisibility) -{ - // We always set the visibility so that if it's chrome and we finish - // the load we know that we have to show the window. - mVisibility = aVisibility; - - // if this is a chrome window and the chrome hasn't finished loading - // yet then don't show the window yet. - if (mOwner->isChrome() && !mOwner->chromeLoaded()) - return NS_OK; - - emit mOwner->visibilityChanged(aVisibility); - - return NS_OK; -} - -// nsITooltipListener - -NS_IMETHODIMP -EmbedWindow::OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar *aTipText) -{ - QString tipText = QString::fromUtf16(aTipText); - - // get the root origin for this content window - nsCOMPtr mainWidget; - mBaseWindow->GetMainWidget(getter_AddRefs(mainWidget)); - QWidget *window; - window = static_cast(mainWidget->GetNativeData(NS_NATIVE_WINDOW)); - - if (!window) { - NS_ERROR("no qt window in hierarchy!\n"); - return NS_ERROR_FAILURE; - } - - int screen = qApp->desktop()->screenNumber(window); - if (!tooltip || qApp->desktop()->screenNumber(tooltip) != screen) { - delete tooltip; - QWidget *s = QApplication::desktop()->screen(screen); - tooltip = new MozTipLabel(s); - } - - tooltip->setText(tipText); - tooltip->resize(tooltip->sizeHint()); - QPoint pos(aXCoords, aYCoords+24); - pos = window->mapToGlobal(pos); - tooltip->move(pos); - tooltip->show(); - - return NS_OK; -} - -NS_IMETHODIMP -EmbedWindow::OnHideTooltip(void) -{ - if (tooltip) - tooltip->hide(); - return NS_OK; -} - - -NS_IMETHODIMP -EmbedWindow::OnShowContextMenu(PRUint32 aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode) -{ -// if (!aEvent->type == NS_CONTEXTMENU) -// return NS_OK; - qDebug("EmbedWindow::OnShowContextMenu"); - - QString url = mOwner->url(); - - PRUint16 nodeType; - aNode->GetNodeType(&nodeType); - if (nodeType == nsIDOMNode::ELEMENT_NODE) { - nsIDOMElement *element = static_cast(aNode); - nsString tagname; - element->GetTagName(tagname); - nsCString ctagname; - LossyCopyUTF16toASCII(tagname, ctagname); - if (!strcasecmp(ctagname.get(), "a")) { - nsString href; - nsString attr; - attr.Assign(NS_LITERAL_STRING("href")); - element->GetAttribute(attr, href); - url = mOwner->resolvedUrl(QString::fromUtf16(href.get())); - } else if (!strcasecmp(ctagname.get(), "img")) { - nsString href; - nsString attr; - attr.Assign(NS_LITERAL_STRING("src")); - element->GetAttribute(attr, href); - url = mOwner->resolvedUrl(QString::fromUtf16(href.get())); - } - } - - emit mOwner->showContextMenu(QCursor::pos(), url); - return NS_OK; -} - -// nsIInterfaceRequestor - -NS_IMETHODIMP -EmbedWindow::GetInterface(const nsIID &aIID, void** aInstancePtr) -{ - nsresult rv; - - rv = QueryInterface(aIID, aInstancePtr); - - // pass it up to the web browser object - if (NS_FAILED(rv) || !*aInstancePtr) { - nsCOMPtr ir = do_QueryInterface(mWebBrowser); - return ir->GetInterface(aIID, aInstancePtr); - } - - return rv; -} diff --git a/embedding/browser/qt/src/EmbedWindow.h b/embedding/browser/qt/src/EmbedWindow.h deleted file mode 100644 index ccadcb5abc..0000000000 --- a/embedding/browser/qt/src/EmbedWindow.h +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Lars Knoll - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef EMBEDWINDOW_H -#define EMBEDWINDOW_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "nsStringGlue.h" - -class QGeckoEmbed; -class MozTipLabel; - -class EmbedWindow : public nsIWebBrowserChrome, - public nsIWebBrowserChromeFocus, - public nsIEmbeddingSiteWindow, - public nsITooltipListener, - public nsIContextMenuListener, - public nsIInterfaceRequestor -{ -public: - EmbedWindow(); - ~EmbedWindow(); - void Init(QGeckoEmbed *aOwner); - - nsresult CreateWindow (void); - void ReleaseChildren (void); - - NS_DECL_ISUPPORTS - - NS_DECL_NSIWEBBROWSERCHROME - - NS_DECL_NSIWEBBROWSERCHROMEFOCUS - - NS_DECL_NSIEMBEDDINGSITEWINDOW - - NS_DECL_NSITOOLTIPLISTENER - - NS_DECL_NSICONTEXTMENULISTENER - - NS_DECL_NSIINTERFACEREQUESTOR - - nsString mTitle; - nsString mJSStatus; - nsString mLinkMessage; - - nsCOMPtr mBaseWindow; // [OWNER] - -private: - QGeckoEmbed *mOwner; - nsCOMPtr mWebBrowser; // [OWNER] - PRBool mVisibility; - PRBool mIsModal; - MozTipLabel *tooltip; -}; - -#endif diff --git a/embedding/browser/qt/src/EmbedWindowCreator.cpp b/embedding/browser/qt/src/EmbedWindowCreator.cpp deleted file mode 100644 index 77d9d36676..0000000000 --- a/embedding/browser/qt/src/EmbedWindowCreator.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Lars Knoll - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "EmbedWindowCreator.h" - -#include "qgeckoembed.h" -#include "qgeckoglobals.h" -#include "EmbedWindow.h" - - -EmbedWindowCreator::EmbedWindowCreator() -{ -} - -EmbedWindowCreator::~EmbedWindowCreator() -{ -} - -NS_IMPL_ISUPPORTS1(EmbedWindowCreator, nsIWindowCreator) - -NS_IMETHODIMP -EmbedWindowCreator::CreateChromeWindow(nsIWebBrowserChrome *aParent, - PRUint32 aChromeFlags, - nsIWebBrowserChrome **_retval) -{ - NS_ENSURE_ARG_POINTER(_retval); - - QGeckoEmbed *newEmbed = 0; - - // No parent? Ask via the singleton object instead. - if (!aParent) { - //create single create window - qDebug("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX not implemented"); - } - else { - // Find the QGeckoEmbed object for this web browser chrome object. - QGeckoEmbed *qecko = QGeckoGlobals::findPrivateForBrowser(aParent); - - if (!qecko) - return NS_ERROR_FAILURE; - newEmbed = qecko; - emit newEmbed->newWindow(&newEmbed, aChromeFlags); - } - - // check to make sure that we made a new window - if (!newEmbed) - return NS_ERROR_FAILURE; - - qDebug("MMMMM here"); - // set the chrome flag on the new window if it's a chrome open - if (aChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME) - newEmbed->setIsChrome(PR_TRUE); - - *_retval = static_cast - (newEmbed->window()); - - if (*_retval) { - NS_ADDREF(*_retval); - return NS_OK; - } - - return NS_ERROR_FAILURE; -} diff --git a/embedding/browser/qt/src/EmbedWindowCreator.h b/embedding/browser/qt/src/EmbedWindowCreator.h deleted file mode 100644 index fab210c05b..0000000000 --- a/embedding/browser/qt/src/EmbedWindowCreator.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Lars Knoll - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef EMBEDWINDOWCREATOR_H -#define EMBEDWINDOWCREATOR_H - -#include - -class EmbedWindowCreator : public nsIWindowCreator -{ -public: - EmbedWindowCreator(); - ~EmbedWindowCreator(); - - NS_DECL_ISUPPORTS - NS_DECL_NSIWINDOWCREATOR -}; - -#endif diff --git a/embedding/browser/qt/src/Makefile.in b/embedding/browser/qt/src/Makefile.in deleted file mode 100644 index 8ffd237e14..0000000000 --- a/embedding/browser/qt/src/Makefile.in +++ /dev/null @@ -1,103 +0,0 @@ -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = qgeckoembed -LIBRARY_NAME = qgeckoembed -LIBXUL_LIBRARY = 1 -FORCE_STATIC_LIB = 1 - -DEFINES += -DIMPL_XREAPI - -ifndef MOZ_ENABLE_LIBXUL -MOZ_QTEMBED_DYN = 1 -endif -ifdef MOZ_QTEMBED_DYN -FORCE_SHARED_LIB = 1 -ifdef MOZ_ENABLE_LIBXUL -LIBXUL_LIBRARY = -endif -endif - -REQUIRES = xpcom \ - string \ - docshell \ - webshell \ - necko \ - widget \ - dom \ - js \ - gfx \ - layout \ - content \ - uriloader \ - webbrwsr \ - shistory \ - embed_base \ - windowwatcher \ - profdirserviceprovider \ - xulapp \ - $(NULL) - -ifdef ACCESSIBILITY -REQUIRES += accessibility -endif - -CPPSRCS = \ - $(MOCSRCS) \ - qgeckoembed.cpp \ - EmbedWindow.cpp \ - EmbedProgress.cpp \ - EmbedContentListener.cpp \ - EmbedEventListener.cpp \ - EmbedWindowCreator.cpp \ - EmbedStream.cpp \ - QtPromptService.cpp \ - qgeckoglobals.cpp \ - $(NULL) - -# $(srcdir)/QtPromptService.cpp \ - -MOCSRCS = \ - moc_qgeckoembed.cpp \ - $(NULL) - - -#UICSRCS = \ -# alert.ui \ -# confirm.ui \ -# prompt.ui \ -# select.ui \ -# userpass.ui \ -# $(NULL) - -# Include config.mk -include $(topsrcdir)/config/config.mk -include $(srcdir)/config/qtconfig.mk - -EXPORTS = qgeckoembed.h - -ifdef MOZ_QTEMBED_DYN -EXTRA_DSO_LDOPTS += \ - $(DIST)/lib/libxpcomglue_s.$(LIB_SUFFIX) \ - $(MOZ_COMPONENT_LIBS) \ - $(MOZ_QT_LIBS) \ - $(NULL) - -ifndef MOZ_ENABLE_LIBXUL -EXTRA_DSO_LDOPTS += \ - -lxul \ - $(NULL) -endif -endif - -include $(topsrcdir)/config/rules.mk -include $(srcdir)/config/qtrules.mk - -QtPromptService.cpp : $(UI_HSRCS) - -CXXFLAGS += $(MOZ_QT_CFLAGS) -CFLAGS += $(MOZ_QT_CFLAGS) diff --git a/embedding/browser/qt/src/QtPromptService.cpp b/embedding/browser/qt/src/QtPromptService.cpp deleted file mode 100644 index 76070b9bb4..0000000000 --- a/embedding/browser/qt/src/QtPromptService.cpp +++ /dev/null @@ -1,509 +0,0 @@ -/* - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Lixto GmbH. - * Portions created by Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Michal Ceresna - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "QtPromptService.h" -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ui_alert.h" -#include "ui_confirm.h" -#include "ui_prompt.h" -#include "ui_userpass.h" -#include "ui_select.h" - -#if (QT_VERSION < 0x030200) -//constant not defined in older qt version -#define SP_MessageBoxQuestion SP_MessageBoxInformation -#endif - -QtPromptService::QtPromptService() -{ -} - -QtPromptService::~QtPromptService() -{ -} - -NS_IMPL_ISUPPORTS1(QtPromptService, nsIPromptService) - -/** - * Puts up an alert dialog with an OK button. - */ -NS_IMETHODIMP -QtPromptService::Alert(nsIDOMWindow* aParent, - const PRUnichar* aDialogTitle, - const PRUnichar* aDialogText) -{ - return - AlertCheck(aParent, - aDialogTitle, aDialogText, - NULL, NULL); -} - -/** - * Puts up an alert dialog with an OK button and - * a message with a checkbox. - */ -NS_IMETHODIMP -QtPromptService::AlertCheck(nsIDOMWindow* aParent, - const PRUnichar* aDialogTitle, - const PRUnichar* aDialogText, - const PRUnichar* aCheckMsg, - PRBool* aCheckValue) -{ - Ui_AlertDialog ui; - QDialog d(GetQWidgetForDOMWindow(aParent)); - ui.setupUi(&d); - ui.icon->setPixmap(QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(64)); - if (aDialogTitle) { - d.setWindowTitle(QString::fromUtf16(aDialogTitle)); - } - ui.message->setText(QString::fromUtf16(aDialogText)); - if (aCheckMsg) { - ui.check->setText(QString::fromUtf16(aCheckMsg)); - ui.check->setChecked(*aCheckValue); - } - else { - ui.check->hide(); - } - d.adjustSize(); - d.exec(); - - if (aCheckMsg) { - *aCheckValue = ui.check->isChecked(); - } - return NS_OK; -} - -/** - * Puts up a dialog with OK and Cancel buttons. - * @return true for OK, false for Cancel - */ -NS_IMETHODIMP -QtPromptService::Confirm(nsIDOMWindow* aParent, - const PRUnichar* aDialogTitle, - const PRUnichar* aDialogText, - PRBool* aConfirm) -{ - return - ConfirmCheck(aParent, - aDialogTitle, aDialogText, - NULL, NULL, - aConfirm); -} - -/** - * Puts up a dialog with OK and Cancel buttons, and - * a message with a single checkbox. - * @return true for OK, false for Cancel - */ -NS_IMETHODIMP -QtPromptService::ConfirmCheck(nsIDOMWindow* aParent, - const PRUnichar* aDialogTitle, - const PRUnichar* aDialogText, - const PRUnichar* aCheckMsg, - PRBool* aCheckValue, - PRBool* aConfirm) -{ - PRInt32 ret; - ConfirmEx(aParent, - aDialogTitle, aDialogText, - STD_OK_CANCEL_BUTTONS, - NULL, NULL, NULL, - aCheckMsg, - aCheckValue, - &ret); - *aConfirm = (ret==0); - - return NS_OK; -} - -/** - * Puts up a dialog with up to 3 buttons and an optional checkbox. - * - * @param dialogTitle - * @param text - * @param buttonFlags Title flags for each button. - * @param button0Title Used when button 0 uses TITLE_IS_STRING - * @param button1Title Used when button 1 uses TITLE_IS_STRING - * @param button2Title Used when button 2 uses TITLE_IS_STRING - * @param checkMsg null if no checkbox - * @param checkValue - * @return buttonPressed - * - * Buttons are numbered 0 - 2. The implementation can decide whether - * the sequence goes from right to left or left to right. - * Button 0 will be the default button. - * - * A button may use a predefined title, specified by one of the - * constants below. Each title constant can be multiplied by a - * position constant to assign the title to a particular button. - * If BUTTON_TITLE_IS_STRING is used for a button, the string - * parameter for that button will be used. If the value for a button - * position is zero, the button will not be shown - * - */ -NS_IMETHODIMP -QtPromptService::ConfirmEx(nsIDOMWindow* aParent, - const PRUnichar* aDialogTitle, - const PRUnichar* aDialogText, - PRUint32 aButtonFlags, - const PRUnichar* aButton0Title, - const PRUnichar* aButton1Title, - const PRUnichar* aButton2Title, - const PRUnichar* aCheckMsg, - PRBool* aCheckValue, - PRInt32* aRetVal) -{ - Ui_ConfirmDialog d; - QDialog md(static_cast(GetQWidgetForDOMWindow(aParent))); - d.setupUi(&md); - d.icon->setPixmap(QApplication::style()->standardIcon(QStyle::SP_MessageBoxQuestion).pixmap(64)); - if (aDialogTitle) { - md.setWindowTitle(QString::fromUtf16(aDialogTitle)); - } - d.message->setText(QString::fromUtf16(aDialogText)); - - QString l = GetButtonLabel(aButtonFlags, BUTTON_POS_0, aButton0Title); - if (!l.isNull()) d.but1->setText(l); else d.but1->hide(); - l = GetButtonLabel(aButtonFlags, BUTTON_POS_1, aButton1Title); - if (!l.isNull()) d.but2->setText(l); else d.but2->hide(); - l = GetButtonLabel(aButtonFlags, BUTTON_POS_2, aButton2Title); - if (!l.isNull()) d.but3->setText(l); else d.but3->hide(); - - if (aCheckMsg) { - d.check->setText(QString::fromUtf16(aCheckMsg)); - d.check->setChecked(*aCheckValue); - } - else { - d.check->hide(); - } - md.adjustSize(); - int ret = md.exec(); - - *aRetVal = ret; - return NS_OK; -} - -/** - * Puts up a dialog with an edit field and an optional checkbox. - * - * @param dialogTitle - * @param text - * @param value in: Pre-fills the dialog field if non-null - * out: If result is true, a newly allocated - * string. If result is false, in string is not - * touched. - * @param checkMsg if null, check box will not be shown - * @param checkValue - * @return true for OK, false for Cancel - */ -NS_IMETHODIMP -QtPromptService::Prompt(nsIDOMWindow* aParent, - const PRUnichar* aDialogTitle, - const PRUnichar* aDialogText, - PRUnichar** aValue, - const PRUnichar* aCheckMsg, - PRBool* aCheckValue, - PRBool* aConfirm) -{ - Ui_PromptDialog d; - QDialog md(static_cast(GetQWidgetForDOMWindow(aParent))); - d.setupUi(&md); - d.icon->setPixmap(QApplication::style()->standardIcon(QStyle::SP_MessageBoxQuestion).pixmap(64)); - if (aDialogTitle) { - md.setWindowTitle(QString::fromUtf16(aDialogTitle)); - } - d.message->setText(QString::fromUtf16(aDialogText)); - if (aValue && *aValue) { - d.input->setText(QString::fromUtf16(*aValue)); - } - if (aCheckMsg) { - d.check->setText(QString::fromUtf16(aCheckMsg)); - d.check->setChecked(*aCheckValue); - } - else { - d.check->hide(); - } - md.adjustSize(); - int ret = md.exec(); - - if (aCheckMsg) { - *aCheckValue = d.check->isChecked(); - } - *aConfirm = (ret & QMessageBox::Ok); - if (*aConfirm) { - if (*aValue) nsMemory::Free(*aValue); - *aValue = - ToNewUnicode(nsDependentString(d.input->text().utf16())); - } - - return NS_OK; -} - -/** - * Puts up a dialog with an edit field, a password field, and an optional checkbox. - * - * @param dialogTitle - * @param text - * @param username in: Pre-fills the dialog field if non-null - * out: If result is true, a newly allocated - * string. If result is false, in string is not - * touched. - * @param password in: Pre-fills the dialog field if non-null - * out: If result is true, a newly allocated - * string. If result is false, in string is not - * touched. - * @param checkMsg if null, check box will not be shown - * @param checkValue - * @return true for OK, false for Cancel - */ -NS_IMETHODIMP -QtPromptService::PromptUsernameAndPassword(nsIDOMWindow* aParent, - const PRUnichar* aDialogTitle, - const PRUnichar* aDialogText, - PRUnichar** aUsername, - PRUnichar** aPassword, - const PRUnichar* aCheckMsg, - PRBool* aCheckValue, - PRBool* aConfirm) -{ - Ui_UserpassDialog d; - QDialog md(static_cast(GetQWidgetForDOMWindow(aParent))); - d.setupUi(&md); - d.icon->setPixmap(QApplication::style()->standardIcon(QStyle::SP_MessageBoxQuestion).pixmap(64)); - if (aDialogTitle) { - md.setWindowTitle(QString::fromUtf16(aDialogTitle)); - } - d.message->setText(QString::fromUtf16(aDialogText)); - if (aUsername && *aUsername) { - d.username->setText(QString::fromUtf16(*aUsername)); - } - if (aPassword && *aPassword) { - d.password->setText(QString::fromUtf16(*aPassword)); - } - if (aCheckMsg) { - d.check->setText(QString::fromUtf16(aCheckMsg)); - d.check->setChecked(*aCheckValue); - } - else { - d.check->hide(); - } - md.adjustSize(); - int ret = md.exec(); - - if (aCheckMsg) { - *aCheckValue = d.check->isChecked(); - } - *aConfirm = (ret & QMessageBox::Ok); - if (*aConfirm) { - if (*aUsername) nsMemory::Free(*aUsername); - *aUsername = - ToNewUnicode(nsDependentString(d.username->text().utf16())); - if (*aPassword) nsMemory::Free(*aPassword); - *aPassword = - ToNewUnicode(nsDependentString(d.password->text().utf16())); - } - - return NS_OK; -} - -/** - * Puts up a dialog with a password field and an optional checkbox. - * - * @param dialogTitle - * @param text - * @param password in: Pre-fills the dialog field if non-null - * out: If result is true, a newly allocated - * string. If result is false, in string is not - * touched. - * @param checkMsg if null, check box will not be shown - * @param checkValue - * @return true for OK, false for Cancel - */ -NS_IMETHODIMP -QtPromptService::PromptPassword(nsIDOMWindow* aParent, - const PRUnichar* aDialogTitle, - const PRUnichar* aDialogText, - PRUnichar** aPassword, - const PRUnichar* aCheckMsg, - PRBool* aCheckValue, - PRBool* aConfirm) -{ - Ui_UserpassDialog d; - QDialog md(static_cast(GetQWidgetForDOMWindow(aParent))); - d.setupUi(&md); - d.icon->setPixmap(QApplication::style()->standardIcon(QStyle::SP_MessageBoxQuestion).pixmap(64)); - if (aDialogTitle) { - md.setWindowTitle(QString::fromUtf16(aDialogTitle)); - } - d.message->setText(QString::fromUtf16(aDialogText)); - d.lb_username->hide(); - d.username->hide(); - if (aPassword && *aPassword) { - d.password->setText(QString::fromUtf16(*aPassword)); - } - if (aCheckMsg) { - d.check->setText(QString::fromUtf16(aCheckMsg)); - d.check->setChecked(*aCheckValue); - } - else { - d.check->hide(); - } - md.adjustSize(); - int ret = md.exec(); - - if (aCheckMsg) { - *aCheckValue = d.check->isChecked(); - } - *aConfirm = (ret & QMessageBox::Ok); - if (*aConfirm) { - if (*aPassword) nsMemory::Free(*aPassword); - *aPassword = - ToNewUnicode(nsDependentString(d.password->text().utf16())); - } - - return NS_OK; -} - -/** - * Puts up a dialog box which has a list box of strings - */ -NS_IMETHODIMP -QtPromptService::Select(nsIDOMWindow* aParent, - const PRUnichar* aDialogTitle, - const PRUnichar* aDialogText, - PRUint32 aCount, - const PRUnichar** aSelectList, - PRInt32* outSelection, - PRBool* aConfirm) -{ - Ui_SelectDialog d; - QDialog md(static_cast(GetQWidgetForDOMWindow(aParent))); - d.setupUi(&md); - d.icon->setPixmap(QApplication::style()->standardIcon(QStyle::SP_MessageBoxQuestion).pixmap(64)); - if (aDialogTitle) { - md.setWindowTitle(QString::fromUtf16(aDialogTitle)); - } - d.message->setText(QString::fromUtf16(aDialogText)); - if (aSelectList) { - QStringList l; - for (PRUint32 i = 0; i < aCount; ++i) { - l.append(QString::fromUtf16(aSelectList[i])); - } - d.select->clear(); - d.select->addItems(l); - } - md.adjustSize(); - int ret = md.exec(); - - *aConfirm = (ret & QMessageBox::Ok); - if (*aConfirm) { - *outSelection = d.select->currentIndex(); - } - - return NS_OK; -} - -QWidget* -QtPromptService::GetQWidgetForDOMWindow(nsIDOMWindow* aDOMWindow) -{ - if (!aDOMWindow) - return NULL; - - nsCOMPtr wwatch = do_GetService("@mozilla.org/embedcomp/window-watcher;1"); - - nsCOMPtr chrome; - wwatch->GetChromeForWindow(aDOMWindow, getter_AddRefs(chrome)); - nsCOMPtr siteWindow = do_QueryInterface(chrome); - - if (!siteWindow) - return NULL; - - QWidget* parentWidget; - siteWindow->GetSiteWindow((void**)&parentWidget); - - if (!parentWidget) - return QApplication::activeWindow(); - - return parentWidget; -} - -QString -QtPromptService::GetButtonLabel(PRUint32 aFlags, - PRUint32 aPos, - const PRUnichar* aStringValue) -{ - PRUint32 posFlag = (aFlags & (255 * aPos)) / aPos; - switch (posFlag) { - case BUTTON_TITLE_OK: - return qApp->translate("QtPromptService", "&OK", "p", QCoreApplication::CodecForTr); - case BUTTON_TITLE_CANCEL: - return qApp->translate("QtPromptService", "&Cancel", "p", QCoreApplication::CodecForTr); - case BUTTON_TITLE_YES: - return qApp->translate("QtPromptService", "&Yes", "p", QCoreApplication::CodecForTr); - case BUTTON_TITLE_NO: - return qApp->translate("QtPromptService", "&No", "p", QCoreApplication::CodecForTr); - case BUTTON_TITLE_SAVE: - return qApp->translate("QtPromptService", "&Save", "p", QCoreApplication::CodecForTr); - case BUTTON_TITLE_DONT_SAVE: - return qApp->translate("QtPromptService", "&Don't Save", "p", QCoreApplication::CodecForTr); - case BUTTON_TITLE_REVERT: - return qApp->translate("QtPromptService", "&Revert", "p", QCoreApplication::CodecForTr); - case BUTTON_TITLE_IS_STRING: - return qApp->translate("QtPromptService", QString::fromUtf16(aStringValue).toUtf8().data(), "p", QCoreApplication::CodecForTr); - case 0: - return QString::null; - default: - NS_WARNING("Unexpected button flags"); - return QString::null; - } -} diff --git a/embedding/browser/qt/src/QtPromptService.h b/embedding/browser/qt/src/QtPromptService.h deleted file mode 100644 index 31327f4d07..0000000000 --- a/embedding/browser/qt/src/QtPromptService.h +++ /dev/null @@ -1,62 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Lixto GmbH. - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Michal Ceresna - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef qtpromptservice_h -#define qtpromptservice_h - -#include -#include -#include - -class nsIDOMWindow; - -class QtPromptService : public nsIPromptService -{ -public: - QtPromptService(); - virtual ~QtPromptService(); - - NS_DECL_ISUPPORTS - NS_DECL_NSIPROMPTSERVICE - -private: - QWidget* GetQWidgetForDOMWindow(nsIDOMWindow* aDOMWindow); - QString GetButtonLabel(PRUint32 aFlags, PRUint32 aPos, - const PRUnichar* aStringValue); -}; - -#endif /* qtpromptservice_h */ diff --git a/embedding/browser/qt/src/alert.ui b/embedding/browser/qt/src/alert.ui deleted file mode 100644 index 91cf936d5a..0000000000 --- a/embedding/browser/qt/src/alert.ui +++ /dev/null @@ -1,217 +0,0 @@ - - AlertDialog - - - - 0 - 0 - 187 - 122 - - - - Alert - - - false - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 5 - 5 - - - - - - - - true - - - - 0 - 0 - - - - alert text - - - Qt::AlignVCenter - - - true - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 5 - 5 - - - - - - - - - 0 - 0 - - - - confirm - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 5 - 5 - - - - - - - - - 0 - 0 - - - - false - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - false - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - &OK - - - true - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - - - qPixmapFromMimeSource - - ok - check - - - - - ok - clicked() - AlertDialog - accept() - - - 20 - 20 - - - 20 - 20 - - - - - diff --git a/embedding/browser/qt/src/config/qtconfig.mk b/embedding/browser/qt/src/config/qtconfig.mk deleted file mode 100644 index fe93cb0a96..0000000000 --- a/embedding/browser/qt/src/config/qtconfig.mk +++ /dev/null @@ -1,26 +0,0 @@ - -#need a fullpath here, otherwise uic complains about -#already defined symbols -FULLDIST = `(cd $(DIST); pwd)` -DIST_QTDESIGNERPLUGINS = $(FULLDIST)/lib/designer - -ifneq (,$(filter Linux FreeBSD SunOS,$(OS_ARCH))) -UICEX = $(UIC) -# -L $(DIST_QTDESIGNERPLUGINS) -endif -ifeq ($(OS_ARCH), WINNT) -UICEX = $(CYGWIN_WRAPPER) $(QTDIR)/bin/uic$(BIN_SUFFIX) -L $(DIST_QTDESIGNERPLUGINS) -endif - - -UI_HSRCS = $(UICSRCS:%.ui=ui_%.h) -UI_CPPSRCS = -#$(UICSRCS:%.ui=ui_%.cpp) -MOCUI_CPPSRCS = -#$(UI_CPPSRCS:%=moc_%) -ifdef IMAGES -IMGUI_CPPSRCS = uiimg_collection.cpp -endif -CPPSRCS += $(UI_CPPSRCS) $(MOCUI_CPPSRCS) $(IMGUI_CPPSRCS) -GARBAGE += $(UI_HSRCS) $(UI_CPPSRCS) $(MOCUI_CPPSRCS) $(IMGUI_CPPSRCS) - diff --git a/embedding/browser/qt/src/config/qtrules.mk b/embedding/browser/qt/src/config/qtrules.mk deleted file mode 100644 index 9422b0845a..0000000000 --- a/embedding/browser/qt/src/config/qtrules.mk +++ /dev/null @@ -1,15 +0,0 @@ -ui_%.h: %.ui Makefile Makefile.in - $(UICEX) $< -o $@ - -ui_%.cpp: %.ui ui_%.h Makefile Makefile.in - $(UICEX) $< -i $(<:%.ui=ui_%.h) -o $@ - -uiimg_%.cpp: $(IMAGES) Makefile Makefile.in - $(UICEX) -embed $(PROGRAM) $(IMAGES) -o $@ - -libs:: -ifdef IS_QTDESIGNERPLUGIN - @if test ! -d $(DIST_QTDESIGNERPLUGINS); then echo Creating $(DIST_QTDESIGNERPLUGINS); rm -rf $(DIST_QTDESIGNERPLUGINS); $(NSINSTALL) -D $(DIST_QTDESIGNERPLUGINS); else true; fi - $(INSTALL) $(SHARED_LIBRARY) $(DIST_QTDESIGNERPLUGINS) -endif - diff --git a/embedding/browser/qt/src/confirm.ui b/embedding/browser/qt/src/confirm.ui deleted file mode 100644 index 20c8bd10bb..0000000000 --- a/embedding/browser/qt/src/confirm.ui +++ /dev/null @@ -1,271 +0,0 @@ - - ConfirmDialog - - - - 0 - 0 - 296 - 152 - - - - - 0 - 0 - - - - Confirm - - - false - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 5 - 5 - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 5 - 5 - - - - - - - - - 0 - 0 - - - - confirm - - - - - - - true - - - - 0 - 0 - - - - confirm text - - - Qt::AlignVCenter - - - true - - - - - - - - 0 - 0 - - - - false - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - false - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 5 - 5 - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 5 - 5 - - - - - - - - 1 - - - true - - - true - - - - - - - 2 - - - true - - - - - - - 3 - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 5 - 5 - - - - - - - - - - qPixmapFromMimeSource - - - - but1 - clicked() - ConfirmDialog - done1() - - - 20 - 20 - - - 20 - 20 - - - - - but2 - clicked() - ConfirmDialog - done2() - - - 20 - 20 - - - 20 - 20 - - - - - but3 - clicked() - ConfirmDialog - done3() - - - 20 - 20 - - - 20 - 20 - - - - - diff --git a/embedding/browser/qt/src/prompt.ui b/embedding/browser/qt/src/prompt.ui deleted file mode 100644 index 5e6e5385f1..0000000000 --- a/embedding/browser/qt/src/prompt.ui +++ /dev/null @@ -1,291 +0,0 @@ - - PromptDialog - - - - 0 - 0 - 222 - 177 - - - - Prompt - - - false - - - - - - - - true - - - - 0 - 0 - - - - prompt text - - - Qt::AlignVCenter - - - true - - - - - - - - 0 - 0 - - - - false - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - false - - - - - - - - 0 - 0 - - - - confirm - - - - - - - - - - 0 - 0 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 10 - 5 - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 5 - 5 - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 5 - 5 - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 5 - 5 - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 5 - 5 - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - &OK - - - true - - - true - - - - - - - &Cancel - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - - - qPixmapFromMimeSource - - input - check - ok - cancel - - - - - ok - clicked() - PromptDialog - accept() - - - 20 - 20 - - - 20 - 20 - - - - - cancel - clicked() - PromptDialog - reject() - - - 20 - 20 - - - 20 - 20 - - - - - diff --git a/embedding/browser/qt/src/qgeckoembed.cpp b/embedding/browser/qt/src/qgeckoembed.cpp deleted file mode 100644 index b4f8ad63bb..0000000000 --- a/embedding/browser/qt/src/qgeckoembed.cpp +++ /dev/null @@ -1,781 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Lars Knoll - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "qgeckoembed.h" - -#include "EmbedWindow.h" -#include "EmbedProgress.h" -#include "EmbedStream.h" -#include "EmbedEventListener.h" -#include "EmbedContentListener.h" -#include "EmbedWindowCreator.h" -#include "qgeckoglobals.h" - -#include "nsIAppShell.h" -#include -#include -#include -#include -#include -#include -#include "nsIWidget.h" -#include "nsCRT.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "nsIDirectoryService.h" -#include "nsAppDirectoryServiceDefs.h" -#include -#include -#include -#include -#include -#include -#include "nsPIDOMEventTarget.h" -#include -#include -#include -#include - -#include "prenv.h" - -#include -#include -#include - -class QGeckoEmbedPrivate -{ -public: - QGeckoEmbedPrivate(QGeckoEmbed *qq); - ~QGeckoEmbedPrivate(); - - QGeckoEmbed *q; - - QWidget *mMainWidget; - - // all of the objects that we own - EmbedWindow *window; - nsCOMPtr windowGuard; - EmbedProgress *progress; - nsCOMPtr progressGuard; - EmbedContentListener *contentListener; - nsCOMPtr contentListenerGuard; - EmbedEventListener *eventListener; - nsCOMPtr eventListenerGuard; - EmbedStream *stream; - nsCOMPtr streamGuard; - - nsCOMPtr navigation; - nsCOMPtr sessionHistory; - - // our event receiver - nsCOMPtr eventReceiver; - - // chrome mask - PRUint32 chromeMask; - - bool isChrome; - bool chromeLoaded; - bool listenersAttached; - - void initGUI(); - void init(); - void ApplyChromeMask(); -}; - - -QGeckoEmbedPrivate::QGeckoEmbedPrivate(QGeckoEmbed *qq) - : q(qq), - mMainWidget(0), - chromeMask(nsIWebBrowserChrome::CHROME_ALL), - isChrome(FALSE), - chromeLoaded(FALSE), - listenersAttached(FALSE) -{ -} - -QGeckoEmbedPrivate::~QGeckoEmbedPrivate() -{ - QGeckoGlobals::removeEngine(q); - QGeckoGlobals::popStartup(); -} - -void -QGeckoEmbedPrivate::init() -{ - QGeckoGlobals::initializeGlobalObjects(); - QGeckoGlobals::pushStartup(); - QGeckoGlobals::addEngine(q); - - // Create our embed window, and create an owning reference to it and - // initialize it. It is assumed that this window will be destroyed - // when we go out of scope. - window = new EmbedWindow(); - windowGuard = static_cast(window); - window->Init(q); - // Create our progress listener object, make an owning reference, - // and initialize it. It is assumed that this progress listener - // will be destroyed when we go out of scope. - progress = new EmbedProgress(q); - progressGuard = static_cast - (progress); - - // Create our content listener object, initialize it and attach it. - // It is assumed that this will be destroyed when we go out of - // scope. - contentListener = new EmbedContentListener(q); - contentListenerGuard = static_cast - (static_cast(contentListener)); - - // Create our key listener object and initialize it. It is assumed - // that this will be destroyed before we go out of scope. - eventListener = new EmbedEventListener(q); - eventListenerGuard = - static_cast(static_cast - (eventListener)); - - // has the window creator service been set up? - static int initialized = PR_FALSE; - // Set up our window creator ( only once ) - if (!initialized) { - // create our local object - nsCOMPtr windowCreator = new EmbedWindowCreator(); - - // Attach it via the watcher service - nsCOMPtr watcher = do_GetService(NS_WINDOWWATCHER_CONTRACTID); - if (watcher) - watcher->SetWindowCreator(windowCreator); - initialized = PR_TRUE; - } - - // Get the nsIWebBrowser object for our embedded window. - nsCOMPtr webBrowser; - window->GetWebBrowser(getter_AddRefs(webBrowser)); - - // get a handle on the navigation object - navigation = do_QueryInterface(webBrowser); - - // Create our session history object and tell the navigation object - // to use it. We need to do this before we create the web browser - // window. - sessionHistory = do_CreateInstance(NS_SHISTORY_CONTRACTID); - navigation->SetSessionHistory(sessionHistory); - - // create the window - window->CreateWindow(); - - // bind the progress listener to the browser object - nsCOMPtr supportsWeak; - supportsWeak = do_QueryInterface(progressGuard); - nsCOMPtr weakRef; - supportsWeak->GetWeakReference(getter_AddRefs(weakRef)); - webBrowser->AddWebBrowserListener(weakRef, - nsIWebProgressListener::GetIID()); - - // set ourselves as the parent uri content listener - webBrowser->SetParentURIContentListener(contentListener); - - // save the window id of the newly created window - nsCOMPtr qtWidget; - window->mBaseWindow->GetMainWidget(getter_AddRefs(qtWidget)); - // get the native drawing area - mMainWidget = static_cast(qtWidget->GetNativeData(NS_NATIVE_WINDOW)); - - // Apply the current chrome mask - ApplyChromeMask(); - - window->SetVisibility(PR_TRUE); -} - -void -QGeckoEmbedPrivate::initGUI() -{ - QBoxLayout *l = new QHBoxLayout(q); - qDebug("FIXME: %s:%i: Q3-4: setAutoAdd(TRUE)", __PRETTY_FUNCTION__, __LINE__); -// l->setAutoAdd(TRUE); -} - -void -QGeckoEmbedPrivate::ApplyChromeMask() -{ - if (window) { - nsCOMPtr webBrowser; - window->GetWebBrowser(getter_AddRefs(webBrowser)); - - nsCOMPtr domWindow; - webBrowser->GetContentDOMWindow(getter_AddRefs(domWindow)); - if (domWindow) { - nsCOMPtr scrollbars; - domWindow->GetScrollbars(getter_AddRefs(scrollbars)); - if (scrollbars) { - - scrollbars->SetVisible( - chromeMask & nsIWebBrowserChrome::CHROME_SCROLLBARS ? - PR_TRUE : PR_FALSE); - } - } - } -} - - - - -QGeckoEmbed::QGeckoEmbed(QWidget *parent, const char *name) - : QWidget(parent) -{ - setObjectName(QString::fromAscii(name)); - d = new QGeckoEmbedPrivate(this); - if (!d) return; - d->initGUI(); - d->init(); -} - -QGeckoEmbed::~QGeckoEmbed() -{ - delete d; -} - - -bool -QGeckoEmbed::canGoBack() const -{ - PRBool retval = PR_FALSE; - if (d->navigation) - d->navigation->GetCanGoBack(&retval); - return retval; -} - -bool -QGeckoEmbed::canGoForward() const -{ - PRBool retval = PR_FALSE; - if (d->navigation) - d->navigation->GetCanGoForward(&retval); - return retval; -} - -void -QGeckoEmbed::loadURL(const QString &url) -{ - if (!url.isEmpty()) { - d->navigation->LoadURI((const PRUnichar*)url.utf16 (), - nsIWebNavigation::LOAD_FLAGS_NONE, // Load flags - nsnull, // Referring URI - nsnull, // Post data - nsnull); - } -} - -void -QGeckoEmbed::stopLoad() -{ - if (d->navigation) - d->navigation->Stop(nsIWebNavigation::STOP_NETWORK); -} - -void -QGeckoEmbed::goForward() -{ - if (d->navigation) - d->navigation->GoForward(); -} - -void -QGeckoEmbed::goBack() -{ - if (d->navigation) - d->navigation->GoBack(); -} - -void -QGeckoEmbed::renderData(const QByteArray &data, const QString &baseURI, - const QString &mimeType) -{ - openStream(baseURI, mimeType); - appendData(data); - closeStream(); -} - -int -QGeckoEmbed::openStream(const QString &baseURI, const QString &mimeType) -{ - nsresult rv; - - if (!d->stream) { - d->stream = new EmbedStream(); - d->streamGuard = do_QueryInterface(d->stream); - d->stream->InitOwner(this); - rv = d->stream->Init(); - if (NS_FAILED(rv)) - return rv; - } - - rv = d->stream->OpenStream(baseURI.toUtf8().data(), mimeType.toUtf8().data()); - return rv; -} - -int -QGeckoEmbed::appendData(const QByteArray &data) -{ - if (!d->stream) - return NS_ERROR_FAILURE; - - // Attach listeners to this document since in some cases we don't - // get updates for content added this way. - contentStateChanged(); - - return d->stream->AppendToStream(data, data.length()); -} - -int -QGeckoEmbed::closeStream() -{ - nsresult rv; - - if (!d->stream) - return NS_ERROR_FAILURE; - rv = d->stream->CloseStream(); - - // release - d->stream = 0; - d->streamGuard = 0; - - return rv; -} - -void -QGeckoEmbed::reload(ReloadFlags flags) -{ - int qeckoFlags = 0; - switch(flags) { - case Normal: - qeckoFlags = 0; - break; - case BypassCache: - qeckoFlags = nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE; - break; - case BypassProxy: - qeckoFlags = nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY; - break; - case BypassProxyAndCache: - qeckoFlags = nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE | - nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY; - break; - case CharsetChange: - qeckoFlags = nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE; - break; - default: - qeckoFlags = 0; - break; - } - - - nsCOMPtr wn; - - if (d->sessionHistory) { - wn = do_QueryInterface(d->sessionHistory); - } - if (!wn) - wn = d->navigation; - - if (wn) - wn->Reload(qeckoFlags); -} - -bool -QGeckoEmbed::domKeyDownEvent(nsIDOMKeyEvent *keyEvent) -{ - emit domKeyDown(keyEvent); - return false; -} - -bool -QGeckoEmbed::domKeyPressEvent(nsIDOMKeyEvent *keyEvent) -{ - emit domKeyPress(keyEvent); - return false; -} - -bool -QGeckoEmbed::domKeyUpEvent(nsIDOMKeyEvent *keyEvent) -{ - emit domKeyUp(keyEvent); - return false; -} - -bool -QGeckoEmbed::domMouseDownEvent(nsIDOMMouseEvent *mouseEvent) -{ - emit domMouseDown(mouseEvent); - return false; -} - -bool -QGeckoEmbed::domMouseUpEvent(nsIDOMMouseEvent *mouseEvent) -{ - emit domMouseUp(mouseEvent); - return false; -} - -bool -QGeckoEmbed::domMouseClickEvent(nsIDOMMouseEvent *mouseEvent) -{ - emit domMouseClick(mouseEvent); - return false; -} - -bool -QGeckoEmbed::domMouseDblClickEvent(nsIDOMMouseEvent *mouseEvent) -{ - emit domMouseDblClick(mouseEvent); - return false; -} - -bool -QGeckoEmbed::domMouseOverEvent(nsIDOMMouseEvent *mouseEvent) -{ - emit domMouseOver(mouseEvent); - return false; -} - -bool -QGeckoEmbed::domMouseOutEvent(nsIDOMMouseEvent *mouseEvent) -{ - emit domMouseOut(mouseEvent); - return false; -} - -bool -QGeckoEmbed::domActivateEvent(nsIDOMUIEvent *event) -{ - emit domActivate(event); - return false; -} - -bool -QGeckoEmbed::domFocusInEvent(nsIDOMUIEvent *event) -{ - emit domFocusIn(event); - return false; -} - -bool -QGeckoEmbed::domFocusOutEvent(nsIDOMUIEvent *event) -{ - emit domFocusOut(event); - return false; -} - -void -QGeckoEmbed::emitScriptStatus(const QString &str) -{ - emit jsStatusMessage(str); -} - -void -QGeckoEmbed::emitLinkStatus(const QString &str) -{ - emit linkMessage(str); -} - -int -QGeckoEmbed::chromeMask() const -{ - return d->chromeMask; -} - -void -QGeckoEmbed::setChromeMask(int mask) -{ - d->chromeMask = mask; - - d->ApplyChromeMask(); -} - -void -QGeckoEmbed::resizeEvent(QResizeEvent *e) -{ - d->window->SetDimensions(nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER, - 0, 0, e->size().width(), e->size().height()); -} - -nsIDOMDocument* -QGeckoEmbed::document() const -{ - nsIDOMDocument *doc = 0; - - nsCOMPtr window; - nsCOMPtr webBrowser; - - d->window->GetWebBrowser(getter_AddRefs(webBrowser)); - - webBrowser->GetContentDOMWindow(getter_AddRefs(window)); - if (window) { - window->GetDocument(&doc); - } - - return doc; -} - -void -QGeckoEmbed::contentStateChanged() -{ - // we don't attach listeners to chrome - if (d->listenersAttached && !d->isChrome) - return; - - setupListener(); - - if (!d->eventReceiver) - return; - - attachListeners(); -} - -void -QGeckoEmbed::contentFinishedLoading() -{ - if (d->isChrome) { - // We're done loading. - d->chromeLoaded = PR_TRUE; - - // get the web browser - nsCOMPtr webBrowser; - d->window->GetWebBrowser(getter_AddRefs(webBrowser)); - - // get the content DOM window for that web browser - nsCOMPtr domWindow; - webBrowser->GetContentDOMWindow(getter_AddRefs(domWindow)); - if (!domWindow) { - NS_WARNING("no dom window in content finished loading\n"); - return; - } - - // resize the content - domWindow->SizeToContent(); - } -} - -void -QGeckoEmbed::setupListener() -{ - if (d->eventReceiver) - return; - - nsCOMPtr piWin; - GetPIDOMWindow(getter_AddRefs(piWin)); - - if (!piWin) - return; - - d->eventReceiver = do_QueryInterface(piWin->GetChromeEventHandler()); -} - -void -QGeckoEmbed::attachListeners() -{ - if (!d->eventReceiver || d->listenersAttached) - return; - - nsIDOMEventListener *eventListener = - static_cast - (static_cast(d->eventListener)); - - // add the key listener - nsresult rv; - rv = d->eventReceiver->AddEventListenerByIID(eventListener, - NS_GET_IID(nsIDOMKeyListener)); - if (NS_FAILED(rv)) { - NS_WARNING("Failed to add key listener\n"); - return; - } - - rv = d->eventReceiver->AddEventListenerByIID(eventListener, - NS_GET_IID(nsIDOMMouseListener)); - if (NS_FAILED(rv)) { - NS_WARNING("Failed to add mouse listener\n"); - return; - } - - rv = d->eventReceiver->AddEventListenerByIID(eventListener, - NS_GET_IID(nsIDOMUIListener)); - if (NS_FAILED(rv)) { - NS_WARNING("Failed to add UI listener\n"); - return; - } - - // ok, all set. - d->listenersAttached = PR_TRUE; -} - -EmbedWindow * QGeckoEmbed::window() const -{ - return d->window; -} - - -int QGeckoEmbed::GetPIDOMWindow(nsPIDOMWindow **aPIWin) -{ - *aPIWin = nsnull; - - // get the web browser - nsCOMPtr webBrowser; - d->window->GetWebBrowser(getter_AddRefs(webBrowser)); - - // get the content DOM window for that web browser - nsCOMPtr domWindow; - webBrowser->GetContentDOMWindow(getter_AddRefs(domWindow)); - if (!domWindow) - return NS_ERROR_FAILURE; - - // get the private DOM window - nsCOMPtr domWindowPrivate = do_QueryInterface(domWindow); - // and the root window for that DOM window - *aPIWin = domWindowPrivate->GetPrivateRoot(); - - if (*aPIWin) { - NS_ADDREF(*aPIWin); - return NS_OK; - } - - return NS_ERROR_FAILURE; - -} - -void QGeckoEmbed::setIsChrome(bool isChrome) -{ - d->isChrome = isChrome; -} - -bool QGeckoEmbed::isChrome() const -{ - return d->isChrome; -} - -bool QGeckoEmbed::chromeLoaded() const -{ - return d->chromeLoaded; -} - -QString QGeckoEmbed::url() const -{ - nsCOMPtr uri; - d->navigation->GetCurrentURI(getter_AddRefs(uri)); - nsCAutoString acstring; - uri->GetSpec(acstring); - - return QString::fromUtf8(acstring.get()); -} - -QString QGeckoEmbed::resolvedUrl(const QString &relativepath) const -{ - nsCOMPtr uri; - d->navigation->GetCurrentURI(getter_AddRefs(uri)); - nsCAutoString rel; - rel.Assign(relativepath.toUtf8().data()); - nsCAutoString resolved; - uri->Resolve(rel, resolved); - - return QString::fromUtf8(resolved.get()); -} - -void QGeckoEmbed::initialize(const char *aDir, const char *aName, const char *xpcomPath) -{ - QGeckoGlobals::setPath(xpcomPath); - QGeckoGlobals::setProfilePath(aDir, aName); -} - -static nsresult -GetMarkupViewerByWindow(nsIDOMWindow *aDOMWindow, - nsIMarkupDocumentViewer * *aMarkupDocViewver) -{ - nsresult rv; - NS_ENSURE_ARG_POINTER(aMarkupDocViewver); - nsCOMPtr window(do_QueryInterface(aDOMWindow, &rv)); - NS_ENSURE_SUCCESS(rv, rv); - nsIDocShell *docShell = nsnull; - if (window) - docShell = window->GetDocShell(); - NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE); - nsCOMPtr contentViewer; - rv = docShell->GetContentViewer(getter_AddRefs(contentViewer)); - NS_ENSURE_SUCCESS(rv, rv); - nsCOMPtr markupViewer(do_QueryInterface(contentViewer, &rv)); - NS_ENSURE_TRUE(markupViewer, NS_ERROR_FAILURE); - *aMarkupDocViewver = markupViewer; - NS_IF_ADDREF(*aMarkupDocViewver); - return rv; -} - -bool QGeckoEmbed::zoom( const float &zoomFactor ) -{ - // get the web browser - nsCOMPtr webBrowser = NULL; - d->window->GetWebBrowser(getter_AddRefs(webBrowser)); - - if( !webBrowser ){ - return FALSE; - } - - // get the content DOM window for that web browser - nsCOMPtr domWindow = NULL; - webBrowser->GetContentDOMWindow(getter_AddRefs(domWindow)); - if (!domWindow){ - return FALSE; - } - - nsCOMPtr markupViewer = NULL; - nsresult rv = NS_OK; - rv = GetMarkupViewerByWindow(domWindow, getter_AddRefs(markupViewer)); - if (!markupViewer || !NS_SUCCEEDED(rv) ){ - return FALSE; - } - rv = markupViewer->SetFullZoom(zoomFactor); - - return NS_SUCCEEDED(rv); -} - - diff --git a/embedding/browser/qt/src/qgeckoembed.h b/embedding/browser/qt/src/qgeckoembed.h deleted file mode 100644 index 8f0c622561..0000000000 --- a/embedding/browser/qt/src/qgeckoembed.h +++ /dev/null @@ -1,226 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Lars Knoll - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef QECKOEMBED_H -#define QECKOEMBED_H - -#include -#include - -#define DISABLE_SLOTS 1 - -#ifdef DISABLE_SLOTS -#define NS_SLOTS -#define NS_VISIBILITY_DEFAULT __attribute__ ((visibility ("default"))) -#else -#define NS_SLOTS slots -#define NS_VISIBILITY_DEFAULT -#endif - -class nsIDOMKeyEvent; -class nsIDOMMouseEvent; -class nsIDOMUIEvent; -class nsModuleComponentInfo; -class nsIDirectoryServiceProvider; -class nsIAppShell; -class nsVoidArray; -class nsProfileDirServiceProvider; -class nsISupports; -class EmbedWindow; -class EmbedEventListener; -class EmbedProgress; -class nsIWebNavigation; -class nsISHistory; -class nsIDOMEventReceiver; -class EmbedContentListener; -class EmbedStream; -class QHBox; -class nsIDOMDocument; -class nsPIDOMWindow; -class QPaintEvent; - -class QGeckoEmbedPrivate; - -class QGeckoEmbed : public QWidget -{ - Q_OBJECT -public: - NS_VISIBILITY_DEFAULT static void initialize(const char *aDir, const char *aName, const char *xpcomPath); -public: - enum ReloadFlags - { - Normal, - BypassCache, - BypassProxy, - BypassProxyAndCache, - CharsetChange - }; -public: - NS_VISIBILITY_DEFAULT QGeckoEmbed(QWidget *parent, const char *name); - NS_VISIBILITY_DEFAULT ~QGeckoEmbed(); - - NS_VISIBILITY_DEFAULT bool canGoBack() const; - NS_VISIBILITY_DEFAULT bool canGoForward() const; - - NS_VISIBILITY_DEFAULT void setIsChrome(bool); - NS_VISIBILITY_DEFAULT int chromeMask() const; - - NS_VISIBILITY_DEFAULT nsIDOMDocument *document() const; - NS_VISIBILITY_DEFAULT QString url() const; - NS_VISIBILITY_DEFAULT QString resolvedUrl(const QString &relativepath) const; - - NS_VISIBILITY_DEFAULT bool zoom( const float &zoomFactor ); - -public NS_SLOTS: - NS_VISIBILITY_DEFAULT void loadURL(const QString &url); - NS_VISIBILITY_DEFAULT void stopLoad(); - NS_VISIBILITY_DEFAULT void goForward(); - NS_VISIBILITY_DEFAULT void goBack(); - - NS_VISIBILITY_DEFAULT void renderData(const QByteArray &data, const QString &baseURI, - const QString &mimeType); - - NS_VISIBILITY_DEFAULT int openStream(const QString &baseURI, const QString &mimeType); - NS_VISIBILITY_DEFAULT int appendData(const QByteArray &data); - NS_VISIBILITY_DEFAULT int closeStream(); - - NS_VISIBILITY_DEFAULT void reload(ReloadFlags flags = Normal); - - NS_VISIBILITY_DEFAULT void setChromeMask(int); - -signals: - void linkMessage(const QString &message); - void jsStatusMessage(const QString &message); - void locationChanged(const QString &location); - void windowTitleChanged(const QString &title); - - void progress(int current, int max); - void progressAll(const QString &url, int current, int max); - - void netState(int state, int status); - void netStateAll(const QString &url, int state, int status); - - void netStart(); - void netStop(); - - void newWindow(QGeckoEmbed **newWindow, int chromeMask); - void visibilityChanged(bool visible); - void destroyBrowser(); - void openURI(const QString &url); - void sizeTo(int width, int height); - - void securityChange(void *request, int status, void *message); - void statusChange(void *request, int status, void *message); - - void showContextMenu(const QPoint &p, const QString &url); - - /** - * The dom signals are called only if the dom* methods - * are not reimplemented. - */ - void domKeyDown(nsIDOMKeyEvent *keyEvent); - void domKeyPress(nsIDOMKeyEvent *keyEvent); - void domKeyUp(nsIDOMKeyEvent *keyEvent); - void domMouseDown(nsIDOMMouseEvent *mouseEvent); - void domMouseUp(nsIDOMMouseEvent *mouseEvent); - void domMouseClick(nsIDOMMouseEvent *mouseEvent); - void domMouseDblClick(nsIDOMMouseEvent *mouseEvent); - void domMouseOver(nsIDOMMouseEvent *mouseEvent); - void domMouseOut(nsIDOMMouseEvent *mouseEvent); - void domActivate(nsIDOMUIEvent *event); - void domFocusIn(nsIDOMUIEvent *event); - void domFocusOut(nsIDOMUIEvent *event); - - - void startURIOpen(const QString &url, bool &abort); - -protected: - friend class EmbedEventListener; - friend class EmbedContentListener; - /** - * return true if you want to stop the propagation - * of the event. By default the events are being - * propagated - */ - - virtual bool domKeyDownEvent(nsIDOMKeyEvent *keyEvent); - virtual bool domKeyPressEvent(nsIDOMKeyEvent *keyEvent); - virtual bool domKeyUpEvent(nsIDOMKeyEvent *keyEvent); - - virtual bool domMouseDownEvent(nsIDOMMouseEvent *mouseEvent); - virtual bool domMouseUpEvent(nsIDOMMouseEvent *mouseEvent); - virtual bool domMouseClickEvent(nsIDOMMouseEvent *mouseEvent); - virtual bool domMouseDblClickEvent(nsIDOMMouseEvent *mouseEvent); - virtual bool domMouseOverEvent(nsIDOMMouseEvent *mouseEvent); - virtual bool domMouseOutEvent(nsIDOMMouseEvent *mouseEvent); - - virtual bool domActivateEvent(nsIDOMUIEvent *event); - virtual bool domFocusInEvent(nsIDOMUIEvent *event); - virtual bool domFocusOutEvent(nsIDOMUIEvent *event); - - -protected: - friend class EmbedWindow; - friend class EmbedWindowCreator; - friend class EmbedProgress; - friend class EmbedContextMenuListener; - friend class EmbedStream; - friend class QGeckoGlobals; - void emitScriptStatus(const QString &str); - void emitLinkStatus(const QString &str); - void contentStateChanged(); - void contentFinishedLoading(); - - bool isChrome() const; - bool chromeLoaded() const; - -protected: - void resizeEvent(QResizeEvent *e); - - void setupListener(); - void attachListeners(); - - EmbedWindow *window() const; - int GetPIDOMWindow(nsPIDOMWindow **aPIWin); - -protected: - QGeckoEmbedPrivate *d; -}; - -#endif diff --git a/embedding/browser/qt/src/qgeckoglobals.cpp b/embedding/browser/qt/src/qgeckoglobals.cpp deleted file mode 100644 index 007080c277..0000000000 --- a/embedding/browser/qt/src/qgeckoglobals.cpp +++ /dev/null @@ -1,397 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Lars Knoll - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "qgeckoglobals.h" - -#include "qgeckoembed.h" -#include "EmbedWindow.h" -#include "QtPromptService.h" - -#include "nsIAppShell.h" -#include -#include -#include -#include -#include -#include -#include "nsIWidget.h" -#include "nsCRT.h" -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include "nsIDirectoryService.h" -#include "nsAppDirectoryServiceDefs.h" -#include -#include -#include -#include -#include -#include -#include - -char *QGeckoGlobals::sPath = nsnull; -PRUint32 QGeckoGlobals::sWidgetCount = 0; -char *QGeckoGlobals::sCompPath = nsnull; -nsILocalFile *QGeckoGlobals::sProfileDir = nsnull; -nsISupports *QGeckoGlobals::sProfileLock = nsnull; -nsVoidArray *QGeckoGlobals::sWindowList = nsnull; -nsIDirectoryServiceProvider *QGeckoGlobals::sAppFileLocProvider = nsnull; - -class QTEmbedDirectoryProvider : public nsIDirectoryServiceProvider2 -{ -public: - NS_DECL_ISUPPORTS_INHERITED - NS_DECL_NSIDIRECTORYSERVICEPROVIDER - NS_DECL_NSIDIRECTORYSERVICEPROVIDER2 -}; - -static const QTEmbedDirectoryProvider kDirectoryProvider; - -NS_IMPL_QUERY_INTERFACE2(QTEmbedDirectoryProvider, - nsIDirectoryServiceProvider, - nsIDirectoryServiceProvider2) - -NS_IMETHODIMP_(nsrefcnt) -QTEmbedDirectoryProvider::AddRef() -{ - return 1; -} - -NS_IMETHODIMP_(nsrefcnt) -QTEmbedDirectoryProvider::Release() -{ - return 1; -} - -NS_IMETHODIMP -QTEmbedDirectoryProvider::GetFile(const char *aKey, PRBool *aPersist, - nsIFile* *aResult) -{ - if (QGeckoGlobals::sAppFileLocProvider) { - nsresult rv = QGeckoGlobals::sAppFileLocProvider->GetFile(aKey, aPersist, - aResult); - if (NS_SUCCEEDED(rv)) - return rv; - } - - if (QGeckoGlobals::sProfileDir && !strcmp(aKey, NS_APP_USER_PROFILE_50_DIR)) { - *aPersist = PR_TRUE; - return QGeckoGlobals::sProfileDir->Clone(aResult); - } - - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP -QTEmbedDirectoryProvider::GetFiles(const char *aKey, - nsISimpleEnumerator* *aResult) -{ - nsCOMPtr - dp2(do_QueryInterface(QGeckoGlobals::sAppFileLocProvider)); - - if (!dp2) - return NS_ERROR_FAILURE; - - return dp2->GetFiles(aKey, aResult); -} - -#ifndef _NO_PROMPT_UI -#define NS_PROMPTSERVICE_CID \ - {0x95611356, 0xf583, 0x46f5, {0x81, 0xff, 0x4b, 0x3e, 0x01, 0x62, 0xc6, 0x19}} - -NS_GENERIC_FACTORY_CONSTRUCTOR(QtPromptService) - -static const nsModuleComponentInfo defaultAppComps[] = { - { - "Prompt Service", - NS_PROMPTSERVICE_CID, - "@mozilla.org/embedcomp/prompt-service;1", - QtPromptServiceConstructor - } -}; - -const nsModuleComponentInfo *QGeckoGlobals::sAppComps = defaultAppComps; -int QGeckoGlobals::sNumAppComps = sizeof(defaultAppComps) / sizeof(nsModuleComponentInfo); - -#else -static const nsModuleComponentInfo defaultAppComps[] = { { NULL } }; -const nsModuleComponentInfo *QGeckoGlobals::sAppComps = defaultAppComps; -int QGeckoGlobals::sNumAppComps = 0; -#endif - - -void -QGeckoGlobals::pushStartup() -{ - // increment the number of widgets - sWidgetCount++; - - // if this is the first widget, fire up xpcom - if (sWidgetCount != 1) return; - nsresult rv; - nsCOMPtr binDir; - - if (sCompPath) { - rv = NS_NewNativeLocalFile(nsDependentCString(sCompPath), 1, getter_AddRefs(binDir)); - if (NS_FAILED(rv)) - return; - } - - const char *grePath = sPath; - - if (!grePath) - grePath = getenv("MOZILLA_FIVE_HOME"); - - if (!grePath) - return; - - nsCOMPtr greDir; - rv = NS_NewNativeLocalFile(nsDependentCString(grePath), PR_TRUE, - getter_AddRefs(greDir)); - if (NS_FAILED(rv)) - return; - - if (sProfileDir && !sProfileLock) { - rv = XRE_LockProfileDirectory(sProfileDir, - &sProfileLock); - if (NS_FAILED(rv)) return; - } - - rv = XRE_InitEmbedding(greDir, binDir, - const_cast - (&kDirectoryProvider), - nsnull, nsnull); - - if (NS_FAILED(rv)) - return; - - if (sProfileDir) - XRE_NotifyProfile(); - - rv = registerAppComponents(); - NS_ASSERTION(NS_SUCCEEDED(rv), "Warning: Failed to register app components.\n"); -} - -void -QGeckoGlobals::popStartup() -{ - sWidgetCount--; - if (sWidgetCount != 0) return; - - // we no longer need a reference to the DirectoryServiceProvider - if (sAppFileLocProvider) { - NS_RELEASE(sAppFileLocProvider); - sAppFileLocProvider = nsnull; - } - - // shut down XPCOM/Embedding - XRE_TermEmbedding(); - - NS_IF_RELEASE(sProfileLock); - NS_IF_RELEASE(sProfileDir); -} - -void -QGeckoGlobals::setPath(const char *aPath) -{ - if (sPath) - free(sPath); - if (aPath) - sPath = strdup(aPath); - else - sPath = nsnull; -} - - -void -QGeckoGlobals::setCompPath(const char *aPath) -{ - if (sCompPath) - free(sCompPath); - if (aPath) - sCompPath = strdup(aPath); - else - sCompPath = nsnull; -} - -void -QGeckoGlobals::setAppComponents(const nsModuleComponentInfo *aComps, - int aNumComponents) -{ - sAppComps = aComps; - sNumAppComps = aNumComponents; -} - -void -QGeckoGlobals::setProfilePath(const char *aDir, const char *aName) -{ - if (sProfileDir) { - if (sWidgetCount) { - NS_ERROR("Cannot change profile directory during run."); - return; - } - - NS_RELEASE(sProfileDir); - NS_RELEASE(sProfileLock); - } - - nsresult rv = - NS_NewNativeLocalFile(nsDependentCString(aDir), PR_TRUE, &sProfileDir); - - if (NS_SUCCEEDED(rv) && aName) - rv = sProfileDir->AppendNative(nsDependentCString(aName)); - - if (NS_SUCCEEDED(rv)) { - PRBool exists = PR_FALSE; - rv = sProfileDir->Exists(&exists); - if (!exists) - rv = sProfileDir->Create(nsIFile::DIRECTORY_TYPE, 0700); - rv = XRE_LockProfileDirectory(sProfileDir, &sProfileLock); - } - - if (NS_SUCCEEDED(rv)) { - if (sWidgetCount) - XRE_NotifyProfile(); - - return; - } - - NS_WARNING("Failed to lock profile."); - - // Failed - NS_IF_RELEASE(sProfileDir); - NS_IF_RELEASE(sProfileLock); -} - -void -QGeckoGlobals::setDirectoryServiceProvider(nsIDirectoryServiceProvider - *appFileLocProvider) -{ - if (sAppFileLocProvider) - NS_RELEASE(sAppFileLocProvider); - - if (appFileLocProvider) { - sAppFileLocProvider = appFileLocProvider; - NS_ADDREF(sAppFileLocProvider); - } -} - -/* static */ -int -QGeckoGlobals::registerAppComponents() -{ - nsCOMPtr cr; - nsresult rv = NS_GetComponentRegistrar(getter_AddRefs(cr)); - NS_ENSURE_SUCCESS(rv, rv); - - nsCOMPtr cm; - rv = NS_GetComponentManager (getter_AddRefs (cm)); - NS_ENSURE_SUCCESS (rv, rv); - - for (int i = 0; i < sNumAppComps; ++i) { - nsCOMPtr componentFactory; - rv = NS_NewGenericFactory(getter_AddRefs(componentFactory), - &(sAppComps[i])); - if (NS_FAILED(rv)) { - NS_WARNING("Unable to create factory for component"); - continue; // don't abort registering other components - } - - rv = cr->RegisterFactory(sAppComps[i].mCID, sAppComps[i].mDescription, - sAppComps[i].mContractID, componentFactory); - NS_ASSERTION(NS_SUCCEEDED(rv), "Unable to register factory for component"); - - // Call the registration hook of the component, if any - if (sAppComps[i].mRegisterSelfProc) { - rv = sAppComps[i].mRegisterSelfProc(cm, nsnull, nsnull, nsnull, - &(sAppComps[i])); - NS_ASSERTION(NS_SUCCEEDED(rv), "Unable to self-register component"); - } - } - - return rv; -} - -void QGeckoGlobals::initializeGlobalObjects() -{ - if (!sWindowList) { - sWindowList = new nsVoidArray(); - } -} - -void QGeckoGlobals::addEngine(QGeckoEmbed *embed) -{ - sWindowList->AppendElement(embed); -} - -void QGeckoGlobals::removeEngine(QGeckoEmbed *embed) -{ - sWindowList->RemoveElement(embed); -} - -QGeckoEmbed *QGeckoGlobals::findPrivateForBrowser(nsIWebBrowserChrome *aBrowser) -{ - if (!sWindowList) - return nsnull; - - // Get the number of browser windows. - PRInt32 count = sWindowList->Count(); - // This function doesn't get called very often at all ( only when - // creating a new window ) so it's OK to walk the list of open - // windows. - for (int i = 0; i < count; i++) { - QGeckoEmbed *tmpPrivate = static_cast - (sWindowList->ElementAt(i)); - // get the browser object for that window - nsIWebBrowserChrome *chrome = static_cast - (tmpPrivate->window()); - if (chrome == aBrowser) - return tmpPrivate; - } - - return nsnull; -} diff --git a/embedding/browser/qt/src/qgeckoglobals.h b/embedding/browser/qt/src/qgeckoglobals.h deleted file mode 100644 index 2d5a3162d9..0000000000 --- a/embedding/browser/qt/src/qgeckoglobals.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Zack Rusin . - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Zack Rusin - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef QECKOGLOBALS_H -#define QECKOGLOBALS_H - -#include "prenv.h" - -class nsModuleComponentInfo; -class nsIDirectoryServiceProvider; -class nsModuleComponentInfo; -class nsIAppShell; -class nsVoidArray; -class nsIDirectoryServiceProvider; -class nsIWebBrowserChrome; -class QGeckoEmbed; -class nsILocalFile; -class nsISupports; -class QTEmbedDirectoryProvider; - -class QGeckoGlobals -{ - friend class QGeckoEmbed; - friend class QTEmbedDirectoryProvider; -public: - static void initializeGlobalObjects(); - static void pushStartup(); - static void popStartup(); - static void setPath(const char *aPath); - static void setCompPath(const char *aPath); - static void setAppComponents(const nsModuleComponentInfo *aComps, - int aNumComponents); - static void setProfilePath(const char *aDir, const char *aName); - static void setDirectoryServiceProvider(nsIDirectoryServiceProvider - *appFileLocProvider); - static int registerAppComponents(); - - static void addEngine(QGeckoEmbed *embed); - static void removeEngine(QGeckoEmbed *embed); - static QGeckoEmbed *findPrivateForBrowser(nsIWebBrowserChrome *aBrowser); - static nsIDirectoryServiceProvider *sAppFileLocProvider; - -private: - static PRUint32 sWidgetCount; - // the path to the GRE - static char *sPath; - // the path to components - static char *sCompPath; - // the list of application-specific components to register - static const nsModuleComponentInfo *sAppComps; - static int sNumAppComps; - // the appshell we have created - static nsIAppShell *sAppShell; - // what is our profile path? - static nsILocalFile *sProfileDir; - static nsISupports *sProfileLock; - - - // the list of all open windows - static nsVoidArray *sWindowList; -}; - -#endif diff --git a/embedding/browser/qt/src/select.ui b/embedding/browser/qt/src/select.ui deleted file mode 100644 index e82639b3ee..0000000000 --- a/embedding/browser/qt/src/select.ui +++ /dev/null @@ -1,229 +0,0 @@ - - SelectDialog - - - - 0 - 0 - 222 - 141 - - - - Select - - - false - - - - - - - - true - - - - 0 - 0 - - - - select text - - - Qt::AlignVCenter - - - true - - - - - - - - 0 - 0 - - - - false - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - false - - - - - - - - - - 0 - 0 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 10 - 5 - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 5 - 5 - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - &OK - - - true - - - true - - - - - - - &Cancel - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - - - qPixmapFromMimeSource - - select - ok - cancel - - - - - ok - clicked() - SelectDialog - accept() - - - 20 - 20 - - - 20 - 20 - - - - - cancel - clicked() - SelectDialog - reject() - - - 20 - 20 - - - 20 - 20 - - - - - diff --git a/embedding/browser/qt/src/ui_alert.h b/embedding/browser/qt/src/ui_alert.h deleted file mode 100644 index 0f514f2eb2..0000000000 --- a/embedding/browser/qt/src/ui_alert.h +++ /dev/null @@ -1,159 +0,0 @@ -/******************************************************************************** -** Form generated from reading ui file 'alert.ui' -** -** Created: Mon May 5 19:26:41 2008 -** by: Qt User Interface Compiler version 4.4.0-rc1 -** -** WARNING! All changes made in this file will be lost when recompiling ui file! -********************************************************************************/ - -#ifndef UI_ALERT_H -#define UI_ALERT_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_AlertDialog -{ -public: - QVBoxLayout *vboxLayout; - QGridLayout *gridLayout; - QSpacerItem *spacerItem; - QLabel *message; - QSpacerItem *spacerItem1; - QCheckBox *check; - QSpacerItem *spacerItem2; - QLabel *icon; - QSpacerItem *spacerItem3; - QHBoxLayout *hboxLayout; - QSpacerItem *spacerItem4; - QPushButton *ok; - QSpacerItem *spacerItem5; - - void setupUi(QDialog *AlertDialog) - { - if (AlertDialog->objectName().isEmpty()) - AlertDialog->setObjectName(QString::fromUtf8("AlertDialog")); - AlertDialog->resize(187, 122); - AlertDialog->setSizeGripEnabled(false); - vboxLayout = new QVBoxLayout(AlertDialog); - vboxLayout->setSpacing(6); - vboxLayout->setMargin(11); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - gridLayout = new QGridLayout(); - gridLayout->setSpacing(6); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - spacerItem = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem, 1, 1, 1, 1); - - message = new QLabel(AlertDialog); - message->setObjectName(QString::fromUtf8("message")); - message->setEnabled(true); - QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(message->sizePolicy().hasHeightForWidth()); - message->setSizePolicy(sizePolicy); - message->setAlignment(Qt::AlignVCenter); - message->setWordWrap(true); - - gridLayout->addWidget(message, 0, 1, 1, 1); - - spacerItem1 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem1, 2, 0, 1, 1); - - check = new QCheckBox(AlertDialog); - check->setObjectName(QString::fromUtf8("check")); - QSizePolicy sizePolicy1(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(check->sizePolicy().hasHeightForWidth()); - check->setSizePolicy(sizePolicy1); - - gridLayout->addWidget(check, 2, 1, 1, 1); - - spacerItem2 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem2, 1, 0, 1, 1); - - icon = new QLabel(AlertDialog); - icon->setObjectName(QString::fromUtf8("icon")); - QSizePolicy sizePolicy2(QSizePolicy::Minimum, QSizePolicy::Minimum); - sizePolicy2.setHorizontalStretch(0); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(icon->sizePolicy().hasHeightForWidth()); - icon->setSizePolicy(sizePolicy2); - icon->setScaledContents(false); - icon->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop); - icon->setWordWrap(false); - - gridLayout->addWidget(icon, 0, 0, 1, 1); - - - vboxLayout->addLayout(gridLayout); - - spacerItem3 = new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Fixed); - - vboxLayout->addItem(spacerItem3); - - hboxLayout = new QHBoxLayout(); - hboxLayout->setSpacing(6); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - spacerItem4 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout->addItem(spacerItem4); - - ok = new QPushButton(AlertDialog); - ok->setObjectName(QString::fromUtf8("ok")); - ok->setAutoDefault(true); - ok->setDefault(true); - - hboxLayout->addWidget(ok); - - spacerItem5 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout->addItem(spacerItem5); - - - vboxLayout->addLayout(hboxLayout); - - QWidget::setTabOrder(ok, check); - - retranslateUi(AlertDialog); - QObject::connect(ok, SIGNAL(clicked()), AlertDialog, SLOT(accept())); - - QMetaObject::connectSlotsByName(AlertDialog); - } // setupUi - - void retranslateUi(QDialog *AlertDialog) - { - AlertDialog->setWindowTitle(QApplication::translate("AlertDialog", "Alert", 0, QApplication::UnicodeUTF8)); - message->setText(QApplication::translate("AlertDialog", "alert text", 0, QApplication::UnicodeUTF8)); - check->setText(QApplication::translate("AlertDialog", "confirm", 0, QApplication::UnicodeUTF8)); - ok->setText(QApplication::translate("AlertDialog", "&OK", 0, QApplication::UnicodeUTF8)); - Q_UNUSED(AlertDialog); - } // retranslateUi - -}; - -namespace Ui { - class AlertDialog: public Ui_AlertDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_ALERT_H diff --git a/embedding/browser/qt/src/ui_confirm.h b/embedding/browser/qt/src/ui_confirm.h deleted file mode 100644 index ab55e95254..0000000000 --- a/embedding/browser/qt/src/ui_confirm.h +++ /dev/null @@ -1,178 +0,0 @@ -/******************************************************************************** -** Form generated from reading ui file 'confirm.ui' -** -** Created: Mon May 5 20:48:56 2008 -** by: Qt User Interface Compiler version 4.4.0-rc1 -** -** WARNING! All changes made in this file will be lost when recompiling ui file! -********************************************************************************/ - -#ifndef UI_CONFIRM_H -#define UI_CONFIRM_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_ConfirmDialog -{ -public: - QVBoxLayout *vboxLayout; - QGridLayout *gridLayout; - QSpacerItem *spacerItem; - QSpacerItem *spacerItem1; - QCheckBox *check; - QLabel *message; - QLabel *icon; - QSpacerItem *spacerItem2; - QSpacerItem *spacerItem3; - QHBoxLayout *hboxLayout; - QSpacerItem *spacerItem4; - QPushButton *but1; - QPushButton *but2; - QPushButton *but3; - QSpacerItem *spacerItem5; - - void setupUi(QDialog *ConfirmDialog) - { - if (ConfirmDialog->objectName().isEmpty()) - ConfirmDialog->setObjectName(QString::fromUtf8("ConfirmDialog")); - ConfirmDialog->resize(296, 152); - QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(ConfirmDialog->sizePolicy().hasHeightForWidth()); - ConfirmDialog->setSizePolicy(sizePolicy); - ConfirmDialog->setSizeGripEnabled(false); - vboxLayout = new QVBoxLayout(ConfirmDialog); - vboxLayout->setSpacing(6); - vboxLayout->setMargin(11); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - gridLayout = new QGridLayout(); - gridLayout->setSpacing(6); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - spacerItem = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem, 1, 0, 1, 1); - - spacerItem1 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem1, 2, 0, 1, 1); - - check = new QCheckBox(ConfirmDialog); - check->setObjectName(QString::fromUtf8("check")); - QSizePolicy sizePolicy1(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(check->sizePolicy().hasHeightForWidth()); - check->setSizePolicy(sizePolicy1); - - gridLayout->addWidget(check, 2, 1, 1, 1); - - message = new QLabel(ConfirmDialog); - message->setObjectName(QString::fromUtf8("message")); - message->setEnabled(true); - QSizePolicy sizePolicy2(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - sizePolicy2.setHorizontalStretch(0); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(message->sizePolicy().hasHeightForWidth()); - message->setSizePolicy(sizePolicy2); - message->setAlignment(Qt::AlignVCenter); - message->setWordWrap(true); - - gridLayout->addWidget(message, 0, 1, 1, 1); - - icon = new QLabel(ConfirmDialog); - icon->setObjectName(QString::fromUtf8("icon")); - sizePolicy.setHeightForWidth(icon->sizePolicy().hasHeightForWidth()); - icon->setSizePolicy(sizePolicy); - icon->setScaledContents(false); - icon->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop); - icon->setWordWrap(false); - - gridLayout->addWidget(icon, 0, 0, 1, 1); - - spacerItem2 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem2, 1, 1, 1, 1); - - - vboxLayout->addLayout(gridLayout); - - spacerItem3 = new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Fixed); - - vboxLayout->addItem(spacerItem3); - - hboxLayout = new QHBoxLayout(); - hboxLayout->setSpacing(6); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - spacerItem4 = new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout->addItem(spacerItem4); - - but1 = new QPushButton(ConfirmDialog); - but1->setObjectName(QString::fromUtf8("but1")); - but1->setAutoDefault(true); - but1->setDefault(true); - - hboxLayout->addWidget(but1); - - but2 = new QPushButton(ConfirmDialog); - but2->setObjectName(QString::fromUtf8("but2")); - but2->setAutoDefault(true); - - hboxLayout->addWidget(but2); - - but3 = new QPushButton(ConfirmDialog); - but3->setObjectName(QString::fromUtf8("but3")); - but3->setAutoDefault(true); - - hboxLayout->addWidget(but3); - - spacerItem5 = new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout->addItem(spacerItem5); - - - vboxLayout->addLayout(hboxLayout); - - - retranslateUi(ConfirmDialog); - QObject::connect(but1, SIGNAL(clicked()), ConfirmDialog, SLOT(reject())); - QObject::connect(but2, SIGNAL(clicked()), ConfirmDialog, SLOT(accept())); - QObject::connect(but3, SIGNAL(clicked()), ConfirmDialog, SLOT(done3())); - - QMetaObject::connectSlotsByName(ConfirmDialog); - } // setupUi - - void retranslateUi(QDialog *ConfirmDialog) - { - ConfirmDialog->setWindowTitle(QApplication::translate("ConfirmDialog", "Confirm", 0, QApplication::UnicodeUTF8)); - check->setText(QApplication::translate("ConfirmDialog", "confirm", 0, QApplication::UnicodeUTF8)); - message->setText(QApplication::translate("ConfirmDialog", "confirm text", 0, QApplication::UnicodeUTF8)); - but1->setText(QApplication::translate("ConfirmDialog", "1", 0, QApplication::UnicodeUTF8)); - but2->setText(QApplication::translate("ConfirmDialog", "2", 0, QApplication::UnicodeUTF8)); - but3->setText(QApplication::translate("ConfirmDialog", "3", 0, QApplication::UnicodeUTF8)); - Q_UNUSED(ConfirmDialog); - } // retranslateUi - -}; - -namespace Ui { - class ConfirmDialog: public Ui_ConfirmDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_CONFIRM_H diff --git a/embedding/browser/qt/src/ui_prompt.h b/embedding/browser/qt/src/ui_prompt.h deleted file mode 100644 index f562109486..0000000000 --- a/embedding/browser/qt/src/ui_prompt.h +++ /dev/null @@ -1,196 +0,0 @@ -/******************************************************************************** -** Form generated from reading ui file 'prompt.ui' -** -** Created: Mon May 5 21:01:48 2008 -** by: Qt User Interface Compiler version 4.4.0-rc1 -** -** WARNING! All changes made in this file will be lost when recompiling ui file! -********************************************************************************/ - -#ifndef UI_PROMPT_H -#define UI_PROMPT_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_PromptDialog -{ -public: - QVBoxLayout *vboxLayout; - QGridLayout *gridLayout; - QLabel *message; - QLabel *icon; - QCheckBox *check; - QHBoxLayout *hboxLayout; - QLineEdit *input; - QSpacerItem *spacerItem; - QSpacerItem *spacerItem1; - QSpacerItem *spacerItem2; - QSpacerItem *spacerItem3; - QSpacerItem *spacerItem4; - QSpacerItem *spacerItem5; - QHBoxLayout *hboxLayout1; - QSpacerItem *spacerItem6; - QPushButton *ok; - QPushButton *cancel; - QSpacerItem *spacerItem7; - - void setupUi(QDialog *PromptDialog) - { - if (PromptDialog->objectName().isEmpty()) - PromptDialog->setObjectName(QString::fromUtf8("PromptDialog")); - PromptDialog->resize(222, 177); - PromptDialog->setSizeGripEnabled(false); - vboxLayout = new QVBoxLayout(PromptDialog); - vboxLayout->setSpacing(6); - vboxLayout->setMargin(11); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - gridLayout = new QGridLayout(); - gridLayout->setSpacing(6); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - message = new QLabel(PromptDialog); - message->setObjectName(QString::fromUtf8("message")); - message->setEnabled(true); - QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(message->sizePolicy().hasHeightForWidth()); - message->setSizePolicy(sizePolicy); - message->setAlignment(Qt::AlignVCenter); - message->setWordWrap(true); - - gridLayout->addWidget(message, 0, 1, 1, 1); - - icon = new QLabel(PromptDialog); - icon->setObjectName(QString::fromUtf8("icon")); - QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Minimum); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(icon->sizePolicy().hasHeightForWidth()); - icon->setSizePolicy(sizePolicy1); - icon->setScaledContents(false); - icon->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop); - icon->setWordWrap(false); - - gridLayout->addWidget(icon, 0, 0, 1, 1); - - check = new QCheckBox(PromptDialog); - check->setObjectName(QString::fromUtf8("check")); - QSizePolicy sizePolicy2(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); - sizePolicy2.setHorizontalStretch(0); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(check->sizePolicy().hasHeightForWidth()); - check->setSizePolicy(sizePolicy2); - - gridLayout->addWidget(check, 3, 1, 1, 1); - - hboxLayout = new QHBoxLayout(); - hboxLayout->setSpacing(6); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - input = new QLineEdit(PromptDialog); - input->setObjectName(QString::fromUtf8("input")); - sizePolicy2.setHeightForWidth(input->sizePolicy().hasHeightForWidth()); - input->setSizePolicy(sizePolicy2); - - hboxLayout->addWidget(input); - - spacerItem = new QSpacerItem(10, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - hboxLayout->addItem(spacerItem); - - - gridLayout->addLayout(hboxLayout, 1, 1, 1, 1); - - spacerItem1 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem1, 3, 0, 1, 1); - - spacerItem2 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem2, 2, 1, 1, 1); - - spacerItem3 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem3, 2, 0, 1, 1); - - spacerItem4 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem4, 1, 0, 1, 1); - - - vboxLayout->addLayout(gridLayout); - - spacerItem5 = new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Fixed); - - vboxLayout->addItem(spacerItem5); - - hboxLayout1 = new QHBoxLayout(); - hboxLayout1->setSpacing(6); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); - spacerItem6 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout1->addItem(spacerItem6); - - ok = new QPushButton(PromptDialog); - ok->setObjectName(QString::fromUtf8("ok")); - ok->setAutoDefault(true); - ok->setDefault(true); - - hboxLayout1->addWidget(ok); - - cancel = new QPushButton(PromptDialog); - cancel->setObjectName(QString::fromUtf8("cancel")); - cancel->setAutoDefault(true); - - hboxLayout1->addWidget(cancel); - - spacerItem7 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout1->addItem(spacerItem7); - - - vboxLayout->addLayout(hboxLayout1); - - QWidget::setTabOrder(input, check); - QWidget::setTabOrder(check, ok); - QWidget::setTabOrder(ok, cancel); - - retranslateUi(PromptDialog); - QObject::connect(ok, SIGNAL(clicked()), PromptDialog, SLOT(accept())); - QObject::connect(cancel, SIGNAL(clicked()), PromptDialog, SLOT(reject())); - - QMetaObject::connectSlotsByName(PromptDialog); - } // setupUi - - void retranslateUi(QDialog *PromptDialog) - { - PromptDialog->setWindowTitle(QApplication::translate("PromptDialog", "Prompt", 0, QApplication::UnicodeUTF8)); - message->setText(QApplication::translate("PromptDialog", "prompt text", 0, QApplication::UnicodeUTF8)); - check->setText(QApplication::translate("PromptDialog", "confirm", 0, QApplication::UnicodeUTF8)); - ok->setText(QApplication::translate("PromptDialog", "&OK", 0, QApplication::UnicodeUTF8)); - cancel->setText(QApplication::translate("PromptDialog", "&Cancel", 0, QApplication::UnicodeUTF8)); - Q_UNUSED(PromptDialog); - } // retranslateUi - -}; - -namespace Ui { - class PromptDialog: public Ui_PromptDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_PROMPT_H diff --git a/embedding/browser/qt/src/ui_select.h b/embedding/browser/qt/src/ui_select.h deleted file mode 100644 index c9e4068b9f..0000000000 --- a/embedding/browser/qt/src/ui_select.h +++ /dev/null @@ -1,170 +0,0 @@ -/******************************************************************************** -** Form generated from reading ui file 'select.ui' -** -** Created: Mon May 5 21:13:44 2008 -** by: Qt User Interface Compiler version 4.4.0-rc1 -** -** WARNING! All changes made in this file will be lost when recompiling ui file! -********************************************************************************/ - -#ifndef UI_SELECT_H -#define UI_SELECT_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_SelectDialog -{ -public: - QVBoxLayout *vboxLayout; - QGridLayout *gridLayout; - QLabel *message; - QLabel *icon; - QHBoxLayout *hboxLayout; - QComboBox *select; - QSpacerItem *spacerItem; - QSpacerItem *spacerItem1; - QSpacerItem *spacerItem2; - QHBoxLayout *hboxLayout1; - QSpacerItem *spacerItem3; - QPushButton *ok; - QPushButton *cancel; - QSpacerItem *spacerItem4; - - void setupUi(QDialog *SelectDialog) - { - if (SelectDialog->objectName().isEmpty()) - SelectDialog->setObjectName(QString::fromUtf8("SelectDialog")); - SelectDialog->resize(222, 141); - SelectDialog->setSizeGripEnabled(false); - vboxLayout = new QVBoxLayout(SelectDialog); - vboxLayout->setSpacing(6); - vboxLayout->setMargin(11); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - gridLayout = new QGridLayout(); - gridLayout->setSpacing(6); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - message = new QLabel(SelectDialog); - message->setObjectName(QString::fromUtf8("message")); - message->setEnabled(true); - QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(message->sizePolicy().hasHeightForWidth()); - message->setSizePolicy(sizePolicy); - message->setAlignment(Qt::AlignVCenter); - message->setWordWrap(true); - - gridLayout->addWidget(message, 0, 1, 1, 1); - - icon = new QLabel(SelectDialog); - icon->setObjectName(QString::fromUtf8("icon")); - QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Minimum); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(icon->sizePolicy().hasHeightForWidth()); - icon->setSizePolicy(sizePolicy1); - icon->setScaledContents(false); - icon->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop); - icon->setWordWrap(false); - - gridLayout->addWidget(icon, 0, 0, 1, 1); - - hboxLayout = new QHBoxLayout(); - hboxLayout->setSpacing(6); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - select = new QComboBox(SelectDialog); - select->setObjectName(QString::fromUtf8("select")); - QSizePolicy sizePolicy2(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); - sizePolicy2.setHorizontalStretch(0); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(select->sizePolicy().hasHeightForWidth()); - select->setSizePolicy(sizePolicy2); - - hboxLayout->addWidget(select); - - spacerItem = new QSpacerItem(10, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - hboxLayout->addItem(spacerItem); - - - gridLayout->addLayout(hboxLayout, 1, 1, 1, 1); - - spacerItem1 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem1, 1, 0, 1, 1); - - - vboxLayout->addLayout(gridLayout); - - spacerItem2 = new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Fixed); - - vboxLayout->addItem(spacerItem2); - - hboxLayout1 = new QHBoxLayout(); - hboxLayout1->setSpacing(6); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); - spacerItem3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout1->addItem(spacerItem3); - - ok = new QPushButton(SelectDialog); - ok->setObjectName(QString::fromUtf8("ok")); - ok->setAutoDefault(true); - ok->setDefault(true); - - hboxLayout1->addWidget(ok); - - cancel = new QPushButton(SelectDialog); - cancel->setObjectName(QString::fromUtf8("cancel")); - cancel->setAutoDefault(true); - - hboxLayout1->addWidget(cancel); - - spacerItem4 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout1->addItem(spacerItem4); - - - vboxLayout->addLayout(hboxLayout1); - - QWidget::setTabOrder(select, ok); - QWidget::setTabOrder(ok, cancel); - - retranslateUi(SelectDialog); - QObject::connect(ok, SIGNAL(clicked()), SelectDialog, SLOT(accept())); - QObject::connect(cancel, SIGNAL(clicked()), SelectDialog, SLOT(reject())); - - QMetaObject::connectSlotsByName(SelectDialog); - } // setupUi - - void retranslateUi(QDialog *SelectDialog) - { - SelectDialog->setWindowTitle(QApplication::translate("SelectDialog", "Select", 0, QApplication::UnicodeUTF8)); - message->setText(QApplication::translate("SelectDialog", "select text", 0, QApplication::UnicodeUTF8)); - ok->setText(QApplication::translate("SelectDialog", "&OK", 0, QApplication::UnicodeUTF8)); - cancel->setText(QApplication::translate("SelectDialog", "&Cancel", 0, QApplication::UnicodeUTF8)); - Q_UNUSED(SelectDialog); - } // retranslateUi - -}; - -namespace Ui { - class SelectDialog: public Ui_SelectDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_SELECT_H diff --git a/embedding/browser/qt/src/ui_userpass.h b/embedding/browser/qt/src/ui_userpass.h deleted file mode 100644 index 050ff36b02..0000000000 --- a/embedding/browser/qt/src/ui_userpass.h +++ /dev/null @@ -1,221 +0,0 @@ -/******************************************************************************** -** Form generated from reading ui file 'userpass.ui' -** -** Created: Mon May 5 21:09:17 2008 -** by: Qt User Interface Compiler version 4.4.0-rc1 -** -** WARNING! All changes made in this file will be lost when recompiling ui file! -********************************************************************************/ - -#ifndef UI_USERPASS_H -#define UI_USERPASS_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_UserpassDialog -{ -public: - QVBoxLayout *vboxLayout; - QGridLayout *gridLayout; - QLabel *message; - QSpacerItem *spacerItem; - QSpacerItem *spacerItem1; - QLabel *icon; - QGridLayout *gridLayout1; - QLineEdit *username; - QSpacerItem *spacerItem2; - QLineEdit *password; - QLabel *lb_password; - QSpacerItem *spacerItem3; - QLabel *lb_username; - QSpacerItem *spacerItem4; - QCheckBox *check; - QSpacerItem *spacerItem5; - QSpacerItem *spacerItem6; - QHBoxLayout *hboxLayout; - QSpacerItem *spacerItem7; - QPushButton *ok; - QPushButton *cancel; - QSpacerItem *spacerItem8; - - void setupUi(QDialog *UserpassDialog) - { - if (UserpassDialog->objectName().isEmpty()) - UserpassDialog->setObjectName(QString::fromUtf8("UserpassDialog")); - UserpassDialog->resize(264, 204); - vboxLayout = new QVBoxLayout(UserpassDialog); - vboxLayout->setSpacing(6); - vboxLayout->setMargin(11); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - gridLayout = new QGridLayout(); - gridLayout->setSpacing(6); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - message = new QLabel(UserpassDialog); - message->setObjectName(QString::fromUtf8("message")); - message->setEnabled(true); - QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(message->sizePolicy().hasHeightForWidth()); - message->setSizePolicy(sizePolicy); - message->setAlignment(Qt::AlignVCenter); - message->setWordWrap(true); - - gridLayout->addWidget(message, 0, 1, 1, 1); - - spacerItem = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem, 3, 0, 1, 1); - - spacerItem1 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem1, 2, 1, 1, 1); - - icon = new QLabel(UserpassDialog); - icon->setObjectName(QString::fromUtf8("icon")); - QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Minimum); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(icon->sizePolicy().hasHeightForWidth()); - icon->setSizePolicy(sizePolicy1); - icon->setScaledContents(false); - icon->setWordWrap(false); - - gridLayout->addWidget(icon, 0, 0, 1, 1); - - gridLayout1 = new QGridLayout(); - gridLayout1->setSpacing(6); - gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); - username = new QLineEdit(UserpassDialog); - username->setObjectName(QString::fromUtf8("username")); - - gridLayout1->addWidget(username, 0, 1, 1, 1); - - spacerItem2 = new QSpacerItem(10, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout1->addItem(spacerItem2, 1, 2, 1, 1); - - password = new QLineEdit(UserpassDialog); - password->setObjectName(QString::fromUtf8("password")); - password->setEchoMode(QLineEdit::Password); - - gridLayout1->addWidget(password, 1, 1, 1, 1); - - lb_password = new QLabel(UserpassDialog); - lb_password->setObjectName(QString::fromUtf8("lb_password")); - lb_password->setWordWrap(false); - - gridLayout1->addWidget(lb_password, 1, 0, 1, 1); - - spacerItem3 = new QSpacerItem(10, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout1->addItem(spacerItem3, 0, 2, 1, 1); - - lb_username = new QLabel(UserpassDialog); - lb_username->setObjectName(QString::fromUtf8("lb_username")); - lb_username->setWordWrap(false); - - gridLayout1->addWidget(lb_username, 0, 0, 1, 1); - - - gridLayout->addLayout(gridLayout1, 1, 1, 1, 1); - - spacerItem4 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem4, 1, 0, 1, 1); - - check = new QCheckBox(UserpassDialog); - check->setObjectName(QString::fromUtf8("check")); - QSizePolicy sizePolicy2(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); - sizePolicy2.setHorizontalStretch(0); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(check->sizePolicy().hasHeightForWidth()); - check->setSizePolicy(sizePolicy2); - - gridLayout->addWidget(check, 3, 1, 1, 1); - - spacerItem5 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem5, 2, 0, 1, 1); - - - vboxLayout->addLayout(gridLayout); - - spacerItem6 = new QSpacerItem(20, 16, QSizePolicy::Minimum, QSizePolicy::Fixed); - - vboxLayout->addItem(spacerItem6); - - hboxLayout = new QHBoxLayout(); - hboxLayout->setSpacing(6); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - spacerItem7 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout->addItem(spacerItem7); - - ok = new QPushButton(UserpassDialog); - ok->setObjectName(QString::fromUtf8("ok")); - ok->setAutoDefault(true); - ok->setDefault(true); - - hboxLayout->addWidget(ok); - - cancel = new QPushButton(UserpassDialog); - cancel->setObjectName(QString::fromUtf8("cancel")); - - hboxLayout->addWidget(cancel); - - spacerItem8 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout->addItem(spacerItem8); - - - vboxLayout->addLayout(hboxLayout); - - QWidget::setTabOrder(username, password); - QWidget::setTabOrder(password, check); - QWidget::setTabOrder(check, ok); - QWidget::setTabOrder(ok, cancel); - - retranslateUi(UserpassDialog); - QObject::connect(ok, SIGNAL(clicked()), UserpassDialog, SLOT(accept())); - QObject::connect(cancel, SIGNAL(clicked()), UserpassDialog, SLOT(reject())); - QObject::connect(password, SIGNAL(returnPressed()), UserpassDialog, SLOT(accept())); - - QMetaObject::connectSlotsByName(UserpassDialog); - } // setupUi - - void retranslateUi(QDialog *UserpassDialog) - { - UserpassDialog->setWindowTitle(QApplication::translate("UserpassDialog", "Prompt", 0, QApplication::UnicodeUTF8)); - message->setText(QApplication::translate("UserpassDialog", "prompt text", 0, QApplication::UnicodeUTF8)); - lb_password->setText(QApplication::translate("UserpassDialog", "Password:", 0, QApplication::UnicodeUTF8)); - lb_username->setText(QApplication::translate("UserpassDialog", "Username:", 0, QApplication::UnicodeUTF8)); - check->setText(QApplication::translate("UserpassDialog", "confirm", 0, QApplication::UnicodeUTF8)); - ok->setText(QApplication::translate("UserpassDialog", "&OK", 0, QApplication::UnicodeUTF8)); - cancel->setText(QApplication::translate("UserpassDialog", "&Cancel", 0, QApplication::UnicodeUTF8)); - Q_UNUSED(UserpassDialog); - } // retranslateUi - -}; - -namespace Ui { - class UserpassDialog: public Ui_UserpassDialog {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_USERPASS_H diff --git a/embedding/browser/qt/src/userpass.ui b/embedding/browser/qt/src/userpass.ui deleted file mode 100644 index 4e7a553674..0000000000 --- a/embedding/browser/qt/src/userpass.ui +++ /dev/null @@ -1,335 +0,0 @@ - - UserpassDialog - - - - 0 - 0 - 264 - 204 - - - - Prompt - - - - - - - - true - - - - 0 - 0 - - - - prompt text - - - Qt::AlignVCenter - - - true - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 5 - 5 - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 5 - 5 - - - - - - - - - 0 - 0 - - - - false - - - false - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 10 - 5 - - - - - - - - QLineEdit::Password - - - - - - - Password: - - - false - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 10 - 5 - - - - - - - - Username: - - - false - - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 5 - 5 - - - - - - - - - 0 - 0 - - - - confirm - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 5 - 5 - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 16 - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - &OK - - - true - - - true - - - - - - - &Cancel - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - - - qPixmapFromMimeSource - - username - password - check - ok - cancel - - - - - ok - clicked() - UserpassDialog - accept() - - - 20 - 20 - - - 20 - 20 - - - - - cancel - clicked() - UserpassDialog - reject() - - - 20 - 20 - - - 20 - 20 - - - - - password - returnPressed() - UserpassDialog - accept() - - - 20 - 20 - - - 20 - 20 - - - - - diff --git a/embedding/browser/qt/tests/Makefile.in b/embedding/browser/qt/tests/Makefile.in deleted file mode 100644 index f0798321a3..0000000000 --- a/embedding/browser/qt/tests/Makefile.in +++ /dev/null @@ -1,103 +0,0 @@ -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = qgeckoembed -REQUIRES = xpcom \ - string \ - dom \ - $(NULL) - -ifdef NS_TRACE_MALLOC -REQUIRES += tracemalloc -endif - -ifdef MOZ_JPROF -REQUIRES += jprof -endif - -CPPSRCS = \ - $(MOCSRCS) \ - mainwindow.cpp \ - TestQGeckoEmbed.cpp - -MOCSRCS = \ - moc_mainwindow.cpp \ - $(NULL) - -#IMAGES = fileopen.png reload.png back.png forward.png stop.png - -CXXFLAGS += $(MOZ_QT_CFLAGS) -PROGRAM = TestQGeckoEmbed$(BIN_SUFFIX) - -ifdef MOZ_ENABLE_QT -LIBS += \ - $(XLDFLAGS) \ - $(XLIBS) \ - $(MOZ_QT_LIBS) \ - $(NULL) - -ifndef MOZ_ENABLE_LIBXUL -LIBS += \ - -lqgeckoembed \ - $(NULL) -endif -LIBS += \ - -lxul \ - $(NULL) -endif - -include $(topsrcdir)/config/config.mk -include $(srcdir)/../src/config/qtconfig.mk - -# Force applications to be built non-statically -# when building the mozcomps meta component -ifneq (,$(filter mozcomps,$(MOZ_META_COMPONENTS))) -BUILD_STATIC_LIBS= -endif - -ifdef NS_TRACE_MALLOC -EXTRA_LIBS += -ltracemalloc -endif - -ifdef MOZ_PERF_METRICS -EXTRA_LIBS += -lmozutil_s -endif - -ifdef MOZ_JPROF -EXTRA_LIBS += -ljprof -endif - -EXTRA_LIBS += $(MOZ_JS_LIBS) -EXTRA_LIBS += $(MOZ_COMPONENT_LIBS) - -include $(topsrcdir)/config/rules.mk -include $(srcdir)/../src/config/qtrules.mk - -LIBS += $(XPCOM_STANDALONE_GLUE_LDOPTS) -DEFINES += -DXPCOM_GLUE - -CXXFLAGS += $(MOZ_QT_CFLAGS) - -EXTRA_LIBS += \ - $(TK_LIBS) \ - $(MOZ_QT_LIBS) \ - $(NULL) - -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. -DEFINES += -D_TIME_H=1 -endif -endif - -ifeq ($(OS_ARCH), OpenVMS) -DEFINES += -DGENERIC_MOTIF_REDEFINES -endif diff --git a/embedding/browser/qt/tests/TestQGeckoEmbed.cpp b/embedding/browser/qt/tests/TestQGeckoEmbed.cpp deleted file mode 100644 index 7573bffcbc..0000000000 --- a/embedding/browser/qt/tests/TestQGeckoEmbed.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include -#include "mainwindow.h" -#include "qgeckoembed.h" -#include "nsXPCOMGlue.h" -#ifdef MOZ_JPROF -#include "jprof/jprof.h" -#endif - -#include -#include - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - - static const GREVersionRange greVersion = { - "1.9a", PR_TRUE, - "2", PR_TRUE - }; - -#ifdef MOZ_JPROF - setupProfilingStuff(); -#endif - - char xpcomPath[PATH_MAX]; - - nsresult rv = GRE_GetGREPathWithProperties(&greVersion, 1, nsnull, 0, - xpcomPath, sizeof(xpcomPath)); - if (NS_FAILED(rv)) { - fprintf(stderr, "Couldn't find a compatible GRE.\n"); - return 1; - } - - rv = XPCOMGlueStartup(xpcomPath); - if (NS_FAILED(rv)) { - fprintf(stderr, "Couldn't start XPCOM.\n"); - return 1; - } - char *lastSlash = strrchr(xpcomPath, '/'); - if (lastSlash) - *lastSlash = '\0'; - - QGeckoEmbed::initialize(QDir::homePath().toUtf8(), - ".TestQGeckoEmbed", xpcomPath); - - MyMainWindow *mainWindow = new MyMainWindow(); - //app.setMainWidget(mainWindow); - - mainWindow->resize(400, 600); - mainWindow->show(); - - QString url; - if (argc > 1) - url = argv[1]; - else - url = "http://www.kde.org"; - - mainWindow->qecko->loadURL(url); - - return app.exec(); -} diff --git a/embedding/browser/qt/tests/back.png b/embedding/browser/qt/tests/back.png deleted file mode 100755 index e8d11504c94363368a5351111fe986ada43ffea3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcwPel00001 literal 1523 zcwPbX1q}L$P)rty-*d%VQgx!1nF%iKG2@64RT0}~X|1lqs!Y37{y z=J)^3InsCFQ)-~6>ye?pzK@R%55Dnf{{c|{UqYg<_e&kkd*2^TB;Nbh^Uov=MS1SC z7(7tNh6lCYj*d5zeFO66uY6zH3lnm7;te_4e@K27j()$%!$X70_D=r7VBf%zAD?-F zu125fbFX7XI&poKuC|U}tD068!Y_q%bw<QR=qa@l;bFkVwv`-7`9*XKTA zaCmqq?i7lbpMLany{Ate#!6t@Fp@+^P}n6*;oI|V7RmM#z=$K_miJ}hg>?##kb$X_Z{k+TZr!I zV0(Fzy*)i>p$JuL8^3DfRw@XuiYh(Y`iB^K=0(n*yTr@iJwr7TYtin&lZOtyv){{) zo;mX@TF7MlH*X&gVj9zM>>+BVmh*L4kGWO(>3Gn;w*+ozr+@z7x=e*0HEr%YXAJ*@*>)Hc_XUE3fU zk6{=preR{3A!_R5gd<^u=TWg8V!QXVxx9*-yM?9KbLqxHr+ze%{Gqh+UwNdriLn!h zx%iI{$fnY?_Z^_Nsh-uTc{b-)k-mqbLMWuNXI}%Z=i^v5w(DSo4eX+YT@~0>1uI|1 zu|ue;rs|#)FVx8@Uw-`aEKklb|IsW$3d)v)RC73%O}S9Qt$MhwN7b&NX&PqKz_BY- zDiwt1g95(mlFwNzUSDA+yqA!sSvn96g~KSK!p+GQBpSM|lHbZv+$ms&O@x$`trDeT z1;?qPD3WL_h88lAN(9YRiS07Tr8h~XGsGjUY-cj)A$?9)6|M`RG+&(Fp}nb=md*y! zOV@B+7rz2lp^WeQxUP>c6%|&Q4bkl%P6jRy=ArNW|DZ;qEic!~0 zXMcjtVwwELHY)Dx>ZPkw1)&*VoX>7Cm&vpH_*V&ck0H!@N)>@-Mvz*Vva7P=NQ$0; zA8)3l*FsYdM*9$Y{XTXz?W3_bNu+InBDW?>qsD`-McXXX*nA~gqkNj~-@$&+8ejK@GiYGn;w*AOWD{oGluO;yI*lOrrQz)R2K^#AzEnNvV)QR4g*9iM)%lk$OwRn`zRm8~@W7EU{<-eY^O7{Cy!BbEM9r> zIr7E)Ur^L>Ro899G{TyqqUxb#DY-B;znFSJ_x`u)YIZetv^JkVksOpSfAf_5^Pk?4 zSLaf4M@sqO)QTMIJ19-V=>DIOKzFae0OEiEasah8vG3JI!l&c9(lDGn&SOt}jn&0# zoIU${|LW4p!@v&E2)KX~Jj*}@NZ)I)HwZ5R)g_> zR-gn`*8(+w465G)v;@X?wowUyr6BC!n*Zp8zb8k~u|EB{W&Abg-26eR8i Z{R?`wnj_hO0x19h002ovPDHLkV1jtg|EmB1 diff --git a/embedding/browser/qt/tests/back.png.uu b/embedding/browser/qt/tests/back.png.uu deleted file mode 100644 index 6ce1d3d4ce..0000000000 --- a/embedding/browser/qt/tests/back.png.uu +++ /dev/null @@ -1,37 +0,0 @@ -begin 755 ./debian/resources/sandbox/qt_port/embedding/browser/qt/tests/back.png -MB5!.1PT*&@H````-24A$4@```!@````8"`8```#@=SWX```%NDE$051XG)65 -M66P=5QG'?[/YU[Z^R]P[<^_, -MG,,#$Q32!-J_]&GFG/GF]__..=)WX%-JH*?KD:&^OH^/#@^^\6G_`5#_7T*B -MK_=+'>ZS&#Q0QX8'M=Z.CC>3?0/RYZ]\7]H+$W)V -MX@TYVG](?A:.?K_)PT.#RO9._L)@W\"1'Y]Y@:Y&G^ESKV-%.G%]E:ZVCE^K -MFE86PB^%='5&T_1W%87<].S))B:N'R6T7R*XMX>I1EK9RV7RQ,%Y35_N#JS/7YSYA<'AX -M*.X4BI>??O1SO:=//TOVYBP?OGV>[,9M6GO;Z!AH9W]O-XV))RC=O(2SLX8G -M3!Q'I:ZU%TO4\JO7?LGO_O`F,E+SH^G9V5?_RV"XL_/&2(/6]Y.??8=<.LO% -MM]_#]QWJFUN([NE@>WF2O3T]:*$(56L;OVKC5BH(KXHJ/=KZAQAYYD7.G[O$ -MR]\]0S42:]'NP).'#KVSW\N/GCGS+%K(9/PW;R%EE8.)'O;W=U&\O<;ZPAKK -M"[>8OWR%U/(M-E?2;*ZEV4KET/L[*VC;7E]=U#6!D>/@M -M,YMY_-NGGB3QT&$F?OM7/*=,76,]K0-=U#;7DUW;(!J/81@JIF%BF"%JZN.$ -M(V&$YU&Q'6*[][.YO(J;NX6EUW/IQD*G?C21_*&T\E]YI+>)L1.'N?B/#\BF -MTK3W':"VJ9[5J7DVYU>1OH>B0BBDLF=?`Z[GXU@VMNM@A`WLHH5=%=A5!2M? -MQK%#J*JFZIX4+]3)*E]^_/,L3\XP_]$L0@K*EH-47V$GO)>0IEDZ$`V%PRBBPLW)%20:NJZ2 -MW\I1W"E@ADV$E)2M$J5B!<>IHBB2:"R&%C*02@3-5(GM,LBE-TFE,\0CK6QG -M,N@A?4Y7%:X+H31?G-ZAO:F6ELX&TDO7<%T7OP)6H8SO^[BNCR\5%%5!^`)/ -M,;$*)3S710G'$:I/L6`3;VZC9#:PN95&4=6;NJ;P5%'3MC]*V;JV^R#%Z1D4 -MVT*X931%14J0FD:I[&*7'733@%`44]H((1!J#"G"N+Z*4==,9W^"S6*9_,8V -M*N[KZJ6K4P6A&5^/(@1]O -MIJ370E,/1OL0>OT^=C7MH[$W2:1M@.5LEG+9^OCRU,P'.L#EJ>E_'AGL/S6] -M<.VUAMI==`^,$=O=0F9A&JDK:$)09^81T2(U!WI)/O8DR9-?P(S'0$)J90U= -MUQ`H_/W<6:Y-7<(TS:]_HE6,)H:>"FOJ'X\G1AD8.XGB.:1N3*+X5=20@6?$ -M:1L]2:F0050L,JN+E*H^N9*#$=*I^I*-U!J9U?F7+DS._.*^S>[8\,"1,/ZY -M[O:^QA-//\_!_F&RZTMLIS.T)X]1>?$Y\L7\7U#4<577;<,TPIJBHNJA -M92FY,#6_F'I`]_ZWZFIV-7:T-I\_D1R4+W_SE/SSG]Z15^=2'4BASK -M.RA-P^C^GY!`=Z_``.*``'(`M36Q[]5%PJ?CNM(PG#S.8T]\C=7%:YP]^WO_ -MZM+*P\`.T`BX@!,\RT`%2-]KL#<(+S"*!8F)FECT)2E$%]5*&%_B:.JXYXN_ -M`29@!>`M8#T`J\`068!PX`$E]L!,780#:H -MV@]VP016@_%_5J`$5=<"-8`,JM\#M`3&=[91"8"E(.S@FP06@<*#SN!NQ0.8 -F&IR)O"O_3L@@?*`:%"3N!?T+>K::(]F``BD`````245.1*Y"8((` -` -end diff --git a/embedding/browser/qt/tests/fileopen.png b/embedding/browser/qt/tests/fileopen.png deleted file mode 100755 index 667d2fe2aaf41b359361c8be48f75460fa6a3d57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcwPel00001 literal 1249 zcwPbF1Rnc|P)9{sfk8kL6P830^(KiL6K`G!@u1>=;K_I}#F!Y2 zCpE|cP(;y#28hB8vW(0CL$mbIOLbRuS65fp;=#tW%z#UbFZt#DUcFb}_j~oKQt%(N zp}`%AyUhvz7MfkW?ZH%9eW^F2zhKpkq1=rBZ2snv{dcaD|0#I&*v?m%EL*fojfyLS zFhmpubW7&ag~{iEd4j*SgPxx4(&*Bj*B^a+#qMZQ>bY?}N3~kTs+qK$7RgjMZX?W9 z%ay~$Th6f?H;#Vtw*})*zOw6y@l|gly6G!drYV-@FwGje8e?E^F)LP%F)%bhwVJ15 z7Wn4i*SAie{4#U<{&|mR&DiFheIv_0%;oY^qoWV>_4X$-m#&_na4S!}ZWD>X z8#ivGY?PUvnZ`74plMN-^)Bal{6xN!_b0)YEzf6n4W# z78J(DHn48pIFb}F`ODA9a)iO5VI0S%R4kIq)hNyt3-bj11J6Y68_`b=FMnv&?B(;= z4I4oSvFj#vtHE$~1>@^CAjxofb{b97NhG^5Et69}ouE>!Fwmc2Ak&W?jWy>9q7g?H z#n!6gtsKpkLl_2_6$3SrVAJNU3}=UE*d+pArYqHrX;!$FyGp%QMOCA$e&jJUO{G}O zV_9{1p5W5#5j&b(f1uIh?C^b`npGtT1=g&6n(p2>O{YQ-2vjWtD>sYhx%Bt-ksZ#W zX&M!y$jrSPCrP-`4>J*5bgJwf}zh)U2r6QF|g{D&{lj$dw?m|-} z#IS`Dk%%XvxV}%JRHEfJs9Od?7?RD7FgV;d+}pEVTu_kKg}p-PVcRu~VgbjtXf_=} zuZ8D%w0v+qpF+{VGz_AuL@Jday=W1F7!vpvaV=&RiU)%Q1*gt^o0kINFrtX>x3H`V zp6lU-0fHzY3L!10PCBl!bTms(Z!dw@#3)`z3Y!Q`ftl&XYYU#iAI2c|jznW?5PHjW0VRI`h>nqxsYe- z{DmWD&rIyPa^>vVzXIP=U{tP7M0ELwL^3_@x;|1EF~0cxvzKS4Cl0ii2tcGG2MF5{ zboO`t45#7E*00000 LNkvXXu0mjf^W9;t diff --git a/embedding/browser/qt/tests/fileopen.png.uu b/embedding/browser/qt/tests/fileopen.png.uu deleted file mode 100644 index e8c967e988..0000000000 --- a/embedding/browser/qt/tests/fileopen.png.uu +++ /dev/null @@ -1,31 +0,0 @@ -begin 755 ./debian/resources/sandbox/qt_port/embedding/browser/qt/tests/fileopen.png -MB5!.1PT*&@H````-24A$4@```!@````8"`8```#@=SWX```$J$E$051XG+V5 -MR8\451R`O]JZJGJ='F:F9[-A!A2(BC)&@4%`$A.61!+U)HD:$V]>"/&@XG_@ -MR7@PQ)@8C"O5??]WOUJE+P'[2AP1V)N\T)_Q::7;SMP51:?:DWH[]@U8VAW(S_;/[F -MD?UWKI/_*7CUV,Y7ERQ;M$N-BBN#,$04!71+YM*%R>>!>8*_M8.>GNW2Z-*> -MUQ]]?,7N:%+JN7$]1[5:Q:J9M)P6R50W;B/,5F*9;F,,T:NAIC8'`Q*U:.,3`T0+6:IV(6^.;@U[=.G_PR -M<_O^>8]HS=CFG7TCRS[,Y?)3HZ,/]/7V)S.7KIZA<"M/O6X3B>@\M6D;&S=N -MI&R4F9Z9QC1OH&E1EO4NYWC\1+Z3]R?!EBW/?;3TX74OFN8<3<]YN%*;X^;D -M%';#1A84QL8VL&[=.)(4,/G+S\ARA,&A81S'IE0LDLO5*,X5"_,$_0//1.X; -MT4\.+W]HU>SE\]@-&T$(L>LF=:O!<'8%X^LW(,EP>78:3=-))+LQ+9-3/YV@ -M4JTPT)]A(-./'HTUYPFB$4<6Q=:JXJTX-+L$3N:7'^@T>/L\'V? -MFE4E"`76K'V:[MXX3:="$`A4+0,K-XOGN?3W]9$=SJ)I&A6CR,S,%&I,18]J -M^H)G(+6\=\NEP@X]&D>69<#',(M$=)^J4<%MN>AZE'17&E73T%4-555HNC:. -MZS,R>C_1A,[IXY/)!043%XX?72ZNO4DH#$B2@.^YS.7G\'V'>#Q&=UH4B)V#9D-[OV89&*4BE4J%IE,G -MD^DGE>Y"4R3$L(42D8@GHKB^3Z%4HN4VJ%L&0AB2S8XP.-PWW-NS75Q0D-:% -MO4+H8=LUC&(!Q[9H-AU"KX7G>;1\<#V?0M'`-`RBJD0JE2"]:!&"&!+X%G$M -M9A:*!X,%!:?.?9N7`N$PHHCOM["L"I[KX84!@B@A"B$MITXZKK%T-$M/;R^! -MU\0H7D<*FPA-@9GIQFL+GL$?QB#VCD1C:Q!ZU,PJ2D1&0D"10)$E,GT9TNDN -MPM"CU;11%06_$3L[,?GKOA,G+^XOE[^:NJ=@\MRQHR/+5N=%0>BW3(-KN:LD -MDU&R2T;0]"BR+!"X-BU/H5%3#_WX_=1;^SY^X]2=G+L*`#)=\0\JIK[',LO4 -M+8NAH3XBDH1ME0G=)C4ENO_0P>_>/'1X[_F[@>\IF)J>_331G=YCE`H0^H2^ -M2[F09^K\A2-GSTSLNG+E[-F_`M]38%2N3D1T^8=$,CWNNCY2&#&^^/RSEV>F -M)PZTEPA`I",'"-L1=/9W_@\D(`8HP,I4>O"]>"*EEO*SNQW7/@XDV\#;KZ'? -MSEN`"W@=X2\H$`0A%89A3QNFMROUVO,6X'0`_#;'.RMJ5WPZO(_]_VV]P4B@+$=V^0@````!)14Y$KD)@@@`` -` -end diff --git a/embedding/browser/qt/tests/forward.png b/embedding/browser/qt/tests/forward.png deleted file mode 100755 index 418e5d74b774b813be40e3085c226e3706e67cc1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcwPel00001 literal 1537 zcwPYk2LAbpP)h=c};T7fE%f&@|}D2VnUPdpS}ScH_8 zqVUA}0#bqU5~NbGh)M`0RZ<$qb(?xTj`z56YR|;mc-C*dJn$6?IEWnSNJm%qznpue zbKoB0$jHGLM+XPr8P4TS{l6G_F9MwhGB1Dr$untPmtQPzZavQ-vAhzXV1H z2ftw$mFGWu<}-Zxt6w1$G1)Aw5D0><+e9Mmq%#k)vT~V~<#`qt*H~Iwp`#>S|y_g>_WzrVN=iNwaI^7);A3XBa8Cmp-KeeV48eCpGu_{(2^&EotFO6dq82?PS@ zdXQkK1=lfIy}7`BnIX!1Yiw;70Usw%o}i;6#j{^~fu;HKawHPHe{wpn0Aw;2`|i=> zW5+-Dh0|QP@IwkSOEemixw&Q5){3mH6}fryU1nzs6pNcQjRtM0AOnK~`29M?Vu`uA zCHneuj2+H#JW}lil6f-V^Jk(ywGkGWGRb ze>M^bTa-$B_JG8gA;`ax*_3ka2 zO`8+P$C+PP;P%>9Ur)BnCo}Es&m>!e$#SK{?sk<}tc7NC7a;_$>!N8I3XO8PLbcMs zFf5vefnk`KriEqM)M|Aql{#CSWdZ^CP+yj7R|_b|*CVr;j!z0{^~YKQtgfsPiUdit zq|lJKuE4f!DwR6h+hr=%22I1nbrk@Pbu0^Vcwov#kPd03n7+w z_bgI&jFwav#XD6RhCtIC9IKA5OTwWDj_n|%j%hkk=VA2uWAAho)O& z;_VG=8-&p2Wj5VWM9HVK_m9#u@Bo#)DvgGV?P}N#ShhveP}J)t^;(tk?jE-Dj}Dqf zgJ#p9R;kfw*lg@J(EJCOzrIX$r>caMO-RGxXYao4b+B!!__l~nVdz00|4TO}BO-|>hbpW5=|J363 z$$W0)AwKcMmk>f>+cupCx{y+%QL8fX#zn5a_GdQN7f7}xh=k)HBr@QT=^i59*2(hB zbyf=3L273w^E0ph+bsIX$ib)DJ99rzclV;}8kS`ejfM$^eB77qMfWENBwCp({0+^m z<2ViqL2vF5N)IwKafusmypCzuXC~gs|90PLI@+J>K;x)uTYawUVj5=Cah)Kzr=qd= z6W{#NOGJ}x+$cNEEivSiCc4p9m`UWP3C8>-feW>HT=5l92?51OK&Zz z9i`Oda!Fly^^$t}>{)eed{pJK>8maAXnH@a{(-t32m)ci=hZr}W7d1+eF31yK9$WY1O5`wQs- nHBa#UeE**C+*?5PKZ*Vh1qFvKncpx|00000NkvXXu0mjfMd$V& diff --git a/embedding/browser/qt/tests/forward.png.uu b/embedding/browser/qt/tests/forward.png.uu deleted file mode 100644 index 7af1c51726..0000000000 --- a/embedding/browser/qt/tests/forward.png.uu +++ /dev/null @@ -1,38 +0,0 @@ -begin 755 ./debian/resources/sandbox/qt_port/embedding/browser/qt/tests/forward.png -MB5!.1PT*&@H````-24A$4@```!@````8"`8```#@=SWX```%R$E$051XG)65 -M66R<5Q7'?]^]W^R;QQY[IAEO>&J[=F(7QU%)DXB$!HI:@2J0@@12)2B(]B%/ -M/!1>6(24EJ+PQ/H"4H'R$J12L8A*""554AK'=9MZ/([WN'%JS\3;>-9OO3SP -M%0HXB!SI2$=7][^<>Z5SX![BR,C!%T<'!]\9SN5._;\8>2\"G0._QD?'G[`N7;M%;6Y]:8Z_\*WU=C0L!KHZ?G# -MD9&#OKMAM/T.1P;Z4TII<<>V3EFV9F-= -M\=QW?D(^GY]N222.3!4*YET%QH:&=BT>CI3+:M36@FZ70W;:D6-,U$ -M2`W=9W/ZT6,L+$Q3KS?XV",?)9D._!$8'![]A -M&)7G/WOF,WSYJU\A%#'9+*T0"(*NVT0B[:0S#[*RPH*,CQ;-?>X&E -M^?)R)!*]?W(ZKP!D,A;[[M'C8\<_]X737+CP0PHS2S0:DKFY9=;6BJRM%;EY -M\UUF9PL4BYLTC09MJ2`#@P/X_3K%8HFYN27Z^G*,' -MGFYT76=WMTR]7F?M]CK'3QPCU9'@RFN3W=W9WA/KI=*O9$X]>XM -MFDV;$\?'F5]8X/;:5E]/MLLG,^WMSR1;@\ERI<3N=I58K(5FGEK%MH2I"R&6=_F6V/B[0UL&X30YF4VW5%$R:>S -M]X_2,_``E;TJC8:+[6K8#EBV1=-0U.LF]5J5\NX>MO./#II&@V;3H%:IT6C8 -M;.PVT/P'F+^^3'6GJH24X_*]TIWU5#SZ>#`4R_:/'D43$C20>HAP/(,2$9J& -M!2)$K=:D4JTA=1_A:`3=YZ=>:R!]<=HZ1TCWCK,Z>Y/5P@V$E(]-3N>G=0"? -MW__4XO7)?&[D(3[QQ)<00F';-IT'NI!2HU&K,O'&1:Z^]F(M[6R?+,=58*UT%J9R?S,Z_^VRSZR,C!I]H[BZQJ691*- -MA@F&?-R7[47W)P@D6IDK_`W-K>,X#@I!;^X02@\R,W&)&V^\CFG89R;>R?]V -MWVDZVI_K0..H:UM]KNMB&F;3<9T@N*>BL?@3W_S12T23;=PH3)%*M9$^T,O2 -M_"P77WF)6W.%';73?-?RZ[!P;RJE+;RVJ':74Y'))77CUDGKZ -M[%EU;'Q4Y;+IJRWQ:'H_K/Z!NAT(`F'`Y]4ZL&/:3M@P;>-WO_EIX*VI![GT -MIY?)3US!-.R=O;KY@YUJ]9S'D?1>I088'WPB`0P`RA/J`E*>0!QH2B$>T7$? -M%5*@ZWY3$W*I4JO]3,&;0`BH>,0Z<`>X#?_:R0HP/=*8YU[SLA5(*J5<1V': -MKBJ:MCUI6%;%$]>`#.``.T``L($&8.^W,F-`SNM*>>ZB0,2K\ -#include -#include -#include -#include -#include -#include -#include - -#include "qgeckoembed.h" - -const QString rsrcPath = ":/images/lin"; - -MyMainWindow::MyMainWindow() - : zoomFactor( 1.0f ) -{ - - QFrame *box = new QFrame(this); - qecko = new QGeckoEmbed(box, "qgecko"); - box->setFrameStyle(QFrame::Panel | QFrame::Sunken); - QHBoxLayout *hboxLayout = new QHBoxLayout(box); - hboxLayout->addWidget(qecko); - setCentralWidget( box ); - - QToolBar *toolbar = new QToolBar(this); - toolbar->setWindowTitle("Location:"); - addToolBar(toolbar); - setToolButtonStyle(Qt::ToolButtonTextOnly); - - QAction *action = new QAction(QIcon(rsrcPath + "/back.png"), tr( "Back"), toolbar); - action->setShortcut(Qt::ControlModifier + Qt::Key_B); - connect(action, SIGNAL(triggered()), this, SLOT(goBack())); - toolbar->addAction(action); - - action = new QAction(QIcon(rsrcPath + "/forward.png" ), tr( "Forward"), toolbar); - action->setShortcut(Qt::ControlModifier + Qt::Key_F); - connect(action, SIGNAL(triggered()), this, SLOT(goForward())); - toolbar->addAction(action); - - action = new QAction(QIcon(rsrcPath + "/stop.png" ), tr("Stop"), toolbar); - action->setShortcut(Qt::ControlModifier + Qt::Key_S); - connect(action, SIGNAL(triggered()), this, SLOT(stop())); - toolbar->addAction(action); - - action = new QAction(QIcon(rsrcPath + "/stop.png" ), tr("Z+"), toolbar); - action->setShortcut(Qt::ControlModifier + Qt::Key_Plus); - connect(action, SIGNAL(triggered()), this, SLOT(zoomIn())); - toolbar->addAction(action); - - action = new QAction(QIcon(rsrcPath + "/stop.png" ), tr("Z-"), toolbar); - action->setShortcut(Qt::ControlModifier + Qt::Key_Minus); - connect(action, SIGNAL(triggered()), this, SLOT(zoomOut())); - toolbar->addAction(action); - - - location = new QLineEdit(toolbar); - toolbar->addWidget(location); - -/* - QMenu *menu = new QMenu(tr( "&File" ), this); - menuBar()->addMenu( menu ); - - QAction *a = new QAction( QIcon(rsrcPath + "/fileopen.png" ), tr( "&Open..." ), toolbar); - a->setShortcut( Qt::ControlModifier + Qt::Key_O ); - connect( a, SIGNAL( triggered() ), this, SLOT( fileOpen() ) ); - menu->addAction(a); -*/ - - connect( qecko, SIGNAL(linkMessage(const QString &)), - statusBar(), SLOT(message(const QString &)) ); - connect( qecko, SIGNAL(jsStatusMessage(const QString &)), - statusBar(), SLOT(message(const QString &)) ); - connect( qecko, SIGNAL(windowTitleChanged(const QString &)), - SLOT(setCaption(const QString &)) ); - connect( qecko, SIGNAL(startURIOpen(const QString &, bool &)), - SLOT(startURIOpen(const QString &, bool &)) ); - connect(qecko, SIGNAL(locationChanged(const QString&)), - location, SLOT(setText(const QString&))); - connect(qecko, SIGNAL(progress(int, int)), SLOT(slotProgress(int, int))); - connect(qecko, SIGNAL(progressAll(const QString&, int, int)), SLOT(slotProgress(const QString&, int, int))); - connect(qecko, SIGNAL(newWindow(QGeckoEmbed**, int)), SLOT(slotNewWindow(QGeckoEmbed**, int))); - - connect( location, SIGNAL(returnPressed()), SLOT(changeLocation())); - - connect( qApp, SIGNAL(lastWindowClosed()), SLOT(mainQuit())); -} - -void MyMainWindow::mainQuit() -{ - delete qecko; - qecko = NULL; -} - -void MyMainWindow::fileOpen() -{ - QString fn = QFileDialog::getOpenFileName( this, tr( "HTML-Files (*.htm *.html);;All Files (*)" ), QDir::currentPath()); - if ( !fn.isEmpty() ) - qecko->loadURL( fn ); -} - -void MyMainWindow::startURIOpen(const QString &str, bool &) -{ - //qDebug("XX in the signal"); - statusBar()->showMessage(QString("Opening %1").arg(str), 2000); -} - -void MyMainWindow::changeLocation() -{ - qecko->loadURL( location->text() ); -} - -void MyMainWindow::goBack() -{ - qecko->goBack(); -} - -void MyMainWindow::goForward() -{ - qecko->goForward(); -} - -void MyMainWindow::stop() -{ - qecko->stopLoad(); -} - -void MyMainWindow::zoomIn() -{ - zoomFactor += 0.2f; - qecko->zoom( zoomFactor ); -} - -void MyMainWindow::zoomOut() -{ - zoomFactor -= 0.2f; - qecko->zoom( zoomFactor ); -} - -void MyMainWindow::slotProgress(const QString &url, int current, int max) -{ - //qDebug("progress %d / %d (%s)", current, max, url.toUtf8().data()); - statusBar()->showMessage(QString("Loading %1/%2").arg(current).arg(max), 2000); -} - -void MyMainWindow::slotProgress(int current, int max) -{ - //qDebug("progress %d / %d ", current, max); - statusBar()->showMessage(QString("Loading %1/%2").arg(current).arg(max), 2000); -} - -void MyMainWindow::slotNewWindow(QGeckoEmbed **newWindow, int chromeMask) -{ - MyMainWindow *mainWindow = new MyMainWindow(); - if(!mainWindow) return; - mainWindow->resize(400, 600); - mainWindow->show(); - - *newWindow = mainWindow->qecko; -} diff --git a/embedding/browser/qt/tests/mainwindow.h b/embedding/browser/qt/tests/mainwindow.h deleted file mode 100644 index 555ebc69ef..0000000000 --- a/embedding/browser/qt/tests/mainwindow.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -class QGeckoEmbed; -class QLineEdit; - -class MyMainWindow : public QMainWindow -{ - Q_OBJECT -public: - MyMainWindow(); - -public slots: - void fileOpen(); - void startURIOpen(const QString &, bool &); - void changeLocation(); - void goBack(); - void goForward(); - void stop(); - void mainQuit(); - void zoomIn(); - void zoomOut(); - -public: - QGeckoEmbed *qecko; - -private slots: - void slotProgress(int, int); - void slotProgress(const QString &, int, int); - void slotNewWindow(QGeckoEmbed**, int); - -private: - QLineEdit *location; - float zoomFactor; -}; - -#endif diff --git a/embedding/browser/qt/tests/reload.png b/embedding/browser/qt/tests/reload.png deleted file mode 100755 index a1243d01743ec7ed63fd65d7b45c56f14356b9ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcwPel00001 literal 1450 zcwPaj1y%ZqP)}X7d_f?A z;1fuosS;2G65`7yR8dw0>ZXlV&@tL{C2Lobj5JA;%rEh4{C0ic?8}F_rA^vxM>@K? z&vTyt?|+VTpDXY_F?R6ajINrW)$00$(;-Dg(J7jik&@lg8?wjwr}@Rjv+s3YxYx$S z@S(@`YU4K^k3Tvz*2n17Fu|ywikYOG5?Od-g_SEClxl^n;**a5dtu?s2L_A{4WDpY z$~Ol;x|a`q!NGm;5=VlEi7-Z%tE`&W_|Iw*edT^~FGe{3*YlW;>dC9i%U|26<=D9} zJ~aF*kL3UQ;OBkBo_d>be}*oP8^cstF3(}>dnuKwsEr&2<#j@F2Ol2%B&(M)alc>g z+bZPG+!GK#H1ed=^86(B83(?ZH|g=aXmfZ-mx~Cc2RJBy1H~F4V2`3!yewtkBv)TV z@7Z9i?=i0bD>)kO_TNZlvsdmqqWJzJ`M{{V(|c^5Jt2v(-;G)c@o417Ob>i+*C^+c z=Qwfc8FXo#rV&E>!#JCl(q(6x9h$rPmU%}9lOu<}gdiN#r>_u+h8g!C=SHr;?2+df zjZL?zOf)NlZkKS05cM6v&j7EjoT6@5NvJ6tE1j|+2#G{y>oS1zmL1FSgb~_?kcGe5 z#}~(E(aoAD5mbr7lvfX*?Kyn&S_Cm&@z_z_2W6f+MQZ2-XmD?VkdE zeFs2nh?9-ZDv}Gdx`nQn>1bE5De>F6UvOsqhYUml>`_E&K9vjk6I?s}3PpPXT%cD$ zZUZ%FBWy8oOZQd>qTSten=~xYswSGIQ`I%jUi%x*UHt*Q0U62cpi%{`4h{jf#Ra_0 z81C|ZY8vPkNL~d*JA702|05Cv3&SbdHWbR+7&RxNTVbDXkp1o{(#4AeT{?AJrCAB` zSnn)do*1$A{mfmvz)vsC64={8q-~gVW5L=Dpt(ZHd!Uxfk(O5Z(Oxqu)QmGn3yV>>TFu`gxMI8tHO{>r4OT{@@YRdKpoaNLOsehh|8gdy7&rcP3pZ z{P_+*Pb6FvRr|})eIpREG0Ysf6ij%gndpzx?&xCJ_b_HbAYepzc<2cf*^4bI2x1V) z-%UXC^3T&R;B?F1NoF!@cK{NZ%w{wc_?V(8_Z@s-hPqfoH?zzyUBqK_;rDi8<6tQK z5e`HiqP?w)25uHN5{ODWhx!k5_LnC~rZz5Id3*W$yG8`i8;kzEn#<32*g+&ucHAWhIe*q|t2V?g~h3WwtfL zxNH=%$6RG6Ge@6dU@(s4S4gNSvgHbTQ>5XLkUD&f$EO$x4RPw{KjWnrPVr8@_;g*@ zU%g%PuGe*&EPuK;9DaUZU%x!{iN`tg&=ei9Zk&>Y?2zy{J(RaHTzutaUOe?YH`dlj z6}P{wYWlM~weALR05Wj2tE2r}0grbk6burH?Ij$IB8ae+Oz_V78o7L)lB%ud%axPB zX`ldX1NM6XTtFuf0eXRP#U*`QmZSmUU9i-!?V4elo0@4Y0q1~upa^7v+WU3j1l&Lf z=mG|TK,X=AR[<;HT398V#6U>3#*F(36,;&(30C`8T$U($Q0) -M`0I(?$$@@>`32*"I$E`$$N++)E115@3JIHU5T#':="5K5Y*,-$F3S"_Q:_QV -M?=_LRX>YI4W:;4) -M,$:6JZR:U_C/:A)]Y7YR+T8X_]?SF([JR:O+RU_;J>78N3`^-/PKC^3_^N#G -M?<2>>IMP?X8NCQO#5%DNSV'K>RF5JJB-'`7E=4)Q!Q\>_"2KES)QOU_NVRKD -MS]P3$#\T\J33\OPD]AD'OIDWZ?&[:'-X2)>+"*4'."A_`\4:(6"/HE:\+&7? -M)%=?1._98*SO,:[_*SD:[O;?2&6S5^XZHOC^(_G`J+O3>VR>/2&)L-^-6@GQ -M:.3'3`]\;M4<'DR.'OX0@ -M'-.GKQ")AAGW'^=&KL#LD><8C4VWJDPT*X-NEW")$/4=P,\`KZVP%B6V&?;Y#][BG2Q8L$ -M73IU6Z59"?)8[RQ=GABQ]OW,7;O`3R_,$MC;0:1MF'1CP=H-H+E"R7N@ELN1 -MEE;YT5^^PG#/.(5RGHWB!G2`RY=%ECS4#1N[XB;:U4,FOXE;E&B41/:XI_$U -MV]EL:FN[OH,]W>$1R?;$[6XW#;E$0M]D69VCWS_",Y/?(^P9*U&NER -MA>M+_^7^X!'4>AE1E$A7;,:'9DB>>XM2,7*:9Z(_3[NABV/.@)%-F++2H(8A#)WTU`\_+/TR_@ -M=,O?268R:W<`$IG,9C04^)BB*?<=?&"&NEA#-[/,+UW$8W3A]W9BXV`H_!$. -M1!ZBO:V+!FX6-Q*(2CN'^@]S]I_G[NT8$T!N+_KV:R\]VV$$F -MCSZ)X/1B*S;74S>P#2\^;P1;=&(TH:H9+&UMX@@J3(Y,\>KO?L]K+Y]E)9%^ -MI-%LYNX*2&QEMC7#N&P4LL=<92;+E9/`::``;`/V>P%<0"<0 -M`7J!<<4E?5R6I`'A7;#4L.V:89J;FFDM`>>`>:`(9(':^W7@!-Q`".@"!H%` -MZUT!S%86@12PTG*=`ZJWN[\IMC,:@-8Z8``6X`,DWKV[C%:J0*556VZ)[XI[ -M_O1;(0(>H*UE1F@YM(#F;6;J.YU_4,#.6K'UO`EJMO*>\3].S3_`-#PH-@`` -*``!)14Y$KD)@@@`` -` -end diff --git a/embedding/browser/qt/tests/stop.png b/embedding/browser/qt/tests/stop.png deleted file mode 100755 index b3f5c9a8029157e033d4f268f990c686859deea9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcwPel00001 literal 1498 zcwPb81tt24P)wMF|uIRSBw~R6HOg+6rFa5&i)lkow9C z>PwM81dyPr1d*ULDO5y(UP+ud&ds;jx%w8{>$5&*&z{Q+4|XgP(!lp+G$YOTGxMF9 z-w2+d0|R?I!Z>~+awps$ZF_jl7@acJ%CBbdC*WS}@dcb~HpGc3-}O%{as?!_zDKKQ=?2L|^&+feH7 z1Dze-i!!5kbpgxCkqAYaZ^G3Lta^xwL&EOQ@@}DxKV2Uuu2x?gyL|P>kNR2v*%=<% z_l3lDKRV(%_6t+jSv@z#4d1XBrqI;F&hPzzyLaw0e)B$4bL*^JzRXZ{iS9l9Od*~t z7xI;b#idh^1soh2C?(1n8On@1IC74;YCu%!ph-cC3E0_Hq)SKF&zmI`G!36vKdWlTAyd zgp?YCVs){~a*)sfbh({IqrrN(#?8S&rX3ZkBx(EC=vcV5gM&i@+qJY#bT6&ays}In z1WB-lOcGKcjy1trouC@ATn$-GG!YO2I<8|`iX@Fm!aB7|#ZEENz4?W+01CheUde07 zReh=mVw2Iiy%V=oB8?)}jUhA|X+R4JLZHzI+a=fD!P2Es>VQ@A@oE84$$J%eZ400c z$2=^A?GkuJzWS}>9RB8UbS_V76vk+blprJ~O96wH7AjZ7l7^XcBfR;OpF-6quMKOk z%XaMUBu;KA03pO)*YVJ99!qMz`0W?zJg}ceBSDx13ys7eZ5Lx8OJlT=Xe=zpqHB8_ zAD#XOSKd8~B^{Jh*p_uDVG|$)&C1OY0HvIVx3dRTX+bu81QKa!q{u*+jay-C;?yS1 z6e{Q97)f(W3w14U90!3w*{V!^GomDk>z3!arcl6S3Bt>xR2QgbU?Y-8WxEn^Q8<8) zmnPsks6sQC8d;{Ztuyfb+BCiHu-)2D{oWnke*L$6<3|>D!NV3YBGY7A0}?G1!lVcZ z86I`vaO>1NOq{z$Zrcu=_EyY7l_+YgZ2@ZQ!9U|P8m?^Hj$iZn@XQDw|M@+fVi5&6 zMu5pSSDr&y3Xy5*Iwgu@>PgDFo2T@dRuV6V@B3s~HoFC=uGLO1&fWfD|IuN>JGT+7 z?O?j_{VGCONF}kP1!;<9JJ?E*#R=Y19MijfiqbJDq*I$U8PmH>UAR zd1gl5V_~`aHz0VZR465n?d|J5{rpQWQ+A51-Mz)0Lq~|?1jn&)y*yHa)=;kp)cqRe z_I4}@OH-4?1&`Bz`8^jdT%29;Yu^X{`cSdc+DwP_uo$e|J>0WzKRvsiW^Up--A_Hm z{^t&}duShhPw!?&Zx4m$GG3{PBv?lpO@3PkZ~yVvj9nT{7gyKb0Nw%ohjy^3axtI# zS?`Xnm%nuE>l`|A94k(+ge2!G^35%zNlFwaD9a{a@)#c<<*gHMaD8GtTv+jc0sIOW zd0=Qg0*K-yy>h?md-rZk9GJRx0qIJb$|VZTMNk%vG$xFECZ@(X`Q|S<`McjRF?(~O zS_@wX{s4>t*#pDJeVGF22fpSg^-`1P^f#AEl}e?8ZQE#_Qd_HWe`Q67QL?z+XnYKu z0?q*U9z^pb0Dukj0G|U60egUEpat-Nbzl;h1ukwzG7m(LTkWUG2HJrRpmVeJ*r*-h zrr9)b8Av|O)wEzGB07*qoM6N<$f|BsV AO#lD@ diff --git a/embedding/browser/qt/tests/stop.png.uu b/embedding/browser/qt/tests/stop.png.uu deleted file mode 100644 index 4829d809f6..0000000000 --- a/embedding/browser/qt/tests/stop.png.uu +++ /dev/null @@ -1,37 +0,0 @@ -begin 755 ./debian/resources/sandbox/qt_port/embedding/browser/qt/tests/stop.png -MB5!.1PT*&@H````-24A$4@```!@````8"`8```#@=SWX```%H4E$051XG(V5 -MVV]<1QW'/S-GSCE[=M=K[^)K+I:QF\0TL9W&)$4)%`55":J@5#P@)-H*7N`1 -M_@$>D/K*"^I+D4`$D*"J!)&@-"E41(%>29PXSLVWV+GZ%MOKLSYGSY[+#`]V -M+!+2P/=E-"/-]S/SG9G?")Z@`P-[.\(X?B5*]5$W7]BMI&S14D9Q&-PFRSXI -M.O9;HU>OO?\D#_&XP<\/[,T'QOS>_P=*E4>J`5?/Q:@%1R7L5>&T+H`W'/"R$[1)X1;[ZK>,< -M_N9Q="Y/:A3&:(R4("0F2P&#EA8J5\22AIES([SYDY]"U2>O#6NPRW;L[B1. -M;BD`(<1>U_'0;AY+:K[X[1?I/+"?1B-!F`0+C<0@;1=C($MCM)%H+"S'HFM[ -M&Q^=_@=7WCV+)1V45-B6=2AA$R`%SWLP=5:4$V?`02:6FDR$"8 -MC5MA;.+4)LT4*N?B&$ES2PMU+7`YIE#`9`G"RZ-4 -M%ZAF8".21V6[$G!1.("/ER;@.JA",Y@:6::SK3/P_=HTO>ZPW=I._=X=WG[] -MMWSC1Q9VP<,6,2+39%H#$BT4PJ0("1D>=>%PZ]0[3)R[1F[;#ISV5LQ"E2AJ -MK&T!:NO!/^,T&JYLVXY?\_GPS`@?__D]G&(1!3A&@,DV5YY#6`J1:>HZ)8IC -MZDG*NING])E6$B^'[_MD63:[!:BNU4XNSMW^8?_18<([MQ&M[6"Z\/TJ0EA( -M);&D!6F*93O82I'%">N!3R0UY9X>6K,&=EL7,[6[+"^OC`'7MP!)EIU9F)L_ -M/S]_8[COZ//,?O(!@U]Y@=K\/=*HCD'@6!(M!"9):=0#ZHV(F\4MY9D;>8V&Y^C<@>*A4*"6/[>WK/?W\2R]3=HJLW;W%GD-'B.,$Q[%Q -MO3Q2@M90KP?4_1KE]G8L"4M3D\0%C]-_^3T7+ER<7?%KWP?^^E"QT]I,A_6P -M&*S8R7JF))%A'&DU^ -M6P=O__'7C%T:31=7U]X`W@'\AW:PJ7(QG_M9[XZNE[]T[.L<.G(<*TZPA"3G -M*O+-+:1)2A0G*,LF7_(8'Q_EK1-O<'UB/%Q8\7\!_`H8>6!H/0*(XB2]_=N3!R8NG8!Z4J:RB4*S450%HTT)HQ\)J;&./GF+SGYN]\P,7MSHEH+7P?^ -M`(P!V0/#QWV9`N@'ON8H]5*3Y_0WETJ52J6";=MHG5);JW%_946'4;*XWFA\ -M#)P"S@#W'D3S)`"`#?0`GP,.`7N`9J`%\(!U8!*8!2YN1C(/1(];[:?)!MJ! -M#J!SL_78J!WAIMDT