Skip to content
Open

Hi #1

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ qrc_*.cpp
*.cpp.swp
*.js.swp
src/services/html/htmlservice
*.pro.user
3 changes: 3 additions & 0 deletions .qmake.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
load(qt_build_config)

MODULE_VERSION = 0.0.0
Binary file added How to run&debug with plugin.odt
Binary file not shown.
Binary file added How to run&debug with plugin.pdf
Binary file not shown.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
This is the Qt HTML backend utilizing the Qt Platform Abstraction (QPA).
Compile against Qt5 (Depend on the Qt Service Framework in qtsystems).
Compile against Qt5

[Video Demo](http://www.youtube.com/watch?v=qDyWjNju1yU)

See also: [Gtk+ HTML backend (broadway)](https://www.google.com/search?q=gtk%20html%20backend)

Dependancy on Ubuntu 14.04:
- apt-get install qt5-default qtbase5-private-dev libxrender-dev libfontconfig1-dev libfreetype6-dev libudev-dev libglib2.0-dev

How to build:
- qmake qthtml.pro
- make

Compiled library will be at ./plugins/platforms/libqthtml.so

How to run Qt5 based application with plugin:
- copy plugin to [QT_DIR]/plugins/platforms/
for example for Ubuntu 14.04 QT_DIR is
/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms
- or (if you don't have root rights or don't want to change original qt installation) perform command “export QT_QPA_PLATFORM_PLUGIN_PATH="path_where_plugin_is_located" ” in console where qt5 application will run from
- qt5_app -platform html
- application will be accessible at 127.0.0.1:8080 in any HTML5 capable web browser
6 changes: 6 additions & 0 deletions src/plugins/html/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.pro.user
/.moc/
/.obj/
/.pch/
/.rcc/
/Makefile.html_embed
10 changes: 5 additions & 5 deletions src/services/html/client.html → src/plugins/html/client.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script type="text/javascript" src="client.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<link href="jquery-ui.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery-ui.min.js"></script>
<script type="text/javascript" src="client.js"></script>

<style type="text/css">
body {
Expand Down
6 changes: 5 additions & 1 deletion src/services/html/client.js → src/plugins/html/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function base64Decode(s)
{
s = s.replace(new RegExp('[^' + base64chars.join('') + '=]', 'g'), '');

var p = (s.charAt(s.length - 1) == '=' ? (s.charAt(s.length - 2) == '=' ? 'AA' : 'A') : '');
var p = (s.charAt(s.length - 1) == '=' ? (s.charAt(s.length - 2) == '=' ? 'AA' : 'A') : '');
var r = '';
s = s.substr(0, s.length - p.length) + p;

Expand Down Expand Up @@ -469,6 +469,10 @@ function processMessage(message) {
context.drawImage(context.canvas, x, y, width, height,
x + dx, y + dy, width, height);
break;
case 'D': //debugging
console.log('recieved from plugin - ', args[1]);
//sendMessage('D', [args[1]]);
break;
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/plugins/html/html.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"Keys": [ "html" ]
}
22 changes: 22 additions & 0 deletions src/plugins/html/html.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<RCC>
<qresource prefix="/">
<file>client.html</file>
<file>client.js</file>
<file>jquery-ui.min.js</file>
<file>jquery-ui.css</file>
<file>jquery.min.js</file>
<file>images/ui-bg_flat_0_aaaaaa_40x100.png</file>
<file>images/ui-bg_flat_75_ffffff_40x100.png</file>
<file>images/ui-bg_glass_55_fbf9ee_1x400.png</file>
<file>images/ui-bg_glass_65_ffffff_1x400.png</file>
<file>images/ui-bg_glass_75_dadada_1x400.png</file>
<file>images/ui-bg_glass_75_e6e6e6_1x400.png</file>
<file>images/ui-bg_glass_95_fef1ec_1x400.png</file>
<file>images/ui-bg_highlight-soft_75_cccccc_1x100.png</file>
<file>images/ui-icons_2e83ff_256x240.png</file>
<file>images/ui-icons_222222_256x240.png</file>
<file>images/ui-icons_454545_256x240.png</file>
<file>images/ui-icons_888888_256x240.png</file>
<file>images/ui-icons_cd0a0a_256x240.png</file>
</qresource>
</RCC>
58 changes: 58 additions & 0 deletions src/plugins/html/html_embed.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
TARGET = qhtml
#DEFINES += QT_FONTS_ARE_RESOURCES

PLUGIN_TYPE = platforms
PLUGIN_CLASS_NAME = QHtmlIntegrationPlugin
load(qt_plugin)

QT += core-private gui-private network

lessThan(QT_MAJOR_VERSION, 5) {
QT += platformsupport-private
} else {
equals(QT_MAJOR_VERSION, 5): lessThan(QT_MINOR_VERSION, 8): {
QT += platformsupport-private
} else {
QT += fontdatabase_support_private eventdispatcher_support_private
}
}

CONFIG += qpa/genericunixfontdatabase #fonts support

#DEFINES += \
# QT_NO_CAST_FROM_BYTEARRAY \
# QT_NO_CAST_FROM_ASCII \
# QT_NO_CAST_TO_ASCII

HEADERS = \
qhtmlintegration.h \
qhtmlscreen.h \
qhtmlcursor.h \
qhtmlwindow.h \
qhtmlbackingstore.h \
qhtmlservice.h


SOURCES = \
main.cpp \
qhtmlintegration.cpp \
qhtmlscreen.cpp \
qhtmlcursor.cpp \
qhtmlwindow.cpp \
qhtmlbackingstore.cpp \
qhtmlservice.cpp


#DESTDIR = $$QT.gui.plugins/platforms
#target.path += $$[QT_INSTALL_PLUGINS]/platforms
#INSTALLS += target

OTHER_FILES += \
client.js \
client.html \
jquery.min.js \
jquery-ui.min.js \
jquery-ui.css

RESOURCES += \
html.qrc
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading