Initial GTK version of GridProxy

This commit is contained in:
Latif Khalifa
2013-12-01 15:05:43 +01:00
parent 9b8c017ab9
commit e78a1908e5
14 changed files with 1916 additions and 28 deletions

View File

@@ -0,0 +1,87 @@
using System;
using System.Collections.Generic;
using Gtk;
using GridProxyGUI;
namespace GridProxyGUI
{
public class UDPFilterItem
{
public bool Enabled;
public string Name;
}
public class FilterScroller : ScrolledWindow
{
ListStore store;
public FilterScroller(Container parent, ListStore store)
{
this.store = store;
TreeView tvFilterUDP = new TreeView();
TreeViewColumn cbCol = new TreeViewColumn();
TreeViewColumn udpCol = new TreeViewColumn();
CellRendererToggle cbCell = new CellRendererToggle();
cbCell.Toggled += new ToggledHandler(cbCell_Toggled);
cbCell.Activatable = true;
cbCol.PackStart(cbCell, true);
cbCol.SetCellDataFunc(cbCell, renderToggleCell);
tvFilterUDP.AppendColumn(cbCol);
CellRendererText cell = new CellRendererText();
udpCol.PackStart(cell, true);
udpCol.SetCellDataFunc(cell, renderTextCell);
tvFilterUDP.AppendColumn(udpCol);
tvFilterUDP.Model = store;
tvFilterUDP.HeadersVisible = false;
tvFilterUDP.Selection.Mode = SelectionMode.Single;
foreach (var child in new List<Widget>(parent.Children))
{
parent.Remove(child);
}
Add(tvFilterUDP);
ShadowType = ShadowType.EtchedIn;
parent.Add(this);
parent.ShowAll();
}
void cbCell_Toggled(object o, ToggledArgs args)
{
TreeIter iter;
if (store.GetIterFromString(out iter, args.Path))
{
UDPFilterItem item = store.GetValue(iter, 0) as UDPFilterItem;
if (null != item)
{
item.Enabled = !item.Enabled;
store.SetValue(iter, 0, item);
}
}
}
void renderTextCell(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
{
var item = model.GetValue(iter, 0) as UDPFilterItem;
if (item != null)
{
((CellRendererText)cell).Text = item.Name;
}
}
void renderToggleCell(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
{
var item = model.GetValue(iter, 0) as UDPFilterItem;
if (item != null)
{
((CellRendererToggle)cell).Active = item.Enabled;
}
}
}
}

View File

@@ -0,0 +1,184 @@
using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using Gtk;
using GridProxyGUI;
using WinGridProxy;
using OpenMetaverse.Packets;
public partial class MainWindow : Gtk.Window
{
ProxyManager proxy = null;
ConcurrentDictionary<string, UDPFilterItem> UDPFilterItems = new ConcurrentDictionary<string, UDPFilterItem>();
ConcurrentDictionary<string, UDPFilterItem> CapFilterItems = new ConcurrentDictionary<string, UDPFilterItem>();
ListStore udpStore, capStore;
FilterScroller capScroller;
public MainWindow()
: base(Gtk.WindowType.Toplevel)
{
Build();
SetIconFromFile("libomv.png");
tabsMain.Page = 1;
mainSplit.Position = 600;
txtSummary.ModifyFont(Pango.FontDescription.FromString("monospace bold 9"));
ProxyLogger.Init();
ProxyManager.OnCapabilityAdded += new ProxyManager.CapsAddedHandler(ProxyManager_OnCapabilityAdded);
ProxyManager.OnEventMessageLog += new ProxyManager.EventQueueMessageHandler(ProxyManager_OnEventMessageLog);
ProxyManager.OnMessageLog += new ProxyManager.MessageLogHandler(ProxyManager_OnMessageLog);
}
void ProxyManager_OnCapabilityAdded(GridProxy.CapInfo cap)
{
Application.Invoke((sender, e) =>
{
if (null == capStore)
{
capStore = new ListStore(typeof(UDPFilterItem));
}
if (!CapFilterItems.ContainsKey(cap.CapType))
{
UDPFilterItem item = new UDPFilterItem() { Enabled = true, Name = cap.CapType };
CapFilterItems[item.Name] = item;
capStore.AppendValues(item);
}
if (null == capScroller)
{
capScroller = new FilterScroller(containerFilterCap, capStore);
}
});
}
void ProxyManager_OnEventMessageLog(GridProxy.CapsRequest req, GridProxy.CapsStage stage)
{
Application.Invoke((sender, e) =>
{
if (null == capStore)
{
capStore = new ListStore(typeof(UDPFilterItem));
}
if (!CapFilterItems.ContainsKey(req.Info.CapType))
{
UDPFilterItem item = new UDPFilterItem() { Enabled = true, Name = req.Info.CapType };
CapFilterItems[item.Name] = item;
capStore.AppendValues(item);
}
else
{
ProxyManager_OnMessageLog(req, GridProxy.CapsStage.Response);
}
if (null == capScroller)
{
capScroller = new FilterScroller(containerFilterCap, capStore);
}
});
}
void ProxyManager_OnMessageLog(GridProxy.CapsRequest req, GridProxy.CapsStage stage)
{
}
void Logger_OnLogLine(object sender, LogEventArgs e)
{
Gtk.Application.Invoke((sx, ex) =>
{
AppendLog(e.Message);
});
}
void AppendLog(string msg)
{
var end = txtSummary.Buffer.EndIter;
txtSummary.Buffer.Insert(ref end, msg);
}
protected void StartPoxy()
{
AppendLog("Starting proxy..." + Environment.NewLine);
ProxyLogger.OnLogLine += new ProxyLogger.Log(Logger_OnLogLine);
proxy = new ProxyManager(txtPort.Text, cbListen.ActiveText, cbLoginURL.ActiveText);
proxy.Start();
}
protected void StopProxy()
{
AppendLog("Proxy stopped" + Environment.NewLine);
ProxyLogger.OnLogLine -= new ProxyLogger.Log(Logger_OnLogLine);
if (proxy != null) proxy.Stop();
proxy = null;
foreach (var child in new List<Widget>(containerFilterUDP.Children))
{
containerFilterUDP.Remove(child);
}
}
protected void OnDeleteEvent(object sender, DeleteEventArgs a)
{
StopProxy();
Application.Quit();
a.RetVal = true;
}
protected void OnExitActionActivated(object sender, EventArgs e)
{
StopProxy();
Application.Quit();
}
protected void OnBtnStartClicked(object sender, EventArgs e)
{
if (btnStart.Label.StartsWith("Start"))
{
btnStart.Label = "Stop Proxy";
StartPoxy();
InitProxyFilters();
}
else if (btnStart.Label.StartsWith("Stop"))
{
btnStart.Label = "Start Proxy";
StopProxy();
}
}
void InitUDPFilters()
{
if (UDPFilterItems.Count > 0) return;
UDPFilterItems["Login Request"] = new UDPFilterItem() { Enabled = false, Name = "Login Request" };
UDPFilterItems["Login Response"] = new UDPFilterItem() { Enabled = true, Name = "Login Response" };
foreach (string name in Enum.GetNames(typeof(PacketType)))
{
if (!string.IsNullOrEmpty(name))
{
UDPFilterItems[name] = new UDPFilterItem() { Enabled = false, Name = name };
}
}
}
void InitProxyFilters()
{
InitUDPFilters();
udpStore = new ListStore(typeof(UDPFilterItem));
List<string> keys = new List<string>(UDPFilterItems.Keys);
keys.Sort((a, b) => { return string.Compare(a.ToLower(), b.ToLower()); });
udpStore.AppendValues(UDPFilterItems["Login Request"]);
udpStore.AppendValues(UDPFilterItems["Login Response"]);
foreach (var key in keys)
{
if (key == "Login Request" || key == "Login Response") continue;
udpStore.AppendValues(UDPFilterItems[key]);
}
new FilterScroller(containerFilterUDP, udpStore);
}
}

View File

@@ -0,0 +1,16 @@
using System;
using Gtk;
namespace GridProxyGUI
{
class MainClass
{
public static void Main(string[] args)
{
Application.Init();
MainWindow win = new MainWindow();
win.Show();
Application.Run();
}
}
}

View File

@@ -0,0 +1,23 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle ("GridProxyGUI")]
[assembly: AssemblyDescription("GTK Based GUI for Grid Proxy")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany("Open Metaverse Foundation")]
[assembly: AssemblyProduct("Grid Proxy GUI")]
[assembly: AssemblyCopyright("Latif Khalifa")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion ("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
[assembly: AssemblyFileVersionAttribute("1.0")]

View File

@@ -0,0 +1,42 @@
using System;
using log4net;
using log4net.Appender;
using log4net.Core;
using log4net.Config;
using log4net.Layout;
namespace GridProxyGUI
{
public class ProxyLogger : AppenderSkeleton
{
public delegate void Log(object sender, LogEventArgs e);
public static event Log OnLogLine;
public static void Init()
{
var appender = new ProxyLogger();
appender.Layout = new PatternLayout("%timestamp %-5level %message%newline");
// appender.AddFilter(new log4net.Filter.LoggerMatchFilter() { LoggerToMatch = "OpenMetaverse" });
BasicConfigurator.Configure(appender);
}
protected override void Append(LoggingEvent le)
{
if (OnLogLine != null && le.Level != Level.Debug)
{
OnLogLine(this, new LogEventArgs(string.Format("{0} [{1}] {2}\n", le.TimeStamp, le.Level, le.MessageObject)));
}
}
}
public class LogEventArgs : EventArgs
{
public string Message { get; set; }
public LogEventArgs(string msg)
{
this.Message = msg;
}
}
}

View File

@@ -0,0 +1,510 @@
/*
* Copyright (c) 2009, openmetaverse.org
* All rights reserved.
*
* - Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - Neither the name of the openmetaverse.org nor the names
* of its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Net;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Reflection;
using GridProxy;
using Nwc.XmlRpc;
using OpenMetaverse.Packets;
using OpenMetaverse.StructuredData;
using OpenMetaverse;
namespace WinGridProxy
{
public class ProxyManager
{
// fired when a new packet arrives
public delegate void PacketLogHandler(Packet packet, Direction direction, IPEndPoint endpoint);
public static event PacketLogHandler OnPacketLog;
// fired when a message arrives over a known capability
public delegate void MessageLogHandler(CapsRequest req, CapsStage stage);
public static event MessageLogHandler OnMessageLog;
// handle login request/response data
public delegate void LoginLogHandler(object request, Direction direction);
public static event LoginLogHandler OnLoginResponse;
// fired when a new Capability is added to the KnownCaps Dictionary
public delegate void CapsAddedHandler(CapInfo cap);
public static event CapsAddedHandler OnCapabilityAdded;
// Handle messages sent via the EventQueue
public delegate void EventQueueMessageHandler(CapsRequest req, CapsStage stage);
public static event EventQueueMessageHandler OnEventMessageLog;
private string _Port;
private string _ListenIP;
private string _LoginURI;
public ProxyFrame Proxy;
private Assembly openmvAssembly;
public ProxyManager(string port, string listenIP, string loginUri)
{
openmvAssembly = Assembly.Load("OpenMetaverse");
if (openmvAssembly == null) throw new Exception("Assembly load exception");
_Port = string.Format("--proxy-login-port={0}", port);
IPAddress remoteIP; // not used
if (IPAddress.TryParse(listenIP, out remoteIP))
_ListenIP = String.Format("--proxy-client-facing-address={0}", listenIP);
else
_ListenIP = "--proxy-client-facing-address=127.0.0.1";
if (String.IsNullOrEmpty(loginUri))
_LoginURI = "--proxy-remote-login-uri=https://login.agni.lindenlab.com/cgi-bin/login.cgi";
else
_LoginURI = "--proxy-remote-login-uri=" + loginUri;
string[] args = { _Port, _ListenIP, _LoginURI };
/*
help
proxy-help
proxy-login-port
proxy-client-facing-address
proxy-remote-facing-address
proxy-remote-login-uri
verbose
quiet
*/
ProxyConfig pc = new ProxyConfig("WinGridProxy", "Jim Radford", args);
Proxy = new ProxyFrame(args, pc);
Proxy.proxy.AddLoginRequestDelegate(new XmlRpcRequestDelegate(LoginRequest));
Proxy.proxy.AddLoginResponseDelegate(new XmlRpcResponseDelegate(LoginResponse));
Proxy.proxy.AddCapsDelegate("EventQueueGet", new CapsDelegate(EventQueueGetHandler));
// this is so we are informed of any new capabilities that are added to the KnownCaps dictionary
Proxy.proxy.KnownCaps.AddDelegate(OpenMetaverse.DictionaryEventAction.Add, new OpenMetaverse.DictionaryChangeCallback(KnownCapsAddedHandler));
}
public void Start()
{
Proxy.proxy.Start();
}
public void Stop()
{
Proxy.proxy.Stop();
}
public void KnownCapsAddedHandler(OpenMetaverse.DictionaryEventAction action, System.Collections.DictionaryEntry de)
{
if (OnCapabilityAdded != null)
OnCapabilityAdded((CapInfo)de.Value);
}
private void LoginRequest(object sender, XmlRpcRequestEventArgs e)
{
if (OnLoginResponse != null)
OnLoginResponse(e.m_Request, Direction.Outgoing);
}
private void LoginResponse(XmlRpcResponse response)
{
if (OnLoginResponse != null)
OnLoginResponse(response, Direction.Incoming);
}
internal OpenMetaverse.ObservableDictionary<string, CapInfo> GetCapabilities()
{
return Proxy.proxy.KnownCaps;
}
internal void AddCapsDelegate(string capsKey, bool add)
{
if (add)
Proxy.proxy.AddCapsDelegate(capsKey, new CapsDelegate(CapsHandler));
else
Proxy.proxy.RemoveCapRequestDelegate(capsKey, new CapsDelegate(CapsHandler));
}
private bool CapsHandler(CapsRequest req, CapsStage stage)
{
if (OnMessageLog != null)
OnMessageLog(req, stage);
return false;
}
/// <summary>
/// Process individual messages that arrive via the EventQueue and convert each indvidual event into a format
/// suitable for processing by the IMessage system
/// </summary>
/// <param name="req"></param>
/// <param name="stage"></param>
/// <returns></returns>
private bool EventQueueGetHandler(CapsRequest req, CapsStage stage)
{
if (stage == CapsStage.Response && req.Response is OSDMap)
{
OSDMap map = (OSDMap)req.Response;
if (map.ContainsKey("events"))
{
OSDArray eventsArray = (OSDArray)map["events"];
for (int i = 0; i < eventsArray.Count; i++)
{
OSDMap bodyMap = (OSDMap)eventsArray[i];
if (OnEventMessageLog != null)
{
CapInfo capInfo = new CapInfo(req.Info.URI, req.Info.Sim, bodyMap["message"].AsString());
CapsRequest capReq = new CapsRequest(capInfo);
capReq.RequestHeaders = req.RequestHeaders;
capReq.ResponseHeaders = req.ResponseHeaders;
capReq.Request = null;// req.Request;
capReq.RawRequest = null;// req.RawRequest;
capReq.RawResponse = OSDParser.SerializeLLSDXmlBytes(bodyMap);
capReq.Response = bodyMap;
OnEventMessageLog(capReq, CapsStage.Response);
}
}
}
}
return false;
}
internal void AddUDPDelegate(PacketType packetType, bool add)
{
if (add)
{
Proxy.proxy.AddDelegate(packetType, Direction.Incoming, new PacketDelegate(PacketInHandler));
Proxy.proxy.AddDelegate(packetType, Direction.Outgoing, new PacketDelegate(PacketOutHandler));
}
else
{
Proxy.proxy.RemoveDelegate(packetType, Direction.Incoming, new PacketDelegate(PacketInHandler));
Proxy.proxy.RemoveDelegate(packetType, Direction.Outgoing, new PacketDelegate(PacketOutHandler));
}
}
private Packet PacketInHandler(Packet packet, IPEndPoint endPoint)
{
if (OnPacketLog != null)
OnPacketLog(packet, Direction.Incoming, endPoint);
return packet;
}
private Packet PacketOutHandler(Packet packet, IPEndPoint endPoint)
{
if (OnPacketLog != null)
OnPacketLog(packet, Direction.Outgoing, endPoint);
return packet;
}
internal void InjectPacket(string packetData, bool toSimulator)
{
Direction direction = Direction.Incoming;
string name = null;
string block = null;
object blockObj = null;
Type packetClass = null;
Packet packet = null;
try
{
foreach (string line in packetData.Split(new[] { '\n' }))
{
Match match;
if (name == null)
{
match = (new Regex(@"^\s*(in|out)\s+(\w+)\s*$")).Match(line);
if (!match.Success)
{
OpenMetaverse.Logger.Log("expecting direction and packet name, got: " + line, OpenMetaverse.Helpers.LogLevel.Error);
return;
}
string lineDir = match.Groups[1].Captures[0].ToString();
string lineName = match.Groups[2].Captures[0].ToString();
if (lineDir == "in")
direction = Direction.Incoming;
else if (lineDir == "out")
direction = Direction.Outgoing;
else
{
OpenMetaverse.Logger.Log("expecting 'in' or 'out', got: " + line, OpenMetaverse.Helpers.LogLevel.Error);
return;
}
name = lineName;
packetClass = openmvAssembly.GetType("OpenMetaverse.Packets." + name + "Packet");
if (packetClass == null) throw new Exception("Couldn't get class " + name + "Packet");
ConstructorInfo ctr = packetClass.GetConstructor(new Type[] { });
if (ctr == null) throw new Exception("Couldn't get suitable constructor for " + name + "Packet");
packet = (Packet)ctr.Invoke(new object[] { });
}
else
{
match = (new Regex(@"^\s*\[(\w+)\]\s*$")).Match(line);
if (match.Success)
{
block = match.Groups[1].Captures[0].ToString();
FieldInfo blockField = packetClass.GetField(block);
if (blockField == null) throw new Exception("Couldn't get " + name + "Packet." + block);
Type blockClass = blockField.FieldType;
if (blockClass.IsArray)
{
blockClass = blockClass.GetElementType();
ConstructorInfo ctr = blockClass.GetConstructor(new Type[] { });
if (ctr == null) throw new Exception("Couldn't get suitable constructor for " + blockClass.Name);
blockObj = ctr.Invoke(new object[] { });
object[] arr = (object[])blockField.GetValue(packet);
object[] narr = (object[])Array.CreateInstance(blockClass, arr.Length + 1);
Array.Copy(arr, narr, arr.Length);
narr[arr.Length] = blockObj;
blockField.SetValue(packet, narr);
//Console.WriteLine("Added block "+block);
}
else
{
blockObj = blockField.GetValue(packet);
}
if (blockObj == null) throw new Exception("Got " + name + "Packet." + block + " == null");
//Console.WriteLine("Got block " + name + "Packet." + block);
continue;
}
if (block == null)
{
OpenMetaverse.Logger.Log("expecting block name, got: " + line, OpenMetaverse.Helpers.LogLevel.Error);
return;
}
match = (new Regex(@"^\s*(\w+)\s*=\s*(.*)$")).Match(line);
if (match.Success)
{
string lineField = match.Groups[1].Captures[0].ToString();
string lineValue = match.Groups[2].Captures[0].ToString();
object fval;
//FIXME: use of MagicCast inefficient
//if (lineValue == "$Value")
// fval = MagicCast(name, block, lineField, value);
if (lineValue == "$UUID")
fval = UUID.Random();
else if (lineValue == "$AgentID")
fval = Proxy.AgentID;
else if (lineValue == "$SessionID")
fval = Proxy.SessionID;
else
fval = MagicCast(name, block, lineField, lineValue);
MagicSetField(blockObj, lineField, fval);
continue;
}
OpenMetaverse.Logger.Log("expecting block name or field, got: " + line, OpenMetaverse.Helpers.LogLevel.Error);
return;
}
}
if (name == null)
{
OpenMetaverse.Logger.Log("expecting direction and packet name, got EOF", OpenMetaverse.Helpers.LogLevel.Error);
return;
}
packet.Header.Reliable = true;
Proxy.proxy.InjectPacket(packet, direction);
OpenMetaverse.Logger.Log("Injected " + name, OpenMetaverse.Helpers.LogLevel.Info);
}
catch (Exception e)
{
OpenMetaverse.Logger.Log("failed to injected " + name, OpenMetaverse.Helpers.LogLevel.Error, e);
}
}
private static void MagicSetField(object obj, string field, object val)
{
Type cls = obj.GetType();
FieldInfo fieldInf = cls.GetField(field);
if (fieldInf == null)
{
PropertyInfo prop = cls.GetProperty(field);
if (prop == null) throw new Exception("Couldn't find field " + cls.Name + "." + field);
prop.SetValue(obj, val, null);
//throw new Exception("FIXME: can't set properties");
}
else
{
fieldInf.SetValue(obj, val);
}
}
// MagicCast: given a packet/block/field name and a string, convert the string to a value of the appropriate type
private object MagicCast(string name, string block, string field, string value)
{
Type packetClass = openmvAssembly.GetType("OpenMetaverse.Packets." + name + "Packet");
if (packetClass == null) throw new Exception("Couldn't get class " + name + "Packet");
FieldInfo blockField = packetClass.GetField(block);
if (blockField == null) throw new Exception("Couldn't get " + name + "Packet." + block);
Type blockClass = blockField.FieldType;
if (blockClass.IsArray) blockClass = blockClass.GetElementType();
// Console.WriteLine("DEBUG: " + blockClass.Name);
FieldInfo fieldField = blockClass.GetField(field); PropertyInfo fieldProp = null;
Type fieldClass = null;
if (fieldField == null)
{
fieldProp = blockClass.GetProperty(field);
if (fieldProp == null) throw new Exception("Couldn't get " + name + "Packet." + block + "." + field);
fieldClass = fieldProp.PropertyType;
}
else
{
fieldClass = fieldField.FieldType;
}
try
{
if (fieldClass == typeof(byte))
{
return Convert.ToByte(value);
}
else if (fieldClass == typeof(ushort))
{
return Convert.ToUInt16(value);
}
else if (fieldClass == typeof(uint))
{
return Convert.ToUInt32(value);
}
else if (fieldClass == typeof(ulong))
{
return Convert.ToUInt64(value);
}
else if (fieldClass == typeof(sbyte))
{
return Convert.ToSByte(value);
}
else if (fieldClass == typeof(short))
{
return Convert.ToInt16(value);
}
else if (fieldClass == typeof(int))
{
return Convert.ToInt32(value);
}
else if (fieldClass == typeof(long))
{
return Convert.ToInt64(value);
}
else if (fieldClass == typeof(float))
{
return Convert.ToSingle(value);
}
else if (fieldClass == typeof(double))
{
return Convert.ToDouble(value);
}
else if (fieldClass == typeof(UUID))
{
return new UUID(value);
}
else if (fieldClass == typeof(bool))
{
if (value.ToLower() == "true")
return true;
else if (value.ToLower() == "false")
return false;
else
throw new Exception();
}
else if (fieldClass == typeof(byte[]))
{
return Utils.StringToBytes(value);
}
else if (fieldClass == typeof(Vector3))
{
Vector3 result;
if (Vector3.TryParse(value, out result))
return result;
else
throw new Exception();
}
else if (fieldClass == typeof(Vector3d))
{
Vector3d result;
if (Vector3d.TryParse(value, out result))
return result;
else
throw new Exception();
}
else if (fieldClass == typeof(Vector4))
{
Vector4 result;
if (Vector4.TryParse(value, out result))
return result;
else
throw new Exception();
}
else if (fieldClass == typeof(Quaternion))
{
Quaternion result;
if (Quaternion.TryParse(value, out result))
return result;
else
throw new Exception();
}
else
{
throw new Exception("unsupported field type " + fieldClass);
}
}
catch
{
throw new Exception("unable to interpret " + value + " as " + fieldClass);
}
}
}
}

View File

@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

View File

@@ -0,0 +1,422 @@
// This file has been generated by the GUI designer. Do not modify.
public partial class MainWindow
{
private global::Gtk.UIManager UIManager;
private global::Gtk.Action FileAction;
private global::Gtk.Action ExitAction;
private global::Gtk.Action EditAction;
private global::Gtk.Action HelpAction;
private global::Gtk.Action AboutAction;
private global::Gtk.Action RemoveAction;
private global::Gtk.Action SelectAction;
private global::Gtk.Action AllAction;
private global::Gtk.Action AllAction1;
private global::Gtk.Action SelectedAction;
private global::Gtk.Action FindAction;
private global::Gtk.Action OpenSessionAction;
private global::Gtk.Action SaveSessionAction;
private global::Gtk.Action SaveSessionAsAction;
private global::Gtk.VBox vbox1;
private global::Gtk.HBox boxTopMenu;
private global::Gtk.Alignment alignment2;
private global::Gtk.MenuBar menubar1;
private global::Gtk.VSeparator vseparator1;
private global::Gtk.Label label1;
private global::Gtk.ComboBoxEntry cbListen;
private global::Gtk.Label label2;
private global::Gtk.Entry txtPort;
private global::Gtk.Label label3;
private global::Gtk.ComboBoxEntry cbLoginURL;
private global::Gtk.Button btnStart;
private global::Gtk.HPaned mainSplit;
private global::Gtk.ScrolledWindow sessionLogScroller;
private global::Gtk.TreeView treeview1;
private global::Gtk.Notebook tabsMain;
private global::Gtk.ScrolledWindow logFileScroller;
private global::Gtk.TextView txtSummary;
private global::Gtk.Label label4;
private global::Gtk.VBox filterBox;
private global::Gtk.HBox hbox2;
private global::Gtk.Button btnLoadFilters;
private global::Gtk.Button btnSaveFilters;
private global::Gtk.CheckButton cbAutoCheckCaps;
private global::Gtk.HBox hbox3;
private global::Gtk.Frame frameFilterUDP;
private global::Gtk.Alignment containerFilterUDP;
private global::Gtk.Label GtkLabel7;
private global::Gtk.Frame frameFilterCap;
private global::Gtk.Alignment containerFilterCap;
private global::Gtk.Label GtkLabel8;
private global::Gtk.HBox hbox4;
private global::Gtk.CheckButton cbSelectAllUDP;
private global::Gtk.CheckButton cbSelectAllCap;
private global::Gtk.Label label5;
private global::Gtk.Label label6;
protected virtual void Build ()
{
global::Stetic.Gui.Initialize (this);
// Widget MainWindow
this.UIManager = new global::Gtk.UIManager ();
global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup ("Default");
this.FileAction = new global::Gtk.Action ("FileAction", global::Mono.Unix.Catalog.GetString ("File"), null, null);
this.FileAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("File");
w1.Add (this.FileAction, "<Alt>f");
this.ExitAction = new global::Gtk.Action ("ExitAction", global::Mono.Unix.Catalog.GetString ("Exit"), null, null);
this.ExitAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Exit");
w1.Add (this.ExitAction, "<Primary>q");
this.EditAction = new global::Gtk.Action ("EditAction", global::Mono.Unix.Catalog.GetString ("Edit"), null, null);
this.EditAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Edit");
w1.Add (this.EditAction, null);
this.HelpAction = new global::Gtk.Action ("HelpAction", global::Mono.Unix.Catalog.GetString ("Help"), null, null);
this.HelpAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Help");
w1.Add (this.HelpAction, null);
this.AboutAction = new global::Gtk.Action ("AboutAction", global::Mono.Unix.Catalog.GetString ("About"), null, null);
this.AboutAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("About");
w1.Add (this.AboutAction, null);
this.RemoveAction = new global::Gtk.Action ("RemoveAction", global::Mono.Unix.Catalog.GetString ("Remove"), null, null);
this.RemoveAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Remove");
w1.Add (this.RemoveAction, null);
this.SelectAction = new global::Gtk.Action ("SelectAction", global::Mono.Unix.Catalog.GetString ("Select"), null, null);
this.SelectAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Select");
w1.Add (this.SelectAction, null);
this.AllAction = new global::Gtk.Action ("AllAction", global::Mono.Unix.Catalog.GetString ("All"), null, null);
this.AllAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("All");
w1.Add (this.AllAction, null);
this.AllAction1 = new global::Gtk.Action ("AllAction1", global::Mono.Unix.Catalog.GetString ("All"), null, null);
this.AllAction1.ShortLabel = global::Mono.Unix.Catalog.GetString ("All");
w1.Add (this.AllAction1, null);
this.SelectedAction = new global::Gtk.Action ("SelectedAction", global::Mono.Unix.Catalog.GetString ("Selected"), null, null);
this.SelectedAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Selected");
w1.Add (this.SelectedAction, null);
this.FindAction = new global::Gtk.Action ("FindAction", global::Mono.Unix.Catalog.GetString ("Find"), null, null);
this.FindAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Find (Ctrl-F)");
w1.Add (this.FindAction, "<Primary>f");
this.OpenSessionAction = new global::Gtk.Action ("OpenSessionAction", global::Mono.Unix.Catalog.GetString ("Open Session..."), null, null);
this.OpenSessionAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Open Session...");
w1.Add (this.OpenSessionAction, "<Primary>o");
this.SaveSessionAction = new global::Gtk.Action ("SaveSessionAction", global::Mono.Unix.Catalog.GetString ("Save Session"), null, null);
this.SaveSessionAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Save Session");
w1.Add (this.SaveSessionAction, "<Primary>s");
this.SaveSessionAsAction = new global::Gtk.Action ("SaveSessionAsAction", global::Mono.Unix.Catalog.GetString ("Save Session As..."), null, null);
this.SaveSessionAsAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Save Session As...");
w1.Add (this.SaveSessionAsAction, null);
this.UIManager.InsertActionGroup (w1, 0);
this.AddAccelGroup (this.UIManager.AccelGroup);
this.Name = "MainWindow";
this.Title = global::Mono.Unix.Catalog.GetString ("Grid Proxy");
this.WindowPosition = ((global::Gtk.WindowPosition)(4));
this.AllowShrink = true;
// Container child MainWindow.Gtk.Container+ContainerChild
this.vbox1 = new global::Gtk.VBox ();
this.vbox1.Name = "vbox1";
this.vbox1.Spacing = 6;
// Container child vbox1.Gtk.Box+BoxChild
this.boxTopMenu = new global::Gtk.HBox ();
this.boxTopMenu.Name = "hbox1";
this.boxTopMenu.Spacing = 6;
this.boxTopMenu.BorderWidth = ((uint)(3));
// Container child hbox1.Gtk.Box+BoxChild
this.alignment2 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
this.alignment2.Name = "alignment2";
// Container child alignment2.Gtk.Container+ContainerChild
this.UIManager.AddUiFromString (@"<ui><menubar name='menubar1'><menu name='FileAction' action='FileAction'><menuitem name='OpenSessionAction' action='OpenSessionAction'/><menuitem name='SaveSessionAction' action='SaveSessionAction'/><menuitem name='SaveSessionAsAction' action='SaveSessionAsAction'/><separator/><menuitem name='ExitAction' action='ExitAction'/></menu><menu name='EditAction' action='EditAction'><menu name='RemoveAction' action='RemoveAction'><menuitem name='AllAction1' action='AllAction1'/><menuitem name='SelectedAction' action='SelectedAction'/></menu><menu name='SelectAction' action='SelectAction'><menuitem name='AllAction' action='AllAction'/></menu><separator/><menuitem name='FindAction' action='FindAction'/></menu><menu name='HelpAction' action='HelpAction'><menuitem name='AboutAction' action='AboutAction'/></menu></menubar></ui>");
this.menubar1 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget ("/menubar1")));
this.menubar1.Name = "menubar1";
this.alignment2.Add (this.menubar1);
this.boxTopMenu.Add (this.alignment2);
global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.alignment2]));
w3.Position = 0;
w3.Expand = false;
w3.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.vseparator1 = new global::Gtk.VSeparator ();
this.vseparator1.Name = "vseparator1";
this.boxTopMenu.Add (this.vseparator1);
global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.vseparator1]));
w4.Position = 1;
w4.Expand = false;
w4.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.label1 = new global::Gtk.Label ();
this.label1.Name = "label1";
this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("Listen IP Address:");
this.boxTopMenu.Add (this.label1);
global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.label1]));
w5.Position = 2;
w5.Expand = false;
w5.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.cbListen = global::Gtk.ComboBoxEntry.NewText ();
this.cbListen.AppendText (global::Mono.Unix.Catalog.GetString ("127.0.0.1"));
this.cbListen.AppendText (global::Mono.Unix.Catalog.GetString ("0.0.0.0"));
this.cbListen.WidthRequest = 100;
this.cbListen.Name = "cbListen";
this.cbListen.Active = 0;
this.boxTopMenu.Add (this.cbListen);
global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.cbListen]));
w6.Position = 3;
w6.Expand = false;
w6.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.label2 = new global::Gtk.Label ();
this.label2.Name = "label2";
this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Port");
this.boxTopMenu.Add (this.label2);
global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.label2]));
w7.Position = 4;
w7.Expand = false;
w7.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.txtPort = new global::Gtk.Entry ();
this.txtPort.WidthRequest = 50;
this.txtPort.CanFocus = true;
this.txtPort.Name = "txtPort";
this.txtPort.Text = global::Mono.Unix.Catalog.GetString ("8080");
this.txtPort.IsEditable = true;
this.txtPort.MaxLength = 5;
this.txtPort.InvisibleChar = '●';
this.boxTopMenu.Add (this.txtPort);
global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.txtPort]));
w8.Position = 5;
w8.Expand = false;
// Container child hbox1.Gtk.Box+BoxChild
this.label3 = new global::Gtk.Label ();
this.label3.Name = "label3";
this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("Login URL");
this.boxTopMenu.Add (this.label3);
global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.label3]));
w9.Position = 6;
w9.Expand = false;
w9.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.cbLoginURL = global::Gtk.ComboBoxEntry.NewText ();
this.cbLoginURL.AppendText (global::Mono.Unix.Catalog.GetString ("https://login.agni.lindenlab.com/cgi-bin/login.cgi"));
this.cbLoginURL.AppendText (global::Mono.Unix.Catalog.GetString ("https://login.aditi.lindenlab.com/cgi-bin/login.cgi"));
this.cbLoginURL.AppendText (global::Mono.Unix.Catalog.GetString ("http://login.orgrid.org/"));
this.cbLoginURL.WidthRequest = 300;
this.cbLoginURL.Name = "cbLoginURL";
this.cbLoginURL.Active = 0;
this.boxTopMenu.Add (this.cbLoginURL);
global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.cbLoginURL]));
w10.Position = 7;
w10.Expand = false;
w10.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.btnStart = new global::Gtk.Button ();
this.btnStart.CanFocus = true;
this.btnStart.Name = "btnStart";
this.btnStart.UseUnderline = true;
this.btnStart.Label = global::Mono.Unix.Catalog.GetString ("Start Proxy");
this.boxTopMenu.Add (this.btnStart);
global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.boxTopMenu [this.btnStart]));
w11.Position = 8;
w11.Expand = false;
w11.Fill = false;
this.vbox1.Add (this.boxTopMenu);
global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.boxTopMenu]));
w12.Position = 0;
w12.Expand = false;
w12.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
this.mainSplit = new global::Gtk.HPaned ();
this.mainSplit.CanFocus = true;
this.mainSplit.Name = "mainSplit";
this.mainSplit.Position = 1;
// Container child mainSplit.Gtk.Paned+PanedChild
this.sessionLogScroller = new global::Gtk.ScrolledWindow ();
this.sessionLogScroller.Name = "GtkScrolledWindow1";
this.sessionLogScroller.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child GtkScrolledWindow1.Gtk.Container+ContainerChild
this.treeview1 = new global::Gtk.TreeView ();
this.treeview1.CanFocus = true;
this.treeview1.Name = "treeview1";
this.sessionLogScroller.Add (this.treeview1);
this.mainSplit.Add (this.sessionLogScroller);
global::Gtk.Paned.PanedChild w14 = ((global::Gtk.Paned.PanedChild)(this.mainSplit [this.sessionLogScroller]));
w14.Resize = false;
// Container child mainSplit.Gtk.Paned+PanedChild
this.tabsMain = new global::Gtk.Notebook ();
this.tabsMain.CanFocus = true;
this.tabsMain.Name = "tabsMain";
this.tabsMain.CurrentPage = 1;
this.tabsMain.EnablePopup = true;
// Container child tabsMain.Gtk.Notebook+NotebookChild
this.logFileScroller = new global::Gtk.ScrolledWindow ();
this.logFileScroller.Name = "logFileScroller";
this.logFileScroller.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child logFileScroller.Gtk.Container+ContainerChild
this.txtSummary = new global::Gtk.TextView ();
this.txtSummary.CanFocus = true;
this.txtSummary.Name = "txtSummary";
this.txtSummary.Editable = false;
this.txtSummary.WrapMode = ((global::Gtk.WrapMode)(2));
this.logFileScroller.Add (this.txtSummary);
this.tabsMain.Add (this.logFileScroller);
// Notebook tab
this.label4 = new global::Gtk.Label ();
this.label4.Name = "label4";
this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("Summary");
this.tabsMain.SetTabLabel (this.logFileScroller, this.label4);
this.label4.ShowAll ();
// Container child tabsMain.Gtk.Notebook+NotebookChild
this.filterBox = new global::Gtk.VBox ();
this.filterBox.Name = "filterBox";
this.filterBox.Spacing = 6;
// Container child filterBox.Gtk.Box+BoxChild
this.hbox2 = new global::Gtk.HBox ();
this.hbox2.Name = "hbox2";
this.hbox2.Spacing = 6;
// Container child hbox2.Gtk.Box+BoxChild
this.btnLoadFilters = new global::Gtk.Button ();
this.btnLoadFilters.CanFocus = true;
this.btnLoadFilters.Name = "btnLoadFilters";
this.btnLoadFilters.UseUnderline = true;
this.btnLoadFilters.Label = global::Mono.Unix.Catalog.GetString ("Load");
global::Gtk.Image w17 = new global::Gtk.Image ();
w17.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-open", global::Gtk.IconSize.Menu);
this.btnLoadFilters.Image = w17;
this.hbox2.Add (this.btnLoadFilters);
global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.btnLoadFilters]));
w18.Position = 0;
w18.Expand = false;
w18.Fill = false;
// Container child hbox2.Gtk.Box+BoxChild
this.btnSaveFilters = new global::Gtk.Button ();
this.btnSaveFilters.CanFocus = true;
this.btnSaveFilters.Name = "btnSaveFilters";
this.btnSaveFilters.UseUnderline = true;
this.btnSaveFilters.Label = global::Mono.Unix.Catalog.GetString ("Save");
global::Gtk.Image w19 = new global::Gtk.Image ();
w19.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-save", global::Gtk.IconSize.Menu);
this.btnSaveFilters.Image = w19;
this.hbox2.Add (this.btnSaveFilters);
global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.btnSaveFilters]));
w20.Position = 1;
w20.Expand = false;
w20.Fill = false;
// Container child hbox2.Gtk.Box+BoxChild
this.cbAutoCheckCaps = new global::Gtk.CheckButton ();
this.cbAutoCheckCaps.CanFocus = true;
this.cbAutoCheckCaps.Name = "cbAutoCheckCaps";
this.cbAutoCheckCaps.Label = global::Mono.Unix.Catalog.GetString ("Auto Check New Capabilities");
this.cbAutoCheckCaps.Active = true;
this.cbAutoCheckCaps.DrawIndicator = true;
this.cbAutoCheckCaps.UseUnderline = true;
this.hbox2.Add (this.cbAutoCheckCaps);
global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.cbAutoCheckCaps]));
w21.Position = 2;
this.filterBox.Add (this.hbox2);
global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.filterBox [this.hbox2]));
w22.Position = 0;
w22.Expand = false;
w22.Fill = false;
// Container child filterBox.Gtk.Box+BoxChild
this.hbox3 = new global::Gtk.HBox ();
this.hbox3.Name = "hbox3";
this.hbox3.Homogeneous = true;
this.hbox3.Spacing = 6;
// Container child hbox3.Gtk.Box+BoxChild
this.frameFilterUDP = new global::Gtk.Frame ();
this.frameFilterUDP.Name = "frameFilterUDP";
this.frameFilterUDP.ShadowType = ((global::Gtk.ShadowType)(0));
this.frameFilterUDP.LabelYalign = 0F;
// Container child frameFilterUDP.Gtk.Container+ContainerChild
this.containerFilterUDP = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
this.containerFilterUDP.Name = "containerFilterUDP";
this.containerFilterUDP.LeftPadding = ((uint)(12));
this.frameFilterUDP.Add (this.containerFilterUDP);
this.GtkLabel7 = new global::Gtk.Label ();
this.GtkLabel7.Name = "GtkLabel7";
this.GtkLabel7.LabelProp = global::Mono.Unix.Catalog.GetString ("UDP Packets & Login");
this.frameFilterUDP.LabelWidget = this.GtkLabel7;
this.hbox3.Add (this.frameFilterUDP);
global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.frameFilterUDP]));
w24.Position = 0;
// Container child hbox3.Gtk.Box+BoxChild
this.frameFilterCap = new global::Gtk.Frame ();
this.frameFilterCap.Name = "frameFilterCap";
this.frameFilterCap.ShadowType = ((global::Gtk.ShadowType)(0));
this.frameFilterCap.LabelYalign = 0F;
// Container child frameFilterCap.Gtk.Container+ContainerChild
this.containerFilterCap = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
this.containerFilterCap.Name = "containerFilterCap";
this.containerFilterCap.LeftPadding = ((uint)(12));
this.frameFilterCap.Add (this.containerFilterCap);
this.GtkLabel8 = new global::Gtk.Label ();
this.GtkLabel8.Name = "GtkLabel8";
this.GtkLabel8.LabelProp = global::Mono.Unix.Catalog.GetString ("Capabilities & EventQueue Messages");
this.frameFilterCap.LabelWidget = this.GtkLabel8;
this.hbox3.Add (this.frameFilterCap);
global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.frameFilterCap]));
w26.Position = 1;
this.filterBox.Add (this.hbox3);
global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.filterBox [this.hbox3]));
w27.Position = 1;
// Container child filterBox.Gtk.Box+BoxChild
this.hbox4 = new global::Gtk.HBox ();
this.hbox4.Name = "hbox4";
this.hbox4.Homogeneous = true;
this.hbox4.Spacing = 6;
// Container child hbox4.Gtk.Box+BoxChild
this.cbSelectAllUDP = new global::Gtk.CheckButton ();
this.cbSelectAllUDP.CanFocus = true;
this.cbSelectAllUDP.Name = "cbSelectAllUDP";
this.cbSelectAllUDP.Label = global::Mono.Unix.Catalog.GetString ("Select/Uncheck All");
this.cbSelectAllUDP.DrawIndicator = true;
this.cbSelectAllUDP.UseUnderline = true;
this.hbox4.Add (this.cbSelectAllUDP);
global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.cbSelectAllUDP]));
w28.Position = 0;
// Container child hbox4.Gtk.Box+BoxChild
this.cbSelectAllCap = new global::Gtk.CheckButton ();
this.cbSelectAllCap.CanFocus = true;
this.cbSelectAllCap.Name = "cbSelectAllCap";
this.cbSelectAllCap.Label = global::Mono.Unix.Catalog.GetString ("Select/Uncheck All");
this.cbSelectAllCap.DrawIndicator = true;
this.cbSelectAllCap.UseUnderline = true;
this.hbox4.Add (this.cbSelectAllCap);
global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.cbSelectAllCap]));
w29.Position = 1;
this.filterBox.Add (this.hbox4);
global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.filterBox [this.hbox4]));
w30.PackType = ((global::Gtk.PackType)(1));
w30.Position = 2;
w30.Expand = false;
w30.Fill = false;
this.tabsMain.Add (this.filterBox);
global::Gtk.Notebook.NotebookChild w31 = ((global::Gtk.Notebook.NotebookChild)(this.tabsMain [this.filterBox]));
w31.Position = 1;
// Notebook tab
this.label5 = new global::Gtk.Label ();
this.label5.Name = "label5";
this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("Filters");
this.tabsMain.SetTabLabel (this.filterBox, this.label5);
this.label5.ShowAll ();
// Notebook tab
global::Gtk.Label w32 = new global::Gtk.Label ();
w32.Visible = true;
this.tabsMain.Add (w32);
this.label6 = new global::Gtk.Label ();
this.label6.Name = "label6";
this.label6.LabelProp = global::Mono.Unix.Catalog.GetString ("Inspector");
this.tabsMain.SetTabLabel (w32, this.label6);
this.label6.ShowAll ();
this.mainSplit.Add (this.tabsMain);
this.vbox1.Add (this.mainSplit);
global::Gtk.Box.BoxChild w34 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.mainSplit]));
w34.Position = 1;
this.Add (this.vbox1);
if ((this.Child != null)) {
this.Child.ShowAll ();
}
this.DefaultWidth = 1211;
this.DefaultHeight = 552;
this.Show ();
this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent);
this.ExitAction.Activated += new global::System.EventHandler (this.OnExitActionActivated);
this.btnStart.Clicked += new global::System.EventHandler (this.OnBtnStartClicked);
}
}

View File

@@ -0,0 +1,67 @@
// This file has been generated by the GUI designer. Do not modify.
namespace Stetic
{
internal class Gui
{
private static bool initialized;
internal static void Initialize (Gtk.Widget iconRenderer)
{
if ((Stetic.Gui.initialized == false)) {
Stetic.Gui.initialized = true;
}
}
}
internal class IconLoader
{
public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
{
Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
if ((res != null)) {
return res;
} else {
int sz;
int sy;
global::Gtk.Icon.SizeLookup (size, out sz, out sy);
try {
return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
} catch (System.Exception) {
if ((name != "gtk-missing-image")) {
return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
} else {
Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
Gdk.GC gc = new Gdk.GC (pmap);
gc.RgbFgColor = new Gdk.Color (255, 255, 255);
pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
gc.RgbFgColor = new Gdk.Color (0, 0, 0);
pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
gc.RgbFgColor = new Gdk.Color (255, 0, 0);
pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1)
- (sz / 4)), ((sz - 1)
- (sz / 4)));
pmap.DrawLine (gc, ((sz - 1)
- (sz / 4)), (sz / 4), (sz / 4), ((sz - 1)
- (sz / 4)));
return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
}
}
}
}
}
internal class ActionGroups
{
public static Gtk.ActionGroup GetActionGroup (System.Type type)
{
return Stetic.ActionGroups.GetActionGroup (type.FullName);
}
public static Gtk.ActionGroup GetActionGroup (string name)
{
return null;
}
}
}

View File

@@ -0,0 +1,532 @@
<?xml version="1.0" encoding="utf-8"?>
<stetic-interface>
<configuration>
<images-root-path>..</images-root-path>
</configuration>
<import>
<widget-library name="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<widget-library name="../bin/Debug/GridProxyGUI.exe" internal="true" />
</import>
<widget class="Gtk.Window" id="MainWindow" design-size="1211 552">
<action-group name="Default">
<action id="FileAction">
<property name="Type">Action</property>
<property name="Accelerator">&lt;Alt&gt;f</property>
<property name="Label" translatable="yes">File</property>
<property name="ShortLabel" translatable="yes">File</property>
</action>
<action id="ExitAction">
<property name="Type">Action</property>
<property name="Accelerator">&lt;Primary&gt;q</property>
<property name="Label" translatable="yes">Exit</property>
<property name="ShortLabel" translatable="yes">Exit</property>
<signal name="Activated" handler="OnExitActionActivated" />
</action>
<action id="EditAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Edit</property>
<property name="ShortLabel" translatable="yes">Edit</property>
</action>
<action id="HelpAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Help</property>
<property name="ShortLabel" translatable="yes">Help</property>
</action>
<action id="AboutAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">About</property>
<property name="ShortLabel" translatable="yes">About</property>
</action>
<action id="RemoveAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Remove</property>
<property name="ShortLabel" translatable="yes">Remove</property>
</action>
<action id="SelectAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Select</property>
<property name="ShortLabel" translatable="yes">Select</property>
</action>
<action id="AllAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">All</property>
<property name="ShortLabel" translatable="yes">All</property>
</action>
<action id="AllAction1">
<property name="Type">Action</property>
<property name="Label" translatable="yes">All</property>
<property name="ShortLabel" translatable="yes">All</property>
</action>
<action id="SelectedAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Selected</property>
<property name="ShortLabel" translatable="yes">Selected</property>
</action>
<action id="FindAction">
<property name="Type">Action</property>
<property name="Accelerator">&lt;Primary&gt;f</property>
<property name="Label" translatable="yes">Find</property>
<property name="ShortLabel" translatable="yes">Find (Ctrl-F)</property>
</action>
<action id="OpenSessionAction">
<property name="Type">Action</property>
<property name="Accelerator">&lt;Primary&gt;o</property>
<property name="Label" translatable="yes">Open Session...</property>
<property name="ShortLabel" translatable="yes">Open Session...</property>
</action>
<action id="SaveSessionAction">
<property name="Type">Action</property>
<property name="Accelerator">&lt;Primary&gt;s</property>
<property name="Label" translatable="yes">Save Session</property>
<property name="ShortLabel" translatable="yes">Save Session</property>
</action>
<action id="SaveSessionAsAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Save Session As...</property>
<property name="ShortLabel" translatable="yes">Save Session As...</property>
</action>
</action-group>
<property name="MemberName" />
<property name="Title" translatable="yes">Grid Proxy</property>
<property name="WindowPosition">CenterOnParent</property>
<property name="AllowShrink">True</property>
<signal name="DeleteEvent" handler="OnDeleteEvent" />
<child>
<widget class="Gtk.VBox" id="vbox1">
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
<widget class="Gtk.HBox" id="hbox1">
<property name="MemberName" />
<property name="Spacing">6</property>
<property name="BorderWidth">3</property>
<child>
<widget class="Gtk.Alignment" id="alignment2">
<property name="MemberName" />
<child>
<widget class="Gtk.MenuBar" id="menubar1">
<property name="MemberName" />
<node name="menubar1" type="Menubar">
<node type="Menu" action="FileAction">
<node type="Menuitem" action="OpenSessionAction" />
<node type="Menuitem" action="SaveSessionAction" />
<node type="Menuitem" action="SaveSessionAsAction" />
<node type="Separator" />
<node type="Menuitem" action="ExitAction" />
</node>
<node type="Menu" action="EditAction">
<node type="Menu" action="RemoveAction">
<node type="Menuitem" action="AllAction1" />
<node type="Menuitem" action="SelectedAction" />
</node>
<node type="Menu" action="SelectAction">
<node type="Menuitem" action="AllAction" />
</node>
<node type="Separator" />
<node type="Menuitem" action="FindAction" />
</node>
<node type="Menu" action="HelpAction">
<node type="Menuitem" action="AboutAction" />
</node>
</node>
</widget>
</child>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.VSeparator" id="vseparator1">
<property name="MemberName" />
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Label" id="label1">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">Listen IP Address:</property>
</widget>
<packing>
<property name="Position">2</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.ComboBoxEntry" id="cbListen">
<property name="MemberName" />
<property name="WidthRequest">100</property>
<property name="IsTextCombo">True</property>
<property name="Items" translatable="yes">127.0.0.1
0.0.0.0</property>
<property name="Active">0</property>
</widget>
<packing>
<property name="Position">3</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Label" id="label2">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">Port</property>
</widget>
<packing>
<property name="Position">4</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Entry" id="txtPort">
<property name="MemberName" />
<property name="WidthRequest">50</property>
<property name="CanFocus">True</property>
<property name="Text" translatable="yes">8080</property>
<property name="IsEditable">True</property>
<property name="MaxLength">5</property>
<property name="InvisibleChar">●</property>
</widget>
<packing>
<property name="Position">5</property>
<property name="AutoSize">False</property>
<property name="Expand">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Label" id="label3">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">Login URL</property>
</widget>
<packing>
<property name="Position">6</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.ComboBoxEntry" id="cbLoginURL">
<property name="MemberName" />
<property name="WidthRequest">300</property>
<property name="IsTextCombo">True</property>
<property name="Items" translatable="yes">https://login.agni.lindenlab.com/cgi-bin/login.cgi
https://login.aditi.lindenlab.com/cgi-bin/login.cgi
http://login.orgrid.org/</property>
<property name="Active">0</property>
</widget>
<packing>
<property name="Position">7</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Button" id="btnStart">
<property name="MemberName">btnStart</property>
<property name="CanFocus">True</property>
<property name="Type">TextOnly</property>
<property name="Label" translatable="yes">Start Proxy</property>
<property name="UseUnderline">True</property>
<signal name="Clicked" handler="OnBtnStartClicked" />
</widget>
<packing>
<property name="Position">8</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.HPaned" id="mainSplit">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="Position">400</property>
<child>
<widget class="Gtk.ScrolledWindow" id="scrolledwindow1">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="ShadowType">In</property>
<child>
<widget class="Gtk.Viewport" id="GtkViewport">
<property name="MemberName" />
<property name="ShadowType">None</property>
<child>
<placeholder />
</child>
</widget>
</child>
</widget>
<packing>
<property name="Resize">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Notebook" id="tabsMain">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="CurrentPage">1</property>
<property name="EnablePopup">True</property>
<child>
<widget class="Gtk.ScrolledWindow" id="logFileScroller">
<property name="MemberName" />
<property name="ShadowType">In</property>
<child>
<widget class="Gtk.TextView" id="txtSummary">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="ShowScrollbars">True</property>
<property name="Editable">False</property>
<property name="Text" translatable="yes" />
<property name="WrapMode">Word</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="Gtk.Label" id="label4">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">Summary</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
<child>
<widget class="Gtk.VBox" id="filterBox">
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
<widget class="Gtk.HBox" id="hbox2">
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
<widget class="Gtk.Button" id="btnLoadFilters">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="Type">TextAndIcon</property>
<property name="Icon">stock:gtk-open Menu</property>
<property name="Label" translatable="yes">Load</property>
<property name="UseUnderline">True</property>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Button" id="btnSaveFilters">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="Type">TextAndIcon</property>
<property name="Icon">stock:gtk-save Menu</property>
<property name="Label" translatable="yes">Save</property>
<property name="UseUnderline">True</property>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.CheckButton" id="cbAutoCheckCaps">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="Label" translatable="yes">Auto Check New Capabilities</property>
<property name="Active">True</property>
<property name="DrawIndicator">True</property>
<property name="HasLabel">True</property>
<property name="UseUnderline">True</property>
</widget>
<packing>
<property name="Position">2</property>
<property name="AutoSize">True</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.HBox" id="hbox3">
<property name="MemberName" />
<property name="Homogeneous">True</property>
<property name="Spacing">6</property>
<child>
<widget class="Gtk.Frame" id="frameFilterUDP">
<property name="MemberName" />
<property name="ShadowType">None</property>
<property name="LabelYalign">0</property>
<child>
<widget class="Gtk.Alignment" id="containerFilterUDP">
<property name="MemberName" />
<property name="Xalign">0</property>
<property name="Yalign">0</property>
<property name="LeftPadding">12</property>
<child>
<placeholder />
</child>
</widget>
</child>
<child>
<widget class="Gtk.Label" id="GtkLabel7">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">UDP Packets &amp; Login</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Frame" id="frameFilterCap">
<property name="MemberName" />
<property name="ShadowType">None</property>
<property name="LabelYalign">0</property>
<child>
<widget class="Gtk.Alignment" id="containerFilterCap">
<property name="MemberName" />
<property name="Xalign">0</property>
<property name="Yalign">0</property>
<property name="LeftPadding">12</property>
<child>
<placeholder />
</child>
</widget>
</child>
<child>
<widget class="Gtk.Label" id="GtkLabel8">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">Capabilities &amp; EventQueue Messages</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">False</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">True</property>
</packing>
</child>
<child>
<widget class="Gtk.HBox" id="hbox4">
<property name="MemberName" />
<property name="Homogeneous">True</property>
<property name="Spacing">6</property>
<child>
<widget class="Gtk.CheckButton" id="cbSelectAllUDP">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="Label" translatable="yes">Select/Uncheck All</property>
<property name="DrawIndicator">True</property>
<property name="HasLabel">True</property>
<property name="UseUnderline">True</property>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
</packing>
</child>
<child>
<widget class="Gtk.CheckButton" id="cbSelectAllCap">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="Label" translatable="yes">Select/Uncheck All</property>
<property name="DrawIndicator">True</property>
<property name="HasLabel">True</property>
<property name="UseUnderline">True</property>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">True</property>
</packing>
</child>
</widget>
<packing>
<property name="PackType">End</property>
<property name="Position">2</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">1</property>
</packing>
</child>
<child>
<widget class="Gtk.Label" id="label5">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">Filters</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
<child>
<placeholder />
</child>
<child>
<widget class="Gtk.Label" id="label6">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">Inspector</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</stetic-interface>

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB