{
return QCoreApplication::translate("QWebPage", "Open Image", "Open Image in New Window context menu item");
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
-index 5bb3c57..9c9981e 100644
+index 5bb3c57..283db71 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -396,7 +396,8 @@ static const char* editorCommandWebActions[] =
case WebCore::ContextMenuItemTagOpenImageInNewWindow: return QWebPage::OpenImageInNewWindow;
case WebCore::ContextMenuItemTagDownloadImageToDisk: return QWebPage::DownloadImageToDisk;
case WebCore::ContextMenuItemTagCopyImageToClipboard: return QWebPage::CopyImageToClipboard;
-@@ -2225,6 +2227,53 @@ static void collectChildFrames(QWebFrame* frame, QList<QWebFrame*>& list)
+@@ -2225,6 +2227,7 @@ static void collectChildFrames(QWebFrame* frame, QList<QWebFrame*>& list)
\sa action()
*/
-+#include <string.h>
-+#include <unistd.h>
-+#include <sys/un.h>
-+#include <sys/types.h>
-+#include <arpa/inet.h>
+#include "qscreen_qws.h"
-+
-+#define BUFF_SIZE 1024
-+#define FILE_SERVER "/tmp/vuplus.tmp"
-+int uds_send_message(char* buffer)
-+{
-+ int message_len;
-+ int client_socket;
-+ struct sockaddr_un server_addr;
-+
-+ if(buffer == 0)
-+ {
-+ qDebug("[buffer is NULL]");
-+ return 0;
-+ }
-+
-+ if((client_socket = socket( PF_FILE, SOCK_STREAM, 0)) < 0)
-+ {
-+ qDebug("[fail to open socket]");
-+ return 0;
-+ }
-+ memset(&server_addr, 0, sizeof(server_addr));
-+ strcpy(server_addr.sun_path, FILE_SERVER);
-+ server_addr.sun_family = AF_UNIX;
-+ if(connect(client_socket, (struct sockaddr*)&server_addr, sizeof(server_addr)) < 0)
-+ {
-+ qDebug("[fail to connect][%s]", FILE_SERVER);
-+ return 0;
-+ }
-+
-+ Singleton<CVu>::instance().lock();
-+
-+ write(client_socket, buffer, strlen(buffer));
-+ int rc = read (client_socket, buffer, BUFF_SIZE);
-+ buffer[rc] = 0;
-+
-+ Singleton<CVu>::instance().unlock();
-+
-+ close(client_socket);
-+ return 1;
-+}
-+
void QWebPage::triggerAction(WebAction action, bool)
{
WebCore::Frame *frame = d->page->focusController()->focusedOrMainFrame();
-@@ -2263,6 +2312,19 @@ void QWebPage::triggerAction(WebAction action, bool)
+@@ -2263,6 +2266,19 @@ void QWebPage::triggerAction(WebAction action, bool)
editor->copyURL(d->hitTestResult.linkUrl(), d->hitTestResult.linkText());
break;
}
+ UChar* url_wide_string = url_string.characters();
+ for(int i=0 ; i<url_string.length() ; i++)
+ tmp[i] = (url_wide_string[i]&0x00FF);
-+ int rc = uds_send_message(tmp);
++ int rc = Singleton<CVu>::instance().sendMessage(tmp);
+ if(rc)
+ if(strncmp(tmp, "ok$", 3) != 0)
+ if(strlen(tmp) > 4)
case OpenImageInNewWindow:
openNewWindow(d->hitTestResult.imageUrl(), frame);
break;
-@@ -2493,7 +2555,9 @@ QAction *QWebPage::action(WebAction action) const
+@@ -2493,7 +2509,9 @@ QAction *QWebPage::action(WebAction action) const
case CopyLinkToClipboard:
text = contextMenuItemTagCopyLinkToClipboard();
break;
};
enum FindFlag {
+diff --git a/src/gui/embedded/qkbdlinuxinput_qws.cpp b/src/gui/embedded/qkbdlinuxinput_qws.cpp
+index 376b0d0..c0c58ed 100644
+--- a/src/gui/embedded/qkbdlinuxinput_qws.cpp
++++ b/src/gui/embedded/qkbdlinuxinput_qws.cpp
+@@ -57,6 +57,8 @@
+
+ QT_BEGIN_NAMESPACE
+
++#include "qscreen_qws.h"
++static int kbd_fd = 0;
+
+ class QWSLinuxInputKbPrivate : public QObject
+ {
+@@ -64,6 +66,7 @@ class QWSLinuxInputKbPrivate : public QObject
+ public:
+ QWSLinuxInputKbPrivate(QWSLinuxInputKeyboardHandler *, const QString &);
+ ~QWSLinuxInputKbPrivate();
++ static void readKeycodeE();
+
+ private:
+ void switchLed(int, bool);
+@@ -77,6 +80,7 @@ private:
+ int m_tty_fd;
+ struct termios m_tty_attr;
+ int m_orig_kbmode;
++ QSocketNotifier *notifier;
+ };
+
+ QWSLinuxInputKeyboardHandler::QWSLinuxInputKeyboardHandler(const QString &device)
+@@ -121,10 +125,12 @@ QWSLinuxInputKbPrivate::QWSLinuxInputKbPrivate(QWSLinuxInputKeyboardHandler *h,
+ ::ioctl(m_fd, EVIOCSREP, kbdrep);
+ }
+
+- QSocketNotifier *notifier;
+ notifier = new QSocketNotifier(m_fd, QSocketNotifier::Read, this);
+ connect(notifier, SIGNAL(activated(int)), this, SLOT(readKeycode()));
+
++ kbd_fd = m_fd;
++ Singleton<CVu>::instance().setKeyboardHandler(kbd_fd, (void*)this, QWSLinuxInputKbPrivate::readKeycodeE);
++
+ // play nice in case we are started from a shell (e.g. for debugging)
+ m_tty_fd = isatty(0) ? 0 : -1;
+
+@@ -181,6 +187,33 @@ void QWSLinuxInputKbPrivate::switchLed(int led, bool state)
+ QT_WRITE(m_fd, &led_ie, sizeof(led_ie));
+ }
+
++void QWSLinuxInputKbPrivate::readKeycodeE()
++{
++ if(!Singleton<CVu>::instance().isLocked()) return;
++
++ int n = 0;
++ struct ::input_event buffer[32];
++ if(Singleton<CVu>::instance().isLocked())
++ {
++ if(kbd_fd > 0)
++ {
++ forever {
++ n = QT_READ(kbd_fd, reinterpret_cast<char *>(buffer) + n, sizeof(buffer) - n);
++ if (n == 0) {
++ qWarning("Got EOF from the input device.");
++ return;
++ } else if (n < 0 && (errno != EINTR && errno != EAGAIN)) {
++ qWarning("Could not read from input device: %s", strerror(errno));
++ return;
++ } else if (n % sizeof(buffer[0]) == 0) {
++ break;
++ }
++ }
++ }
++ return;
++ }
++}
++
+ void QWSLinuxInputKbPrivate::readKeycode()
+ {
+ struct ::input_event buffer[32];
+@@ -209,6 +242,20 @@ void QWSLinuxInputKbPrivate::readKeycode()
+ quint16 code = buffer[i].code;
+ qint32 value = buffer[i].value;
+
++ //qDebug("kbd data : code [%d], value [%d]", code, value);
++ switch(code)
++ {
++ case 399:
++ case 400:
++ if(!value) return;
++ notifier->setEnabled(false);
++ Singleton<CVu>::instance().parseKey(&code, value);
++ notifier->setEnabled(true);
++ return;
++ case 401:
++ code = 14;
++ }
++
+ if (m_handler->filterInputEvent(code, value))
+ continue;
+
diff --git a/src/gui/embedded/qmousepc_qws.cpp b/src/gui/embedded/qmousepc_qws.cpp
index 5d3b182..0af16e7 100644
--- a/src/gui/embedded/qmousepc_qws.cpp
uchar buf[8];
int n = read(fd, buf, 8);
diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp
-index d55fbed..5e7af34 100644
+index d55fbed..fa535d2 100644
--- a/src/gui/embedded/qscreen_qws.cpp
+++ b/src/gui/embedded/qscreen_qws.cpp
-@@ -2029,6 +2029,22 @@ QImage::Format QScreenPrivate::preferredImageFormat() const
+@@ -2029,6 +2029,61 @@ QImage::Format QScreenPrivate::preferredImageFormat() const
server to connect to. The \a classId specifies the class
identifier.
*/
+
+static int fd = -1;
+
++QString ch2qstr(char* str) { QString q = str; return q; }
++
++void* CVu::thread_main(void* args)
++{
++ CVu* thiz = (CVu*) args;
++ struct pollfd* fds = thiz->getDevices();
++
++ qDebug("input control thread start");
++ KLOG("[%ld]", thiz->getTid());
++ while(thiz->isRunable())
++ {
++ if((fds[0].fd==-1) && (fds[1].fd==-1))
++ {
++ qDebug("pease, setting handler before start thread.", 0);
++ break;
++ }
++ thiz->runHandler(fds);
++ }
++ qDebug("input control thread stop");
++ KLOG("[%ld]", thiz->getTid());
++ return 0;
++}
++
++void CVu::runHandler(struct pollfd* fds)
++{
++ poll(fds, 2, 2000);
++ if((fds[0].revents & POLLIN) && mouse.cb)
++ mouse.cb(mouse.h, mouse.fd);
++ if((fds[1].revents & POLLIN) && keyboard.cb)
++ keyboard.cb(keyboard.h);
++}
++
++void CVu::start()
++{
++ thread_status = 1;
++ if(pthread_create(&h_thread, NULL, CVu::thread_main, (void*)this) != 0)
++ qDebug("fail to start input control thread!!", 0);
++}
++
QScreen::QScreen(int display_id, ClassId classId)
: screencols(0), data(0), entries(0), entryp(0), lowest(0),
w(0), lstep(0), h(0), d(1), pixeltype(NormalPixel), grayscale(false),
-@@ -2036,6 +2052,14 @@ QScreen::QScreen(int display_id, ClassId classId)
+@@ -2036,6 +2091,14 @@ QScreen::QScreen(int display_id, ClassId classId)
physWidth(0), physHeight(0), d_ptr(new QScreenPrivate(this, classId))
{
clearCacheFunc = 0;
}
QScreen::QScreen(int display_id)
-@@ -2045,6 +2069,14 @@ QScreen::QScreen(int display_id)
+@@ -2045,6 +2108,14 @@ QScreen::QScreen(int display_id)
physWidth(0), physHeight(0), d_ptr(new QScreenPrivate(this))
{
clearCacheFunc = 0;
}
/*!
-@@ -2053,6 +2085,13 @@ QScreen::QScreen(int display_id)
+@@ -2053,6 +2124,13 @@ QScreen::QScreen(int display_id)
QScreen::~QScreen()
{
delete d_ptr;
}
-@@ -2498,6 +2537,11 @@ void QScreen::blit(const QImage &img, const QPoint &topLeft, const QRegion ®)
+@@ -2498,6 +2576,11 @@ void QScreen::blit(const QImage &img, const QPoint &topLeft, const QRegion ®)
d_ptr->blit(this, img, topLeft - offset(),
(reg & bound).translated(-topLeft));
QWSDisplay::ungrab();
}
#ifdef QT_QWS_CLIENTBLIT
-@@ -2581,6 +2625,7 @@ struct fill_data {
+@@ -2581,6 +2664,7 @@ struct fill_data {
void QScreen::solidFill(const QColor &color, const QRegion ®ion)
{
QWSDisplay::grab();
region.translated(-offset()) & QRect(0, 0, dw, dh));
QWSDisplay::ungrab();
diff --git a/src/gui/embedded/qscreen_qws.h b/src/gui/embedded/qscreen_qws.h
-index c2f8010..5488536 100644
+index c2f8010..66bd1e4 100644
--- a/src/gui/embedded/qscreen_qws.h
+++ b/src/gui/embedded/qscreen_qws.h
-@@ -82,6 +82,132 @@ static const int qt_red_rounding_shift = qt_red_shift + qt_rbits;
+@@ -82,6 +82,111 @@ static const int qt_red_rounding_shift = qt_red_shift + qt_rbits;
static const int qt_green_rounding_shift = qt_green_shift + qt_gbits;
static const int qt_blue_rounding_shift = qt_bbits - qt_neg_blue_shift;
+#include <stdio.h>
++#define BUFF_SIZE 1024
++QString ch2qstr(char* str);
++
+#define KLOG(f,x...)
+//#define KLOG(f,x...) fprintf(stderr, "CVu :: [%s][%d]\t>> "f"\n", __FUNCTION__, __LINE__, x);
+template <class T>
+public:
+ static T& instance()
+ {
-+ // locking here!!
+ static Singleton<T> singleton;
+ return singleton;
+ }
+ pthread_t h_thread;
+
+ struct pollfd device_fds[2];
++
++ int (*cb_pk)(quint16*, qint32);
++ int (*cb_sm)(char*);
+protected:
+ CVu()
+ {
+
+ device_fds[0].fd = device_fds[1].fd = -1;
+ device_fds[0].events = device_fds[1].events = POLLIN;
-+ };
-+
-+ static void* thread_main(void* args)
-+ {
-+ CVu* thiz = (CVu*) args;
-+ struct pollfd* fds = thiz->getDevices();
-+
-+ qDebug("input control thread start");
-+ KLOG("[%ld]", thiz->getTid());
-+ while(thiz->isRunable())
-+ {
-+ if((fds[0].fd==-1) && (fds[1].fd==-1))
-+ {
-+ qDebug("pease, setting handler before start thread.", 0);
-+ break;
-+ }
-+ thiz->runHandler(fds);
-+ }
-+ qDebug("input control thread stop");
-+ KLOG("[%ld]", thiz->getTid());
-+ return 0;
-+ }
+
-+ void runHandler(struct pollfd* fds)
-+ {
-+ poll(fds, 2, 2000);
-+ if((fds[0].revents & POLLIN) && mouse.cb)
-+ mouse.cb(mouse.h, mouse.fd);
-+ if((fds[1].revents & POLLIN) && keyboard.cb)
-+ keyboard.cb(keyboard.h);
-+ }
++ cb_pk = cb_sm = 0;
++ };
+
++ static void* thread_main(void* args);
++ void runHandler(struct pollfd* fds);
+public:
+ void lock() { KLOG("%d", key); key = 1; }
+ void unlock() { KLOG("%d", key); key = 0; }
+ }
+
+ void stop() { thread_status = 0; }
-+ void start()
-+ {
-+ thread_status = 1;
-+ if(pthread_create(&h_thread, NULL, CVu::thread_main, (void*)this) != 0)
-+ qDebug("fail to start input control thread!!", 0);
-+ }
++ void start();
+ int isRunable() { return thread_status; }
+ pthread_t getTid() { return h_thread; }
+
+ struct pollfd* getDevices() { return device_fds; }
-+};
+
++ void setCallbackSM(int (*func)(char*)) { cb_sm = func; }
++ void setCallbackPK(int (*func)(quint16*, qint32)) { cb_pk = func; }
++
++ int sendMessage(char* buff) { if(!cb_sm) return 0; return cb_sm(buff); }
++ int parseKey(quint16* code, qint32 value) { if(!cb_pk) return 0; return cb_pk(code, value); }
++};
inline ushort qt_convRgbTo16(const int r, const int g, const int b)
{
diff --git a/Source/WebCore/page/ContextMenuController.cpp b/Source/WebCore/page/ContextMenuController.cpp
-index 923d2ce..556c8cd 100644
+index 923d2ce..fb0c016 100644
--- a/Source/WebCore/page/ContextMenuController.cpp
+++ b/Source/WebCore/page/ContextMenuController.cpp
-@@ -195,6 +195,8 @@ void ContextMenuController::contextMenuItemSelected(ContextMenuItem* item)
+@@ -195,6 +195,9 @@ void ContextMenuController::contextMenuItemSelected(ContextMenuItem* item)
case ContextMenuItemTagCopyLinkToClipboard:
frame->editor()->copyURL(m_hitTestResult.absoluteLinkURL(), m_hitTestResult.textContent());
break;
+ case ContextMenuItemTagGotoYoutubeLink:
++ qDebug("not impl!!");
+ break;
case ContextMenuItemTagOpenImageInNewWindow:
openNewWindow(m_hitTestResult.absoluteImageURL(), frame);
break;
-@@ -625,6 +627,8 @@ void ContextMenuController::populate()
+@@ -625,6 +628,8 @@ void ContextMenuController::populate()
contextMenuItemTagDownloadLinkToDisk());
ContextMenuItem CopyLinkItem(ActionType, ContextMenuItemTagCopyLinkToClipboard,
contextMenuItemTagCopyLinkToClipboard());
ContextMenuItem OpenImageInNewWindowItem(ActionType, ContextMenuItemTagOpenImageInNewWindow,
contextMenuItemTagOpenImageInNewWindow());
ContextMenuItem DownloadImageItem(ActionType, ContextMenuItemTagDownloadImageToDisk,
-@@ -1172,6 +1176,7 @@ void ContextMenuController::checkOrEnableIfNeeded(ContextMenuItem& item) const
+@@ -1172,6 +1177,7 @@ void ContextMenuController::checkOrEnableIfNeeded(ContextMenuItem& item) const
case ContextMenuItemTagOpenLinkInNewWindow:
case ContextMenuItemTagDownloadLinkToDisk:
case ContextMenuItemTagCopyLinkToClipboard:
case ContextMenuItemTagDownloadImageToDisk:
case ContextMenuItemTagCopyImageToClipboard:
diff --git a/Source/WebCore/platform/ContextMenuItem.h b/Source/WebCore/platform/ContextMenuItem.h
-index 46a6987..bcab2c4 100644
+index 46a6987..f48860a 100644
--- a/Source/WebCore/platform/ContextMenuItem.h
+++ b/Source/WebCore/platform/ContextMenuItem.h
-@@ -158,6 +158,7 @@ namespace WebCore {
- ContextMenuItemTagEnterVideoFullscreen,
- ContextMenuItemTagMediaPlayPause,
- ContextMenuItemTagMediaMute,
-+ ContextMenuItemTagGotoYoutubeLink,
+@@ -161,7 +161,8 @@ namespace WebCore {
ContextMenuItemBaseCustomTag = 5000,
ContextMenuItemCustomTagNoAction = 5998,
ContextMenuItemLastCustomTag = 5999,
+- ContextMenuItemBaseApplicationTag = 10000
++ ContextMenuItemBaseApplicationTag = 10000,
++ ContextMenuItemTagGotoYoutubeLink
+ };
+
+ enum ContextMenuItemType {
diff --git a/Source/WebCore/platform/DefaultLocalizationStrategy.cpp b/Source/WebCore/platform/DefaultLocalizationStrategy.cpp
-index 4c11f29..1dab43d 100644
+index 4c11f29..28cb00e 100644
--- a/Source/WebCore/platform/DefaultLocalizationStrategy.cpp
+++ b/Source/WebCore/platform/DefaultLocalizationStrategy.cpp
@@ -150,6 +150,11 @@ String DefaultLocalizationStrategy::contextMenuItemTagCopyLinkToClipboard()
+String DefaultLocalizationStrategy::contextMenuItemTagGotoYoutubeLink()
+{
-+ return WEB_UI_STRING("Open Youtube", "Open Youtube context menu item");
++ return WEB_UI_STRING("Open Youtube", "Open Youtube");
+}
+
String DefaultLocalizationStrategy::contextMenuItemTagOpenImageInNewWindow()
String contextMenuItemTagOpenImageInNewWindow();
String contextMenuItemTagDownloadImageToDisk();
String contextMenuItemTagCopyImageToClipboard();
+diff --git a/Source/WebCore/platform/android/LocalizedStringsAndroid.cpp b/Source/WebCore/platform/android/LocalizedStringsAndroid.cpp
+index e67e389..19f5368 100644
+--- a/Source/WebCore/platform/android/LocalizedStringsAndroid.cpp
++++ b/Source/WebCore/platform/android/LocalizedStringsAndroid.cpp
+@@ -63,6 +63,12 @@ String contextMenuItemTagCopyLinkToClipboard()
+ return String();
+ }
+
++String contextMenuItemTagGotoYoutubeLink()
++{
++ notImplemented();
++ return String();
++}
++
+ String contextMenuItemTagOpenImageInNewWindow()
+ {
+ notImplemented();
+diff --git a/Source/WebCore/platform/brew/LocalizedStringsBrew.cpp b/Source/WebCore/platform/brew/LocalizedStringsBrew.cpp
+index ba5d4a9..4abe957 100644
+--- a/Source/WebCore/platform/brew/LocalizedStringsBrew.cpp
++++ b/Source/WebCore/platform/brew/LocalizedStringsBrew.cpp
+@@ -81,9 +81,14 @@ String contextMenuItemTagCopyLinkToClipboard()
+ return "Copy link to clipboard";
+ }
+
+-String contextMenuItemTagOpenImageInNewWindow()
++String contextMenuItemTagCopyLinkToClipboard()
++{
++ return "Copy link to clipboard";
++}
++
++String contextMenuItemTagGotoYoutubeLink()
+ {
+- return "Open image in new window";
++ return "Open Youtube";
+ }
+
+ String contextMenuItemTagDownloadImageToDisk()
+diff --git a/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp b/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp
+index 36a9f01..bbca0fd 100644
+--- a/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp
++++ b/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp
+@@ -88,6 +88,11 @@ String contextMenuItemTagCopyLinkToClipboard()
+ return String::fromUTF8("Copy Link Location");
+ }
+
++String contextMenuItemTagGotoYoutubeLink()
++{
++ return String::fromUTF8("Open Youtube");
++}
++
+ String contextMenuItemTagOpenImageInNewWindow()
+ {
+ return String::fromUTF8("Open Image in New Window");
+diff --git a/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp b/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp
+index 13c46fc..ed8fdf1 100644
+--- a/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp
++++ b/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp
+@@ -101,6 +101,11 @@ String contextMenuItemTagCopyLinkToClipboard()
+ return String::fromUTF8(_("Copy Link Loc_ation"));
+ }
+
++String contextMenuItemTagGotoYoutubeLink()
++{
++ return String::fromUTF8(_("Open Youtube"));
++}
++
+ String contextMenuItemTagOpenImageInNewWindow()
+ {
+ return String::fromUTF8(_("Open _Image in New Window"));
+diff --git a/Source/WebCore/platform/haiku/LocalizedStringsHaiku.cpp b/Source/WebCore/platform/haiku/LocalizedStringsHaiku.cpp
+index c1f3641..9fa3904 100644
+--- a/Source/WebCore/platform/haiku/LocalizedStringsHaiku.cpp
++++ b/Source/WebCore/platform/haiku/LocalizedStringsHaiku.cpp
+@@ -88,6 +88,11 @@ String contextMenuItemTagCopyLinkToClipboard()
+ return "Copy link to clipboard";
+ }
+
++String contextMenuItemTagGotoYoutubeLink()
++{
++ return "Open Youtube";
++}
++
+ String contextMenuItemTagOpenImageInNewWindow()
+ {
+ return "Open image in new window";
+diff --git a/Source/WebCore/platform/wx/LocalizedStringsWx.cpp b/Source/WebCore/platform/wx/LocalizedStringsWx.cpp
+index 8ec791e..8e1dea8 100644
+--- a/Source/WebCore/platform/wx/LocalizedStringsWx.cpp
++++ b/Source/WebCore/platform/wx/LocalizedStringsWx.cpp
+@@ -87,6 +87,11 @@ String contextMenuItemTagCopyLinkToClipboard()
+ return String("Copy Link to Clipboard");
+ }
+
++String contextMenuItemTagGotoYoutubeLink()
++{
++ return String("Open Youtube");
++}
++
+ String contextMenuItemTagOpenImageInNewWindow()
+ {
+ return String("Open Image in New Window");
diff --git a/Source/WebKit/chromium/src/LocalizedStrings.cpp b/Source/WebKit/chromium/src/LocalizedStrings.cpp
index 35e03c4..6dbbfa4 100644
--- a/Source/WebKit/chromium/src/LocalizedStrings.cpp
String contextMenuItemTagDownloadImageToDisk() { return String(); }
String contextMenuItemTagCopyImageToClipboard() { return String(); }
diff --git a/Source/WebKit/qt/Api/qwebpage.cpp b/Source/WebKit/qt/Api/qwebpage.cpp
-index b3efe0f..8860ba8 100644
+index b3efe0f..8e0e09c 100644
--- a/Source/WebKit/qt/Api/qwebpage.cpp
+++ b/Source/WebKit/qt/Api/qwebpage.cpp
@@ -247,7 +247,8 @@ static const char* editorCommandWebActions[] =
case WebCore::ContextMenuItemTagOpenImageInNewWindow: return QWebPage::OpenImageInNewWindow;
case WebCore::ContextMenuItemTagDownloadImageToDisk: return QWebPage::DownloadImageToDisk;
case WebCore::ContextMenuItemTagCopyImageToClipboard: return QWebPage::CopyImageToClipboard;
-@@ -2335,6 +2337,53 @@ static void collectChildFrames(QWebFrame* frame, QList<QWebFrame*>& list)
+@@ -2335,6 +2337,7 @@ static void collectChildFrames(QWebFrame* frame, QList<QWebFrame*>& list)
\sa action()
*/
-+#include <string.h>
-+#include <unistd.h>
-+#include <sys/un.h>
-+#include <sys/types.h>
-+#include <arpa/inet.h>
+#include "qscreen_qws.h"
-+
-+#define BUFF_SIZE 1024
-+#define FILE_SERVER "/tmp/vuplus.tmp"
-+int uds_send_message(char* buffer)
-+{
-+ int message_len;
-+ int client_socket;
-+ struct sockaddr_un server_addr;
-+
-+ if(buffer == 0)
-+ {
-+ qDebug("[buffer is NULL]");
-+ return 0;
-+ }
-+
-+ if((client_socket = socket( PF_FILE, SOCK_STREAM, 0)) < 0)
-+ {
-+ qDebug("[fail to open socket]");
-+ return 0;
-+ }
-+ memset(&server_addr, 0, sizeof(server_addr));
-+ strcpy(server_addr.sun_path, FILE_SERVER);
-+ server_addr.sun_family = AF_UNIX;
-+ if(connect(client_socket, (struct sockaddr*)&server_addr, sizeof(server_addr)) < 0)
-+ {
-+ qDebug("[fail to connect][%s]", FILE_SERVER);
-+ return 0;
-+ }
-+
-+ Singleton<CVu>::instance().lock();
-+
-+ write(client_socket, buffer, strlen(buffer));
-+ int rc = read (client_socket, buffer, BUFF_SIZE);
-+ buffer[rc] = 0;
-+
-+ Singleton<CVu>::instance().unlock();
-+
-+ close(client_socket);
-+ return 1;
-+}
-+
void QWebPage::triggerAction(WebAction action, bool)
{
WebCore::Frame *frame = d->page->focusController()->focusedOrMainFrame();
-@@ -2373,6 +2422,19 @@ void QWebPage::triggerAction(WebAction action, bool)
+@@ -2373,6 +2376,19 @@ void QWebPage::triggerAction(WebAction action, bool)
editor->copyURL(d->hitTestResult.linkUrl(), d->hitTestResult.linkText());
break;
}
+ UChar* url_wide_string = url_string.characters();
+ for(int i=0 ; i<url_string.length() ; i++)
+ tmp[i] = (url_wide_string[i]&0x00FF);
-+ int rc = uds_send_message(tmp);
++ int rc = Singleton<CVu>::instance().sendMessage(tmp);
+ if(rc)
+ if(strncmp(tmp, "ok$", 3) != 0)
+ if(strlen(tmp) > 4)
case OpenImageInNewWindow:
openNewWindow(d->hitTestResult.imageUrl(), frame);
break;
-@@ -2767,6 +2829,9 @@ QAction *QWebPage::action(WebAction action) const
+@@ -2767,6 +2783,9 @@ QAction *QWebPage::action(WebAction action) const
case CopyLinkToClipboard:
text = contextMenuItemTagCopyLinkToClipboard();
break;
virtual WTF::String contextMenuItemTagOpenImageInNewWindow();
virtual WTF::String contextMenuItemTagDownloadImageToDisk();
virtual WTF::String contextMenuItemTagCopyImageToClipboard();
+diff --git a/Source/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.cpp b/Source/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.cpp
+index 455da71..3de4d34 100644
+--- a/Source/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.cpp
++++ b/Source/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.cpp
+@@ -164,6 +164,11 @@ String PlatformStrategiesWinCE::contextMenuItemTagCopyLinkToClipboard()
+ return UI_STRING("Copy Link", "Copy Link context menu item");
+ }
+
++String PlatformStrategiesWinCE::contextMenuItemTagGotoYoutubeLink()
++{
++ return UI_STRING("Open Youtube", "Open Youtube context menu item");
++}
++
+ String PlatformStrategiesWinCE::contextMenuItemTagOpenImageInNewWindow()
+ {
+ return UI_STRING("Open Image in New Window", "Open Image in New Window context menu item");
+diff --git a/Source/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.h b/Source/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.h
+index 6ed49ae..4587ec3 100644
+--- a/Source/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.h
++++ b/Source/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.h
+@@ -63,6 +63,7 @@ private:
+ virtual WTF::String contextMenuItemTagOpenLinkInNewWindow();
+ virtual WTF::String contextMenuItemTagDownloadLinkToDisk();
+ virtual WTF::String contextMenuItemTagCopyLinkToClipboard();
++ virtual WTF::String contextMenuItemTagGotoYoutubeLink();
+ virtual WTF::String contextMenuItemTagOpenImageInNewWindow();
+ virtual WTF::String contextMenuItemTagDownloadImageToDisk();
+ virtual WTF::String contextMenuItemTagCopyImageToClipboard();
+diff --git a/Source/WebKit2/Shared/API/c/WKContextMenuItemTypes.h b/Source/WebKit2/Shared/API/c/WKContextMenuItemTypes.h
+index a3536d9..3150519 100644
+--- a/Source/WebKit2/Shared/API/c/WKContextMenuItemTypes.h
++++ b/Source/WebKit2/Shared/API/c/WKContextMenuItemTypes.h
+@@ -113,6 +113,7 @@ enum {
+ kWKContextMenuItemTagEnterVideoFullscreen,
+ kWKContextMenuItemTagMediaPlayPause,
+ kWKContextMenuItemTagMediaMute,
++ kWKContextMenuItemTagGotoYoutubeLink,
+ kWKContextMenuItemBaseApplicationTag = 10000
+ };
+ typedef uint32_t WKContextMenuItemTag;
+diff --git a/Source/WebKit2/Shared/API/c/WKSharedAPICast.h b/Source/WebKit2/Shared/API/c/WKSharedAPICast.h
+index ac3b420..295df13 100644
+--- a/Source/WebKit2/Shared/API/c/WKSharedAPICast.h
++++ b/Source/WebKit2/Shared/API/c/WKSharedAPICast.h
+@@ -300,6 +300,8 @@ inline WKContextMenuItemTag toAPI(WebCore::ContextMenuAction action)
+ return kWKContextMenuItemTagDownloadLinkToDisk;
+ case WebCore::ContextMenuItemTagCopyLinkToClipboard:
+ return kWKContextMenuItemTagCopyLinkToClipboard;
++ case WebCore::ContextMenuItemTagGotoYoutubeLink:
++ return kWKContextMenuItemTagGotoYoutubeLink;
+ case WebCore::ContextMenuItemTagOpenImageInNewWindow:
+ return kWKContextMenuItemTagOpenImageInNewWindow;
+ case WebCore::ContextMenuItemTagDownloadImageToDisk:
+@@ -478,6 +480,8 @@ inline WebCore::ContextMenuAction toImpl(WKContextMenuItemTag tag)
+ return WebCore::ContextMenuItemTagDownloadLinkToDisk;
+ case kWKContextMenuItemTagCopyLinkToClipboard:
+ return WebCore::ContextMenuItemTagCopyLinkToClipboard;
++ case kWKContextMenuItemTagGotoYoutubeLink:
++ return WebCore::ContextMenuItemTagGotoYoutubeLink;
+ case kWKContextMenuItemTagOpenImageInNewWindow:
+ return WebCore::ContextMenuItemTagOpenImageInNewWindow;
+ case kWKContextMenuItemTagDownloadImageToDisk:
+diff --git a/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp b/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp
+index 85a7c48..a508d37 100644
+--- a/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp
++++ b/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp
+@@ -72,6 +72,8 @@ static WebCore::ContextMenuAction contextMenuActionForWebAction(QWKPage::WebActi
+ return WebCore::ContextMenuItemTagOpenLinkInNewWindow;
+ case QWKPage::CopyLinkToClipboard:
+ return WebCore::ContextMenuItemTagCopyLinkToClipboard;
++ case QWKPage::GotoYoutubeLink:
++ return WebCore::ContextMenuItemTagGotoYoutubeLink;
+ case QWKPage::OpenImageInNewWindow:
+ return WebCore::ContextMenuItemTagOpenImageInNewWindow;
+ case QWKPage::Cut:
+@@ -754,6 +756,9 @@ QAction* QWKPage::action(WebAction action) const
+ case CopyLinkToClipboard:
+ text = contextMenuItemTagCopyLinkToClipboard();
+ break;
++ case GotoYoutubeLink:
++ text = contextMenuItemTagGotoYoutubeLink();
++ break;
+ case OpenImageInNewWindow:
+ text = contextMenuItemTagOpenImageInNewWindow();
+ break;
+diff --git a/Source/WebKit2/UIProcess/API/qt/qwkpage.h b/Source/WebKit2/UIProcess/API/qt/qwkpage.h
+index 5dcfad2..ec024cf 100644
+--- a/Source/WebKit2/UIProcess/API/qt/qwkpage.h
++++ b/Source/WebKit2/UIProcess/API/qt/qwkpage.h
+@@ -45,7 +45,8 @@ public:
+ Paste,
+ SelectAll,
+
+- WebActionCount
++ WebActionCount,
++ GotoYoutubeLink
+ };
+
+ class QWEBKIT_EXPORT ViewportAttributes {
+diff --git a/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp b/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp
+index 1133c2f..e2c75e6 100644
+--- a/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp
++++ b/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp
+@@ -46,6 +46,8 @@ static QWKPage::WebAction webActionForContextMenuAction(WebCore::ContextMenuActi
+ return QWKPage::OpenLinkInNewWindow;
+ case WebCore::ContextMenuItemTagCopyLinkToClipboard:
+ return QWKPage::CopyLinkToClipboard;
++ case WebCore::ContextMenuItemTagGotoYoutubeLink:
++ return QWKPage::GotoYoutubeLink;
+ case WebCore::ContextMenuItemTagOpenImageInNewWindow:
+ return QWKPage::OpenImageInNewWindow;
+ case WebCore::ContextMenuItemTagGoBack: