-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathStockIconsManager.cs
152 lines (142 loc) · 3.05 KB
/
StockIconsManager.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
using System;
using System.Collections;
using System.Reflection;
using Gtk;
using Gdk;
namespace Moscrif.IDE
{
public class StockIconsManager
{
// icons for path ./resources
private static string[] stock_icon_names = {
"application.png",
"breakpoint.png",
"bookmark.png",
"bookmark-clear.png",
"bookmark-next.png",
"bookmark-previous.png",
"close.png",
"delete.png",
"about.png",
"find.png",
"filter.png",
"folder.png",
"folder-new.png",
"folder-open.png",
"folder-properties.png",
"folder-properties-16.png",
"file-new.png",
"file-open.png",
"file-properties.png",
"file-conditions.png",
"file-exclude.png",
"file-image.png",
"file-database.png",
"file-text.png",
"file-ms.png",
"file-html.png",
"file.png",
"preferences.png",
"project.png",
"project-new.png",
"project-unload.png",
"project-folder.png",
"project-preferences.png",
"workspace.png",
"workspace-tree.png",
"themes.png",
"keyboard-shortcuts.png",
"undo.png",
"redo.png",
"refresh.png",
"rename.png",
"save.png",
"save-all.png",
"save-as.png",
"quit.png",
"publish.png",
"run.png",
"run-in-console.png",
"console.png",
"task.png",
"compile.png",
"empty.png",
"mobil.png",
"stock-close.png",
"stock-add.png",
"device.png",
"conditions.png",
"apple.png",
"android.png",
"bada.png",
"symbian.png",
"windows.png",
"macos.png",
"win32.png",
"error.png",
"log.png",
"home.png",
"libs.png",
"logo74.png",
"logo96.png",
"barier-add.png",
"barier-delete.png",
"barier-show.png",
"barier-movie.png",
"barier-delete-all.png",
"zoom-in.png",
"zoom-original.png",
"zoom-out.png",
"editor-image.png",
"editor-text.png",
"go-up.png",
"drive-harddisk.png",
"edit-copy.png",
"edit-cut.png",
"edit-paste.png",
"emulator-skin.png",
"workspace-right.png",
"workspace-left.png",
"workspace-bottom.png",
"garbage-collector.png",
"resolution.png",
"emulator.png",
"feedback.png",
"actions24.png",
"twitter24.png",
"twitter12.png",
"tutorial.png",
"video.png",
"showcase.png",
"api.png",
"content.png"
};
public static void Initialize()
{
IconFactory icon_factory = new IconFactory();
icon_factory.AddDefault();
foreach (string item_id in stock_icon_names) {
StockItem item = new StockItem(item_id, null, 0, Gdk.ModifierType.ShiftMask, null);
IconSet icon_set = null;
string file = System.IO.Path.Combine(MainClass.Paths.ResDir, item_id);
icon_set = new IconSet();
if (System.IO.File.Exists(file)){
try{
IconSource source = new IconSource();
source.Pixbuf = new Pixbuf(file);
source.Size = IconSize.LargeToolbar;
icon_set.AddSource(source);
}catch(Exception ex){
Tool.Logger.Error(ex.Message);
//continue;
}
}
if (icon_set == null) {
continue;
}
icon_factory.Add(item.StockId, icon_set);
StockManager.Add(item);
}
}
}
}