This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
ComponentType.cs
94 lines (80 loc) · 1.98 KB
/
ComponentType.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System;
namespace Stetic
{
public class ComponentType
{
Application app;
string name;
string description;
string className;
string category;
Gdk.Pixbuf icon;
ActionComponent action;
string targetGtkVersion;
string library;
static ComponentType unknown;
internal ComponentType (Application app, string name, string desc, string className, string category, string targetGtkVersion, string library, Gdk.Pixbuf icon)
{
this.app = app;
this.name = name;
this.description = desc;
this.icon = icon;
this.className = className;
this.category = category;
this.targetGtkVersion = targetGtkVersion;
this.library = library;
}
internal ComponentType (Application app, ActionComponent action)
{
this.action = action;
this.app = app;
this.name = action.Name;
this.description = action.Label != null ? action.Label.Replace ("_", "") : action.Name;
this.icon = action.Icon;
this.className = "Gtk.Action";
this.category = "Actions / " + action.ActionGroup.Name;
this.targetGtkVersion = "2.4"; // Not version-specific
}
public string Name {
get { return name; }
}
public string ClassName {
get { return className; }
}
public string Category {
get { return category; }
}
public string Description {
get { return description; }
}
public string Library {
get { return library; }
}
public Gdk.Pixbuf Icon {
get { return icon; }
}
internal ActionComponent Action {
get { return action; }
}
internal static ComponentType Unknown {
get {
if (unknown == null) {
unknown = new ComponentType (null, "Unknown", "Unknown", "", "", "2.4", null, WidgetUtils.MissingIcon);
}
return unknown;
}
}
public object[] InitializationValues {
get {
if (app == null)
return new object [0];
return app.Backend.GetClassDescriptorInitializationValues (name);
}
}
public string TargetGtkVersion {
get {
return targetGtkVersion;
}
}
}
}