Re: [webkit-dev] How can I call a javascript function from the hosting application

2011-01-10 Thread André Pedralho
2011/1/10 fredx21 :
> The function "evaluateJavaScript()"is not in my Frame.h. Do you know why? Is
> there some cmake options that makes it appear in the Frame class?
>

Hi Fred, my bad! Sorry, it is only available in the Qt port.


> Regards,
> Fred
>
> -Original Message-
> From: André Pedralho [mailto:apedra...@gmail.com]
> Sent: Friday, January 07, 2011 2:21 PM
> To: fredx21
> Cc: webkit-dev@lists.webkit.org
> Subject: Re: [webkit-dev] How can I call a javascript function from the
> hosting application
>
> On Fri, Jan 7, 2011 at 14:35, fredx21  wrote:
>> My application is hosting a WebView instance to render its GUI using
>> the Windows CE port of Webkit.
>>
>>
>>
>> I need to be able to call some JavaScript functions that are written
>> into the loaded HTML page. For example, I have an
>> Init(backgroundColor) function that needs to be called once the page
>> is loaded. I guess calling a JavaScript function is trivial, but I did
>> not find an answer to my question yet.
>>
>>
>>
>> Can anyone give me pointer on how I can call a JavaScript function
>> from the hosting application?
>>
> http://doc.qt.nokia.com/4.7-snapshot/qwebframe.html#evaluateJavaScript
>
> WebView->page()->mainFrame()->evaluateJavaScript("Init(backgroundColor)"
> WebView->);
>
> BR,
>
> --
> Andre Pedralho
> http://pedralho.blogspot.com/
>
>>
>>
>> Regards,
>>
>> Fred
>>
>> ___
>> webkit-dev mailing list
>> webkit-dev@lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>>
>>
>
>
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] How can I call a javascript function from the hosting application

2011-01-07 Thread André Pedralho
On Fri, Jan 7, 2011 at 14:35, fredx21  wrote:
> My application is hosting a WebView instance to render its GUI using the
> Windows CE port of Webkit.
>
>
>
> I need to be able to call some JavaScript functions that are written into
> the loaded HTML page. For example, I have an Init(backgroundColor) function
> that needs to be called once the page is loaded. I guess calling a
> JavaScript function is trivial, but I did not find an answer to my question
> yet.
>
>
>
> Can anyone give me pointer on how I can call a JavaScript function from the
> hosting application?
>
http://doc.qt.nokia.com/4.7-snapshot/qwebframe.html#evaluateJavaScript

WebView->page()->mainFrame()->evaluateJavaScript("Init(backgroundColor)");

BR,

--
Andre Pedralho
http://pedralho.blogspot.com/

>
>
> Regards,
>
> Fred
>
> ___
> webkit-dev mailing list
> webkit-dev@lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Handling upload progresses

2008-11-24 Thread André Pedralho
I built WebKit from trunk and also from Qt 4.5 snapshot and in both of
them I could not attach a file in Gmail. I tried Arora and the demo
browser in Qt 4.5. They send the email without the file attached.

Is there anything I could have done wrong?

Questions:
1) Does WebKit support this kind of upload?
2) What is the difference between WebKit trunk and Qt WebKit? Are they
forks? Which of them contains the most recent changes (I guess it is
the trunk, right)?

-- 
André Pedralho
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Handling upload progresses

2008-11-11 Thread André Pedralho
On Tue, Nov 11, 2008 at 2:32 PM, Holger Freyther <[EMAIL PROTECTED]> wrote:
> On Tuesday 11 November 2008 14:46:12 André Pedralho wrote:
>> Hi all,
>>
>> I'm just wondering if there is a way to get upload progresses the same
>> way we can do with download ones.
>>
>
> Not out of the box. Are you talking about PUSH/PUT.
>
Actually I was thinking in show a progress while an user uploads an
attachment to a webmail for instance. It would be simple if I could
get the network reply related to that file uploading.

> You might want to look at
> this[1].
>
A network reply handler might be good, but if could not get a network
reply when one upload starts I guess I will not be able to get a
handler for it...

Did I miss something?

-- 
André Pedralho
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] Handling upload progresses

2008-11-11 Thread André Pedralho
Hi all,

I'm just wondering if there is a way to get upload progresses the same
way we can do with download ones.

I mean, when a download starts it raises a download requested signal
(QWebPage), which can be used to get the related QNetworkRequest. With
this network request I'm able to get a network reply and connect the
download progress signal to it. See the code below that shows what I'm
trying to explain:

void MainWindow::downloadRequested(
const QNetworkRequest &request)
{
(...)
  QNetworkAccessManager *networkManager =
webView->page()->networkAccessManager();
  QNetworkReply *reply =
networkManager->get(request);
  connect(
reply, SIGNAL(downloadProgress(qint64, qint64)),
this, SLOT(downloadProgress(qint64, qint64)));
  connect(reply, SIGNAL(finished()),
  this, SLOT(downloadIssueFinished()));
}

How can I do the same to uploads? Do we have an upload requested
signal in QWebPage? I'm using the chooseFile method to do some uploads
handling, is there a better way to do it? How can I get the
uploadProgress signal from the network reply using a structure similar
to the code above.

Thanks all,

--
André Pedralho
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Doubts on QNetworkAccessManager

2008-11-11 Thread André Pedralho
Hi Benjamin,

thanks for your elucidations and sorry if I'm being newbie with my
questions. Follows some more ones:

On Fri, Nov 7, 2008 at 5:19 PM, Benjamin Meyer <[EMAIL PROTECTED]> wrote:

> On Nov 3, 2008, at 11:34 AM, André Pedralho wrote:
>
>  Hi all,
>>
>> I'm using the new QNetworkAccessManager to set my QtWebkit browser cache
>> system and realized that I can have more than one QWebPage loaded and then
>> (I guess) more than one QNetworkAccessManager as well.
>>
>> What happens when I call, for example, something like
>> page[1].networkAccessManager().cache().clear() ?
>>
>
> That cache object that the network access manager has a pointer to is
> cleared.
>
>  Will it clear all the cache or just the cache related the page[1]?
>>
>
> The default NetworkCache objects do not know about each other so only one
> cache object is cleared.
>

 Wouldn't be better to have this kind of functionalities in the QWebView
>> class? Maybe something like QWebSettings. Actually, IMHO we could have
>> access to the cache settings from QWebSettings.
>>
>
> QWebSettings is for settings, not to hold cache objects
>
>  Is there any other way to clear the cache?
>>
>
> Using the clear function on the cache is the proper way.  What you are
> probably looking for is to share the same network access manager with all
> your pages.  Then you only have one cache.  For an example of this checkout
> the source code for Arora.
>

Got it! So if I don't set a new global network access manager and want to
clear the cache I would need to go page by page clearing them, right?

What is the advantage on having one separated cache for each page? Wouldn't
be better to have one network access manager shared by default? Or maybe a
way to set WebKit to share them.

BTW, Arora is a great reference browser!

Thanks,

-- 
André Pedralho
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] Doubts on QNetworkAccessManager

2008-11-03 Thread André Pedralho
Hi all,

I'm using the new QNetworkAccessManager to set my QtWebkit browser cache
system and realized that I can have more than one QWebPage loaded and then
(I guess) more than one QNetworkAccessManager as well.

What happens when I call, for example, something like
page[1].networkAccessManager().cache().clear() ?
Will it clear all the cache or just the cache related the page[1]?

Wouldn't be better to have this kind of functionalities in the QWebView
class? Maybe something like QWebSettings. Actually, IMHO we could have
access to the cache settings from QWebSettings.

Is there any other way to clear the cache?

BR,

-- 
André Pedralho
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] Build error on Ubuntu Gutsy

2008-10-01 Thread André Pedralho
Hi all,

I'm trying to build release 37144 on Ubuntu Gutsy with
WebKitTools/Scripts/build-webkit --qt. In the linkage it stops with the
following error:

tmp/StyleTransformData.o:(.bss._ZZN7WebCore11RenderStyle16initialTransformEvE3ops[*WebCore::RenderStyle::initialTransform()::ops]+0x0):
multiple definition of `WebCore::RenderStyle::initialTransform()::ops'
tmp/CSSStyleSelector.o:(.bss._ZZN7WebCore11RenderStyle16initialTransformEvE3ops[WebCore::RenderStyle::initialTransform()::ops]+0x0):
first defined here
../JavaScriptCore/libJavaScriptCore.a(InternalFunction.o): In function
`JSC::InternalFunction::classInfo() const':InternalFunction.cpp:(.text+0x0):
multiple definition of `JSC::InternalFunction::classInfo() const'
tmp/JSCounter.o:JSCounter.cpp:(.text._ZNK3JSC16InternalFunction9classInfoEv[JSC::InternalFunction::classInfo()
const]+0x0): first defined here
collect2: ld returned 1 exit status
make[1]: *** [../lib/libQtWebKit.so.4.4.1] Error 1
make[1]: Leaving directory
`/home/pedralho/svn-webkit/WebKit/WebKitBuild/Release/WebCore'
make: *** [sub-WebCore-make_default-ordered] Error 2

What can I do to fix it?

-- 
André Pedralho
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev