Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Pouliot <sebastien@ximian.com>2005-05-08 22:15:04 +0400
committerSebastien Pouliot <sebastien@ximian.com>2005-05-08 22:15:04 +0400
commit794e5c9e7b9e89048bc64a4cdf63a5ec53300276 (patch)
treee811d25d1d345db5b8b89f3f62abfaa1e3b26f31 /asn1view
parenta17dff3ea2016d415cde10e881852b0e1cf1a724 (diff)
2005-05-08 Sebastien Pouliot <sebastien@ximian.com>
* Initial import into SVN. svn path=/trunk/mono-tools/; revision=44219
Diffstat (limited to 'asn1view')
-rw-r--r--asn1view/AUTHORS1
-rw-r--r--asn1view/ChangeLog3
-rw-r--r--asn1view/Makefile.am2
-rw-r--r--asn1view/README24
-rw-r--r--asn1view/TODO24
-rw-r--r--asn1view/art/Makefile.am7
-rw-r--r--asn1view/art/export-16.pngbin0 -> 739 bytes
-rw-r--r--asn1view/art/export.pngbin0 -> 1322 bytes
-rw-r--r--asn1view/art/text_hilight-16.pngbin0 -> 576 bytes
-rw-r--r--asn1view/art/text_lolight-16.pngbin0 -> 297 bytes
-rw-r--r--asn1view/common/ASN1Decoder.cs181
-rw-r--r--asn1view/common/AssemblyInfo.cs86
-rw-r--r--asn1view/common/Makefile.am7
-rw-r--r--asn1view/common/OidCache.cs96
-rw-r--r--asn1view/common/PrettyPrinter.cs774
-rw-r--r--asn1view/gtk/Main.cs745
-rw-r--r--asn1view/gtk/Makefile.am53
-rw-r--r--asn1view/gtk/gui.glade1184
-rw-r--r--asn1view/gtk/gui.gladep7
-rw-r--r--asn1view/gtk/script.in2
20 files changed, 3196 insertions, 0 deletions
diff --git a/asn1view/AUTHORS b/asn1view/AUTHORS
new file mode 100644
index 00000000..5849da32
--- /dev/null
+++ b/asn1view/AUTHORS
@@ -0,0 +1 @@
+Sebastien Pouliot <sebastien@ximian.com>
diff --git a/asn1view/ChangeLog b/asn1view/ChangeLog
new file mode 100644
index 00000000..fa0271cd
--- /dev/null
+++ b/asn1view/ChangeLog
@@ -0,0 +1,3 @@
+2005-05-08 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Initial import into SVN.
diff --git a/asn1view/Makefile.am b/asn1view/Makefile.am
new file mode 100644
index 00000000..5dfe91d1
--- /dev/null
+++ b/asn1view/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS= art gtk common
+
diff --git a/asn1view/README b/asn1view/README
new file mode 100644
index 00000000..5545cc62
--- /dev/null
+++ b/asn1view/README
@@ -0,0 +1,24 @@
+FEATURES
+
+General
+- Decode ASN.1 structures;
+- Support undefined length elements;
+- Support encapsulated ASN.1 elements;
+- Export textual representation of structures (great for diffs);
+- Download and cache OID definitions from the web, either from:
+ - Alvestrand (www.alvestrand.no); or
+ - Elibel (asn1.elibel.tm.fr).
+
+Gnome specific
+- Find bar (a la FireFox) with highlight (yellow);
+- Encapsulated ASN.1 in alternate color (blue);
+
+
+
+HISTORY
+
+2004-12-05 Version 0.1.0.0
+ - Initial (un)release with Gnome support (Gtk#);
+
+2005-05-08 Version 0.1.1.0
+ - First public version (restructured for SVN);
diff --git a/asn1view/TODO b/asn1view/TODO
new file mode 100644
index 00000000..640c0e4c
--- /dev/null
+++ b/asn1view/TODO
@@ -0,0 +1,24 @@
+MISSING
+
+General features
+- Support for base64 encoded structures (e.g. PEM);
+- Use Mono.Security.dll for ASN.1 support [1];
+
+GNOME version
+- MRU (Most Recently Used) files in File menu;
+- Update UI while downloading OID informations;
+- (Optional) Syntax highlighting (reserved words);
+- Separate strings from code for easier translation;
+
+Other versions
+- Command-line tool (with scripts for easier diffs);
+- SWF (System.Windows.Forms) port for Win32;
+- Cocoa# port for Mac OS X ? (that would require a Mac user of the tool ;-)
+
+
+Notes:
+
+[1] The current ASN.1 decoder class is included in the main assembly. This
+will change later when an "enhanced" version of the class will be included
+in Mono.Security.dll (in a future version of Mono::). Until then the ASN.1
+viewer doesn't requires a dependency on Mono.Security.dll.
diff --git a/asn1view/art/Makefile.am b/asn1view/art/Makefile.am
new file mode 100644
index 00000000..1e9769ab
--- /dev/null
+++ b/asn1view/art/Makefile.am
@@ -0,0 +1,7 @@
+FILES= export-16.png \
+ export.png \
+ text_hilight-16.png \
+ text_lolight-16.png
+
+EXTRA_DIST= $(FILES)
+
diff --git a/asn1view/art/export-16.png b/asn1view/art/export-16.png
new file mode 100644
index 00000000..f64425bb
--- /dev/null
+++ b/asn1view/art/export-16.png
Binary files differ
diff --git a/asn1view/art/export.png b/asn1view/art/export.png
new file mode 100644
index 00000000..2e560a74
--- /dev/null
+++ b/asn1view/art/export.png
Binary files differ
diff --git a/asn1view/art/text_hilight-16.png b/asn1view/art/text_hilight-16.png
new file mode 100644
index 00000000..35122786
--- /dev/null
+++ b/asn1view/art/text_hilight-16.png
Binary files differ
diff --git a/asn1view/art/text_lolight-16.png b/asn1view/art/text_lolight-16.png
new file mode 100644
index 00000000..9028c3f1
--- /dev/null
+++ b/asn1view/art/text_lolight-16.png
Binary files differ
diff --git a/asn1view/common/ASN1Decoder.cs b/asn1view/common/ASN1Decoder.cs
new file mode 100644
index 00000000..e5d69e2e
--- /dev/null
+++ b/asn1view/common/ASN1Decoder.cs
@@ -0,0 +1,181 @@
+//
+// ASN1Decoder.cs: ASN.1 Decoder
+//
+// Author:
+// Sebastien Pouliot <sebastien@ximian.com>
+//
+// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
+//
+
+using System;
+using System.Collections;
+using System.Text;
+
+// NOTE: This class is a prototype. A future version of it will be included into
+// Mono.Security.dll in Mono 2.0. Use at your own risk (as the API _will_ change).
+
+namespace Mono.Security {
+
+ public class ASN1Element {
+
+ private byte [] _data;
+ private int _position;
+ private int _valueLength;
+ private int _valuePosition;
+ private ArrayList _childs;
+
+ public ASN1Element (byte[] buffer, int start)
+ {
+ _data = buffer;
+ _position = start;
+ _valuePosition = start + 1;
+
+ _valueLength = _data [_valuePosition++];
+
+ // special case #1 : undefined length
+ if (_valueLength == 0x80) {
+ // Value.Length will have it anyway
+ _valueLength = -1;
+ }
+ // special case where L contains the Length of the Length + 0x80
+ else if ((_valueLength & 0x80) == 0x80) {
+ int len = _valueLength & 0x7F;
+ _valueLength = 0;
+ for (int i = 0; i < len; i++)
+ _valueLength = _valueLength * 256 + _data [_valuePosition++];
+ }
+
+ if (IsConstructed && (_valueLength != 0)) {
+ DecodeChilds ();
+ if (_valueLength == -1) {
+ // update to the true (known) length
+ int childLength = 0;
+ if ((_childs != null) && (_childs.Count > 0)) {
+ foreach (ASN1Element child in _childs) {
+ childLength += child.TotalLength;
+ }
+ }
+ _valueLength = childLength;
+ }
+ }
+ }
+
+ public byte Tag {
+ get { return _data [_position]; }
+ }
+
+ public int Length {
+ get { return _valueLength; }
+ }
+
+ public byte[] Value {
+ get {
+ if (_valueLength < 0)
+ return null;
+ byte[] value = new byte [_valueLength];
+ Buffer.BlockCopy (_data, _valuePosition, value, 0, value.Length);
+ return value;
+ }
+ }
+
+ public bool IsConstructed {
+ get { return ((_data [_position] & 0x20) == 0x20); }
+ }
+
+ public bool IsUndefinedLength {
+ get { return (_data [_position + 1] == 0x80); }
+ }
+
+ public int Count {
+ get {
+ if (_childs == null)
+ return 0;
+ return _childs.Count;
+ }
+ }
+
+ public ASN1Element this [int index] {
+ get {
+ try {
+ if ((index < 0) || (index >= _childs.Count))
+ return null;
+ return (ASN1Element)_childs [index];
+ }
+ catch (ArgumentOutOfRangeException) {
+ return null;
+ }
+ }
+ }
+
+ public int Position {
+ get { return _position; }
+ }
+
+ internal int TotalLength {
+ get { return _valuePosition - _position + _valueLength; }
+ }
+
+ // note: Length has a variable length ;-)
+ public int ValuePosition {
+ get { return _valuePosition; }
+ }
+
+ private void DecodeChilds ()
+ {
+ _childs = new ArrayList ();
+ int childpos = _valuePosition;
+ int end = childpos + _valueLength;
+ while ((_valueLength == -1) || (childpos < end)) {
+ ASN1Element el = new ASN1Element (_data, childpos);
+ _childs.Add (el);
+ childpos += el.TotalLength;
+ // exit condition for undefined length (_valueLength == -1)
+ if ((el.Tag == 0x00) && (el.Length == 0))
+ break;
+ }
+ }
+
+ public override string ToString ()
+ {
+ StringBuilder sb = new StringBuilder ();
+ BuildString (sb, 0);
+ return sb.ToString ();
+ }
+
+ internal void BuildString (StringBuilder sb, int level)
+ {
+ for (int i = 0; i < level; i++) {
+ sb.Append (" ");
+ }
+ if (this.Value != null) {
+ if (this.Count > 0) {
+ sb.AppendFormat ("Tag {0} Length {1} {2} {3}",
+ this.Tag.ToString ("X2"),
+ this.Length, "{",
+ Environment.NewLine);
+
+ for (int j = 0; j < this.Count; j++) {
+ (this [j] as ASN1Element).BuildString (sb, level + 1);
+ }
+ for (int i = 0; i < level; i++) {
+ sb.Append (" ");
+ }
+ sb.AppendFormat ("{0} {1}", "}", Environment.NewLine);
+ }
+ else {
+ sb.AppendFormat ("Tag {0} Length {1} Value {2} {3}",
+ this.Tag.ToString ("X2"),
+ this.Length,
+ (this.Length == 0) ? String.Empty : BitConverter.ToString (this.Value),
+ Environment.NewLine);
+ }
+ }
+ else {
+ sb.AppendFormat ("Tag {0} Length {1} {2}",
+ this.Tag.ToString ("X2"),
+ this.IsUndefinedLength ? "Undefined" : "0",
+ Environment.NewLine);
+ }
+ }
+ }
+}
diff --git a/asn1view/common/AssemblyInfo.cs b/asn1view/common/AssemblyInfo.cs
new file mode 100644
index 00000000..a4a0ca89
--- /dev/null
+++ b/asn1view/common/AssemblyInfo.cs
@@ -0,0 +1,86 @@
+//
+// AssemblyInfo.cs: Assembly Informations
+//
+// Author:
+// Sebastien Pouliot <sebastien@ximian.com>
+//
+// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Text;
+
+// AssemblyTitle and AssemblyDescription are in /<ui>/Main.cs
+[assembly: AssemblyCompany ("Novell Inc.")]
+[assembly: AssemblyCopyright ("Copyright © 2004-2005 Novell Inc.")]
+[assembly: AssemblyVersion ("0.1.1.0")]
+
+namespace Mono.Tools {
+
+ public class AssemblyInfo {
+
+ private string _name;
+ private string _title;
+ private string _copyright;
+ private string _description;
+ private string _version;
+
+ public AssemblyInfo ()
+ : this (Assembly.GetExecutingAssembly ())
+ {
+ }
+
+ public AssemblyInfo (Assembly a)
+ {
+ if (a == null)
+ throw new ArgumentNullException ("a");
+
+ AssemblyName an = a.GetName ();
+ _name = an.ToString ();
+
+ object [] att = a.GetCustomAttributes (typeof (AssemblyTitleAttribute), false);
+ _title = ((att.Length > 0) ? ((AssemblyTitleAttribute) att [0]).Title : String.Empty);
+
+ att = a.GetCustomAttributes (typeof (AssemblyCopyrightAttribute), false);
+ _copyright = ((att.Length > 0) ? ((AssemblyCopyrightAttribute) att [0]).Copyright : String.Empty);
+
+ att = a.GetCustomAttributes (typeof (AssemblyDescriptionAttribute), false);
+ _description = ((att.Length > 0) ? ((AssemblyDescriptionAttribute) att [0]).Description : String.Empty);
+
+ _version = an.Version.ToString ();
+ }
+
+ public string Copyright {
+ get { return _copyright; }
+ }
+
+ public string Description {
+ get { return _description; }
+ }
+
+ public string Name {
+ get { return _name; }
+ }
+
+ public string Title {
+ get { return _title; }
+ }
+
+ public string Version {
+ get { return _version; }
+ }
+
+ public override string ToString ()
+ {
+ StringBuilder sb = new StringBuilder ();
+ sb.AppendFormat ("{1} - version {2}{0}{3}{0}{4}{0}",
+ Environment.NewLine,
+ _title, _version,
+ _description,
+ _copyright);
+ return sb.ToString ();
+ }
+ }
+}
diff --git a/asn1view/common/Makefile.am b/asn1view/common/Makefile.am
new file mode 100644
index 00000000..83abeef6
--- /dev/null
+++ b/asn1view/common/Makefile.am
@@ -0,0 +1,7 @@
+FILES= ASN1Decoder.cs \
+ AssemblyInfo.cs \
+ OidCache.cs \
+ PrettyPrinter.cs
+
+EXTRA_DIST= $(FILES)
+
diff --git a/asn1view/common/OidCache.cs b/asn1view/common/OidCache.cs
new file mode 100644
index 00000000..fa5bc100
--- /dev/null
+++ b/asn1view/common/OidCache.cs
@@ -0,0 +1,96 @@
+//
+// OidCache.cs: OID Cache Management
+//
+// Author:
+// Sebastien Pouliot <sebastien@ximian.com>
+//
+// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
+//
+
+using System;
+using System.Collections;
+using System.IO;
+
+public class OidCache {
+
+ private Hashtable _cache;
+ private bool _modified;
+
+ public OidCache ()
+ {
+ _cache = new Hashtable ();
+ _modified = false;
+ }
+
+ public OidCache (string filename)
+ : this ()
+ {
+ Load (filename);
+ }
+
+ public void Add (string oid, string description)
+ {
+ _cache.Add (oid, description);
+ _modified = true;
+ }
+
+ public void Clear ()
+ {
+ _cache.Clear ();
+ _modified = true;
+ }
+
+ public string Get (string oid)
+ {
+ return (string) _cache [oid];
+ }
+
+ public void Load (string filename)
+ {
+ if (!File.Exists (filename))
+ return;
+
+ using (StreamReader sr = new StreamReader (filename)) {
+ string oid = sr.ReadLine ();
+ while (oid != null) {
+ _cache.Add (oid, sr.ReadLine ());
+ oid = sr.ReadLine ();
+ }
+ sr.Close ();
+ }
+ _modified = false;
+ }
+
+ public void Save (string filename)
+ {
+ if (!_modified)
+ return;
+
+ try {
+ if (!File.Exists (filename)) {
+ string path = Path.GetDirectoryName (filename);
+ if (!Directory.Exists (path)) {
+ Directory.CreateDirectory (path);
+ }
+ }
+
+ using (StreamWriter sw = new StreamWriter (filename)) {
+ foreach (DictionaryEntry de in _cache) {
+ string desc = (string) de.Value;
+ // don't cache empty values. maybe we
+ // can download updated data (or from
+ // elsewhere) in a future session...
+ if ((desc != null) && (desc.Length > 0)) {
+ sw.WriteLine (de.Key);
+ sw.WriteLine (de.Value);
+ }
+ }
+ sw.Close ();
+ }
+ _modified = false;
+ }
+ catch (Exception e) {
+ Console.Error.WriteLine ("OID cache couldn't be saved. Cause: {0}", e.ToString ());
+ }
+ }
+}
diff --git a/asn1view/common/PrettyPrinter.cs b/asn1view/common/PrettyPrinter.cs
new file mode 100644
index 00000000..2f7ae353
--- /dev/null
+++ b/asn1view/common/PrettyPrinter.cs
@@ -0,0 +1,774 @@
+//
+// PrettyPrinter.cs: ASN.1 PrettyPrinter
+//
+// Author:
+// Sebastien Pouliot <sebastien@ximian.com>
+//
+// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
+//
+
+using System;
+using System.Collections;
+using System.Globalization;
+using System.IO;
+using System.Net;
+using System.Text;
+
+using Mono.Security;
+
+namespace Mono.Tools {
+
+ public enum OidFormat {
+ ITU,
+ IETF,
+ URN
+ }
+
+ public enum OidSource {
+ None,
+ Alvestrand,
+ Elibel
+ }
+
+ [Serializable]
+ public struct PrettyPrinterOptions {
+ public const string EmptyIdent = " ";
+ public const string DottedIndent = ". ";
+
+ public bool ViewPosition;
+ public bool ViewTag;
+ public bool ViewLength;
+ public bool DottedIndentation;
+ public bool ShowTagClass;
+ public bool IncludeEncapsulated;
+ public OidFormat OidFormat;
+ public OidSource OidSource;
+ public string FontName;
+
+ public void Copy (PrettyPrinterOptions options)
+ {
+ ViewPosition = options.ViewPosition;
+ ViewTag = options.ViewTag;
+ ViewLength = options.ViewLength;
+ DottedIndentation = options.DottedIndentation;
+ ShowTagClass = options.ShowTagClass;
+ IncludeEncapsulated = options.IncludeEncapsulated;
+ OidFormat = options.OidFormat;
+ OidSource = options.OidSource;
+ FontName = options.FontName;
+ }
+
+ public bool IsHeader ()
+ {
+ return (ViewPosition || ViewTag || ViewLength);
+ }
+
+ public string Indentation {
+ get { return (DottedIndentation) ? DottedIndent : EmptyIdent; }
+ }
+
+ static public PrettyPrinterOptions GetDefaults ()
+ {
+ PrettyPrinterOptions ppo = new PrettyPrinterOptions ();
+ ppo.ViewPosition = true;
+ ppo.ViewTag = true;
+ ppo.ViewLength = true;
+ ppo.DottedIndentation = false;
+ ppo.OidFormat = OidFormat.IETF;
+ ppo.OidSource = OidSource.None;
+ ppo.ShowTagClass = false;
+ ppo.IncludeEncapsulated = false;
+ ppo.FontName = null;
+ return ppo;
+ }
+ }
+
+ public class PrettyPrinter {
+
+ private static PrettyPrinterOptions _defaults;
+ private static OidCache _cache;
+
+ static PrettyPrinter ()
+ {
+ _defaults = PrettyPrinterOptions.GetDefaults ();
+ _cache = new OidCache ();
+ }
+
+ public static OidCache Cache {
+ get { return _cache; }
+ }
+
+ private ASN1Element _asn;
+ private PrettyPrinterOptions _options;
+ private int _prefix;
+
+ public PrettyPrinter (ASN1Element asn)
+ {
+ _asn = asn;
+ _options.Copy (_defaults);
+ }
+
+ public ASN1Element Document {
+ get { return _asn; }
+ set {
+ _asn = value;
+ _options.Copy (_defaults);
+ }
+ }
+
+ public PrettyPrinterOptions Options {
+ get { return _options; }
+ set { _options = value; }
+ }
+
+ public override string ToString ()
+ {
+ if (_asn == null)
+ return String.Empty;
+
+ StringBuilder sb = new StringBuilder ();
+ _prefix = 0;
+ PrintElement (sb, 0, _asn);
+ return sb.ToString ();
+ }
+
+ // TODO > 9999 (dec) or FFFF (hex)
+ private void Header (StringBuilder sb, ASN1Element asn)
+ {
+ if (asn == null) {
+ if (_options.IsHeader ()) {
+ if (_options.ViewPosition)
+ sb.Append (" ");
+ if (_options.ViewTag)
+ sb.Append (" ");
+ if (_options.ViewLength)
+ sb.Append (" ");
+ sb.Append (": ");
+ }
+ } else {
+ // _prefix is used for encapsulated data
+ if (_options.ViewPosition)
+ sb.AppendFormat ("{0} ", (_prefix + asn.Position).ToString ("D4"));
+ if (_options.ViewTag)
+ sb.AppendFormat ("{0} ", asn.Tag.ToString ("X2"));
+ if (_options.ViewLength)
+ sb.AppendFormat ("{0} ", (asn.IsUndefinedLength) ? "NDEF" : asn.Length.ToString ("D4"));
+ if (_options.IsHeader ())
+ sb.Append (": ");
+ }
+ }
+
+ private void Indent (StringBuilder sb, int level)
+ {
+ for (int i = 0; i < level; i++) {
+ sb.Append (_options.Indentation);
+ }
+ }
+
+ private void PrintElement (StringBuilder sb, int level, ASN1Element asn)
+ {
+ // used in undefined length encoding
+ if (asn.Tag == 0x00)
+ return;
+
+ Header (sb, asn);
+ Indent (sb, level);
+
+ GetTagName (sb, level, asn);
+
+ if (asn.Count > 0) {
+ sb.Append (Environment.NewLine);
+ for (int i = 0; i < asn.Count; i++)
+ PrintElement (sb, level + 1, asn [i]);
+ }
+
+ if (asn.IsConstructed) {
+ if (asn.Count > 0) {
+ Header (sb, null);
+ Indent (sb, level);
+ }
+ sb.Append ("}");
+ }
+ sb.Append (Environment.NewLine);
+ }
+
+ private void GetTagName (StringBuilder sb, int level, ASN1Element asn)
+ {
+ switch (asn.Tag) {
+ case 0x01:
+ PrintBoolean (sb, level, asn);
+ break;
+ case 0x02:
+ PrintInteger (sb, level, asn);
+ break;
+ case 0x03:
+ PrintBitString (sb, level, asn);
+ break;
+ case 0x04:
+ PrintOctetString (sb, level, asn);
+ break;
+ case 0x05:
+ PrintNull (sb, level, asn);
+ break;
+ case 0x06:
+ PrintOID (sb, level, asn);
+ break;
+ case 0x07:
+ PrintObjectDescriptor (sb, level, asn);
+ break;
+ case 0x08:
+ PrintExternal (sb, level, asn);
+ break;
+ case 0x09:
+ PrintReal (sb, level, asn);
+ break;
+ case 0x0A:
+ PrintEnumerated (sb, level, asn);
+ break;
+ case 0x0B:
+ PrintEmbeddedPDV (sb, level, asn);
+ break;
+ case 0x0C:
+ PrintUtf8String (sb, level, asn);
+ break;
+ case 0x0D:
+ PrintRelativeOid (sb, level, asn);
+ break;
+ // 0x0E RFU
+ // 0x0F RFU
+ case 0x10:
+ sb.Append ("SEQUENCE"); // non-constructed version
+ break;
+ case 0x11:
+ sb.Append ("SET"); // non-constructed version
+ break;
+ case 0x12:
+ PrintNumericString (sb, level, asn);
+ break;
+ case 0x13:
+ PrintPrintableString (sb, level, asn);
+ break;
+ case 0x14:
+ PrintT61String (sb, level, asn);
+ break;
+ case 0x15:
+ PrintVideotexString (sb, level, asn);
+ break;
+ case 0x16:
+ PrintIA5String (sb, level, asn);
+ break;
+ case 0x17:
+ PrintUtcTime (sb, level, asn);
+ break;
+ case 0x18:
+ PrintGeneralizedTime (sb, level, asn);
+ break;
+ case 0x19:
+ PrintGraphicString (sb, level, asn);
+ break;
+ case 0x1A:
+ PrintVisibleString (sb, level, asn);
+ break;
+ case 0x1B:
+ PrintGeneralString (sb, level, asn);
+ break;
+ case 0x1C:
+ PrintUniversalString (sb, level, asn);
+ break;
+ case 0x1D:
+ PrintCharacterString (sb, level, asn);
+ break;
+ case 0x1E:
+ PrintBMPString (sb, level, asn);
+ break;
+ case 0x30:
+ sb.Append ("SEQUENCE {");
+ break;
+ case 0x31:
+ sb.Append ("SET {");
+ break;
+ default:
+ PrintOtherData (sb, level, asn);
+ break;
+ }
+ }
+
+ private void PrintEncapsulated (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.Append (", encapsulates {");
+ sb.Append (Environment.NewLine);
+ PrintElement (sb, level + 1, asn);
+ Header (sb, null);
+ Indent (sb, level);
+ sb.Append ("}");
+ }
+
+ private void PrintData (StringBuilder sb, int level, byte[] data, int start, int length)
+ {
+ bool str = true;
+ // first we look if the data is an ASCII string
+ for (int i=0; i < length; i++) {
+ if (!Char.IsLetterOrDigit ((char) data [i])) {
+ str = false;
+ break;
+ }
+ }
+
+ if (str) {
+ PrintString (sb, level, Encoding.ASCII.GetString (data, start, length));
+ }
+ else {
+ PrintBinaryData (sb, level, data, start, length);
+ }
+ }
+
+ private void PrintBinaryData (StringBuilder sb, int level, byte[] data, int start, int length)
+ {
+ int lines = length >> 5; // 32 per line
+ for (int i = 0; i < lines; i++) {
+ sb.Append (Environment.NewLine);
+ Header (sb, null);
+ Indent (sb, level + 1);
+ sb.Append (BitConverter.ToString (data, start, 32));
+ start += 32;
+ }
+ int mod = (length - (lines << 5)); // remainder
+ if (mod > 0) {
+ sb.Append (Environment.NewLine);
+ Header (sb, null);
+ Indent (sb, level + 1);
+ sb.Append (BitConverter.ToString (data, start, mod));
+ }
+ }
+
+ private void PrintString (StringBuilder sb, int level, string s)
+ {
+ int lines = s.Length >> 6; // 64 per line
+ int start = 0;
+ for (int i = 0; i < lines; i++) {
+ sb.Append (Environment.NewLine);
+ Header (sb, null);
+ Indent (sb, level + 1);
+ sb.AppendFormat ("'{0}'", s.Substring (start, 64));
+ start += 64;
+ }
+ int mod = (s.Length - (lines << 6)); // remainder
+ if (mod > 0) {
+ sb.Append (Environment.NewLine);
+ Header (sb, null);
+ Indent (sb, level + 1);
+ sb.AppendFormat ("'{0}'", s.Substring (start));
+ }
+ }
+
+ private void PrintToDo (string s, StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.AppendFormat ("{0} (TODO)");
+ byte[] value = asn.Value;
+ PrintData (sb, level, value, 0, value.Length);
+ }
+
+ // 0x01 BOOLEAN
+ private void PrintBoolean (StringBuilder sb, int level, ASN1Element asn)
+ {
+ byte[] value = asn.Value;
+ sb.AppendFormat ("BOOLEAN {0}", (value [0] == 1) ? "FALSE" : "TRUE");
+ }
+
+ // 0x02 INTEGER
+ private void PrintInteger (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.Append ("INTEGER ");
+ byte[] value = asn.Value;
+ // case 1 - it fits into a ulong (8 bytes)
+ if (value.Length <= 8) {
+ ulong integer = 0;
+ for (int i=0; i < value.Length; i++)
+ integer = (integer << 8) + value [i];
+ sb.Append (integer);
+ } else {
+ // TODO: Use BigInteger class to display the beast
+ PrintBinaryData (sb, level, value, 0, value.Length);
+ }
+ }
+
+ // 0x03 BIT STRING
+ private void PrintBitString (StringBuilder sb, int level, ASN1Element asn)
+ {
+ byte[] value = asn.Value;
+ bool printed = false;
+ sb.AppendFormat ("BIT STRING ({0} unused bits)", value [0]);
+ if (_options.IncludeEncapsulated) {
+ try {
+ ASN1Element enc = new ASN1Element (value, 1);
+ if ((enc.Tag <= 0x31) && (enc.Length < asn.Length)) {
+ _prefix = asn.ValuePosition;
+ PrintEncapsulated (sb, level, enc);
+ printed = true;
+ }
+ }
+ catch {
+ // it may not be ASN.1 !
+ }
+ finally {
+ _prefix = 0;
+ }
+ }
+
+ if (!printed) {
+ // special case for small data (e.g. bitmask)
+ if (value.Length == 2) {
+ sb.Append (Environment.NewLine);
+ Header (sb, null);
+ Indent (sb, level + 1);
+
+ byte b = value [1];
+ // skip the unused bits
+ for (int i = 0; i < value [0]; i++)
+ b >>= 1;
+ // and show the remaining bits
+ sb.Append ("'");
+ for (int i = value [0]; i < 8; i++) {
+ sb.Append (((b & 1) == 1) ? "1" : "0");
+ b >>= 1;
+ }
+ sb.Append ("'B");
+ } else {
+ PrintData (sb, level, value, 1, value.Length - 1);
+ }
+ }
+ }
+
+ // 0x04 OCTET STRING
+ private void PrintOctetString (StringBuilder sb, int level, ASN1Element asn)
+ {
+ byte[] value = asn.Value;
+ bool printed = false;
+ sb.Append ("OCTET STRING");
+ if (_options.IncludeEncapsulated) {
+ try {
+ ASN1Element enc = new ASN1Element (value, 0);
+ if ((enc.Tag <= 0x31) && (enc.Length < asn.Length)) {
+ _prefix = asn.ValuePosition;
+ PrintEncapsulated (sb, level, enc);
+ printed = true;
+ }
+ }
+ catch {
+ // it may not be ASN.1 !
+ }
+ finally {
+ _prefix = 0;
+ }
+ }
+
+ if (!printed) {
+ PrintData (sb, level, value, 0, value.Length);
+ }
+ }
+
+ // 0x05 NULL
+ private void PrintNull (StringBuilder sb, int level, ASN1Element asn)
+ {
+ // FIXME: report errors if length != 0 (in ASNElement ?)
+ sb.Append ("NULL");
+ }
+
+ // 0x06 OBJECT IDENTIFIER
+ private void PrintOID (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.Append ("OBJECT IDENTIFIER ");
+ string oid = DecodeOid (asn.Value);
+ string name = ResolveOid (oid);
+ if (name.Length > 0)
+ sb.AppendFormat ("{0} ", name);
+
+ switch (_options.OidFormat) {
+ case OidFormat.ITU:
+ sb.AppendFormat ("({0})", oid.Replace ('.', ' '));
+ break; // 0x0C UTF8 STRING
+ case OidFormat.URN:
+ sb.AppendFormat ("(urn:oid:{0})", oid);
+ break;
+ default:
+ sb.AppendFormat ("({0})", oid);
+ break;
+ }
+ }
+
+ // 0x07 OBJECT DESCRIPTOR
+ private void PrintObjectDescriptor (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.Append ("ObjectDescriptor");
+ PrintString (sb, level, Encoding.ASCII.GetString (asn.Value));
+ }
+
+ // 0x08 EXTERNAL
+ private void PrintExternal (StringBuilder sb, int level, ASN1Element asn)
+ {
+ PrintToDo ("EXTERNAL", sb, level, asn);
+ }
+
+ // 0x09 REAL
+ private void PrintReal (StringBuilder sb, int level, ASN1Element asn)
+ {
+ PrintToDo ("REAL", sb, level, asn);
+ }
+
+ // 0x0A ENUMERATED
+ private void PrintEnumerated (StringBuilder sb, int level, ASN1Element asn)
+ {
+ PrintToDo ("ENUMERATED", sb, level, asn);
+ }
+
+ // 0x0B EMBEDDED PDV (PRESENTATION DATA VALUE)
+ private void PrintEmbeddedPDV (StringBuilder sb, int level, ASN1Element asn)
+ {
+ PrintToDo ("EMBEDDED PDV", sb, level, asn);
+ }
+
+ // 0x0C UTF8 STRING
+ private void PrintUtf8String (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.Append ("UTF8String");
+ PrintString (sb, level, Encoding.UTF8.GetString (asn.Value));
+ }
+
+ // 0x0D RELATIVE-OID
+ private void PrintRelativeOid (StringBuilder sb, int level, ASN1Element asn)
+ {
+ PrintToDo ("RELATIVE-OID", sb, level, asn);
+ }
+
+ // 0x12 NUMERIC STRING
+ private void PrintNumericString (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.Append ("NumericString");
+ // FIXME: should contain only ' ' and '0' to '9'
+ PrintString (sb, level, Encoding.ASCII.GetString (asn.Value));
+ }
+
+ // 0x13 PRINTABLE STRING
+ private void PrintPrintableString (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.Append ("PrintableString"); // ASCII subset
+ PrintString (sb, level, Encoding.ASCII.GetString (asn.Value));
+ }
+
+ // 0x14 T61 STRING
+ private void PrintT61String (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.Append ("TeletexString");
+ PrintString (sb, level, Encoding.ASCII.GetString (asn.Value));
+ }
+
+ // 0x15 VIDEOTEX STRING
+ private void PrintVideotexString (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.Append ("VideotexString");
+ PrintString (sb, level, Encoding.ASCII.GetString (asn.Value));
+ }
+
+ // 0x16 IA5 STRING
+ private void PrintIA5String (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.Append ("IA5String"); // ASCII
+ PrintString (sb, level, Encoding.ASCII.GetString (asn.Value));
+ }
+
+ // 0x17 UTC TIME
+ private void PrintUtcTime (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.AppendFormat ("UTCTime '{0}'", Encoding.ASCII.GetString (asn.Value));
+ // TODO: option to show as local time ?
+ }
+
+ // 0x18 GENERALIZED TIME
+ private void PrintGeneralizedTime (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.AppendFormat ("GeneralizedTime '{0}'", Encoding.ASCII.GetString (asn.Value));
+ // TODO: option to show as local time ?
+ }
+
+ // 0x19 GRAPHIC STRING
+ private void PrintGraphicString (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.Append ("GraphicString");
+ PrintString (sb, level, Encoding.ASCII.GetString (asn.Value));
+ }
+
+ // 0x1A VISIBLE STRING
+ private void PrintVisibleString (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.Append ("VisibleString"); // ASCII subset
+ PrintString (sb, level, Encoding.ASCII.GetString (asn.Value));
+ }
+
+ // 0x1B GENERAL STRING
+ private void PrintGeneralString (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.Append ("GeneralString");
+ PrintString (sb, level, Encoding.ASCII.GetString (asn.Value));
+ }
+
+ // 0x1C UNIVERSAL STRING
+ private void PrintUniversalString (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.Append ("UniversalString");
+ PrintString (sb, level, Encoding.ASCII.GetString (asn.Value));
+ }
+
+ // 0x1D CHARACTER STRING
+ private void PrintCharacterString (StringBuilder sb, int level, ASN1Element asn)
+ {
+ PrintToDo ("CHARACTER STRING", sb, level, asn);
+ }
+
+ // 0x1E BMP STRING
+ private void PrintBMPString (StringBuilder sb, int level, ASN1Element asn)
+ {
+ sb.Append ("BMPString"); // Unicode
+ PrintString (sb, level, Encoding.Unicode.GetString (asn.Value));
+ }
+
+ // Print non universal data (application, context, private)
+ private void PrintOtherData (StringBuilder sb, int level, ASN1Element asn)
+ {
+ byte tag = asn.Tag;
+ if (tag < 0x40) {
+ PrintToDo ("UNKNOWN", sb, level, asn);
+ return;
+ }
+
+ string type = null;
+ if (tag >= 0xC0) {
+ tag -= 0xC0;
+ type = "PRIVATE";
+ }
+ if (tag >= 0x80) {
+ tag -= 0x80;
+ type = "CONTEXT";
+ }
+ if (tag >= 0x40) {
+ tag -= 0x40;
+ type = "APPLICATION";
+ }
+
+ byte[] value = asn.Value;
+
+ sb.Append ("[");
+ if (_options.ShowTagClass)
+ sb.AppendFormat ("{0} ", type);
+ if (asn.IsConstructed) {
+ sb.AppendFormat ("{0}] {1}", (tag - 0x20), "{");
+ // constructed data is automatically printed elsewhere
+ } else {
+ sb.AppendFormat ("{0}]", tag);
+ PrintData (sb, level, value, 0, value.Length);
+ }
+ }
+
+ // OID decoding / fetching stuff
+
+ private string DecodeOid (byte[] oid)
+ {
+ StringBuilder sb = new StringBuilder ();
+ // Pick apart the OID
+ byte x = (byte) (oid [0] / 40);
+ byte y = (byte) (oid [0] % 40);
+ if (x > 2) {
+ // Handle special case for large y if x = 2
+ y += (byte) ((x - 2) * 40);
+ x = 2;
+ }
+ sb.AppendFormat ("{0}.{1}", x, y);
+ ulong val = 0;
+ for (x = 1; x < oid.Length; x++) {
+ val = ((val << 7) | ((byte) (oid [x] & 0x7F)));
+ if ( !((oid [x] & 0x80) == 0x80)) {
+ sb.AppendFormat (".{0}", val);
+ val = 0;
+ }
+ }
+ return sb.ToString ();
+ }
+
+ private string ResolveOid (string oid)
+ {
+ // 1. try to load from cache
+ string name = _cache.Get (oid);
+ if (name != null)
+ return name;
+
+ // 2. if not found then download from the web
+ switch (_options.OidSource) {
+ case OidSource.Alvestrand:
+ name = GetOidInfoFromAlvestrand (oid);
+ _cache.Add (oid, name);
+ break;
+ case OidSource.Elibel:
+ name = GetOidInfoFromElibel (oid);
+ _cache.Add (oid, name);
+ break;
+ default:
+ name = String.Empty;
+ break;
+ }
+
+ return name;
+ }
+
+ private string GetOidInfoFromAlvestrand (string oid)
+ {
+ string name = String.Empty;
+ try {
+ string url = String.Concat ("http://www.alvestrand.no/objectid/", oid, ".html");
+ HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+ WebResponse resp = req.GetResponse ();
+ Stream s = resp.GetResponseStream ();
+ StreamReader sr = new StreamReader (s, Encoding.UTF8);
+ string webpage = sr.ReadToEnd ();
+ int end = webpage.IndexOf ("</h1>");
+ if (end != -1) {
+ int start = webpage.LastIndexOf (' ', end);
+ if (start != -1) {
+ name = webpage.Substring (start + 1, end - start - 1);
+ }
+ }
+ }
+ catch (Exception) {
+ // many things can go wrong but it's only some
+ // "additional" (not essential) data
+ // FIXME: report error to UI
+ }
+ return name;
+ }
+
+ private string GetOidInfoFromElibel (string oid)
+ {
+ string name = String.Empty;
+ try {
+ string url = String.Concat ("http://asn1.elibel.tm.fr/cgi-bin/oid/display?oid=", oid, "&action=display");
+ HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+ WebResponse resp = req.GetResponse ();
+ Stream s = resp.GetResponseStream ();
+ StreamReader sr = new StreamReader (s, Encoding.UTF8);
+ string webpage = sr.ReadToEnd ();
+ int end = webpage.IndexOf (")}</title>");
+ if (end != -1) {
+ end = webpage.LastIndexOf ("(", end);
+ int start = webpage.LastIndexOf (' ', end);
+ if (start != -1) {
+ name = webpage.Substring (start + 1, end - start - 1);
+ }
+ }
+ }
+ catch (Exception) {
+ // many things can go wrong but it's only some
+ // "additional" (not essential) data
+ // FIXME: report error to UI
+ }
+ return name;
+ }
+ }
+}
diff --git a/asn1view/gtk/Main.cs b/asn1view/gtk/Main.cs
new file mode 100644
index 00000000..044e01b6
--- /dev/null
+++ b/asn1view/gtk/Main.cs
@@ -0,0 +1,745 @@
+//
+// GnomeMain.cs: Main GUI file for GNOME
+//
+// Author:
+// Sebastien Pouliot <sebastien@ximian.com>
+//
+// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
+//
+
+// fx
+using System;
+using System.IO;
+using System.Reflection;
+using System.Text;
+using System.Xml;
+using System.Xml.Serialization;
+
+// gtk#
+using Glade;
+using Gnome;
+using Gtk;
+using Gdk;
+using Pango;
+
+// project internal
+using Mono.Security;
+using Mono.Tools;
+
+[assembly: AssemblyTitle ("ASNView")]
+[assembly: AssemblyDescription ("ASN.1 Viewer for GNOME.")]
+
+public class GASNViewerApp {
+
+ private static readonly string cache;
+ private static readonly string config;
+// private static Program program;
+ private static AssemblyInfo _info;
+ private static TextSearchFlags tsf = TextSearchFlags.TextOnly | TextSearchFlags.VisibleOnly;
+
+ // Application
+ [Widget] private App gasnview;
+ [Widget] private AppBar appbar1;
+ [Widget] private TextView textview1;
+
+ // Menu / Toolbar support
+ [Widget] private ImageMenuItem file_export;
+ [Widget] private Gtk.Image fileexportimage;
+ [Widget] private CheckMenuItem view_position;
+ [Widget] private CheckMenuItem view_tag;
+ [Widget] private CheckMenuItem view_dotted_indentation;
+ [Widget] private CheckMenuItem view_length;
+ [Widget] private RadioMenuItem view_oid_format_ietf;
+ [Widget] private RadioMenuItem view_oid_format_itu;
+ [Widget] private RadioMenuItem view_oid_format_urn;
+ [Widget] private CheckMenuItem view_display_class;
+ [Widget] private CheckMenuItem view_encapsulated;
+ [Widget] private RadioMenuItem settings_oid_alvestrand;
+ [Widget] private RadioMenuItem settings_oid_elibel;
+ [Widget] private RadioMenuItem settings_oid_none;
+
+ // Find bar support
+ [Widget] private HBox findbar;
+ [Widget] private Label findlabel;
+ [Widget] private Gtk.Entry findentry;
+ [Widget] private Button findnextbutton;
+ [Widget] private Button findhighlightbutton;
+ [Widget] private Button findpreviousbutton;
+ [Widget] private Gtk.Image highlightimage;
+ [Widget] private Gtk.Image findimage;
+ private TextIter findbck;
+ private int findstart;
+ private int findend;
+ private Gdk.Color finderrorbasecolor;
+ private Gdk.Color finderrortextcolor;
+ private TextIter findfwd;
+ private Gdk.Color findnormalbasecolor;
+ private Gdk.Color findnormaltextcolor;
+ private bool findhighlight;
+ private TextTag highlight;
+ private Pixbuf highlight_off;
+ private Pixbuf highlight_on;
+
+ // Editor
+ private FontDescription fontdesc;
+ private PrettyPrinterOptions options;
+ private PrettyPrinter pp;
+ private TextTag encapsulated;
+
+ // Application data
+ private ASN1Element asn;
+ private string currentfile;
+ private string savename;
+
+ static GASNViewerApp ()
+ {
+ string path = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal),
+ Path.Combine (".config", "asnview"));
+
+ cache = Path.Combine (path, "oid.cache");
+ config = Path.Combine (path, "config.xml");
+ _info = new AssemblyInfo ();
+ }
+
+ public static void Main (string[] args)
+ {
+// GASNViewerApp.program =
+ new Program (_info.Title, _info.Version, Modules.UI, args);
+ new GASNViewerApp (args);
+ }
+
+ public static AssemblyInfo AppInfo {
+ get { return GASNViewerApp._info; }
+ }
+
+ public GASNViewerApp (string[] args)
+ {
+ Application.Init ();
+ Glade.XML xml = new Glade.XML (null, "gui.glade", "gasnview", null);
+ xml.Autoconnect (this);
+
+ options = LoadConfig (config);
+ UpdateOptions ();
+
+ // load cache
+ PrettyPrinter.Cache.Load (cache);
+
+ // UI preparation
+ fileexportimage.Pixbuf = new Pixbuf (null, "export.png");
+ file_export.Image = new Gtk.Image (new Pixbuf (null, "export-16.png"));
+ textview1.Editable = false;
+ textview1.GrabFocus ();
+ Font = options.FontName;
+ findfwd = textview1.Buffer.StartIter;
+ findbck = textview1.Buffer.EndIter;
+ findstart = -1;
+ findend = -1;
+ highlight_on = new Pixbuf (null, "text_hilight-16.png");
+ highlight_off = new Pixbuf (null, "text_lolight-16.png");
+ findhighlight = false;
+ findnormalbasecolor = findentry.Style.Base (StateType.Normal);
+ try {
+ // GTK# bug - entry point was missing in early 1.0.x versions
+ findnormaltextcolor = findentry.Style.Text (StateType.Normal);
+ }
+ catch (EntryPointNotFoundException) {
+ findnormaltextcolor = new Gdk.Color (0x00, 0x00, 0x00);
+ }
+ finderrorbasecolor = new Gdk.Color (0xff, 0x00, 0x00);
+ finderrortextcolor = new Gdk.Color (0xff, 0xff, 0xff);
+
+ highlight = new TextTag ("highlight");
+ highlight.BackgroundGdk = new Gdk.Color (0xff, 0xff, 0x00);
+ textview1.Buffer.TagTable.Add (highlight);
+ encapsulated = new TextTag ("encapsulated");
+ encapsulated.ForegroundGdk = new Gdk.Color (0x00, 0x00, 0xff);
+ textview1.Buffer.TagTable.Add (encapsulated);
+ Highlight (false);
+
+ // load any specified file and execute application
+ if (args.Length > 0) {
+ FileLoad (args[0]);
+ }
+ Application.Run ();
+ }
+
+ // Application events
+
+ public void OnWindowDeleteEvent (object o, DeleteEventArgs args)
+ {
+ OnFileQuit (null, null);
+ args.RetVal = true;
+ }
+
+ public void OnCloseFindBarButtonClick (object sender, EventArgs args)
+ {
+ findbar.Visible = false;
+ }
+
+ // Data Management
+
+ private byte[] Load (string filename)
+ {
+ byte[] buffer = null;
+ using (FileStream fs = File.OpenRead (filename)) {
+ buffer = new byte [fs.Length];
+ fs.Read (buffer, 0, buffer.Length);
+ fs.Close ();
+ }
+ return buffer;
+ }
+
+ private ASN1Element Decode (byte[] data)
+ {
+ return new ASN1Element (data, 0);
+ }
+
+ private void FileExport (string filename)
+ {
+ try {
+ filename = Path.GetFullPath(filename);
+ if (filename == currentfile) {
+ string msg = string.Format ("You are about to replace the original binary ASN.1 file with its textual representation.\nDo you want to overwrite original file {0} ?", filename);
+ if (!AskUser (msg)) {
+ return;
+ }
+ } else if (File.Exists(filename)) {
+ string msg = string.Format("Do you want to overwrite file {0} ?", filename);
+ if (!AskUser (msg)) {
+ return;
+ }
+ }
+
+ using (StreamWriter sw = new StreamWriter (filename, false, Encoding.UTF8)) {
+ sw.Write (textview1.Buffer.Text);
+ sw.Close ();
+ }
+ appbar1.ProgressPercentage = 1.0f;
+ savename = filename;
+ }
+ catch (Exception e) {
+ savename = null;
+ appbar1.Default = "Error saving file " + filename;
+ Console.Error.WriteLine (e);
+ }
+ }
+
+ private void FileLoad (string filename)
+ {
+ try {
+ byte[] buffer = Load (filename);
+ appbar1.ProgressPercentage = 0.25f;
+ asn = Decode (buffer);
+ appbar1.ProgressPercentage = 0.75f;
+ UpdateDisplay ();
+ appbar1.ProgressPercentage = 1.0f;
+ currentfile = Path.GetFullPath (filename);
+ appbar1.Default = currentfile;
+ findfwd = textview1.Buffer.StartIter;
+ findbck = textview1.Buffer.EndIter;
+ }
+ catch (Exception e) {
+ currentfile = null;
+ asn = null;
+ textview1.Buffer.Text = e.ToString ();
+ appbar1.Default = "Error loading file " + filename;
+ Console.Error.WriteLine (e);
+ }
+ }
+
+ // File Menu
+
+ public void OnFileNew (object sender, EventArgs args)
+ {
+ currentfile = null;
+ savename = null;
+ asn = null;
+ pp = null;
+ appbar1.Default = String.Empty;
+ UpdateDisplay ();
+ findfwd = textview1.Buffer.StartIter;
+ findbck = textview1.Buffer.EndIter;
+ findstart = -1;
+ findend = -1;
+ OnFindEntryChange (sender, args);
+ }
+
+ public void OnFileOpen (object sender, EventArgs args)
+ {
+ appbar1.ProgressPercentage = 0.0f;
+ FileSelection fs = new FileSelection ("Open");
+ try {
+ bool ok = (fs.Run () == (int)Gtk.ResponseType.Ok);
+ fs.Hide ();
+ if (ok) {
+ OnFileNew (sender, args);
+ FileLoad (fs.Filename);
+ OnFindEntryChange (sender, args);
+ }
+ }
+ finally {
+ fs.Destroy ();
+ appbar1.ProgressPercentage = 1.0f;
+ }
+ }
+
+ public void OnFileExport (object sender, EventArgs args)
+ {
+ if (savename == null) {
+ OnFileExportAs (sender, args);
+ } else {
+ FileExport (savename);
+ }
+ }
+
+ public void OnFileExportAs(object sender, EventArgs args)
+ {
+ appbar1.ProgressPercentage = 0.0f;
+ FileSelection fs = new FileSelection ("Export As");
+ try {
+ bool ok = (fs.Run () == (int)Gtk.ResponseType.Ok);
+ fs.Hide ();
+ if (ok) {
+ FileExport (fs.Filename);
+ }
+ }
+ finally {
+ fs.Destroy ();
+ appbar1.ProgressPercentage = 1.0f;
+ }
+ }
+
+ public void OnFileRevert(object sender, EventArgs args)
+ {
+ if (currentfile != null) {
+ FileLoad (currentfile);
+ }
+ }
+
+ public void OnFileQuit (object sender, EventArgs args)
+ {
+ PrettyPrinter.Cache.Save (cache);
+ SaveConfig (config, options);
+ Application.Quit ();
+ }
+
+ // Edit Menu
+
+ public void OnEditCopy (object sender, EventArgs args)
+ {
+ textview1.Buffer.CopyClipboard (Clipboard.Get (Gdk.Selection.Clipboard));
+ }
+
+ public void OnEditFind (object sender, EventArgs args)
+ {
+ findlabel.Text = String.Empty;
+ OnFindEntryChange (sender, args);
+ findbar.Visible = true;
+ findentry.GrabFocus ();
+ }
+
+ public void OnEditSelectAll (object sender, EventArgs args)
+ {
+ textview1.Buffer.MoveMark ("insert", textview1.Buffer.StartIter);
+ textview1.Buffer.MoveMark ("selection_bound", textview1.Buffer.EndIter);
+ }
+
+ // View Menu
+
+ public void OnViewPosition (object sender, EventArgs args)
+ {
+ options.ViewPosition = (sender as CheckMenuItem).Active;
+ UpdateDisplay ();
+ }
+
+ public void OnViewTag (object sender, EventArgs args)
+ {
+ options.ViewTag = (sender as CheckMenuItem).Active;
+ UpdateDisplay ();
+ }
+
+ public void OnViewLength (object sender, EventArgs args)
+ {
+ options.ViewLength = (sender as CheckMenuItem).Active;
+ UpdateDisplay ();
+ }
+
+ public void OnViewDottedIndentation (object sender, EventArgs args)
+ {
+ options.DottedIndentation = (sender as CheckMenuItem).Active;
+ UpdateDisplay ();
+ }
+
+ public void OnViewOidFormatItu (object sender, EventArgs args)
+ {
+ options.OidFormat = OidFormat.ITU;
+ UpdateDisplay ();
+ }
+
+ public void OnViewOidFormatIetf (object sender, EventArgs args)
+ {
+ options.OidFormat = OidFormat.IETF;
+ UpdateDisplay ();
+ }
+
+ public void OnViewOidFormatUrn (object sender, EventArgs args)
+ {
+ options.OidFormat = OidFormat.URN;
+ UpdateDisplay ();
+ }
+
+ public void OnViewDisplayClass (object sender, EventArgs args)
+ {
+ options.ShowTagClass = (sender as CheckMenuItem).Active;
+ UpdateDisplay ();
+ }
+
+ public void OnViewEncapsulated (object sender, EventArgs args)
+ {
+ options.IncludeEncapsulated = (sender as CheckMenuItem).Active;
+ UpdateDisplay ();
+ }
+
+ // Settings Menu
+
+ public void OnSettingsOidSourceNone (object sender, EventArgs args)
+ {
+ options.OidSource = OidSource.None;
+ }
+
+ public void OnSettingsOidSourceAlvestrand (object sender, EventArgs args)
+ {
+ options.OidSource = OidSource.Alvestrand;
+ }
+
+ public void OnSettingsOidSourceElibel (object sender, EventArgs args)
+ {
+ options.OidSource = OidSource.Elibel;
+ }
+
+ public void OnSettingsClearOidCache (object sender, EventArgs args)
+ {
+ if (AskUser ("Are you sure you want to clear the OID cache ?\nN.b. They will be downloaded again as required from the selected site.")) {
+ PrettyPrinter.Cache.Clear ();
+ }
+ }
+
+ public void OnSettingsSelectFont (object sender, EventArgs args)
+ {
+ FontSelectionDialog fsd = new FontSelectionDialog ("Select Font");
+ try {
+ fsd.SetFontName (Font);
+ if (fsd.Run () == (int)Gtk.ResponseType.Ok) {
+ Font = fsd.FontName;
+ }
+ }
+ finally {
+ fsd.Destroy ();
+ }
+ }
+
+ // Help Menu
+
+ public void OnHelpAbout(object sender, EventArgs args)
+ {
+ string[] authors = new string [1] { "Sebastien Pouliot <sebastien@ximian.com>" } ;
+ About about = new About (_info.Title, _info.Version, _info.Copyright, _info.Description, authors, new string [0], String.Empty, null);
+ about.Run ();
+ }
+
+ // Find Bar
+
+ public void OnFindEntryChange (object sender, EventArgs args)
+ {
+ bool empty = (findentry.Text.Length == 0);
+ bool found = (!empty && (textview1.Buffer.Text.IndexOf (findentry.Text) >= 0));
+ if (!empty && !found) {
+ findentry.ModifyBase (StateType.Normal, finderrorbasecolor);
+ findentry.ModifyText (StateType.Normal, finderrortextcolor);
+ findlabel.Text = "Text not found";
+ findimage.Visible = true;
+ findimage.Display.Beep ();
+ } else {
+ findentry.ModifyBase (StateType.Normal, findnormalbasecolor);
+ findentry.ModifyText (StateType.Normal, findnormaltextcolor);
+ findlabel.Text = String.Empty;
+ findimage.Visible = false;
+ }
+
+ findnextbutton.Sensitive = found;
+ findpreviousbutton.Sensitive = found;
+ findhighlightbutton.Sensitive = found;
+
+ if (found && findhighlight) {
+ OnFindHighlightButtonClick (sender, args);
+ OnFindHighlightButtonClick (sender, args);
+ }
+ }
+
+ public void OnFindHighlightButtonClick (object sender, EventArgs args)
+ {
+ appbar1.ClearStack ();
+ findhighlight = !findhighlight;
+ Highlight (findhighlight);
+ }
+
+ public void OnFindNextButtonClick (object sender, EventArgs args)
+ {
+ if (findentry.Text.Length < 1) {
+ return;
+ }
+
+ try {
+ TextIter start;
+ TextIter end;
+ bool found = findfwd.ForwardSearch (findentry.Text, tsf, out start, out end, textview1.Buffer.EndIter);
+ if (!found) {
+ WarnWrapBuffer (true);
+ findfwd = textview1.Buffer.StartIter;
+ findfwd.ForwardSearch (findentry.Text, tsf, out start, out end, textview1.Buffer.EndIter);
+ }
+ UpdateSelection (found, start, end);
+ }
+ catch (Exception e) {
+ // safety net
+ Console.Error.WriteLine (e);
+ }
+ }
+
+ public void OnFindPreviousButtonClick (object sender, EventArgs args)
+ {
+ if (findentry.Text.Length < 1) {
+ return;
+ }
+
+ try {
+ TextIter start;
+ TextIter end;
+ bool found = findbck.BackwardSearch (findentry.Text, tsf, out start, out end, textview1.Buffer.StartIter);
+ if (!found) {
+ WarnWrapBuffer (false);
+ findbck = textview1.Buffer.EndIter;
+ findbck.BackwardSearch (findentry.Text, tsf, out start, out end, textview1.Buffer.StartIter);
+ }
+ UpdateSelection (found, start, end);
+ }
+ catch (Exception e) {
+ // safety net
+ Console.Error.WriteLine (e);
+ }
+ }
+
+ private void Highlight (bool on)
+ {
+ if (on) {
+ TextIter start;
+ TextIter end;
+ highlightimage.Pixbuf = highlight_on;
+ TextIter current = textview1.Buffer.StartIter;
+ while (current.ForwardSearch (findentry.Text, tsf, out start, out end, textview1.Buffer.EndIter)) {
+ textview1.Buffer.ApplyTag (highlight, start, end);
+ current = end;
+ }
+ } else {
+ highlightimage.Pixbuf = highlight_off;
+ textview1.Buffer.RemoveTag (highlight, textview1.Buffer.StartIter, textview1.Buffer.EndIter);
+ }
+ }
+
+ private void UpdateSelection (bool result, TextIter start, TextIter end)
+ {
+ if (result) {
+ findlabel.Text = String.Empty;
+ findimage.Visible = false;
+ }
+ findbck = start;
+ findfwd = end;
+ findstart = start.Offset;
+ findend = end.Offset;
+ if ((findstart != -1) && (findend != -1)) {
+ textview1.Buffer.MoveMark ("insert", textview1.Buffer.GetIterAtOffset (findend));
+ textview1.Buffer.MoveMark ("selection_bound", textview1.Buffer.GetIterAtOffset (findstart));
+ textview1.ScrollMarkOnscreen (textview1.Buffer.InsertMark);
+ }
+ }
+
+ private void UpdateDisplay ()
+ {
+ textview1.Buffer.Text = String.Empty;
+ if (asn == null) {
+ return;
+ }
+ if (pp == null) {
+ pp = new PrettyPrinter(asn);
+ }
+ pp.Options = options;
+ textview1.Buffer.Text = pp.ToString ();
+ Highlight (findhighlight);
+ findfwd = textview1.Buffer.StartIter;
+ findbck = textview1.Buffer.EndIter;
+
+ // process possible encapsulated ASN.1 element
+ // (i.e. ASN.1 elements contained in other ASN.1 elements)
+ if (options.IncludeEncapsulated) {
+ TextIter start;
+ TextIter end;
+ TextIter search = textview1.Buffer.StartIter;
+ while (search.ForwardSearch(", encapsulates {", tsf, out start, out end, textview1.Buffer.EndIter)) {
+ start.ForwardChars (2);
+ int num1 = 1;
+ while (end.ForwardChar ()) {
+ if (end.Char == "}") {
+ num1--;
+ if (num1 == 0) {
+ end.ForwardChar ();
+ break;
+ }
+ continue;
+ }
+ if (end.Char == "{") {
+ num1++;
+ }
+ }
+ textview1.Buffer.ApplyTag (encapsulated, start, end);
+ search = end;
+ }
+ } else {
+ textview1.Buffer.RemoveTag (encapsulated, textview1.Buffer.StartIter, textview1.Buffer.EndIter);
+ }
+ }
+
+ // UI Helpers
+
+ private bool AskUser (string msg)
+ {
+ MessageDialog mdlg = new MessageDialog (gasnview,
+ DialogFlags.DestroyWithParent,
+ MessageType.Question,
+ ButtonsType.YesNo,
+ msg);
+ ResponseType answer = (ResponseType) mdlg.Run ();
+ mdlg.Destroy ();
+ return (answer == ResponseType.Yes);
+ }
+
+ private void WarnWrapBuffer(bool forward)
+ {
+ string msg = string.Format("Reached {0} of structure, continued from {1}",
+ !forward ? "top" : "end",
+ !forward ? "bottom" : "top");
+ findlabel.Text = msg;
+ findimage.Visible = true;
+ }
+
+ // Options
+
+ private FontDescription DefaultFont {
+ get {
+ string fontname = (options.FontName != null) ? options.FontName : "Courier 10 Pitch 10";
+ return FontDescription.FromString (fontname);
+ }
+ }
+
+ public string Font {
+ get {
+ if (fontdesc == null) {
+ fontdesc = DefaultFont;
+ }
+ return fontdesc.ToString ();
+ }
+ set {
+ if (value == null) {
+ fontdesc = DefaultFont;
+ } else {
+ fontdesc = FontDescription.FromString (value);
+ options.FontName = value;
+ }
+ textview1.ModifyFont (fontdesc);
+ }
+ }
+
+ private void UpdateOptions ()
+ {
+ view_position.Active = options.ViewPosition;
+ view_tag.Active = options.ViewTag;
+ view_length.Active = options.ViewLength;
+ view_dotted_indentation.Active = options.DottedIndentation;
+
+ switch (options.OidFormat) {
+ case OidFormat.ITU:
+ view_oid_format_itu.Active = true;
+ view_oid_format_ietf.Active = false;
+ view_oid_format_urn.Active = false;
+ break;
+ case OidFormat.IETF:
+ view_oid_format_itu.Active = false;
+ view_oid_format_ietf.Active = true;
+ view_oid_format_urn.Active = false;
+ break;
+ case OidFormat.URN:
+ view_oid_format_itu.Active = false;
+ view_oid_format_ietf.Active = false;
+ view_oid_format_urn.Active = true;
+ break;
+ }
+
+ view_display_class.Active = options.ShowTagClass;
+ view_encapsulated.Active = options.IncludeEncapsulated;
+ OidSource source1 = options.OidSource;
+
+ if (source1 == OidSource.Alvestrand) {
+ settings_oid_none.Active = false;
+ settings_oid_alvestrand.Active = true;
+ settings_oid_elibel.Active = false;
+ } else if (source1 == OidSource.Elibel) {
+ settings_oid_none.Active = false;
+ settings_oid_alvestrand.Active = false;
+ settings_oid_elibel.Active = true;
+ } else {
+ settings_oid_none.Active = true;
+ settings_oid_alvestrand.Active = false;
+ settings_oid_elibel.Active = false;
+ }
+ }
+
+ public PrettyPrinterOptions LoadConfig (string filename)
+ {
+ try {
+ if (File.Exists(filename)) {
+ using (StreamReader sr = new StreamReader(filename)) {
+ PrettyPrinterOptions options;
+ XmlSerializer xs = new XmlSerializer (typeof (PrettyPrinterOptions));
+ options = (PrettyPrinterOptions) xs.Deserialize (sr);
+ sr.Close ();
+ return options;
+ }
+ }
+ }
+ catch (Exception exception1) {
+ Console.Error.WriteLine ("Couldn't load configuration file {0}.\nCause: {1}", filename, exception1);
+ }
+
+ return PrettyPrinterOptions.GetDefaults ();
+ }
+
+ public void SaveConfig (string filename, PrettyPrinterOptions options)
+ {
+ try {
+ if (!File.Exists(filename)) {
+ string path = Path.GetDirectoryName (filename);
+ if (!Directory.Exists (path)) {
+ Directory.CreateDirectory (path);
+ }
+ }
+ using (StreamWriter sw = new StreamWriter (filename)) {
+ XmlSerializer xs = new XmlSerializer (typeof (PrettyPrinterOptions));
+ xs.Serialize (sw, options);
+ sw.Close();
+ }
+ }
+ catch (Exception e) {
+ Console.Error.WriteLine ("Couldn't save configuration file {0}.\nCause: {1}",
+ filename, e);
+ }
+ }
+}
diff --git a/asn1view/gtk/Makefile.am b/asn1view/gtk/Makefile.am
new file mode 100644
index 00000000..811fb65b
--- /dev/null
+++ b/asn1view/gtk/Makefile.am
@@ -0,0 +1,53 @@
+#
+# Makefile.am for gasnview.exe
+#
+# Authors:
+# Gonzalo Paniagua Javier (gonzalo@ximian.com)
+# Martin Willemoes Hansen (mwh@sysrq.dk>
+#
+local_flags = -debug+ -debug:full -nologo $(NUNIT_LIBS)
+
+local_flags += $(MCSFLAGS) $(GTK_SHARP_LIBS)
+
+gasnview_SCRIPTS = gasnview.exe
+gasnviewdir = $(prefix)/lib/mono/1.0
+
+CLEANFILES = gasnview.exe gasnview.exe.mdb gasnview
+EXTRA_DIST = $(gasnview_sources_dist) gui.glade script.in
+
+resources = $(srcdir)/gui.glade \
+ $(srcdir)/../art/export-16.png \
+ $(srcdir)/../art/export.png \
+ $(srcdir)/../art/text_hilight-16.png \
+ $(srcdir)/../art/text_lolight-16.png
+
+gasnview_sources = Main.cs \
+ $(srcdir)/../common/ASN1Decoder.cs \
+ $(srcdir)/../common/PrettyPrinter.cs \
+ $(srcdir)/../common/OidCache.cs \
+ $(srcdir)/../common/AssemblyInfo.cs
+
+gasnview_sources_in =
+gasnview_sources_dist = $(gasnview_sources) $(gasnview_sources_in)
+gasnview_sources_build = $(addprefix $(srcdir)/, $(gasnview_sources))
+gasnview_sources_build += $(gasnview_sources_in:.in=)
+
+###
+ress= $(foreach res,$(resources), $(addprefix -resource:,$(res)),$(notdir $(res)))
+
+gasnview.exe: $(gasnview_sources_build) $(resources)
+ $(MCS) $(MCSFLAGS) $(local_flags) $(ress) -out:$@ $(gasnview_sources_build)
+
+scriptdir = $(bindir)
+
+script_SCRIPTS = gasnview
+
+REWRITE = sed \
+ -e 's,@''bindir@,$(bindir),g' \
+ -e 's,@''mono_one_instdir@,$(gasnviewdir),g' \
+ -e 's,@''exe_file@,$@.exe,g' \
+ -e 's,@''mono_interp@,mono --debug,g'
+
+gasnview :
+ $(REWRITE) $(srcdir)/script.in > $@.tmp
+ mv $@.tmp $@
diff --git a/asn1view/gtk/gui.glade b/asn1view/gtk/gui.glade
new file mode 100644
index 00000000..ba3f57a1
--- /dev/null
+++ b/asn1view/gtk/gui.glade
@@ -0,0 +1,1184 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+<requires lib="gnome"/>
+<requires lib="bonobo"/>
+
+<widget class="GnomeApp" id="gasnview">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">gasnview</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="enable_layout_config">True</property>
+ <signal name="delete_event" handler="OnWindowDeleteEvent" last_modification_time="Sat, 20 Nov 2004 17:38:26 GMT"/>
+
+ <child internal-child="dock">
+ <widget class="BonoboDock" id="bonobodock1">
+ <property name="visible">True</property>
+ <property name="allow_floating">True</property>
+
+ <child>
+ <widget class="BonoboDockItem" id="bonobodockitem1">
+ <property name="visible">True</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+
+ <child>
+ <widget class="GtkMenuBar" id="menubar1">
+ <property name="visible">True</property>
+
+ <child>
+ <widget class="GtkMenuItem" id="file1">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_FILE_TREE</property>
+
+ <child>
+ <widget class="GtkMenu" id="file1_menu">
+
+ <child>
+ <widget class="GtkImageMenuItem" id="file_new">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_NEW_ITEM</property>
+ <property name="label" translatable="yes">_New</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="OnFileNew" last_modification_time="Sun, 21 Nov 2004 02:34:15 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkImageMenuItem" id="file_open">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_OPEN_ITEM</property>
+ <signal name="activate" handler="OnFileOpen" last_modification_time="Sun, 21 Nov 2004 02:33:50 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkImageMenuItem" id="file_export">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Export</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="OnFileExport" last_modification_time="Thu, 02 Dec 2004 03:18:12 GMT"/>
+ <accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+
+ <child internal-child="image">
+ <widget class="GtkImage" id="image53">
+ <property name="visible">True</property>
+ <property name="stock">gtk-save</property>
+ <property name="icon_size">1</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkImageMenuItem" id="file_export_as">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Export _As...</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="OnFileExportAs" last_modification_time="Thu, 02 Dec 2004 03:19:05 GMT"/>
+ <accelerator key="S" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK" signal="activate"/>
+
+ <child internal-child="image">
+ <widget class="GtkImage" id="image54">
+ <property name="visible">True</property>
+ <property name="stock">gtk-save-as</property>
+ <property name="icon_size">1</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkImageMenuItem" id="file_revert">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_REVERT_ITEM</property>
+ <signal name="activate" handler="OnFileRevert" last_modification_time="Sun, 21 Nov 2004 02:32:47 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="separator1">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkImageMenuItem" id="file_quit">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_EXIT_ITEM</property>
+ <signal name="activate" handler="OnFileQuit" last_modification_time="Sun, 21 Nov 2004 02:32:29 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="edit_menu">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_EDIT_TREE</property>
+
+ <child>
+ <widget class="GtkMenu" id="edit_menu_menu">
+
+ <child>
+ <widget class="GtkImageMenuItem" id="edit_copy">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_COPY_ITEM</property>
+ <signal name="activate" handler="OnEditCopy" last_modification_time="Sun, 21 Nov 2004 02:31:45 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="edit_select_all">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_SELECT_ALL_ITEM</property>
+ <signal name="activate" handler="OnEditSelectAll" last_modification_time="Sun, 21 Nov 2004 02:31:26 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="separator10">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkImageMenuItem" id="edit_find">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_FIND_ITEM</property>
+ <signal name="activate" handler="OnEditFind" last_modification_time="Fri, 26 Nov 2004 21:27:14 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="view1">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_VIEW_TREE</property>
+
+ <child>
+ <widget class="GtkMenu" id="view1_menu">
+
+ <child>
+ <widget class="GtkCheckMenuItem" id="view_position">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Position</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <signal name="activate" handler="OnViewPosition" last_modification_time="Sun, 21 Nov 2004 02:30:13 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkCheckMenuItem" id="view_tag">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Tag</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <signal name="activate" handler="OnViewTag" last_modification_time="Sun, 21 Nov 2004 02:29:52 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkCheckMenuItem" id="view_length">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Length</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <signal name="activate" handler="OnViewLength" last_modification_time="Sun, 21 Nov 2004 02:29:34 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkCheckMenuItem" id="view_dotted_indentation">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Dotted Indentation</property>
+ <property name="use_underline">True</property>
+ <property name="active">False</property>
+ <signal name="activate" handler="OnViewDottedIndentation" last_modification_time="Sun, 21 Nov 2004 02:29:09 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="separator4">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="view_oid_format">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">OID _Format</property>
+ <property name="use_underline">True</property>
+
+ <child>
+ <widget class="GtkMenu" id="view_oid_format_menu">
+
+ <child>
+ <widget class="GtkRadioMenuItem" id="view_oid_format_itu">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">ITU (_Classic)</property>
+ <property name="use_underline">True</property>
+ <property name="active">False</property>
+ <signal name="activate" handler="OnViewOidFormatItu" last_modification_time="Sun, 21 Nov 2004 02:28:03 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkRadioMenuItem" id="view_oid_format_ietf">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">IETF (_Dotted)</property>
+ <property name="use_underline">True</property>
+ <property name="active">False</property>
+ <property name="group">view_oid_format_itu</property>
+ <signal name="activate" handler="OnViewOidFormatIetf" last_modification_time="Sun, 21 Nov 2004 02:27:31 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkRadioMenuItem" id="view_oid_format_urn">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_URN</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="group">view_oid_format_itu</property>
+ <signal name="activate" handler="OnViewOidFormatUrn" last_modification_time="Sun, 21 Nov 2004 02:26:00 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="separator5">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkCheckMenuItem" id="view_display_class">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Display _Class</property>
+ <property name="use_underline">True</property>
+ <property name="active">False</property>
+ <signal name="activate" handler="OnViewDisplayClass" last_modification_time="Sun, 28 Nov 2004 20:26:10 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkCheckMenuItem" id="view_encapsulated">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Encapsulated</property>
+ <property name="use_underline">True</property>
+ <property name="active">False</property>
+ <signal name="activate" handler="OnViewEncapsulated" last_modification_time="Sun, 21 Nov 2004 02:25:25 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="settings_menu">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_SETTINGS_TREE</property>
+
+ <child>
+ <widget class="GtkMenu" id="settings_menu_menu">
+
+ <child>
+ <widget class="GtkMenuItem" id="settings_oid_source">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">OID _Source</property>
+ <property name="use_underline">True</property>
+
+ <child>
+ <widget class="GtkMenu" id="settings_oid_source_menu">
+
+ <child>
+ <widget class="GtkRadioMenuItem" id="settings_oid_none">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_None</property>
+ <property name="use_underline">True</property>
+ <property name="active">False</property>
+ <signal name="activate" handler="OnSettingsOidSourceNone" last_modification_time="Sun, 21 Nov 2004 02:18:04 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkRadioMenuItem" id="settings_oid_alvestrand">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_alvestrand.no</property>
+ <property name="use_underline">True</property>
+ <property name="active">False</property>
+ <property name="group">settings_oid_none</property>
+ <signal name="activate" handler="OnSettingsOidSourceAlvestrand" last_modification_time="Sun, 21 Nov 2004 02:18:32 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkRadioMenuItem" id="settings_oid_elibel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_elibel.tm.fr</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="group">settings_oid_none</property>
+ <signal name="activate" handler="OnSettingsOidSourceElibel" last_modification_time="Sun, 21 Nov 2004 02:19:09 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkImageMenuItem" id="settings_clear_oid_cache">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Clear OID Cache</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="OnSettingsClearOidCache" last_modification_time="Sun, 21 Nov 2004 02:17:22 GMT"/>
+
+ <child internal-child="image">
+ <widget class="GtkImage" id="image55">
+ <property name="visible">True</property>
+ <property name="stock">gnome-stock-trash</property>
+ <property name="icon_size">1</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="separator8">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkImageMenuItem" id="settings_select_font">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Select _Font...</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="OnSettingsSelectFont" last_modification_time="Sun, 21 Nov 2004 02:16:43 GMT"/>
+
+ <child internal-child="image">
+ <widget class="GtkImage" id="image56">
+ <property name="visible">True</property>
+ <property name="stock">gtk-select-font</property>
+ <property name="icon_size">1</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="help_menu">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_HELP_TREE</property>
+
+ <child>
+ <widget class="GtkMenu" id="help_menu_menu">
+
+ <child>
+ <widget class="GtkImageMenuItem" id="about">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_ABOUT_ITEM</property>
+ <signal name="activate" handler="OnHelpAbout" last_modification_time="Sun, 21 Nov 2004 02:15:37 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="placement">BONOBO_DOCK_TOP</property>
+ <property name="band">0</property>
+ <property name="position">0</property>
+ <property name="offset">0</property>
+ <property name="behavior">BONOBO_DOCK_ITEM_BEH_EXCLUSIVE|BONOBO_DOCK_ITEM_BEH_NEVER_VERTICAL|BONOBO_DOCK_ITEM_BEH_LOCKED</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="BonoboDockItem" id="bonobodockitem2">
+ <property name="visible">True</property>
+ <property name="shadow_type">GTK_SHADOW_OUT</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment4">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkToolbar" id="toolbar">
+ <property name="visible">True</property>
+ <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
+ <property name="toolbar_style">GTK_TOOLBAR_ICONS</property>
+ <property name="tooltips">True</property>
+ <property name="show_arrow">True</property>
+
+ <child>
+ <widget class="GtkToolItem" id="toolitem12">
+ <property name="visible">True</property>
+ <property name="visible_horizontal">True</property>
+ <property name="visible_vertical">True</property>
+ <property name="is_important">False</property>
+
+ <child>
+ <widget class="GtkButton" id="filenewbutton">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Clear Display</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <signal name="clicked" handler="OnFileNew" last_modification_time="Sun, 21 Nov 2004 02:35:17 GMT"/>
+
+ <child>
+ <widget class="GtkImage" id="image3">
+ <property name="visible">True</property>
+ <property name="stock">gtk-new</property>
+ <property name="icon_size">3</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkToolItem" id="toolitem13">
+ <property name="visible">True</property>
+ <property name="visible_horizontal">True</property>
+ <property name="visible_vertical">True</property>
+ <property name="is_important">False</property>
+
+ <child>
+ <widget class="GtkButton" id="fileopenbutton">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Open File</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <signal name="clicked" handler="OnFileOpen" last_modification_time="Sun, 21 Nov 2004 02:35:26 GMT"/>
+
+ <child>
+ <widget class="GtkImage" id="image4">
+ <property name="visible">True</property>
+ <property name="stock">gtk-open</property>
+ <property name="icon_size">3</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkToolItem" id="toolitem16">
+ <property name="visible">True</property>
+ <property name="visible_horizontal">True</property>
+ <property name="visible_vertical">True</property>
+ <property name="is_important">False</property>
+
+ <child>
+ <widget class="GtkButton" id="fileexportbutton">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Export Structure</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <signal name="clicked" handler="OnFileExport" last_modification_time="Sat, 04 Dec 2004 21:48:13 GMT"/>
+
+ <child>
+ <widget class="GtkImage" id="fileexportimage">
+ <property name="visible">True</property>
+ <property name="stock">gtk-save</property>
+ <property name="icon_size">3</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkToolItem" id="toolitem11">
+ <property name="visible">True</property>
+ <property name="visible_horizontal">True</property>
+ <property name="visible_vertical">True</property>
+ <property name="is_important">False</property>
+
+ <child>
+ <widget class="GtkButton" id="filerevertbutton">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Revert from Disk</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <signal name="clicked" handler="OnFileRevert" last_modification_time="Sun, 21 Nov 2004 02:35:48 GMT"/>
+
+ <child>
+ <widget class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="stock">gtk-revert-to-saved</property>
+ <property name="icon_size">3</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkSeparatorToolItem" id="separatortoolitem1">
+ <property name="visible">True</property>
+ <property name="draw">True</property>
+ <property name="visible_horizontal">True</property>
+ <property name="visible_vertical">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkToolItem" id="toolitem17">
+ <property name="visible">True</property>
+ <property name="visible_horizontal">True</property>
+ <property name="visible_vertical">True</property>
+ <property name="is_important">False</property>
+
+ <child>
+ <widget class="GtkButton" id="editcopybutton">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Copy</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <signal name="clicked" handler="OnEditCopy" last_modification_time="Sat, 04 Dec 2004 21:50:30 GMT"/>
+
+ <child>
+ <widget class="GtkImage" id="image59">
+ <property name="visible">True</property>
+ <property name="stock">gtk-copy</property>
+ <property name="icon_size">3</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkSeparatorToolItem" id="separatortoolitem2">
+ <property name="visible">True</property>
+ <property name="draw">True</property>
+ <property name="visible_horizontal">True</property>
+ <property name="visible_vertical">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkToolItem" id="toolitem15">
+ <property name="visible">True</property>
+ <property name="visible_horizontal">True</property>
+ <property name="visible_vertical">True</property>
+ <property name="is_important">False</property>
+
+ <child>
+ <widget class="GtkButton" id="settingsselectfontbutton">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Select Font</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <signal name="clicked" handler="OnSettingsSelectFont" last_modification_time="Sun, 21 Nov 2004 02:36:03 GMT"/>
+
+ <child>
+ <widget class="GtkImage" id="image6">
+ <property name="visible">True</property>
+ <property name="stock">gtk-select-font</property>
+ <property name="icon_size">3</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="placement">BONOBO_DOCK_TOP</property>
+ <property name="band">1</property>
+ <property name="position">0</property>
+ <property name="offset">0</property>
+ <property name="behavior">BONOBO_DOCK_ITEM_BEH_EXCLUSIVE|BONOBO_DOCK_ITEM_BEH_LOCKED</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
+ <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <widget class="GtkTextView" id="textview1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">False</property>
+ <property name="overwrite">False</property>
+ <property name="accepts_tab">True</property>
+ <property name="justification">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap_mode">GTK_WRAP_NONE</property>
+ <property name="cursor_visible">True</property>
+ <property name="pixels_above_lines">0</property>
+ <property name="pixels_below_lines">0</property>
+ <property name="pixels_inside_wrap">0</property>
+ <property name="left_margin">0</property>
+ <property name="right_margin">0</property>
+ <property name="indent">0</property>
+ <property name="text" translatable="yes"></property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow3">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+ <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <widget class="GtkViewport" id="viewport1">
+ <property name="visible">True</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+
+ <child>
+ <widget class="GtkHBox" id="findbar">
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Find:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">4</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkEntry" id="findentry">
+ <property name="width_request">158</property>
+ <property name="height_request">23</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="invisible_char" translatable="yes">*</property>
+ <property name="activates_default">False</property>
+ <signal name="changed" handler="OnFindEntryChange" last_modification_time="Fri, 26 Nov 2004 21:37:00 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">4</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="findnextbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <signal name="clicked" handler="OnFindNextButtonClick" last_modification_time="Fri, 26 Nov 2004 21:34:53 GMT"/>
+ <accelerator key="F3" modifiers="0" signal="clicked"/>
+ <accelerator key="G" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment5">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox5">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image7">
+ <property name="visible">True</property>
+ <property name="stock">gtk-go-down</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Find Next</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="findpreviousbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <signal name="clicked" handler="OnFindPreviousButtonClick" last_modification_time="Fri, 26 Nov 2004 21:35:10 GMT"/>
+ <accelerator key="F3" modifiers="GDK_SHIFT_MASK" signal="clicked"/>
+ <accelerator key="G" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK" signal="clicked"/>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment6">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox6">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image8">
+ <property name="visible">True</property>
+ <property name="stock">gtk-go-up</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Find Previous</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="findhighlightbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <signal name="clicked" handler="OnFindHighlightButtonClick" last_modification_time="Fri, 26 Nov 2004 21:36:38 GMT"/>
+ <accelerator key="H" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment7">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox7">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="highlightimage">
+ <property name="visible">True</property>
+ <property name="stock">gtk-justify-fill</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Highlight</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkImage" id="findimage">
+ <property name="visible">True</property>
+ <property name="stock">gtk-dialog-warning</property>
+ <property name="icon_size">1</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">4</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="findlabel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">-</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="closefindbarbutton">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Close Find bar</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">True</property>
+ <signal name="clicked" handler="OnCloseFindBarButtonClick" last_modification_time="Fri, 26 Nov 2004 21:34:00 GMT"/>
+
+ <child>
+ <widget class="GtkImage" id="image12">
+ <property name="visible">True</property>
+ <property name="stock">gtk-close</property>
+ <property name="icon_size">1</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child internal-child="appbar">
+ <widget class="GnomeAppBar" id="appbar1">
+ <property name="visible">True</property>
+ <property name="has_progress">True</property>
+ <property name="has_status">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+</widget>
+
+</glade-interface>
diff --git a/asn1view/gtk/gui.gladep b/asn1view/gtk/gui.gladep
new file mode 100644
index 00000000..7012234d
--- /dev/null
+++ b/asn1view/gtk/gui.gladep
@@ -0,0 +1,7 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
+
+<glade-project>
+ <name></name>
+ <program_name></program_name>
+</glade-project>
diff --git a/asn1view/gtk/script.in b/asn1view/gtk/script.in
new file mode 100644
index 00000000..e68eb084
--- /dev/null
+++ b/asn1view/gtk/script.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @mono_one_instdir@/@exe_file@ "$@"