[Spice-commits] 5 commits - data/Makefile.am data/test.html generator/generator.cpp generator/Makefile.am generator/options.cpp generator/options.h Makefile.am
Peter Hatina
phatina at kemper.freedesktop.org
Wed Jul 11 00:28:44 PDT 2012
Makefile.am | 3
data/Makefile.am | 10 +
data/test.html | 308 ------------------------------------------------
generator/Makefile.am | 2
generator/generator.cpp | 3
generator/options.cpp | 8 -
generator/options.h | 1
7 files changed, 19 insertions(+), 316 deletions(-)
New commits:
commit 858796a39805ef8075cd8bebf5dc85ec4b3d0cdf
Author: Peter Hatina <phatina at redhat.com>
Date: Tue Jul 10 15:03:25 2012 +0200
remove data/test.html
Spice-xpi test page is autogenerated by spice-xpi-generator.
diff --git a/data/test.html b/data/test.html
deleted file mode 100644
index 675d2e6..0000000
--- a/data/test.html
+++ /dev/null
@@ -1,308 +0,0 @@
-<html>
-<head>
-<title>Spice-XPI test page</title>
-<style type="text/css">
-
- caption {
- text-align: left;
- font-weight: bold;
- }
-
- th {
- text-align: left;
- }
-
-</style>
-</head>
-<body onload='bodyLoad()' onunload='bodyUnload()'>
-
-<center>
-<h1>SPICE xpi test page</h1>
-</center>
-
-SPICE xpi test page. Disabled (greyed out) values are passed to SPICE xpi as empty variables, asterisk-marked ones are passed when you press button marked in the same fashion.
-<br />
-
-<center>
-
-<embed type="application/x-spice" width="0" height="0" id="spice-xpi" /><br />
-
-<script type="text/javascript">
-
-var embed = document.getElementById("spice-xpi");
-
-function bodyLoad()
-{
- log("BodyLoad");
-}
-
-function bodyUnload()
-{
- log("BodyUnload");
-}
-
-function connect()
-{
- setConnectVars();
- log("connect: host '" + embed.hostIP + "', port '" + embed.port + "', secure port '" + embed.SecurePort + "', USB port '" + embed.UsbListenPort + "'");
- embed.connect();
-}
-
-function disconnect()
-{
- embed.disconnect();
- log("disconnected by page");
-}
-
-/* FIXME
-function OnDisconnected(msg)
-{
- log(msg);
-}
-*/
-
-function log(message)
-{
- var log = document.getElementById("log");
- var ts = new Date().toString() + ": ";
- var newRow = document.createElement("tr");
- var tsCell = document.createElement("td");
- var msgCell = document.createElement("td");
-
- tsCell.innerHTML = ts;
- msgCell.innerHTML = message;
-
- newRow.appendChild(tsCell);
- newRow.appendChild(msgCell);
- log.appendChild(newRow);
-}
-
-function setLanguageStrings()
-{
- section = document.getElementById("LanguageStringsSectionToggled").checked == true ? document.getElementById("LanguageStringsSection").value : "";
- lang = document.getElementById("LanguageStringsLangToggled").checked == true ? document.getElementById("LanguageStringsLang").value : "";
- embed.SetLanguageStrings(section, lang)
- log("Language Strings were set to '" + section + "' '" + lang + "'");
-}
-
-function setUsbFilter()
-{
- filter = document.getElementById("UsbFilterToggled").checked == true ? document.getElementById("UsbFilter").value : "";
- embed.SetUsbFilter(filter);
- log("USB Filter String was set to: '" + filter + "'");
-}
-
-function setConnectVars()
-{
- if(document.getElementById("hostIPToggled").checked == true) { embed.hostIP = document.getElementById("hostIP").value; } else { embed.hostIP = ""; }
- if(document.getElementById("portToggled").checked == true) { embed.port = document.getElementById("port").value; } else { embed.port = ""; }
- if(document.getElementById("SecurePortToggled").checked == true) { embed.SecurePort = document.getElementById("SecurePort").value; } else { embed.SecurePort = ""; }
- if(document.getElementById("PasswordToggled").checked == true) { embed.Password = document.getElementById("Password").value; } else { embed.Password = ""; }
- if(document.getElementById("CipherSuiteToggled").checked == true) { embed.CipherSuite = document.getElementById("CipherSuite").value; } else { embed.CipherSuite = ""; }
- if(document.getElementById("SSLChannelsToggled").checked == true) { embed.SSLChannels = document.getElementById("SSLChannels").value; } else { embed.SSLChannels = ""; }
- if(document.getElementById("TrustStoreToggled").checked == true) { embed.TrustStore = document.getElementById("TrustStore").value; } else { embed.TrustStore = ""; }
- if(document.getElementById("HostSubjectToggled").checked == true) { embed.HostSubject = document.getElementById("HostSubject").value; } else { embed.HostSubject = ""; }
- if(document.getElementById("fullScreenToggled").checked == true) { embed.fullScreen = document.getElementById("fullScreen").checked; } else { embed.fullScreen = ""; }
- if(document.getElementById("AdminConsoleToggled").checked == true) { embed.AdminConsole = document.getElementById("AdminConsole").checked; } else { embed.AdminConsole = ""; }
- if(document.getElementById("TitleToggled").checked == true) { embed.Title = document.getElementById("Title").value; } else { embed.Title = ""; }
- if(document.getElementById("dynamicMenuToggled").checked == true) { embed.dynamicMenu = document.getElementById("dynamicMenu").value; } else { embed.dynamicMenu = ""; }
- if(document.getElementById("NumberOfMonitorsToggled").checked == true) { embed.NumberOfMonitors = document.getElementById("NumberOfMonitors").value; } else { embed.NumberOfMonitors = ""; }
- if(document.getElementById("GuestHostNameToggled").checked == true) { embed.GuestHostName = document.getElementById("GuestHostName").value; } else { embed.GuestHostName = ""; }
- if(document.getElementById("HotKeyToggled").checked == true) { embed.HotKey = document.getElementById("HotKey").value; } else { embed.HotKey = ""; }
- if(document.getElementById("NoTaskMgrExecutionToggled").checked == true) { embed.NoTaskMgrExecution = document.getElementById("NoTaskMgrExecution").checked; } else { embed.NoTaskMgrExecution = ""; }
- if(document.getElementById("SendCtrlAltdeleteToggled").checked == true) { embed.SendCtrlAltdelete = document.getElementById("SendCtrlAltdelete").checked; } else { embed.SendCtrlAltDelete = ""; }
- if(document.getElementById("UsbListenPortToggled").checked == true) { embed.UsbListenPort = parseInt( document.getElementById("UsbListenPort").value ); } else { embed.UsbListenPort = ""; }
- if(document.getElementById("UsbAutoShareToggled").checked == true) { embed.UsbAutoShare = document.getElementById("UsbAutoShare").checked; } else { embed.UsbAutoShare = ""; }
- if(document.getElementById("SmartcardToggled").checked == true) { embed.Smartcard = document.getElementById("Smartcard").checked; } else { embed.Smartcard = ""; }
- if(document.getElementById("ColorDepthToggled").checked == true) { embed.ColorDepth = document.getElementById("ColorDepth").value; } else { embed.ColorDepth = ""; }
- if(document.getElementById("DisableEffectsToggled").checked == true) { embed.DisableEffects = document.getElementById("DisableEffects").value; } else { embed.DisableEffects = ""; }
- setUsbFilter()
-}
-
-function show()
-{
- embed.show();
- log("Show was called");
-}
-
-function status()
-{
- var status = embed.ConnectedStatus();
- log("ConnectedStatus = " + status);
-}
-
-function toggle(checkboxID)
-{
- var checkbox = document.getElementById(checkboxID);
- for (var i = 1; i < arguments.length; i++)
- {
- var toggle = document.getElementById(arguments[i]);
- var updateToggle = checkbox.checked ? toggle.disabled = false : toggle.disabled = true;
- }
-}
-
-</script>
-
-
-<table id="values">
-<tr>
-
-<td>
-<table>
-<tr>
-<td><input type="checkbox" id="hostIPToggled" onclick="toggle('hostIPToggled', 'hostIP')" checked /></td>
-<td>Host:</td>
-<td> <input id="hostIP" type="text" size="30" /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="portToggled" onclick="toggle('portToggled', 'port')" checked /></td>
-<td>Port:</td>
-<td> <input id="port" type="text" size="30" /> </td>
-</tr>
-<tr>
-<td><input type="checkbox" id="SecurePortToggled" onclick="toggle('SecurePortToggled', 'SecurePort')" /></td>
-<td>SecurePort:</td>
-<td> <input id="SecurePort" type="text" size="30" disabled /> </td>
-</tr>
-<tr>
-<td><input type="checkbox" id="PasswordToggled" onclick="toggle('PasswordToggled', 'Password')" /></td>
-<td>Password:</td>
-<td> <input id="Password" type="text" size="30" disabled /><br />
-</tr>
-<tr>
-<td><input type="checkbox" id="CipherSuiteToggled" onclick="toggle('CipherSuiteToggled', 'CipherSuite')" /></td>
-<td>Cipher Suite:</td>
-<td> <input id="CipherSuite" type="text" size="30" disabled /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="SSLChannelsToggled" onclick="toggle('SSLChannelsToggled', 'SSLChannels')" /></td>
-<td>Secure Channels:</td>
-<td> <input id="SSLChannels" type="text" size="30" disabled /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="HostSubjectToggled" onclick="toggle('HostSubjectToggled', 'HostSubject')" /></td>
-<td>Host Subject:</td>
-<td> <input id="HostSubject" type="text" size="30" disabled /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="fullScreenToggled" onclick="toggle('fullScreenToggled', 'fullScreen')" /></td>
-<td>Full Screen:</td>
-<td> <input id="fullScreen" type="checkbox" disabled /> </td>
-</tr>
-<tr>
-<td><input type="checkbox" id="AdminConsoleToggled" onclick="toggle('AdminConsoleToggled', 'AdminConsole')" checked /></td>
-<td>AdminConsole:</td>
-<td> <input id="AdminConsole" type="checkbox" checked /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="TitleToggled" onclick="toggle('TitleToggled', 'Title')" /></td>
-<td>Title:</td>
-<td> <input id="Title" type="text" size="30" disabled /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="dynamicMenuToggled" onclick="toggle('dynamicMenuToggled', 'dynamicMenu')" /></td>
-<td>Dynamic Menu:</td>
-<td> <input id="dynamicMenu" type="text" size="30" disabled /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="NumberOfMonitorsToggled" onclick="toggle('NumberOfMonitorsToggled', 'NumberOfMonitors')" /></td>
-<td>Number of Monitors:</td>
-<td> <input id="NumberOfMonitors" type="text" size="30" disabled /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="GuestHostNameToggled" onclick="toggle('GuestHostNameToggled', 'GuestHostName')" /></td>
-<td>GuestHostName:</td>
-<td> <input id="GuestHostName" type="text" size="30" disabled /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="HotKeyToggled" onclick="toggle('HotKeyToggled', 'HotKey')" checked /></td>
-<td>Hot Key:</td>
-<td> <input id="HotKey" type="text" size="30" value="toggle-fullscreen=shift+f11,release-cursor=shift+f12,smartcard-insert=shift+f8,smartcard-remove=shift+f9" /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="NoTaskMgrExecutionToggled" onclick="toggle('NoTaskMgrExecutionToggled', 'NoTaskMgrExecution')" /></td>
-<td title="Suppress launching of task manager when Ctrl+Alt+Del is pressed">NoTaskMgrExecution:</td>
-<td> <input id="NoTaskMgrExecution" type="checkbox" disabled /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="SendCtrlAltdeleteToggled" onclick="toggle('SendCtrlAltdeleteToggled', 'SendCtrlAltdelete')" /></td>
-<td>Send Ctrl+Alt+Delete:</td>
-<td> <input id="SendCtrlAltdelete" type="checkbox" disabled /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="UsbListenPortToggled" onclick="toggle('UsbListenPortToggled', 'UsbListenPort')" /></td>
-<td>USB listen port:</td>
-<td> <input id="UsbListenPort" type="text" size="30" value="32023" disabled /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="UsbAutoShareToggled" onclick="toggle('UsbAutoShareToggled', 'UsbAutoShare')" /></td>
-<td>USB Auto Share:</td>
-<td> <input id="UsbAutoShare" type="checkbox" disabled /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="SmartcardToggled" onclick="toggle('SmartcardToggled', 'Smartcard')" checked /></td>
-<td>Smartcard:</td>
-<td> <input id="Smartcard" type="checkbox" /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="ColorDepthToggled" onclick="toggle('ColorDepthToggled', 'ColorDepth')" /></td>
-<td>Color Depth:</td>
-<td> <input id="ColorDepth" type="text" size="30" disabled /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="DisableEffectsToggled" onclick="toggle('DisableEffectsToggled', 'DisableEffects')" /></td>
-<td>Disable Effects:</td>
-<td> <input id="DisableEffects" type="text" size="30" disabled /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="LanguageStringsSectionToggled" onclick="toggle('LanguageStringsSectionToggled', 'LanguageStringsSection')" checked /></td>
-<td>*Language Strings - section:</td>
-<td> <input id="LanguageStringsSection" type="input" size="30" /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="LanguageStringsLangToggled" onclick="toggle('LanguageStringsLangToggled', 'LanguageStringsLang')" checked /></td>
-<td>*Language Strings - lang:</td>
-<td> <input id="LanguageStringsLang" type="input" size="30" /></td>
-</tr>
-<tr>
-<td><input type="checkbox" id="UsbFilterToggled" onclick="toggle('UsbFilterToggled', 'UsbFilter')" checked /></td>
-<td>**Set USB Filter:</td>
-<td><input id="UsbFilter" type="text" size="30" /></td>
-</tr>
-</table>
-</td>
-
-<td rowspan="21" width="25px" > </td>
-
-<td>
-<table>
-<td>
-<tr>
-<td><input type="checkbox" id="TrustStoreToggled" onclick="toggle('TrustStoreToggled', 'TrustStore')" /></td>
-<td title="CA Certificate in plain text. For RHEV-M, it can be found in 'http://rhev-m.example.com/ca.crt'">Trust Store:</td>
-</tr>
-<tr><td colspan="2"><textarea id="TrustStore" cols="66" rows="33" disabled ></textarea></td></tr>
-</table>
-</td>
-
-</tr>
-</table>
-
-<input type="button" value="Connect" onclick='connect()' />
-<input type="button" value="Check Status" onclick='status()' />
-<input type="button" value="Show" onclick='show()' />
-<input type="button" value="*Set Language Strings" onclick='setLanguageStrings()' id="LanguageStringsButton" />
-<input type="button" value="**Set Usb Filter" onclick='setUsbFilter()' id="UsbFilterButton" />
-<input type="button" value="Disconnect" onclick='disconnect()' />
-
-</center>
-
-<hr />
-<table style="border: 1px; border-color: black; " >
-<caption >log:</caption>
-<thead><tr><th style="width: 22em; ">timestamp</th><th>message</th></tr></thead>
-<tbody style="font-family: monospace; " id="log">
-</tbody>
-</table>
-</body>
-</html>
commit 66ef0edf0d8aeb5b4be3f623acf0bc61f0d5faa1
Author: Peter Hatina <phatina at redhat.com>
Date: Tue Jul 10 14:24:49 2012 +0200
generator, fix Makefile.am's to build test.html
diff --git a/Makefile.am b/Makefile.am
index db8e4ea..e154048 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,9 +1,10 @@
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = SpiceXPI data
+SUBDIRS = SpiceXPI
if BUILD_GENERATOR
SUBDIRS += generator
endif
+SUBDIRS += data
DIST_SUBDIRS = spice-protocol $(SUBDIRS)
EXTRA_DIST = m4
diff --git a/data/Makefile.am b/data/Makefile.am
index b47e0c0..1ad42b4 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,3 +1,9 @@
-NULL =
+if BUILD_GENERATOR
+TEST_PAGE = test.html
+IDL = $(top_srcdir)/SpiceXPI/src/plugin/nsISpicec.idl
+GENERATOR = $(top_builddir)/generator/spice-xpi-generator
+dist_pkgdata_DATA = $(TEST_PAGE)
-EXTRA_DIST = test.html
+$(TEST_PAGE): $(IDL)
+ $(AM_V_GEN)$(GENERATOR) -i $< -o $@
+endif
commit 69bf4826c785233f53d6db49cff866c6a1cfd1f1
Author: Peter Hatina <phatina at redhat.com>
Date: Tue Jul 10 13:44:52 2012 +0200
generator, add info about generated page
diff --git a/generator/generator.cpp b/generator/generator.cpp
index fce228c..ee3eedd 100644
--- a/generator/generator.cpp
+++ b/generator/generator.cpp
@@ -82,7 +82,8 @@ void Generator::generateHeader()
<< "<body onload=\"bodyLoad()\" onunload=\"bodyUnload()\">\n\n"
<< "<center>\n"
<< "<h1>SPICE xpi test page (generated)</h1>\n"
- << "SPICE xpi test page. Disabled (greyed out) values are passed\n"
+ << "This page was autogenerated using IDL description and should not be modified by hand.<br>\n"
+ << "Disabled (greyed out) values are passed\n"
<< "to SPICE xpi as empty variables.\n</center>\n<br/>\n\n"
<< "<embed type=\"application/x-spice\" width=\"0\" height=\"0\" id=\"spice-xpi\"/><br/>\n\n"
<< "<script type=\"text/javascript\">\n\n"
commit 9269678cbc7ed59f87375a7660624cedb472820e
Author: Peter Hatina <phatina at redhat.com>
Date: Tue Jul 10 13:33:44 2012 +0200
generator, fix binary name
diff --git a/generator/Makefile.am b/generator/Makefile.am
index b6a01f2..ce7f42c 100644
--- a/generator/Makefile.am
+++ b/generator/Makefile.am
@@ -1,4 +1,4 @@
-bin_PROGRAMS = spice_xpi_generator
+bin_PROGRAMS = spice-xpi-generator
spice_xpi_generator_SOURCES = \
generator.cpp \
main.cpp \
diff --git a/generator/options.cpp b/generator/options.cpp
index 723ca7e..67acb87 100644
--- a/generator/options.cpp
+++ b/generator/options.cpp
@@ -16,6 +16,7 @@
* ***** END LICENSE BLOCK ***** */
#include <iostream>
+#include <cstring>
extern "C" {
# include <getopt.h>
}
@@ -25,7 +26,8 @@ Options::Options(int argc, char **argv):
m_help(false),
m_good(true),
m_input_filename(),
- m_output_filename()
+ m_output_filename(),
+ m_bin_name(argv && argv[0] ? basename(argv[0]) : "spice-xpi-generator")
{
static struct option longopts[] = {
{ "input", required_argument, NULL, 'i' },
@@ -60,7 +62,7 @@ Options::~Options()
void Options::printHelp() const
{
std::cout << "Spice-xpi test page generator\n\n"
- << "Usage: ./generator [-h] [-i input] [-o output]\n\n"
+ << "Usage: " << m_bin_name << " [-h] [-i input] [-o output]\n\n"
<< "Application options:\n"
<< " -i, --input input filename (stdin used, if not specified)\n"
<< " -o, --output output filename (stdout used, if not specified)\n"
diff --git a/generator/options.h b/generator/options.h
index 7c990e5..dfac369 100644
--- a/generator/options.h
+++ b/generator/options.h
@@ -37,6 +37,7 @@ private:
bool m_good;
std::string m_input_filename;
std::string m_output_filename;
+ const std::string m_bin_name;
};
#endif // OPTIONS_H
commit 9ea57d02e5d17446d8f5e8813d9d6af7956351fb
Author: Peter Hatina <phatina at redhat.com>
Date: Tue Jul 10 13:22:50 2012 +0200
generator, fix --help option
diff --git a/generator/options.cpp b/generator/options.cpp
index 86ea867..723ca7e 100644
--- a/generator/options.cpp
+++ b/generator/options.cpp
@@ -30,7 +30,7 @@ Options::Options(int argc, char **argv):
static struct option longopts[] = {
{ "input", required_argument, NULL, 'i' },
{ "output", required_argument, NULL, 'o' },
- { "help", required_argument, NULL, 'h' },
+ { "help", no_argument, NULL, 'h' },
{ NULL, 0, NULL, 0 }
};
More information about the Spice-commits
mailing list