Removed old GLITZ stuff
This commit is contained in:
Oleg Romashin 2008-08-15 09:31:55 +03:00
Родитель f9a45e8af1
Коммит 523919644e
54 изменённых файлов: 0 добавлений и 7240 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -1,3 +0,0 @@
[qeckoembed]
dist/bin/@DLLP@qeckoembed@DLLS@
dist/bin/TestQeckoEmbed

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zack Rusin <zack@kde.org>
*
* 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 <strings.h>
//#include <nsXPIDLString.h>
#include <nsStringGlue.h>
#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<nsIWebNavigationInfo> 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;
}

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Lars Knoll <knoll@kde.org>
* Zack Rusin <zack@kde.org>
*
* 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 <nsIURIContentListener.h>
#include <nsWeakReference.h>
class QGeckoEmbed;
class EmbedContentListener : public nsIURIContentListener,
public nsSupportsWeakReference
{
public:
EmbedContentListener(QGeckoEmbed *aOwner);
~EmbedContentListener();
NS_DECL_ISUPPORTS
NS_DECL_NSIURICONTENTLISTENER
private:
QGeckoEmbed *mOwner;
};
#endif

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zack Rusin <zack@kde.org>
*
* 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 <nsCOMPtr.h>
#include <nsIDOMMouseEvent.h>
#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 <nsIDOMKeyEvent> 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 <nsIDOMKeyEvent> 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 <nsIDOMKeyEvent> 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 <nsIDOMMouseEvent> 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 <nsIDOMMouseEvent> 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 <nsIDOMMouseEvent> 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 <nsIDOMMouseEvent> 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 <nsIDOMMouseEvent> 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 <nsIDOMMouseEvent> 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 <nsIDOMUIEvent> 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 <nsIDOMUIEvent> 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 <nsIDOMUIEvent> 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);
}

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Lars Knoll <knoll@kde.org>
* Zack Rusin <zack@kde.org>
*
* 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 <nsIDOMKeyListener.h>
#include <nsIDOMMouseListener.h>
#include <nsIDOMUIListener.h>
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

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zack Rusin <zack@kde.org>
*
* 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 <qstring.h>
/* 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;
}

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Lars Knoll <knoll@kde.org>
* Zack Rusin <zack@kde.org>
*
* 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

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zack Rusin <zack@kde.org>
*
* 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

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Lars Knoll <knoll@kde.org>
* Zack Rusin <zack@kde.org>
*
* 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 <nsXPIDLString.h>
#include <nsIChannel.h>
#include <nsIWebProgress.h>
#include <nsIDOMWindow.h>
#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<nsIDOMWindow> domWindow;
nsCOMPtr<nsIDOMWindow> 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<nsIChannel> channel;
channel = do_QueryInterface(aRequest);
if (!channel)
return;
nsCOMPtr<nsIURI> uri;
channel->GetURI(getter_AddRefs(uri));
if (!uri)
return;
nsCAutoString uriString;
uri->GetSpec(uriString);
CopyUTF8toUTF16(uriString, aString);
}

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Lars Knoll <knoll@kde.org>
* Zack Rusin <zack@kde.org>
*
* 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 <nsIWebProgressListener.h>
#include <nsWeakReference.h>
#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

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Lars Knoll <knoll@kde.org>
* Zack Rusin <zack@kde.org>
*
* 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 <nsIPipe.h>
#include <nsIInputStream.h>
#include <nsIOutputStream.h>
#include <nsIContentViewerContainer.h>
#include <nsIDocumentLoaderFactory.h>
#include <nsNetUtil.h>
#include <prmem.h>
#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<nsIInputStream> bufInStream;
nsCOMPtr<nsIOutputStream> 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<nsIWebBrowser> browser;
mOwner->window()->GetWebBrowser(getter_AddRefs(browser));
// get the viewer container
nsCOMPtr<nsIContentViewerContainer> viewerContainer;
viewerContainer = do_GetInterface(browser);
// create a new uri object
nsCOMPtr<nsIURI> 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<nsICategoryManager> 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<nsIDocumentLoaderFactory> 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<nsIContentViewer> 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<nsIRequest> 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<nsIRequest> request = do_QueryInterface(mChannel);
rv = mStreamListener->OnDataAvailable(request,
NULL,
static_cast<nsIInputStream *>(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<nsIRequest> 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);
}

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Lars Knoll <knoll@kde.org>
* Zack Rusin <zack@kde.org>
*
* 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 <nsISupports.h>
#include <nsCOMPtr.h>
#include <nsIOutputStream.h>
#include <nsIInputStream.h>
#include <nsILoadGroup.h>
#include <nsIChannel.h>
#include <nsIStreamListener.h>
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<nsIOutputStream> mOutputStream;
nsCOMPtr<nsIInputStream> mInputStream;
nsCOMPtr<nsILoadGroup> mLoadGroup;
nsCOMPtr<nsIChannel> mChannel;
nsCOMPtr<nsIStreamListener> mStreamListener;
PRUint32 mOffset;
PRBool mDoingStream;
QGeckoEmbed *mOwner;
};

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Lars Knoll <knoll@kde.org>
* Zack Rusin <zack@kde.org>
*
* 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 <nsCWebBrowser.h>
#include <nsIComponentManager.h>
#include <nsComponentManagerUtils.h>
#include <nsIDocShellTreeItem.h>
#include "nsIWidget.h"
#include "nsIWebNavigation.h"
//#include "nsReadableUtils.h"
#include "nsStringGlue.h"
#include "nsIDOMNode.h"
#include "nsIDOMElement.h"
#include "nsIDOMEvent.h"
#include <qapplication.h>
#include <qeventloop.h>
#include <qwidget.h>
#include <qtooltip.h>
#include <qcursor.h>
#include <qlabel.h>
#include <qdesktopwidget.h>
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<nsIWebBrowserChrome *>(this));
nsCOMPtr<nsIDocShellTreeItem> 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<void *>(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<nsIWidget> mainWidget;
mBaseWindow->GetMainWidget(getter_AddRefs(mainWidget));
QWidget *window;
window = static_cast<QWidget*>(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<nsIDOMElement *>(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<nsIInterfaceRequestor> ir = do_QueryInterface(mWebBrowser);
return ir->GetInterface(aIID, aInstancePtr);
}
return rv;
}

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Lars Knoll <knoll@kde.org>
* Zack Rusin <zack@kde.org>
*
* 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 <nsStringGlue.h>
#include <nsIWebBrowserChrome.h>
#include <nsIWebBrowserChromeFocus.h>
#include <nsIEmbeddingSiteWindow.h>
#include <nsITooltipListener.h>
#include <nsIContextMenuListener.h>
#include <nsISupports.h>
#include <nsIWebBrowser.h>
#include <nsIBaseWindow.h>
#include <nsIInterfaceRequestor.h>
#include <nsCOMPtr.h>
#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<nsIBaseWindow> mBaseWindow; // [OWNER]
private:
QGeckoEmbed *mOwner;
nsCOMPtr<nsIWebBrowser> mWebBrowser; // [OWNER]
PRBool mVisibility;
PRBool mIsModal;
MozTipLabel *tooltip;
};
#endif

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Lars Knoll <knoll@kde.org>
* Zack Rusin <zack@kde.org>
*
* 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<nsIWebBrowserChrome *>
(newEmbed->window());
if (*_retval) {
NS_ADDREF(*_retval);
return NS_OK;
}
return NS_ERROR_FAILURE;
}

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Lars Knoll <knoll@kde.org>
* Zack Rusin <zack@kde.org>
*
* 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 <nsIWindowCreator.h>
class EmbedWindowCreator : public nsIWindowCreator
{
public:
EmbedWindowCreator();
~EmbedWindowCreator();
NS_DECL_ISUPPORTS
NS_DECL_NSIWINDOWCREATOR
};
#endif

Просмотреть файл

@ -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)

Просмотреть файл

@ -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 <ceresna@amos.sturak.sk>
*
* 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 <nsStringGlue.h>
#include <nsIWindowWatcher.h>
#include <nsIWebBrowserChrome.h>
#include <nsIEmbeddingSiteWindow.h>
#include <nsCOMPtr.h>
#include <nsIServiceManager.h>
#include <qmessagebox.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qapplication.h>
#include <qstyle.h>
#include <qpixmap.h>
#include <qpushbutton.h>
#include <qlineedit.h>
#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<QDialog*>(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<QDialog*>(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<QDialog*>(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<QDialog*>(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<QDialog*>(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<nsIWindowWatcher> wwatch = do_GetService("@mozilla.org/embedcomp/window-watcher;1");
nsCOMPtr<nsIWebBrowserChrome> chrome;
wwatch->GetChromeForWindow(aDOMWindow, getter_AddRefs(chrome));
nsCOMPtr<nsIEmbeddingSiteWindow> 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;
}
}

Просмотреть файл

@ -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 <ceresna@amos.sturak.sk>
*
* 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 <nsIPromptService.h>
#include <nsStringGlue.h>
#include <qwidget.h>
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 */

Просмотреть файл

@ -1,217 +0,0 @@
<ui version="4.0" >
<class>AlertDialog</class>
<widget class="QDialog" name="AlertDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>187</width>
<height>122</height>
</rect>
</property>
<property name="windowTitle" >
<string>Alert</string>
</property>
<property name="sizeGripEnabled" >
<bool>false</bool>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QGridLayout" >
<item row="1" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="message" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>alert text</string>
</property>
<property name="alignment" >
<set>Qt::AlignVCenter</set>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" >
<widget class="QCheckBox" name="check" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>confirm</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="icon" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="scaledContents" >
<bool>false</bool>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="ok" >
<property name="text" >
<string>&amp;OK</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<tabstops>
<tabstop>ok</tabstop>
<tabstop>check</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>ok</sender>
<signal>clicked()</signal>
<receiver>AlertDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>

Просмотреть файл

@ -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)

Просмотреть файл

@ -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

Просмотреть файл

@ -1,271 +0,0 @@
<ui version="4.0" >
<class>ConfirmDialog</class>
<widget class="QDialog" name="ConfirmDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>296</width>
<height>152</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle" >
<string>Confirm</string>
</property>
<property name="sizeGripEnabled" >
<bool>false</bool>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QGridLayout" >
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" >
<widget class="QCheckBox" name="check" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>confirm</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="message" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>confirm text</string>
</property>
<property name="alignment" >
<set>Qt::AlignVCenter</set>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="icon" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="scaledContents" >
<bool>false</bool>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="but1" >
<property name="text" >
<string>1</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="but2" >
<property name="text" >
<string>2</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="but3" >
<property name="text" >
<string>3</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<resources/>
<connections>
<connection>
<sender>but1</sender>
<signal>clicked()</signal>
<receiver>ConfirmDialog</receiver>
<slot>done1()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>but2</sender>
<signal>clicked()</signal>
<receiver>ConfirmDialog</receiver>
<slot>done2()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>but3</sender>
<signal>clicked()</signal>
<receiver>ConfirmDialog</receiver>
<slot>done3()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>

Просмотреть файл

@ -1,291 +0,0 @@
<ui version="4.0" >
<class>PromptDialog</class>
<widget class="QDialog" name="PromptDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>222</width>
<height>177</height>
</rect>
</property>
<property name="windowTitle" >
<string>Prompt</string>
</property>
<property name="sizeGripEnabled" >
<bool>false</bool>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QGridLayout" >
<item row="0" column="1" >
<widget class="QLabel" name="message" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>prompt text</string>
</property>
<property name="alignment" >
<set>Qt::AlignVCenter</set>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="icon" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="scaledContents" >
<bool>false</bool>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QCheckBox" name="check" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>confirm</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<layout class="QHBoxLayout" >
<item>
<widget class="QLineEdit" name="input" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>10</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="3" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="ok" >
<property name="text" >
<string>&amp;OK</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancel" >
<property name="text" >
<string>&amp;Cancel</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<tabstops>
<tabstop>input</tabstop>
<tabstop>check</tabstop>
<tabstop>ok</tabstop>
<tabstop>cancel</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>ok</sender>
<signal>clicked()</signal>
<receiver>PromptDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>cancel</sender>
<signal>clicked()</signal>
<receiver>PromptDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Lars Knoll <knoll@kde.org>
* Zack Rusin <zack@kde.org>
*
* 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 <nsIDocShell.h>
#include <nsIWebProgress.h>
#include <nsIWebNavigation.h>
#include <nsIWebBrowser.h>
#include <nsISHistory.h>
#include <nsIWebBrowserChrome.h>
#include "nsIWidget.h"
#include "nsCRT.h"
#include <nsIWindowWatcher.h>
#include <nsILocalFile.h>
#include <nsEmbedAPI.h>
#include <nsXULAppAPI.h>
#include <nsWidgetsCID.h>
#include <nsIDOMUIEvent.h>
#include <nsIInterfaceRequestor.h>
#include <nsIComponentManager.h>
#include <nsIFocusController.h>
#include <nsProfileDirServiceProvider.h>
#include "nsIDirectoryService.h"
#include "nsAppDirectoryServiceDefs.h"
#include <nsIGenericFactory.h>
#include <nsIComponentRegistrar.h>
#include <nsVoidArray.h>
#include <nsIDOMDocument.h>
#include <nsIDOMBarProp.h>
#include <nsIDOMWindow.h>
#include "nsPIDOMEventTarget.h"
#include <nsCOMPtr.h>
#include <nsPIDOMWindow.h>
#include <nsIMarkupDocumentViewer.h>
#include <nsIContentViewer.h>
#include "prenv.h"
#include <qlayout.h>
#include <qevent.h>
#include <nsIURI.h>
class QGeckoEmbedPrivate
{
public:
QGeckoEmbedPrivate(QGeckoEmbed *qq);
~QGeckoEmbedPrivate();
QGeckoEmbed *q;
QWidget *mMainWidget;
// all of the objects that we own
EmbedWindow *window;
nsCOMPtr<nsISupports> windowGuard;
EmbedProgress *progress;
nsCOMPtr<nsISupports> progressGuard;
EmbedContentListener *contentListener;
nsCOMPtr<nsISupports> contentListenerGuard;
EmbedEventListener *eventListener;
nsCOMPtr<nsISupports> eventListenerGuard;
EmbedStream *stream;
nsCOMPtr<nsISupports> streamGuard;
nsCOMPtr<nsIWebNavigation> navigation;
nsCOMPtr<nsISHistory> sessionHistory;
// our event receiver
nsCOMPtr<nsPIDOMEventTarget> 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<nsIWebBrowserChrome *>(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<nsIWebProgressListener *>
(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<nsISupports*>
(static_cast<nsIURIContentListener*>(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<nsISupports *>(static_cast<nsIDOMKeyListener *>
(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<nsIWindowCreator> windowCreator = new EmbedWindowCreator();
// Attach it via the watcher service
nsCOMPtr<nsIWindowWatcher> watcher = do_GetService(NS_WINDOWWATCHER_CONTRACTID);
if (watcher)
watcher->SetWindowCreator(windowCreator);
initialized = PR_TRUE;
}
// Get the nsIWebBrowser object for our embedded window.
nsCOMPtr<nsIWebBrowser> 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<nsISupportsWeakReference> supportsWeak;
supportsWeak = do_QueryInterface(progressGuard);
nsCOMPtr<nsIWeakReference> 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<nsIWidget> qtWidget;
window->mBaseWindow->GetMainWidget(getter_AddRefs(qtWidget));
// get the native drawing area
mMainWidget = static_cast<QWidget*>(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<nsIWebBrowser> webBrowser;
window->GetWebBrowser(getter_AddRefs(webBrowser));
nsCOMPtr<nsIDOMWindow> domWindow;
webBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
if (domWindow) {
nsCOMPtr<nsIDOMBarProp> 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<nsIWebNavigation> 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<nsIDOMWindow> window;
nsCOMPtr<nsIWebBrowser> 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<nsIWebBrowser> webBrowser;
d->window->GetWebBrowser(getter_AddRefs(webBrowser));
// get the content DOM window for that web browser
nsCOMPtr<nsIDOMWindow> 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<nsPIDOMWindow> 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<nsIDOMEventListener *>
(static_cast<nsIDOMKeyListener *>(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<nsIWebBrowser> webBrowser;
d->window->GetWebBrowser(getter_AddRefs(webBrowser));
// get the content DOM window for that web browser
nsCOMPtr<nsIDOMWindow> domWindow;
webBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
if (!domWindow)
return NS_ERROR_FAILURE;
// get the private DOM window
nsCOMPtr<nsPIDOMWindow> 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<nsIURI> 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<nsIURI> 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<nsPIDOMWindow> 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<nsIContentViewer> contentViewer;
rv = docShell->GetContentViewer(getter_AddRefs(contentViewer));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIMarkupDocumentViewer> 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<nsIWebBrowser> webBrowser = NULL;
d->window->GetWebBrowser(getter_AddRefs(webBrowser));
if( !webBrowser ){
return FALSE;
}
// get the content DOM window for that web browser
nsCOMPtr<nsIDOMWindow> domWindow = NULL;
webBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
if (!domWindow){
return FALSE;
}
nsCOMPtr<nsIMarkupDocumentViewer> 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);
}

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Lars Knoll <knoll@kde.org>
* Zack Rusin <zack@kde.org>
*
* 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 <qwidget.h>
#include <qstring.h>
#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

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Lars Knoll <knoll@kde.org>
* Zack Rusin <zack@kde.org>
*
* 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 <nsIDocShell.h>
#include <nsIWebProgress.h>
#include <nsIWebNavigation.h>
#include <nsIWebBrowser.h>
#include <nsISHistory.h>
#include <nsIWebBrowserChrome.h>
#include "nsIWidget.h"
#include "nsCRT.h"
#include <nsIWindowWatcher.h>
#include <nsILocalFile.h>
#include <nsEmbedAPI.h>
#include <nsXULAppAPI.h>
#include <nsWidgetsCID.h>
#include <nsIDOMUIEvent.h>
#include <nsIInterfaceRequestor.h>
#include <nsIComponentManager.h>
#include <nsIFocusController.h>
#include <nsProfileDirServiceProvider.h>
#include "nsIDirectoryService.h"
#include "nsAppDirectoryServiceDefs.h"
#include <nsIGenericFactory.h>
#include <nsIComponentRegistrar.h>
#include <nsVoidArray.h>
#include <nsIDOMBarProp.h>
#include <nsIDOMWindow.h>
#include <nsIDOMEvent.h>
#include <nsPIDOMEventTarget.h>
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<nsIDirectoryServiceProvider2>
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<nsILocalFile> 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<nsILocalFile> 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<QTEmbedDirectoryProvider*>
(&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<nsIComponentRegistrar> cr;
nsresult rv = NS_GetComponentRegistrar(getter_AddRefs(cr));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIComponentManager> cm;
rv = NS_GetComponentManager (getter_AddRefs (cm));
NS_ENSURE_SUCCESS (rv, rv);
for (int i = 0; i < sNumAppComps; ++i) {
nsCOMPtr<nsIGenericFactory> 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<QGeckoEmbed *>
(sWindowList->ElementAt(i));
// get the browser object for that window
nsIWebBrowserChrome *chrome = static_cast<nsIWebBrowserChrome *>
(tmpPrivate->window());
if (chrome == aBrowser)
return tmpPrivate;
}
return nsnull;
}

Просмотреть файл

@ -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 <zack@kde.org>.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zack Rusin <zack@kde.org>
*
* 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

Просмотреть файл

@ -1,229 +0,0 @@
<ui version="4.0" >
<class>SelectDialog</class>
<widget class="QDialog" name="SelectDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>222</width>
<height>141</height>
</rect>
</property>
<property name="windowTitle" >
<string>Select</string>
</property>
<property name="sizeGripEnabled" >
<bool>false</bool>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QGridLayout" >
<item row="0" column="1" >
<widget class="QLabel" name="message" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>select text</string>
</property>
<property name="alignment" >
<set>Qt::AlignVCenter</set>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="icon" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="scaledContents" >
<bool>false</bool>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1" >
<layout class="QHBoxLayout" >
<item>
<widget class="QComboBox" name="select" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>10</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="ok" >
<property name="text" >
<string>&amp;OK</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancel" >
<property name="text" >
<string>&amp;Cancel</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<tabstops>
<tabstop>select</tabstop>
<tabstop>ok</tabstop>
<tabstop>cancel</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>ok</sender>
<signal>clicked()</signal>
<receiver>SelectDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>cancel</sender>
<signal>clicked()</signal>
<receiver>SelectDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>

Просмотреть файл

@ -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 <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QCheckBox>
#include <QtGui/QDialog>
#include <QtGui/QGridLayout>
#include <QtGui/QHBoxLayout>
#include <QtGui/QLabel>
#include <QtGui/QPushButton>
#include <QtGui/QSpacerItem>
#include <QtGui/QVBoxLayout>
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

Просмотреть файл

@ -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 <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QCheckBox>
#include <QtGui/QDialog>
#include <QtGui/QGridLayout>
#include <QtGui/QHBoxLayout>
#include <QtGui/QLabel>
#include <QtGui/QPushButton>
#include <QtGui/QSpacerItem>
#include <QtGui/QVBoxLayout>
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

Просмотреть файл

@ -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 <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QCheckBox>
#include <QtGui/QDialog>
#include <QtGui/QGridLayout>
#include <QtGui/QHBoxLayout>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QPushButton>
#include <QtGui/QSpacerItem>
#include <QtGui/QVBoxLayout>
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

Просмотреть файл

@ -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 <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QComboBox>
#include <QtGui/QDialog>
#include <QtGui/QGridLayout>
#include <QtGui/QHBoxLayout>
#include <QtGui/QLabel>
#include <QtGui/QPushButton>
#include <QtGui/QSpacerItem>
#include <QtGui/QVBoxLayout>
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

Просмотреть файл

@ -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 <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QCheckBox>
#include <QtGui/QDialog>
#include <QtGui/QGridLayout>
#include <QtGui/QHBoxLayout>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QPushButton>
#include <QtGui/QSpacerItem>
#include <QtGui/QVBoxLayout>
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

Просмотреть файл

@ -1,335 +0,0 @@
<ui version="4.0" >
<class>UserpassDialog</class>
<widget class="QDialog" name="UserpassDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>264</width>
<height>204</height>
</rect>
</property>
<property name="windowTitle" >
<string>Prompt</string>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QGridLayout" >
<item row="0" column="1" >
<widget class="QLabel" name="message" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>prompt text</string>
</property>
<property name="alignment" >
<set>Qt::AlignVCenter</set>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="icon" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="scaledContents" >
<bool>false</bool>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1" >
<layout class="QGridLayout" >
<item row="0" column="1" >
<widget class="QLineEdit" name="username" />
</item>
<item row="1" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>10</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="password" >
<property name="echoMode" >
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="lb_password" >
<property name="text" >
<string>Password:</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>10</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="lb_username" >
<property name="text" >
<string>Username:</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1" >
<widget class="QCheckBox" name="check" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>confirm</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="ok" >
<property name="text" >
<string>&amp;OK</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancel" >
<property name="text" >
<string>&amp;Cancel</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<tabstops>
<tabstop>username</tabstop>
<tabstop>password</tabstop>
<tabstop>check</tabstop>
<tabstop>ok</tabstop>
<tabstop>cancel</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>ok</sender>
<signal>clicked()</signal>
<receiver>UserpassDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>cancel</sender>
<signal>clicked()</signal>
<receiver>UserpassDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>password</sender>
<signal>returnPressed()</signal>
<receiver>UserpassDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>

Просмотреть файл

@ -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

Просмотреть файл

@ -1,61 +0,0 @@
#include <qapplication.h>
#include "mainwindow.h"
#include "qgeckoembed.h"
#include "nsXPCOMGlue.h"
#ifdef MOZ_JPROF
#include "jprof/jprof.h"
#endif
#include <limits.h>
#include <qdir.h>
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();
}

Двоичные данные
embedding/browser/qt/tests/back.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.5 KiB

Просмотреть файл

@ -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'?[/<F;LY7N+8<9QXB;=XN]=9'-.J(FD%A4*EJD)5*_6E8DFE2@CU
M@1"!!*4OO"!X1.H+5$@4)$2!4-$`M:FJM%66IO&2Q'N\Q->YU[Z^R]P[<^_,
MG,,#$Q32!-J_]&GFG/GF]__..=)WX%-JH*?KD:&^OH^/#@^^\6G_`5#_7T*B
MK_=+'<U[WQ]-)-[[UO//)`U%>>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<UKTLY3YPO9"S+CXT=G3DIZ]^`W]SDO?/OHL9
M,6D=.<+$^!5L8>))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<P&;J^L<NO*!,<>/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-4<SB63;E0PJUZN*Y'U:Z@
M:1IFU,"Q*U0J%83G@P*^ZY+/62Q>7V$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^<SVXQE\FS^_A7"7>/(<QZ2A6!9D:06IBRJ[+C2(J>@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<BQ>>?$Y\L7\7U#4<577;<,TPIJBHNJA
M92FY,#6_F'I`]_ZWZFIV-7:T-I\_D1R4+W_SE/SSG]Z15^=2<D=*^>'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\`<X-^YT2)`%`@!/M`,=`;O(\52>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

Двоичные данные
embedding/browser/qt/tests/fileopen.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.2 KiB

Просмотреть файл

@ -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"<UR`%01-&#!HC"#+*,S`!#L_302W57=5=75]?BP<:TS(!+C"_Y
MY?U>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/,5<N5P\5;SK$;-XY^\K<%XT^^
MLNN)\55O([KI*U>F*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=:JXJT<S99#&`:8%0,UDF#3YJT,9X=HV"4"
M7Z8KU8UI5KB6NTJ]5D55HZQ^Y#$T3:58S&-9=7F>X-+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&=U<ONJ:C
MB`**(I%,Q%`4E9(1T)66J==-;EZ<I=FL+>H4B)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`_#;<Z1"TVM=92$`;J+5[B=^_
B%>'.RMJ5WPZO(_]_VV]P4B@+$=V^0@````!)14Y$KD)@@@``
`
end

Двоичные данные
embedding/browser/qt/tests/forward.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.5 KiB

Просмотреть файл

@ -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<R+W_^R3-I
M79=?+&]N/=Z=S;Y7W-I:N!>._QD?'G[`N7;M%;6Y]:8Z_\*WU=C0L!KHZ?G#
MD9&#OKMAM/T.1P;Z4TII<<>V3EFV<TAJ,NPH-QP(AIX\]_UGD+XB(X<>9F-=
M\=QW?D(^GY]N222.3!4*YET%QH:&<GN5O>=BT>CI3+:M36@FZ70W;:D6-,U$
M2`W=9W/ZT6,L+$Q3KS?XV",?)9D<X%O/_I@KEU\OQ..)PU.%&>._!$8'![]A
M&)7G/WOF,WSYJU\A%#'9+*T0"(*NVT0B[:0S#[*R<IF5Y7D6%]=86EJAHR/-
MR9-'Z>P<X/SW7N2/O[^X$HG$QJ?R^9U_"HP-#R<=N[Y][OSS?.K3I_C+7W_-
MXOP,2ND((0D$`NAZD&"H!=<Q6;VYP'V9(<I[:VQM%P$?)T^>H*,CQ;-?>X&E
M^?)R)!*]?W(ZKP!D,A;[[M'C8\<_]X737+CP0PHS2S0:DKFY9=;6BJRM%;EY
M\UUF9PL4BYLTC09MJ2`#@P/X_3K%8HFYN27Z^G*,'<YQY?)$TFQJ'R]N;?T"
M0+8EXK]\Z.'#T4IM@4)AB6@T3;&TCJ9!,AFG)1Y!]_E()A.D4G$RF7;\?IV>
MGFYT76=WMTR]7F?M]CK'3QPCU9'@RFN3W=W9WA/KI=*O9$<R]?5<?S82"%N4
M2GOX?!'*NQN$0F%T71`,!6AM39"(1T$I?+H/36@4BR5*I3NTM[?B]P>X]>XM
MFDV;$\?'F5]8X/;:5E]/MLLG,^WMSR1;@\ERI<3N=I58K(5F<Q<A!*[KHFD:
M"HURN4*UTL`P+)J&@6&8F*:%9=G4:G4JE3I;FV4"`?A07Y9K5PLHQ]<CLYF.
M3PII]<=:`JRNK!&*!$FTI-"0N*[`MFTJE3K;VV4JU09-P\1U%0".X["S4Z91
M;Z"4`GS4ZKO$XF'>GEK%MH2I"R&6=_<L4G:,EE07Q3M5&H9`TQP<JXZN2\*A
M"([M(*2.:3IL;^]1J]814J+K$B%`"$E7MH>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<VUQ=(MB6(A.,@
M)#+@D.D>(M[6R?+,=58*UT%J9R?S,Z_^VRSZR,C!I]H[<S]/=_>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.%'<M2CTWF9Z_>;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\<P`6,`&4/*(
M!;#G9050^^YDSU70^POI`35/\/U\_Y[PW%M`]3^)_@X%!8<MF=\P4P````!)
'14Y$KD)@@@``
`
end

Просмотреть файл

@ -1,161 +0,0 @@
#include "mainwindow.h"
#include <qlineedit.h>
#include <qaction.h>
#include <qmenubar.h>
#include <qtoolbar.h>
#include <qfiledialog.h>
#include <qstatusbar.h>
#include <qlayout.h>
#include <qapplication.h>
#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;
}

Просмотреть файл

@ -1,39 +0,0 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <qmainwindow.h>
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

Двоичные данные
embedding/browser/qt/tests/reload.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Просмотреть файл

@ -1,36 +0,0 @@
begin 755 ./debian/resources/sandbox/qt_port/embedding/browser/qt/tests/reload.png
MB5!.1PT*&@H````-24A$4@```!@````8"`8```#@=SWX```%<4E$051XG(V5
M;6Q;9Q7'?_?:U]?7L>,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<ZNKK/<Y[_[W^.=)\K\#XQ=O#@C*Z:G]7J^H33(45%T2F:
MEI&2W=(;LL?YI_G%Q;/O=5ZXU\;$\*'']6KC-QZ//SHTUL?HU##!J)^*F:2<
M$EEX8X65*QN4:H6LXI.._WMAX<P'!HP-#9]P6LHW!S^ZEP]]P<%]\1)'@H>)
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`]\;M<HYY/G.''I&71IG:810OO#.)N7TF5GFQV:N_J6>4<'DR.'OX0@
M'-.GKQ")AAGW'^=&KL#LD><8C4VWJDPT*X-NEW")$/4=P,\`KZV<HFY72:@I
M'"N=LB`(B41FZS*`\Y8=R_&$$=J&D(6_V<<7QV?1S:\2\?8")J]OO,0?EYXE
MI2Y2K6D\&'Z:XP]^E\OK_\"P+&B"(ZK2"-80<^V?`GY]!T!LB).-SBJ2"[2Z
MA:Z7Z6A7L"GQV[E?<&;]APQ$`NQ11&H^E0OY$UP[_0I%>P%<H%=!;@,U:"-L
M,7%+]U8'HMW==)LT+-"J)IJF4]4USE[[&\]=_0&]`1G)[*!2!:T.#@&VQ06\
MS1CN\GYJ&N@62%X%1#M\4_;_(Q($"\,IV384RML8-2>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/?(^P<YO+Z>9*U&NER
MA>M+_^7^X!'4>AE1E$A7;,:'9DB>>XM2,7<F72C\^0Y`3R1<%%7[R]%](Q"R
M,<P<N11,>*:9Z(_3[NABV/<P9D$@8$1X>.@)%-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<G2:8V+EQY>_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<S1Y]B8#".Y%=(J"FRY0IZ4Z3AD)`Z?(S'
MIQ@)#7'JYS_CI1=.\4Z^^'1=UU^]7?.NUW6;+'^Z-QQ^?E]?OSSUB<<Y]-`4
M';%NG)*$[)#P.#V4MS)<?.5E7CSU/#?6UD@5M[^M:OJS.[7N!G``,G"TJZ/]
M6P&/=R84#!*)[24<C2*(L)5,\,[Z&KE\GI*JK>;+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

Двоичные данные
embedding/browser/qt/tests/stop.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.5 KiB

Просмотреть файл

@ -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<R>>_<Z"OCR_W=]-?<6CM[B.8O,QDH#@_
M=Y^S$S,LSL]-%H3X[L4KUS[XOP`'!O<]VU#J[P.='=Z+,J-W=0'+R9$(19IO
MPM4-K'J(BD/"[L_R;J&-/UT?)ZY67QN[?/7'C_I9_]D9'MKWA<1U/SKB.O8+
M4]=9/3?&#=^P&*;0U,+.[_V`NW?N,W[S/E-SZZQ<OLQ0=8GN/?U,(9XK%_*5
MA<6E4X\%'!P:*"7*&1G*C#LX<HZY:D!4Z:!)08L)V-E5I'MX@.S2^\0STX3+
M2]2<)FZO15CGSU$L-3%7*#S;42G/SBTLCOY71,\\,WBB+*Q7#UZY2C[.2-HZ
M\-:K%,.`<I--2Z6$E!J#8G6QRG*0T`!TN9U&H\%ZN,;-P4&F'16J)&G[U^A8
MN+6#@T,#V[6T3G0OK=*\LDP@!$FPADP24B".-<%:G:`:L5P-64TT$1`".JYC
M68HDC4G".K5*Q4XQT;WYA;,`"L`(7LEKR%5]J@ABD]&YO1.W5"*-(M:-(30:
M:4`+"4*@T0C;)=?>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`%S<K-$0"EG(>WLP=5:4$V?`02:6FDR$"8
MC5MA;.+4)LT4*N?B&$ES2PMU+7`<!X%`V:I,?3.B)(GKEN>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(<D<[G7V[R#LV
M2S>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&*S</=RS;S\]NYYF;N(ZW4\]Q?[G#K-[:!]]3^]F1V\/A>8R7JF))%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]<K_J
M>_=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<!E(/LWD28`'<C9ADHTS<]AX/W5@]7]-_C=+RX%UF+XB
-M0````!)14Y$KD)@@@``
`
end

Просмотреть файл

@ -79,9 +79,6 @@ EXTRA_DSO_LIBS = gkgfx thebes
ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
CPPSRCS += nsSystemFontsQt.cpp
ifdef MOZ_ENABLE_GLITZ
REQUIRES += glitzglx
endif
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)

Просмотреть файл

@ -80,9 +80,6 @@ ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
EXPORTS += gfxQtPlatform.h gfxQPainterSurface.h
EXPORTS += gfxXlibSurface.h gfxQtNativeRenderer.h
EXPORTS += gfxQtFonts.h
ifdef MOZ_ENABLE_GLITZ
REQUIRES += glitzglx
endif
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),os2)

Просмотреть файл

@ -88,13 +88,6 @@ SHARED_LIBRARY_LIBS += \
$(DEPTH)/embedding/browser/gtk/src/$(LIB_PREFIX)gtkembedmoz.$(LIB_SUFFIX)
DEFINES += -DMOZ_ENABLE_GTK2
endif
ifneq (,$(MOZ_ENABLE_QT))
ifdef MOZ_ENABLE_LIBXUL
SHARED_LIBRARY_LIBS += \
$(DEPTH)/embedding/browser/qt/src/$(LIB_PREFIX)qgeckoembed.$(LIB_SUFFIX)
DEFINES += -DMOZ_ENABLE_QT
endif
endif
SHARED_LIBRARY_LIBS += \
$(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) \

Просмотреть файл

@ -255,11 +255,6 @@ ifdef MOZ_XUL_APP
ifneq (,$(MOZ_ENABLE_GTK2))
tier_toolkit_dirs += embedding/browser/gtk
endif
ifdef MOZ_ENABLE_LIBXUL
ifneq (,$(MOZ_ENABLE_QT))
tier_toolkit_dirs += embedding/browser/qt
endif
endif
endif
endif
@ -269,19 +264,6 @@ tier_toolkit_dirs += toolkit/library
endif
endif
ifndef BUILD_STATIC_LIBS
ifdef MOZ_XUL_APP
ifndef MOZ_ENABLE_LIBXUL
#ifneq (,$(MOZ_ENABLE_GTK2))
#tier_toolkit_dirs += embedding/browser/gtk
#endif
ifneq (,$(MOZ_ENABLE_QT))
tier_toolkit_dirs += embedding/browser/qt
endif
endif
endif
endif
ifdef MOZ_ENABLE_LIBXUL
tier_toolkit_dirs += xpcom/stub
endif