• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

BathyScapheで画像のインラインプレビューを可能にするプラグイン


Commit MetaInfo

Revisão4a350244af3e0c7d535eb6e049f6907bf78fe40e (tree)
Hora2012-08-08 22:57:59
Autormasakih <masakih@user...>
Commitermasakih

Mensagem de Log

[Mod] BSLinkPreviewSelectorに対応

Mudança Sumário

Diff

--- /dev/null
+++ b/BSIPReferenceViewController.h
@@ -0,0 +1,22 @@
1+//
2+// BSIPReferenceViewController.h
3+// BSInlinePreviewer
4+//
5+// Created by 堀 昌樹 on 12/08/06.
6+// Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
7+//
8+
9+#import <Cocoa/Cocoa.h>
10+
11+@class BSIThumbnailSizeView;
12+@interface BSIPReferenceViewController : NSViewController
13+{
14+ BSIThumbnailSizeView *sizeView;
15+ NSSize _thumbailSize;
16+}
17+@property (assign, nonatomic) IBOutlet BSIThumbnailSizeView *sizeView;
18+
19+@property (nonatomic) NSSize thumbnailSize;
20+@property CGFloat thumbnailWidth;
21+@property (readonly) NSString *sizeString;
22+@end
--- /dev/null
+++ b/BSIPReferenceViewController.m
@@ -0,0 +1,85 @@
1+//
2+// BSIPReferenceViewController.m
3+// BSInlinePreviewer
4+//
5+// Created by 堀 昌樹 on 12/08/06.
6+// Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
7+//
8+
9+#import "BSIPReferenceViewController.h"
10+#import "BSIThumbnailSizeView.h"
11+
12+@interface BSIPReferenceViewController ()
13+
14+@end
15+
16+@implementation BSIPReferenceViewController
17+@synthesize sizeView;
18+
19+- (id)init
20+{
21+ return [super initWithNibName:NSStringFromClass([self class]) bundle:[NSBundle bundleForClass:[self class]]];
22+}
23+
24+
25+- (void)awakeFromNib
26+{
27+ [self willChangeValueForKey:@"sizeString"];
28+ self.sizeView.imageSize = _thumbailSize;
29+ [self didChangeValueForKey:@"sizeString"];
30+ [sizeView addObserver:self
31+ forKeyPath:@"imageSize"
32+ options:0
33+ context:sizeView];
34+}
35+
36++ (NSSet *)keyPathsForValuesAffectingThumbnailWidth
37+{
38+ return [NSSet setWithObject:@"thumbnailSize"];
39+}
40++ (NSSet *)keyPathsForValuesAffectingThumbnailSize
41+{
42+ return [NSSet setWithObject:@"thumbnailWidth"];
43+}
44+- (CGFloat)thumbnailWidth
45+{
46+ return self.thumbnailSize.width;
47+}
48+- (void)setThumbnailWidth:(CGFloat)thumbnailWidth
49+{
50+ self.thumbnailSize = NSMakeSize(thumbnailWidth, thumbnailWidth);
51+ self.sizeView.imageSize = self.thumbnailSize;
52+}
53+- (NSSize)thumbnailSize
54+{
55+ return sizeView.imageSize;
56+}
57+- (void)setThumbnailSize:(NSSize)thumbnailSize
58+{
59+ if(NSEqualSizes(_thumbailSize, thumbnailSize)) return;
60+
61+ _thumbailSize = thumbnailSize;
62+ sizeView.imageSize = thumbnailSize;
63+}
64+
65+- (NSString *)sizeString
66+{
67+ return [NSString stringWithFormat:@"%.0f %C %.0f", self.thumbnailSize.width, 0x00D7, self.thumbnailSize.height];
68+}
69+
70++(NSSet *)keyPathsForValuesAffectingSizeString
71+{
72+ return [NSSet setWithObject:@"thumbnailSize"];
73+}
74+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
75+{
76+ if(context == sizeView) {
77+ [self willChangeValueForKey:@"thumbnailSize"];
78+ _thumbailSize = sizeView.imageSize;
79+ [self didChangeValueForKey:@"thumbnailSize"];
80+ return;
81+ }
82+
83+ [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
84+}
85+@end
--- /dev/null
+++ b/BSIPReferenceViewController.xib
@@ -0,0 +1,656 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
3+ <data>
4+ <int key="IBDocument.SystemTarget">1070</int>
5+ <string key="IBDocument.SystemVersion">11E53</string>
6+ <string key="IBDocument.InterfaceBuilderVersion">2182</string>
7+ <string key="IBDocument.AppKitVersion">1138.47</string>
8+ <string key="IBDocument.HIToolboxVersion">569.00</string>
9+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
10+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
11+ <string key="NS.object.0">2182</string>
12+ </object>
13+ <array key="IBDocument.IntegratedClassDependencies">
14+ <string>NSTextField</string>
15+ <string>NSCustomObject</string>
16+ <string>NSSliderCell</string>
17+ <string>NSCustomView</string>
18+ <string>NSSlider</string>
19+ <string>IBNSLayoutConstraint</string>
20+ <string>NSTextFieldCell</string>
21+ </array>
22+ <array key="IBDocument.PluginDependencies">
23+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
24+ </array>
25+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
26+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
27+ <integer value="1" key="NS.object.0"/>
28+ </object>
29+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
30+ <object class="NSCustomObject" id="1001">
31+ <string key="NSClassName">BSIPReferenceViewController</string>
32+ </object>
33+ <object class="NSCustomObject" id="1003">
34+ <string key="NSClassName">FirstResponder</string>
35+ </object>
36+ <object class="NSCustomObject" id="1004">
37+ <string key="NSClassName">NSApplication</string>
38+ </object>
39+ <object class="NSCustomView" id="143440082">
40+ <reference key="NSNextResponder"/>
41+ <int key="NSvFlags">268</int>
42+ <array class="NSMutableArray" key="NSSubviews">
43+ <object class="NSSlider" id="116451019">
44+ <reference key="NSNextResponder" ref="143440082"/>
45+ <int key="NSvFlags">268</int>
46+ <string key="NSFrame">{{18, 16}, {322, 21}}</string>
47+ <reference key="NSSuperview" ref="143440082"/>
48+ <reference key="NSWindow"/>
49+ <reference key="NSNextKeyView"/>
50+ <string key="NSReuseIdentifierKey">_NS:9</string>
51+ <bool key="NSEnabled">YES</bool>
52+ <object class="NSSliderCell" key="NSCell" id="985469918">
53+ <int key="NSCellFlags">-2079981824</int>
54+ <int key="NSCellFlags2">0</int>
55+ <string key="NSContents"/>
56+ <string key="NSCellIdentifier">_NS:9</string>
57+ <reference key="NSControlView" ref="116451019"/>
58+ <double key="NSMaxValue">1024</double>
59+ <double key="NSMinValue">32</double>
60+ <double key="NSValue">50</double>
61+ <double key="NSAltIncValue">0.0</double>
62+ <int key="NSNumberOfTickMarks">0</int>
63+ <int key="NSTickMarkPosition">1</int>
64+ <bool key="NSAllowsTickMarkValuesOnly">NO</bool>
65+ <bool key="NSVertical">NO</bool>
66+ </object>
67+ </object>
68+ <object class="NSTextField" id="1051220603">
69+ <reference key="NSNextResponder" ref="143440082"/>
70+ <int key="NSvFlags">268</int>
71+ <string key="NSFrame">{{151, 238}, {190, 17}}</string>
72+ <reference key="NSSuperview" ref="143440082"/>
73+ <reference key="NSWindow"/>
74+ <reference key="NSNextKeyView" ref="439308822"/>
75+ <string key="NSReuseIdentifierKey">_NS:1505</string>
76+ <bool key="NSEnabled">YES</bool>
77+ <object class="NSTextFieldCell" key="NSCell" id="1013035728">
78+ <int key="NSCellFlags">68288064</int>
79+ <int key="NSCellFlags2">272630784</int>
80+ <string key="NSContents">Label</string>
81+ <object class="NSFont" key="NSSupport" id="318760216">
82+ <string key="NSName">LucidaGrande</string>
83+ <double key="NSSize">13</double>
84+ <int key="NSfFlags">1044</int>
85+ </object>
86+ <string key="NSCellIdentifier">_NS:1505</string>
87+ <reference key="NSControlView" ref="1051220603"/>
88+ <object class="NSColor" key="NSBackgroundColor" id="801126389">
89+ <int key="NSColorSpace">6</int>
90+ <string key="NSCatalogName">System</string>
91+ <string key="NSColorName">controlColor</string>
92+ <object class="NSColor" key="NSColor">
93+ <int key="NSColorSpace">3</int>
94+ <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
95+ </object>
96+ </object>
97+ <object class="NSColor" key="NSTextColor" id="289618322">
98+ <int key="NSColorSpace">6</int>
99+ <string key="NSCatalogName">System</string>
100+ <string key="NSColorName">controlTextColor</string>
101+ <object class="NSColor" key="NSColor">
102+ <int key="NSColorSpace">3</int>
103+ <bytes key="NSWhite">MAA</bytes>
104+ </object>
105+ </object>
106+ </object>
107+ </object>
108+ <object class="NSCustomView" id="439308822">
109+ <reference key="NSNextResponder" ref="143440082"/>
110+ <int key="NSvFlags">268</int>
111+ <string key="NSFrame">{{20, 43}, {318, 187}}</string>
112+ <reference key="NSSuperview" ref="143440082"/>
113+ <reference key="NSWindow"/>
114+ <reference key="NSNextKeyView" ref="116451019"/>
115+ <string key="NSReuseIdentifierKey">_NS:9</string>
116+ <string key="NSClassName">BSIThumbnailSizeView</string>
117+ </object>
118+ <object class="NSTextField" id="114936887">
119+ <reference key="NSNextResponder" ref="143440082"/>
120+ <int key="NSvFlags">268</int>
121+ <string key="NSFrame">{{17, 238}, {134, 17}}</string>
122+ <reference key="NSSuperview" ref="143440082"/>
123+ <reference key="NSWindow"/>
124+ <reference key="NSNextKeyView" ref="1051220603"/>
125+ <string key="NSReuseIdentifierKey">_NS:1505</string>
126+ <bool key="NSEnabled">YES</bool>
127+ <object class="NSTextFieldCell" key="NSCell" id="830400923">
128+ <int key="NSCellFlags">68288064</int>
129+ <int key="NSCellFlags2">272630784</int>
130+ <string key="NSContents">サムネイルの大きさ:</string>
131+ <reference key="NSSupport" ref="318760216"/>
132+ <string key="NSCellIdentifier">_NS:1505</string>
133+ <reference key="NSControlView" ref="114936887"/>
134+ <reference key="NSBackgroundColor" ref="801126389"/>
135+ <reference key="NSTextColor" ref="289618322"/>
136+ </object>
137+ </object>
138+ </array>
139+ <string key="NSFrameSize">{358, 275}</string>
140+ <reference key="NSSuperview"/>
141+ <reference key="NSWindow"/>
142+ <reference key="NSNextKeyView" ref="114936887"/>
143+ <string key="NSReuseIdentifierKey">_NS:9</string>
144+ <string key="NSClassName">NSView</string>
145+ </object>
146+ </array>
147+ <object class="IBObjectContainer" key="IBDocument.Objects">
148+ <array class="NSMutableArray" key="connectionRecords">
149+ <object class="IBConnectionRecord">
150+ <object class="IBOutletConnection" key="connection">
151+ <string key="label">view</string>
152+ <reference key="source" ref="1001"/>
153+ <reference key="destination" ref="143440082"/>
154+ </object>
155+ <int key="connectionID">18</int>
156+ </object>
157+ <object class="IBConnectionRecord">
158+ <object class="IBOutletConnection" key="connection">
159+ <string key="label">sizeView</string>
160+ <reference key="source" ref="1001"/>
161+ <reference key="destination" ref="439308822"/>
162+ </object>
163+ <int key="connectionID">20</int>
164+ </object>
165+ <object class="IBConnectionRecord">
166+ <object class="IBBindingConnection" key="connection">
167+ <string key="label">displayPatternValue1: sizeString</string>
168+ <reference key="source" ref="1051220603"/>
169+ <reference key="destination" ref="1001"/>
170+ <object class="NSNibBindingConnector" key="connector">
171+ <reference key="NSSource" ref="1051220603"/>
172+ <reference key="NSDestination" ref="1001"/>
173+ <string key="NSLabel">displayPatternValue1: sizeString</string>
174+ <string key="NSBinding">displayPatternValue1</string>
175+ <string key="NSKeyPath">sizeString</string>
176+ <object class="NSDictionary" key="NSOptions">
177+ <string key="NS.key.0">NSDisplayPattern</string>
178+ <string key="NS.object.0">%{value1}@ ぐらい</string>
179+ </object>
180+ <int key="NSNibBindingConnectorVersion">2</int>
181+ </object>
182+ </object>
183+ <int key="connectionID">122</int>
184+ </object>
185+ <object class="IBConnectionRecord">
186+ <object class="IBBindingConnection" key="connection">
187+ <string key="label">value: thumbnailWidth</string>
188+ <reference key="source" ref="116451019"/>
189+ <reference key="destination" ref="1001"/>
190+ <object class="NSNibBindingConnector" key="connector">
191+ <reference key="NSSource" ref="116451019"/>
192+ <reference key="NSDestination" ref="1001"/>
193+ <string key="NSLabel">value: thumbnailWidth</string>
194+ <string key="NSBinding">value</string>
195+ <string key="NSKeyPath">thumbnailWidth</string>
196+ <int key="NSNibBindingConnectorVersion">2</int>
197+ </object>
198+ </object>
199+ <int key="connectionID">99</int>
200+ </object>
201+ </array>
202+ <object class="IBMutableOrderedSet" key="objectRecords">
203+ <array key="orderedObjects">
204+ <object class="IBObjectRecord">
205+ <int key="objectID">0</int>
206+ <array key="object" id="0"/>
207+ <reference key="children" ref="1000"/>
208+ <nil key="parent"/>
209+ </object>
210+ <object class="IBObjectRecord">
211+ <int key="objectID">-2</int>
212+ <reference key="object" ref="1001"/>
213+ <reference key="parent" ref="0"/>
214+ <string key="objectName">File's Owner</string>
215+ </object>
216+ <object class="IBObjectRecord">
217+ <int key="objectID">-1</int>
218+ <reference key="object" ref="1003"/>
219+ <reference key="parent" ref="0"/>
220+ <string key="objectName">First Responder</string>
221+ </object>
222+ <object class="IBObjectRecord">
223+ <int key="objectID">-3</int>
224+ <reference key="object" ref="1004"/>
225+ <reference key="parent" ref="0"/>
226+ <string key="objectName">Application</string>
227+ </object>
228+ <object class="IBObjectRecord">
229+ <int key="objectID">3</int>
230+ <reference key="object" ref="143440082"/>
231+ <array class="NSMutableArray" key="children">
232+ <reference ref="114936887"/>
233+ <reference ref="439308822"/>
234+ <reference ref="1051220603"/>
235+ <object class="IBNSLayoutConstraint" id="645726643">
236+ <reference key="firstItem" ref="143440082"/>
237+ <int key="firstAttribute">6</int>
238+ <int key="relation">0</int>
239+ <reference key="secondItem" ref="1051220603"/>
240+ <int key="secondAttribute">6</int>
241+ <float key="multiplier">1</float>
242+ <object class="IBNSLayoutSymbolicConstant" key="constant">
243+ <double key="value">20</double>
244+ </object>
245+ <float key="priority">1000</float>
246+ <int key="scoringType">9</int>
247+ <float key="scoringTypeFloat">40</float>
248+ <int key="contentType">3</int>
249+ <reference key="containingView" ref="143440082"/>
250+ </object>
251+ <object class="IBNSLayoutConstraint" id="342166400">
252+ <reference key="firstItem" ref="1051220603"/>
253+ <int key="firstAttribute">5</int>
254+ <int key="relation">0</int>
255+ <reference key="secondItem" ref="143440082"/>
256+ <int key="secondAttribute">5</int>
257+ <float key="multiplier">1</float>
258+ <object class="IBLayoutConstant" key="constant">
259+ <double key="value">154</double>
260+ </object>
261+ <float key="priority">1000</float>
262+ <int key="scoringType">9</int>
263+ <float key="scoringTypeFloat">40</float>
264+ <int key="contentType">3</int>
265+ <reference key="containingView" ref="143440082"/>
266+ </object>
267+ <reference ref="116451019"/>
268+ <object class="IBNSLayoutConstraint" id="763106397">
269+ <reference key="firstItem" ref="1051220603"/>
270+ <int key="firstAttribute">3</int>
271+ <int key="relation">0</int>
272+ <reference key="secondItem" ref="143440082"/>
273+ <int key="secondAttribute">3</int>
274+ <float key="multiplier">1</float>
275+ <object class="IBNSLayoutSymbolicConstant" key="constant">
276+ <double key="value">20</double>
277+ </object>
278+ <float key="priority">1000</float>
279+ <int key="scoringType">8</int>
280+ <float key="scoringTypeFloat">29</float>
281+ <int key="contentType">3</int>
282+ <reference key="containingView" ref="143440082"/>
283+ </object>
284+ <object class="IBNSLayoutConstraint" id="385706440">
285+ <reference key="firstItem" ref="116451019"/>
286+ <int key="firstAttribute">3</int>
287+ <int key="relation">0</int>
288+ <reference key="secondItem" ref="439308822"/>
289+ <int key="secondAttribute">4</int>
290+ <float key="multiplier">1</float>
291+ <object class="IBNSLayoutSymbolicConstant" key="constant">
292+ <double key="value">8</double>
293+ </object>
294+ <float key="priority">1000</float>
295+ <int key="scoringType">6</int>
296+ <float key="scoringTypeFloat">24</float>
297+ <int key="contentType">3</int>
298+ <reference key="containingView" ref="143440082"/>
299+ </object>
300+ <object class="IBNSLayoutConstraint" id="501006590">
301+ <reference key="firstItem" ref="116451019"/>
302+ <int key="firstAttribute">5</int>
303+ <int key="relation">0</int>
304+ <reference key="secondItem" ref="143440082"/>
305+ <int key="secondAttribute">5</int>
306+ <float key="multiplier">1</float>
307+ <object class="IBNSLayoutSymbolicConstant" key="constant">
308+ <double key="value">20</double>
309+ </object>
310+ <float key="priority">1000</float>
311+ <int key="scoringType">8</int>
312+ <float key="scoringTypeFloat">29</float>
313+ <int key="contentType">3</int>
314+ <reference key="containingView" ref="143440082"/>
315+ </object>
316+ <object class="IBNSLayoutConstraint" id="621449664">
317+ <reference key="firstItem" ref="143440082"/>
318+ <int key="firstAttribute">6</int>
319+ <int key="relation">0</int>
320+ <reference key="secondItem" ref="116451019"/>
321+ <int key="secondAttribute">6</int>
322+ <float key="multiplier">1</float>
323+ <object class="IBNSLayoutSymbolicConstant" key="constant">
324+ <double key="value">20</double>
325+ </object>
326+ <float key="priority">1000</float>
327+ <int key="scoringType">8</int>
328+ <float key="scoringTypeFloat">29</float>
329+ <int key="contentType">3</int>
330+ <reference key="containingView" ref="143440082"/>
331+ </object>
332+ <object class="IBNSLayoutConstraint" id="534990701">
333+ <reference key="firstItem" ref="143440082"/>
334+ <int key="firstAttribute">4</int>
335+ <int key="relation">0</int>
336+ <reference key="secondItem" ref="116451019"/>
337+ <int key="secondAttribute">4</int>
338+ <float key="multiplier">1</float>
339+ <object class="IBNSLayoutSymbolicConstant" key="constant">
340+ <double key="value">20</double>
341+ </object>
342+ <float key="priority">1000</float>
343+ <int key="scoringType">8</int>
344+ <float key="scoringTypeFloat">29</float>
345+ <int key="contentType">3</int>
346+ <reference key="containingView" ref="143440082"/>
347+ </object>
348+ <object class="IBNSLayoutConstraint" id="439958902">
349+ <reference key="firstItem" ref="114936887"/>
350+ <int key="firstAttribute">3</int>
351+ <int key="relation">0</int>
352+ <reference key="secondItem" ref="143440082"/>
353+ <int key="secondAttribute">3</int>
354+ <float key="multiplier">1</float>
355+ <object class="IBNSLayoutSymbolicConstant" key="constant">
356+ <double key="value">20</double>
357+ </object>
358+ <float key="priority">1000</float>
359+ <int key="scoringType">8</int>
360+ <float key="scoringTypeFloat">29</float>
361+ <int key="contentType">3</int>
362+ <reference key="containingView" ref="143440082"/>
363+ </object>
364+ <object class="IBNSLayoutConstraint" id="249707225">
365+ <reference key="firstItem" ref="439308822"/>
366+ <int key="firstAttribute">3</int>
367+ <int key="relation">0</int>
368+ <reference key="secondItem" ref="114936887"/>
369+ <int key="secondAttribute">4</int>
370+ <float key="multiplier">1</float>
371+ <object class="IBNSLayoutSymbolicConstant" key="constant">
372+ <double key="value">8</double>
373+ </object>
374+ <float key="priority">1000</float>
375+ <int key="scoringType">6</int>
376+ <float key="scoringTypeFloat">24</float>
377+ <int key="contentType">3</int>
378+ <reference key="containingView" ref="143440082"/>
379+ </object>
380+ <object class="IBNSLayoutConstraint" id="382753584">
381+ <reference key="firstItem" ref="439308822"/>
382+ <int key="firstAttribute">5</int>
383+ <int key="relation">0</int>
384+ <reference key="secondItem" ref="143440082"/>
385+ <int key="secondAttribute">5</int>
386+ <float key="multiplier">1</float>
387+ <object class="IBNSLayoutSymbolicConstant" key="constant">
388+ <double key="value">20</double>
389+ </object>
390+ <float key="priority">1000</float>
391+ <int key="scoringType">8</int>
392+ <float key="scoringTypeFloat">29</float>
393+ <int key="contentType">3</int>
394+ <reference key="containingView" ref="143440082"/>
395+ </object>
396+ <object class="IBNSLayoutConstraint" id="26089336">
397+ <reference key="firstItem" ref="143440082"/>
398+ <int key="firstAttribute">6</int>
399+ <int key="relation">0</int>
400+ <reference key="secondItem" ref="439308822"/>
401+ <int key="secondAttribute">6</int>
402+ <float key="multiplier">1</float>
403+ <object class="IBNSLayoutSymbolicConstant" key="constant">
404+ <double key="value">20</double>
405+ </object>
406+ <float key="priority">1000</float>
407+ <int key="scoringType">8</int>
408+ <float key="scoringTypeFloat">29</float>
409+ <int key="contentType">3</int>
410+ <reference key="containingView" ref="143440082"/>
411+ </object>
412+ <object class="IBNSLayoutConstraint" id="716351558">
413+ <reference key="firstItem" ref="114936887"/>
414+ <int key="firstAttribute">5</int>
415+ <int key="relation">0</int>
416+ <reference key="secondItem" ref="143440082"/>
417+ <int key="secondAttribute">5</int>
418+ <float key="multiplier">1</float>
419+ <object class="IBNSLayoutSymbolicConstant" key="constant">
420+ <double key="value">20</double>
421+ </object>
422+ <float key="priority">1000</float>
423+ <int key="scoringType">8</int>
424+ <float key="scoringTypeFloat">29</float>
425+ <int key="contentType">3</int>
426+ <reference key="containingView" ref="143440082"/>
427+ </object>
428+ </array>
429+ <reference key="parent" ref="0"/>
430+ </object>
431+ <object class="IBObjectRecord">
432+ <int key="objectID">12</int>
433+ <reference key="object" ref="114936887"/>
434+ <array class="NSMutableArray" key="children">
435+ <reference ref="830400923"/>
436+ </array>
437+ <reference key="parent" ref="143440082"/>
438+ </object>
439+ <object class="IBObjectRecord">
440+ <int key="objectID">13</int>
441+ <reference key="object" ref="439308822"/>
442+ <reference key="parent" ref="143440082"/>
443+ </object>
444+ <object class="IBObjectRecord">
445+ <int key="objectID">14</int>
446+ <reference key="object" ref="1051220603"/>
447+ <array class="NSMutableArray" key="children">
448+ <reference ref="1013035728"/>
449+ </array>
450+ <reference key="parent" ref="143440082"/>
451+ </object>
452+ <object class="IBObjectRecord">
453+ <int key="objectID">16</int>
454+ <reference key="object" ref="1013035728"/>
455+ <reference key="parent" ref="1051220603"/>
456+ </object>
457+ <object class="IBObjectRecord">
458+ <int key="objectID">17</int>
459+ <reference key="object" ref="830400923"/>
460+ <reference key="parent" ref="114936887"/>
461+ </object>
462+ <object class="IBObjectRecord">
463+ <int key="objectID">51</int>
464+ <reference key="object" ref="342166400"/>
465+ <reference key="parent" ref="143440082"/>
466+ </object>
467+ <object class="IBObjectRecord">
468+ <int key="objectID">73</int>
469+ <reference key="object" ref="116451019"/>
470+ <array class="NSMutableArray" key="children">
471+ <reference ref="985469918"/>
472+ </array>
473+ <reference key="parent" ref="143440082"/>
474+ </object>
475+ <object class="IBObjectRecord">
476+ <int key="objectID">74</int>
477+ <reference key="object" ref="985469918"/>
478+ <reference key="parent" ref="116451019"/>
479+ </object>
480+ <object class="IBObjectRecord">
481+ <int key="objectID">87</int>
482+ <reference key="object" ref="763106397"/>
483+ <reference key="parent" ref="143440082"/>
484+ </object>
485+ <object class="IBObjectRecord">
486+ <int key="objectID">50</int>
487+ <reference key="object" ref="645726643"/>
488+ <reference key="parent" ref="143440082"/>
489+ </object>
490+ <object class="IBObjectRecord">
491+ <int key="objectID">108</int>
492+ <reference key="object" ref="385706440"/>
493+ <reference key="parent" ref="143440082"/>
494+ </object>
495+ <object class="IBObjectRecord">
496+ <int key="objectID">109</int>
497+ <reference key="object" ref="501006590"/>
498+ <reference key="parent" ref="143440082"/>
499+ </object>
500+ <object class="IBObjectRecord">
501+ <int key="objectID">110</int>
502+ <reference key="object" ref="621449664"/>
503+ <reference key="parent" ref="143440082"/>
504+ </object>
505+ <object class="IBObjectRecord">
506+ <int key="objectID">112</int>
507+ <reference key="object" ref="534990701"/>
508+ <reference key="parent" ref="143440082"/>
509+ </object>
510+ <object class="IBObjectRecord">
511+ <int key="objectID">115</int>
512+ <reference key="object" ref="439958902"/>
513+ <reference key="parent" ref="143440082"/>
514+ </object>
515+ <object class="IBObjectRecord">
516+ <int key="objectID">116</int>
517+ <reference key="object" ref="249707225"/>
518+ <reference key="parent" ref="143440082"/>
519+ </object>
520+ <object class="IBObjectRecord">
521+ <int key="objectID">117</int>
522+ <reference key="object" ref="382753584"/>
523+ <reference key="parent" ref="143440082"/>
524+ </object>
525+ <object class="IBObjectRecord">
526+ <int key="objectID">118</int>
527+ <reference key="object" ref="26089336"/>
528+ <reference key="parent" ref="143440082"/>
529+ </object>
530+ <object class="IBObjectRecord">
531+ <int key="objectID">119</int>
532+ <reference key="object" ref="716351558"/>
533+ <reference key="parent" ref="143440082"/>
534+ </object>
535+ </array>
536+ </object>
537+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
538+ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
539+ <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
540+ <string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
541+ <string key="108.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
542+ <string key="109.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
543+ <string key="110.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
544+ <string key="112.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
545+ <string key="115.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
546+ <string key="116.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
547+ <string key="117.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
548+ <string key="118.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
549+ <string key="119.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
550+ <boolean value="NO" key="12.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
551+ <string key="12.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
552+ <boolean value="NO" key="13.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
553+ <string key="13.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
554+ <boolean value="NO" key="14.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
555+ <string key="14.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
556+ <string key="16.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
557+ <string key="17.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
558+ <array class="NSMutableArray" key="3.IBNSViewMetadataConstraints">
559+ <reference ref="645726643"/>
560+ <reference ref="342166400"/>
561+ <reference ref="763106397"/>
562+ <reference ref="385706440"/>
563+ <reference ref="501006590"/>
564+ <reference ref="621449664"/>
565+ <reference ref="534990701"/>
566+ <reference ref="439958902"/>
567+ <reference ref="249707225"/>
568+ <reference ref="382753584"/>
569+ <reference ref="26089336"/>
570+ <reference ref="716351558"/>
571+ </array>
572+ <string key="3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
573+ <string key="50.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
574+ <string key="51.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
575+ <boolean value="NO" key="73.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
576+ <string key="73.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
577+ <string key="74.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
578+ <string key="87.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
579+ </dictionary>
580+ <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
581+ <nil key="activeLocalization"/>
582+ <dictionary class="NSMutableDictionary" key="localizations"/>
583+ <nil key="sourceID"/>
584+ <int key="maxID">122</int>
585+ </object>
586+ <object class="IBClassDescriber" key="IBDocument.Classes">
587+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
588+ <object class="IBPartialClassDescription">
589+ <string key="className">BSIPReferenceViewController</string>
590+ <string key="superclassName">NSViewController</string>
591+ <object class="NSMutableDictionary" key="outlets">
592+ <string key="NS.key.0">sizeView</string>
593+ <string key="NS.object.0">BSIThumbnailSizeView</string>
594+ </object>
595+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
596+ <string key="NS.key.0">sizeView</string>
597+ <object class="IBToOneOutletInfo" key="NS.object.0">
598+ <string key="name">sizeView</string>
599+ <string key="candidateClassName">BSIThumbnailSizeView</string>
600+ </object>
601+ </object>
602+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
603+ <string key="majorKey">IBProjectSource</string>
604+ <string key="minorKey">./Classes/BSIPReferenceViewController.h</string>
605+ </object>
606+ </object>
607+ <object class="IBPartialClassDescription">
608+ <string key="className">BSIThumbnailSizeView</string>
609+ <string key="superclassName">NSView</string>
610+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
611+ <string key="majorKey">IBProjectSource</string>
612+ <string key="minorKey">./Classes/BSIThumbnailSizeView.h</string>
613+ </object>
614+ </object>
615+ <object class="IBPartialClassDescription">
616+ <string key="className">NSLayoutConstraint</string>
617+ <string key="superclassName">NSObject</string>
618+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
619+ <string key="majorKey">IBProjectSource</string>
620+ <string key="minorKey">./Classes/NSLayoutConstraint.h</string>
621+ </object>
622+ </object>
623+ <object class="IBPartialClassDescription">
624+ <string key="className">NSObject</string>
625+ <dictionary class="NSMutableDictionary" key="actions">
626+ <string key="showPreviewerPreferences:">id</string>
627+ <string key="togglePreviewPanel:">id</string>
628+ </dictionary>
629+ <dictionary class="NSMutableDictionary" key="actionInfosByName">
630+ <object class="IBActionInfo" key="showPreviewerPreferences:">
631+ <string key="name">showPreviewerPreferences:</string>
632+ <string key="candidateClassName">id</string>
633+ </object>
634+ <object class="IBActionInfo" key="togglePreviewPanel:">
635+ <string key="name">togglePreviewPanel:</string>
636+ <string key="candidateClassName">id</string>
637+ </object>
638+ </dictionary>
639+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
640+ <string key="majorKey">IBProjectSource</string>
641+ <string key="minorKey">./Classes/NSObject.h</string>
642+ </object>
643+ </object>
644+ </array>
645+ </object>
646+ <int key="IBDocument.localizationMode">0</int>
647+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
648+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
649+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
650+ <integer value="1070" key="NS.object.0"/>
651+ </object>
652+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
653+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
654+ <bool key="IBDocument.UseAutolayout">YES</bool>
655+ </data>
656+</archive>
--- a/BSIPreferenceWindowController.h
+++ b/BSIPreferenceWindowController.h
@@ -8,14 +8,12 @@
88
99 #import <Cocoa/Cocoa.h>
1010
11-@class BSIThumbnailSizeView;
11+@class BSIPReferenceViewController;
1212 @interface BSIPreferenceWindowController : NSWindowController
1313 {
14- BSIThumbnailSizeView *sizeView;
1514 NSSize _thumbailSize;
15+ BSIPReferenceViewController *_contentViewController;
1616 }
17-@property (assign, nonatomic) IBOutlet BSIThumbnailSizeView *sizeView;
1817
1918 @property (nonatomic) NSSize thumbnailSize;
20-@property (readonly) NSString *sizeString;
2119 @end
--- a/BSIPreferenceWindowController.m
+++ b/BSIPreferenceWindowController.m
@@ -7,70 +7,60 @@
77 //
88
99 #import "BSIPreferenceWindowController.h"
10-#import "BSIThumbnailSizeView.h"
1110
11+#import "BSIPReferenceViewController.h"
1212
13-@interface BSIPreferenceWindowController ()
1413
14+@interface BSIPreferenceWindowController ()
15+@property (retain, nonatomic) BSIPReferenceViewController *contentViewController;
1516 @end
1617
1718 @implementation BSIPreferenceWindowController
18-@synthesize sizeView;
19+@synthesize contentViewController = _contentViewController;
1920
2021 - (id)init
2122 {
2223 self = [super initWithWindowNibName:NSStringFromClass([self class])];
24+
25+ self.contentViewController = [[[BSIPReferenceViewController alloc] init] autorelease];
26+ [self.contentViewController addObserver:self
27+ forKeyPath:@"thumbnailSize"
28+ options:0
29+ context:self.contentViewController];
30+
2331 return self;
2432 }
25-//- (id)initWithWindow:(NSWindow *)window
26-//{
27-// self = [super initWithWindow:window];
28-// if (self) {
29-// // Initialization code here.
30-// }
31-//
32-// return self;
33-//}
34-//
33+
3534 - (void)windowDidLoad
3635 {
3736 [super windowDidLoad];
3837
3938 [[self window] setFrameAutosaveName:@"com.masakih.BSInlinePreviewer.BSIPreferenceWindow"];
40- [self willChangeValueForKey:@"sizeString"];
41- self.sizeView.imageSize = _thumbailSize;
42- [self didChangeValueForKey:@"sizeString"];
43- [sizeView addObserver:self
44- forKeyPath:@"imageSize"
45- options:0
46- context:sizeView];
39+ [[self window] setContentView:self.contentViewController.view];
4740 }
48-- (NSSize)thumbnailSize
49-{
50- return sizeView.imageSize;
51-}
52-- (void)setThumbnailSize:(NSSize)thumbnailSize
41+
42+- (void)dealloc
5343 {
54- if(NSEqualSizes(_thumbailSize, thumbnailSize)) return;
44+ [self.contentViewController unbind:@"thumbnailSize"];
45+ [_contentViewController release];
5546
56- _thumbailSize = thumbnailSize;
57- sizeView.imageSize = thumbnailSize;
47+ [super dealloc];
5848 }
5949
60-- (NSString *)sizeString
50+- (NSSize)thumbnailSize
6151 {
62- return [NSString stringWithFormat:@"%.0f %C %.0f", self.thumbnailSize.width, 0x00D7, self.thumbnailSize.height];
52+ return self.contentViewController.thumbnailSize;
6353 }
64-
65-+(NSSet *)keyPathsForValuesAffectingSizeString
54+- (void)setThumbnailSize:(NSSize)thumbnailSize
6655 {
67- return [NSSet setWithObject:@"thumbnailSize"];
56+ self.contentViewController.thumbnailSize = thumbnailSize;
6857 }
58+
6959 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
7060 {
71- if(context == sizeView) {
61+ if(context == self.contentViewController) {
7262 [self willChangeValueForKey:@"thumbnailSize"];
73- _thumbailSize = sizeView.imageSize;
63+ _thumbailSize = self.contentViewController.thumbnailSize;
7464 [self didChangeValueForKey:@"thumbnailSize"];
7565 return;
7666 }
--- a/BSIPreferenceWindowController.xib
+++ b/BSIPreferenceWindowController.xib
@@ -11,13 +11,9 @@
1111 <string key="NS.object.0">2182</string>
1212 </object>
1313 <array key="IBDocument.IntegratedClassDependencies">
14- <string>NSTextField</string>
15- <string>NSView</string>
1614 <string>NSWindowTemplate</string>
15+ <string>NSView</string>
1716 <string>NSCustomObject</string>
18- <string>NSCustomView</string>
19- <string>IBNSLayoutConstraint</string>
20- <string>NSTextFieldCell</string>
2117 </array>
2218 <array key="IBDocument.PluginDependencies">
2319 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -48,84 +44,12 @@
4844 <object class="NSView" key="NSWindowView" id="1006">
4945 <reference key="NSNextResponder"/>
5046 <int key="NSvFlags">256</int>
51- <array class="NSMutableArray" key="NSSubviews">
52- <object class="NSTextField" id="504613367">
53- <reference key="NSNextResponder" ref="1006"/>
54- <int key="NSvFlags">268</int>
55- <string key="NSFrame">{{17, 263}, {134, 17}}</string>
56- <reference key="NSSuperview" ref="1006"/>
57- <reference key="NSWindow"/>
58- <reference key="NSNextKeyView" ref="1014347823"/>
59- <string key="NSReuseIdentifierKey">_NS:1505</string>
60- <bool key="NSEnabled">YES</bool>
61- <object class="NSTextFieldCell" key="NSCell" id="361832360">
62- <int key="NSCellFlags">68288064</int>
63- <int key="NSCellFlags2">272630784</int>
64- <string key="NSContents">サムネイルの大きさ:</string>
65- <object class="NSFont" key="NSSupport" id="161386795">
66- <string key="NSName">LucidaGrande</string>
67- <double key="NSSize">13</double>
68- <int key="NSfFlags">1044</int>
69- </object>
70- <string key="NSCellIdentifier">_NS:1505</string>
71- <reference key="NSControlView" ref="504613367"/>
72- <object class="NSColor" key="NSBackgroundColor" id="527356786">
73- <int key="NSColorSpace">6</int>
74- <string key="NSCatalogName">System</string>
75- <string key="NSColorName">controlColor</string>
76- <object class="NSColor" key="NSColor">
77- <int key="NSColorSpace">3</int>
78- <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
79- </object>
80- </object>
81- <object class="NSColor" key="NSTextColor" id="155024420">
82- <int key="NSColorSpace">6</int>
83- <string key="NSCatalogName">System</string>
84- <string key="NSColorName">controlTextColor</string>
85- <object class="NSColor" key="NSColor">
86- <int key="NSColorSpace">3</int>
87- <bytes key="NSWhite">MAA</bytes>
88- </object>
89- </object>
90- </object>
91- </object>
92- <object class="NSCustomView" id="294162957">
93- <reference key="NSNextResponder" ref="1006"/>
94- <int key="NSvFlags">268</int>
95- <string key="NSFrame">{{20, 20}, {352, 235}}</string>
96- <reference key="NSSuperview" ref="1006"/>
97- <reference key="NSWindow"/>
98- <reference key="NSNextKeyView"/>
99- <string key="NSReuseIdentifierKey">_NS:9</string>
100- <string key="NSClassName">BSIThumbnailSizeView</string>
101- </object>
102- <object class="NSTextField" id="1014347823">
103- <reference key="NSNextResponder" ref="1006"/>
104- <int key="NSvFlags">268</int>
105- <string key="NSFrame">{{156, 263}, {219, 17}}</string>
106- <reference key="NSSuperview" ref="1006"/>
107- <reference key="NSWindow"/>
108- <reference key="NSNextKeyView" ref="294162957"/>
109- <string key="NSReuseIdentifierKey">_NS:1505</string>
110- <bool key="NSEnabled">YES</bool>
111- <object class="NSTextFieldCell" key="NSCell" id="105423156">
112- <int key="NSCellFlags">68288064</int>
113- <int key="NSCellFlags2">272630784</int>
114- <string key="NSContents">Label</string>
115- <reference key="NSSupport" ref="161386795"/>
116- <string key="NSCellIdentifier">_NS:1505</string>
117- <reference key="NSControlView" ref="1014347823"/>
118- <reference key="NSBackgroundColor" ref="527356786"/>
119- <reference key="NSTextColor" ref="155024420"/>
120- </object>
121- </object>
122- </array>
12347 <string key="NSFrameSize">{392, 300}</string>
12448 <reference key="NSSuperview"/>
12549 <reference key="NSWindow"/>
126- <reference key="NSNextKeyView" ref="504613367"/>
50+ <reference key="NSNextKeyView"/>
12751 </object>
128- <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
52+ <string key="NSScreenRect">{{0, 0}, {1440, 900}}</string>
12953 <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
13054 <bool key="NSWindowIsRestorable">YES</bool>
13155 </object>
@@ -142,40 +66,12 @@
14266 </object>
14367 <object class="IBConnectionRecord">
14468 <object class="IBOutletConnection" key="connection">
145- <string key="label">sizeView</string>
146- <reference key="source" ref="1001"/>
147- <reference key="destination" ref="294162957"/>
148- </object>
149- <int key="connectionID">32</int>
150- </object>
151- <object class="IBConnectionRecord">
152- <object class="IBOutletConnection" key="connection">
15369 <string key="label">delegate</string>
15470 <reference key="source" ref="1005"/>
15571 <reference key="destination" ref="1001"/>
15672 </object>
15773 <int key="connectionID">4</int>
15874 </object>
159- <object class="IBConnectionRecord">
160- <object class="IBBindingConnection" key="connection">
161- <string key="label">displayPatternValue1: sizeString</string>
162- <reference key="source" ref="1014347823"/>
163- <reference key="destination" ref="1001"/>
164- <object class="NSNibBindingConnector" key="connector">
165- <reference key="NSSource" ref="1014347823"/>
166- <reference key="NSDestination" ref="1001"/>
167- <string key="NSLabel">displayPatternValue1: sizeString</string>
168- <string key="NSBinding">displayPatternValue1</string>
169- <string key="NSKeyPath">sizeString</string>
170- <object class="NSDictionary" key="NSOptions">
171- <string key="NS.key.0">NSDisplayPattern</string>
172- <string key="NS.object.0">%{value1}@ ぐらい</string>
173- </object>
174- <int key="NSNibBindingConnectorVersion">2</int>
175- </object>
176- </object>
177- <int key="connectionID">68</int>
178- </object>
17975 </array>
18076 <object class="IBMutableOrderedSet" key="objectRecords">
18177 <array key="orderedObjects">
@@ -214,233 +110,9 @@
214110 <object class="IBObjectRecord">
215111 <int key="objectID">2</int>
216112 <reference key="object" ref="1006"/>
217- <array class="NSMutableArray" key="children">
218- <reference ref="504613367"/>
219- <reference ref="294162957"/>
220- <object class="IBNSLayoutConstraint" id="73386786">
221- <reference key="firstItem" ref="504613367"/>
222- <int key="firstAttribute">3</int>
223- <int key="relation">0</int>
224- <reference key="secondItem" ref="1006"/>
225- <int key="secondAttribute">3</int>
226- <float key="multiplier">1</float>
227- <object class="IBNSLayoutSymbolicConstant" key="constant">
228- <double key="value">20</double>
229- </object>
230- <float key="priority">1000</float>
231- <int key="scoringType">8</int>
232- <float key="scoringTypeFloat">29</float>
233- <int key="contentType">3</int>
234- <reference key="containingView" ref="1006"/>
235- </object>
236- <object class="IBNSLayoutConstraint" id="392589468">
237- <reference key="firstItem" ref="1006"/>
238- <int key="firstAttribute">4</int>
239- <int key="relation">0</int>
240- <reference key="secondItem" ref="294162957"/>
241- <int key="secondAttribute">4</int>
242- <float key="multiplier">1</float>
243- <object class="IBNSLayoutSymbolicConstant" key="constant">
244- <double key="value">20</double>
245- </object>
246- <float key="priority">1000</float>
247- <int key="scoringType">8</int>
248- <float key="scoringTypeFloat">29</float>
249- <int key="contentType">3</int>
250- <reference key="containingView" ref="1006"/>
251- </object>
252- <object class="IBNSLayoutConstraint" id="564137557">
253- <reference key="firstItem" ref="1006"/>
254- <int key="firstAttribute">6</int>
255- <int key="relation">0</int>
256- <reference key="secondItem" ref="294162957"/>
257- <int key="secondAttribute">6</int>
258- <float key="multiplier">1</float>
259- <object class="IBNSLayoutSymbolicConstant" key="constant">
260- <double key="value">20</double>
261- </object>
262- <float key="priority">1000</float>
263- <int key="scoringType">8</int>
264- <float key="scoringTypeFloat">29</float>
265- <int key="contentType">3</int>
266- <reference key="containingView" ref="1006"/>
267- </object>
268- <reference ref="1014347823"/>
269- <object class="IBNSLayoutConstraint" id="438833610">
270- <reference key="firstItem" ref="294162957"/>
271- <int key="firstAttribute">3</int>
272- <int key="relation">0</int>
273- <reference key="secondItem" ref="504613367"/>
274- <int key="secondAttribute">4</int>
275- <float key="multiplier">1</float>
276- <object class="IBNSLayoutSymbolicConstant" key="constant">
277- <double key="value">8</double>
278- </object>
279- <float key="priority">1000</float>
280- <int key="scoringType">6</int>
281- <float key="scoringTypeFloat">24</float>
282- <int key="contentType">3</int>
283- <reference key="containingView" ref="1006"/>
284- </object>
285- <object class="IBNSLayoutConstraint" id="1046472371">
286- <reference key="firstItem" ref="294162957"/>
287- <int key="firstAttribute">5</int>
288- <int key="relation">0</int>
289- <reference key="secondItem" ref="1006"/>
290- <int key="secondAttribute">5</int>
291- <float key="multiplier">1</float>
292- <object class="IBNSLayoutSymbolicConstant" key="constant">
293- <double key="value">20</double>
294- </object>
295- <float key="priority">1000</float>
296- <int key="scoringType">8</int>
297- <float key="scoringTypeFloat">29</float>
298- <int key="contentType">3</int>
299- <reference key="containingView" ref="1006"/>
300- </object>
301- <object class="IBNSLayoutConstraint" id="619533223">
302- <reference key="firstItem" ref="504613367"/>
303- <int key="firstAttribute">5</int>
304- <int key="relation">0</int>
305- <reference key="secondItem" ref="1006"/>
306- <int key="secondAttribute">5</int>
307- <float key="multiplier">1</float>
308- <object class="IBNSLayoutSymbolicConstant" key="constant">
309- <double key="value">20</double>
310- </object>
311- <float key="priority">1000</float>
312- <int key="scoringType">8</int>
313- <float key="scoringTypeFloat">29</float>
314- <int key="contentType">3</int>
315- <reference key="containingView" ref="1006"/>
316- </object>
317- <object class="IBNSLayoutConstraint" id="377278276">
318- <reference key="firstItem" ref="1014347823"/>
319- <int key="firstAttribute">3</int>
320- <int key="relation">0</int>
321- <reference key="secondItem" ref="1006"/>
322- <int key="secondAttribute">3</int>
323- <float key="multiplier">1</float>
324- <object class="IBNSLayoutSymbolicConstant" key="constant">
325- <double key="value">20</double>
326- </object>
327- <float key="priority">1000</float>
328- <int key="scoringType">8</int>
329- <float key="scoringTypeFloat">29</float>
330- <int key="contentType">3</int>
331- <reference key="containingView" ref="1006"/>
332- </object>
333- <object class="IBNSLayoutConstraint" id="652752287">
334- <reference key="firstItem" ref="1006"/>
335- <int key="firstAttribute">6</int>
336- <int key="relation">0</int>
337- <reference key="secondItem" ref="1014347823"/>
338- <int key="secondAttribute">6</int>
339- <float key="multiplier">1</float>
340- <object class="IBNSLayoutSymbolicConstant" key="constant">
341- <double key="value">20</double>
342- </object>
343- <float key="priority">1000</float>
344- <int key="scoringType">9</int>
345- <float key="scoringTypeFloat">40</float>
346- <int key="contentType">3</int>
347- <reference key="containingView" ref="1006"/>
348- </object>
349- <object class="IBNSLayoutConstraint" id="214252530">
350- <reference key="firstItem" ref="1014347823"/>
351- <int key="firstAttribute">5</int>
352- <int key="relation">0</int>
353- <reference key="secondItem" ref="1006"/>
354- <int key="secondAttribute">5</int>
355- <float key="multiplier">1</float>
356- <object class="IBLayoutConstant" key="constant">
357- <double key="value">159</double>
358- </object>
359- <float key="priority">1000</float>
360- <int key="scoringType">9</int>
361- <float key="scoringTypeFloat">40</float>
362- <int key="contentType">3</int>
363- <reference key="containingView" ref="1006"/>
364- </object>
365- </array>
113+ <array class="NSMutableArray" key="children"/>
366114 <reference key="parent" ref="1005"/>
367115 </object>
368- <object class="IBObjectRecord">
369- <int key="objectID">5</int>
370- <reference key="object" ref="504613367"/>
371- <array class="NSMutableArray" key="children">
372- <reference ref="361832360"/>
373- </array>
374- <reference key="parent" ref="1006"/>
375- </object>
376- <object class="IBObjectRecord">
377- <int key="objectID">6</int>
378- <reference key="object" ref="361832360"/>
379- <reference key="parent" ref="504613367"/>
380- </object>
381- <object class="IBObjectRecord">
382- <int key="objectID">11</int>
383- <reference key="object" ref="294162957"/>
384- <reference key="parent" ref="1006"/>
385- </object>
386- <object class="IBObjectRecord">
387- <int key="objectID">29</int>
388- <reference key="object" ref="73386786"/>
389- <reference key="parent" ref="1006"/>
390- </object>
391- <object class="IBObjectRecord">
392- <int key="objectID">33</int>
393- <reference key="object" ref="1014347823"/>
394- <array class="NSMutableArray" key="children">
395- <reference ref="105423156"/>
396- </array>
397- <reference key="parent" ref="1006"/>
398- </object>
399- <object class="IBObjectRecord">
400- <int key="objectID">34</int>
401- <reference key="object" ref="105423156"/>
402- <reference key="parent" ref="1014347823"/>
403- </object>
404- <object class="IBObjectRecord">
405- <int key="objectID">39</int>
406- <reference key="object" ref="619533223"/>
407- <reference key="parent" ref="1006"/>
408- </object>
409- <object class="IBObjectRecord">
410- <int key="objectID">44</int>
411- <reference key="object" ref="214252530"/>
412- <reference key="parent" ref="1006"/>
413- </object>
414- <object class="IBObjectRecord">
415- <int key="objectID">41</int>
416- <reference key="object" ref="652752287"/>
417- <reference key="parent" ref="1006"/>
418- </object>
419- <object class="IBObjectRecord">
420- <int key="objectID">31</int>
421- <reference key="object" ref="564137557"/>
422- <reference key="parent" ref="1006"/>
423- </object>
424- <object class="IBObjectRecord">
425- <int key="objectID">30</int>
426- <reference key="object" ref="392589468"/>
427- <reference key="parent" ref="1006"/>
428- </object>
429- <object class="IBObjectRecord">
430- <int key="objectID">40</int>
431- <reference key="object" ref="377278276"/>
432- <reference key="parent" ref="1006"/>
433- </object>
434- <object class="IBObjectRecord">
435- <int key="objectID">38</int>
436- <reference key="object" ref="1046472371"/>
437- <reference key="parent" ref="1006"/>
438- </object>
439- <object class="IBObjectRecord">
440- <int key="objectID">37</int>
441- <reference key="object" ref="438833610"/>
442- <reference key="parent" ref="1006"/>
443- </object>
444116 </array>
445117 </object>
446118 <dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -450,80 +122,25 @@
450122 <string key="1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
451123 <string key="1.IBWindowTemplateEditedContentRect">{{357, 418}, {480, 270}}</string>
452124 <boolean value="NO" key="1.NSWindowTemplate.visibleAtLaunch"/>
453- <boolean value="NO" key="11.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
454- <string key="11.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
455- <array key="2.IBNSViewMetadataConstraints">
456- <reference ref="73386786"/>
457- <reference ref="392589468"/>
458- <reference ref="564137557"/>
459- <reference ref="438833610"/>
460- <reference ref="1046472371"/>
461- <reference ref="619533223"/>
462- <reference ref="377278276"/>
463- <reference ref="652752287"/>
464- <reference ref="214252530"/>
465- </array>
466125 <string key="2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
467- <string key="29.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
468- <string key="30.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
469- <string key="31.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
470- <boolean value="NO" key="33.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
471- <string key="33.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
472- <string key="34.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
473- <string key="37.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
474- <string key="38.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
475- <string key="39.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
476- <string key="40.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
477- <string key="41.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
478- <string key="44.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
479- <boolean value="NO" key="5.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
480- <string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
481- <string key="6.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
482126 </dictionary>
483127 <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
484128 <nil key="activeLocalization"/>
485129 <dictionary class="NSMutableDictionary" key="localizations"/>
486130 <nil key="sourceID"/>
487- <int key="maxID">68</int>
131+ <int key="maxID">78</int>
488132 </object>
489133 <object class="IBClassDescriber" key="IBDocument.Classes">
490134 <array class="NSMutableArray" key="referencedPartialClassDescriptions">
491135 <object class="IBPartialClassDescription">
492136 <string key="className">BSIPreferenceWindowController</string>
493137 <string key="superclassName">NSWindowController</string>
494- <object class="NSMutableDictionary" key="outlets">
495- <string key="NS.key.0">sizeView</string>
496- <string key="NS.object.0">BSIThumbnailSizeView</string>
497- </object>
498- <object class="NSMutableDictionary" key="toOneOutletInfosByName">
499- <string key="NS.key.0">sizeView</string>
500- <object class="IBToOneOutletInfo" key="NS.object.0">
501- <string key="name">sizeView</string>
502- <string key="candidateClassName">BSIThumbnailSizeView</string>
503- </object>
504- </object>
505138 <object class="IBClassDescriptionSource" key="sourceIdentifier">
506139 <string key="majorKey">IBProjectSource</string>
507140 <string key="minorKey">./Classes/BSIPreferenceWindowController.h</string>
508141 </object>
509142 </object>
510143 <object class="IBPartialClassDescription">
511- <string key="className">BSIThumbnailSizeView</string>
512- <string key="superclassName">NSView</string>
513- <object class="IBClassDescriptionSource" key="sourceIdentifier">
514- <string key="majorKey">IBProjectSource</string>
515- <string key="minorKey">./Classes/BSIThumbnailSizeView.h</string>
516- </object>
517- </object>
518- <object class="IBPartialClassDescription">
519- <string key="className">NSLayoutConstraint</string>
520- <string key="superclassName">NSObject</string>
521- <object class="IBClassDescriptionSource" key="sourceIdentifier">
522- <string key="majorKey">IBProjectSource</string>
523- <string key="minorKey">./Classes/NSLayoutConstraint.h</string>
524- </object>
525- </object>
526- <object class="IBPartialClassDescription">
527144 <string key="className">NSObject</string>
528145 <dictionary class="NSMutableDictionary" key="actions">
529146 <string key="showPreviewerPreferences:">id</string>
--- a/BSIThumbnailSizeView.m
+++ b/BSIThumbnailSizeView.m
@@ -68,6 +68,15 @@
6868 - (void)setImageSize:(NSSize)imageSize
6969 {
7070 if(NSEqualSizes(_imageSize, imageSize)) return;
71+
72+ if(imageSize.width < 32) {
73+ imageSize = NSMakeSize(32, 32);
74+ }
75+ if(imageSize.width > 1024) {
76+ imageSize = NSMakeSize(1024, 1024);
77+ }
78+
7179 _imageSize = imageSize;
80+ [self setNeedsDisplay:YES];
7281 }
7382 @end
--- a/BSInlinePreviewer.h
+++ b/BSInlinePreviewer.h
@@ -12,6 +12,7 @@
1212 #import "BSPreviewPluginInterface.h"
1313
1414 @class BSIPreferenceWindowController;
15+@class BSIPReferenceViewController;
1516
1617 @interface BSInlinePreviewer : NSObject <BSImagePreviewerProtocol, BSLinkPreviewing>
1718 {
@@ -33,6 +34,8 @@
3334
3435 BSIPreferenceWindowController *pref;
3536 NSSize _previewSize;
37+
38+ BSIPReferenceViewController *_prefViewCon;
3639 }
3740
3841 @property (nonatomic) NSUInteger totalDownloads;
--- a/BSInlinePreviewer.m
+++ b/BSInlinePreviewer.m
@@ -10,6 +10,8 @@
1010 #import "BSILinkInfomation.h"
1111
1212 #import "BSIPreferenceWindowController.h"
13+#import "BSIPReferenceViewController.h"
14+
1315
1416 @interface BSInlinePreviewer(Private)
1517 - (NSRange)linkRange;
@@ -81,10 +83,31 @@ static NSString *ThumbnailSizeKey = @"com.masakih.BSInlinePreviewer.thumbnailSiz
8183 [pref showWindow:nil];
8284 }
8385
86+- (NSView *)preferenceView
87+{
88+
89+ if(!_prefViewCon) {
90+ _prefViewCon = [[BSIPReferenceViewController alloc] init];
91+ _prefViewCon.thumbnailSize = self.previewSize;
92+ [_prefViewCon addObserver:self
93+ forKeyPath:@"thumbnailSize"
94+ options:0
95+ context:_prefViewCon];
96+ }
97+ return _prefViewCon.view;
98+}
99+
84100 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
85101 {
86102 if(context == pref) {
87103 self.previewSize = pref.thumbnailSize;
104+ _prefViewCon.thumbnailSize = pref.thumbnailSize;
105+ [cache removeAllObjects];
106+ return;
107+ }
108+ if(context == _prefViewCon) {
109+ self.previewSize = _prefViewCon.thumbnailSize;
110+ pref.thumbnailSize = _prefViewCon.thumbnailSize;
88111 [cache removeAllObjects];
89112 return;
90113 }
--- a/BSInlinePreviewer.xcodeproj/project.pbxproj
+++ b/BSInlinePreviewer.xcodeproj/project.pbxproj
@@ -14,9 +14,11 @@
1414 F43172A415BB9BFF00210D48 /* BSIThumbnailSizeView.m in Sources */ = {isa = PBXBuildFile; fileRef = F43172A315BB9BFF00210D48 /* BSIThumbnailSizeView.m */; };
1515 F468C5C912201875009EFA3E /* BSILinkInfomation.m in Sources */ = {isa = PBXBuildFile; fileRef = F468C5C812201875009EFA3E /* BSILinkInfomation.m */; };
1616 F468C69D1220CA07009EFA3E /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F468C69C1220CA07009EFA3E /* WebKit.framework */; };
17+ F48E012015CFF43E00BB62AB /* BSIPReferenceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F48E011E15CFF43E00BB62AB /* BSIPReferenceViewController.m */; };
18+ F48E012115CFF43E00BB62AB /* BSIPReferenceViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F48E011F15CFF43E00BB62AB /* BSIPReferenceViewController.xib */; };
19+ F48E012815D2A71000BB62AB /* Panel.xib in Resources */ = {isa = PBXBuildFile; fileRef = F4FE889E10F772DD0076B366 /* Panel.xib */; };
1720 F4C8070C0E53CCB000BF4144 /* BSInlinePreviewer.m in Sources */ = {isa = PBXBuildFile; fileRef = F4C8070B0E53CCB000BF4144 /* BSInlinePreviewer.m */; };
1821 F4F1DC700E546EC800055177 /* notFound.png in Resources */ = {isa = PBXBuildFile; fileRef = F4F1DC6F0E546EC800055177 /* notFound.png */; };
19- F4FE88A010F772DD0076B366 /* Panel.xib in Resources */ = {isa = PBXBuildFile; fileRef = F4FE889E10F772DD0076B366 /* Panel.xib */; };
2022 /* End PBXBuildFile section */
2123
2224 /* Begin PBXFileReference section */
@@ -37,6 +39,9 @@
3739 F468C5C712201875009EFA3E /* BSILinkInfomation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSILinkInfomation.h; sourceTree = "<group>"; };
3840 F468C5C812201875009EFA3E /* BSILinkInfomation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSILinkInfomation.m; sourceTree = "<group>"; };
3941 F468C69C1220CA07009EFA3E /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
42+ F48E011D15CFF43E00BB62AB /* BSIPReferenceViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSIPReferenceViewController.h; sourceTree = "<group>"; };
43+ F48E011E15CFF43E00BB62AB /* BSIPReferenceViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSIPReferenceViewController.m; sourceTree = "<group>"; };
44+ F48E011F15CFF43E00BB62AB /* BSIPReferenceViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BSIPReferenceViewController.xib; sourceTree = "<group>"; };
4045 F4C807090E53CBE500BF4144 /* BSImagePreviewerInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSImagePreviewerInterface.h; sourceTree = "<group>"; };
4146 F4C8070A0E53CCB000BF4144 /* BSInlinePreviewer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSInlinePreviewer.h; sourceTree = "<group>"; };
4247 F4C8070B0E53CCB000BF4144 /* BSInlinePreviewer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSInlinePreviewer.m; sourceTree = "<group>"; };
@@ -101,6 +106,9 @@
101106 F431729D15BB9B6E00210D48 /* BSIPreferenceWindowController.h */,
102107 F431729E15BB9B6E00210D48 /* BSIPreferenceWindowController.m */,
103108 F431729F15BB9B6E00210D48 /* BSIPreferenceWindowController.xib */,
109+ F48E011D15CFF43E00BB62AB /* BSIPReferenceViewController.h */,
110+ F48E011E15CFF43E00BB62AB /* BSIPReferenceViewController.m */,
111+ F48E011F15CFF43E00BB62AB /* BSIPReferenceViewController.xib */,
104112 F43172A215BB9BFE00210D48 /* BSIThumbnailSizeView.h */,
105113 F43172A315BB9BFF00210D48 /* BSIThumbnailSizeView.m */,
106114 );
@@ -198,8 +206,9 @@
198206 files = (
199207 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */,
200208 F4F1DC700E546EC800055177 /* notFound.png in Resources */,
201- F4FE88A010F772DD0076B366 /* Panel.xib in Resources */,
209+ F48E012815D2A71000BB62AB /* Panel.xib in Resources */,
202210 F43172A115BB9B6E00210D48 /* BSIPreferenceWindowController.xib in Resources */,
211+ F48E012115CFF43E00BB62AB /* BSIPReferenceViewController.xib in Resources */,
203212 );
204213 runOnlyForDeploymentPostprocessing = 0;
205214 };
@@ -231,6 +240,7 @@
231240 F468C5C912201875009EFA3E /* BSILinkInfomation.m in Sources */,
232241 F43172A015BB9B6E00210D48 /* BSIPreferenceWindowController.m in Sources */,
233242 F43172A415BB9BFF00210D48 /* BSIThumbnailSizeView.m in Sources */,
243+ F48E012015CFF43E00BB62AB /* BSIPReferenceViewController.m in Sources */,
234244 );
235245 runOnlyForDeploymentPostprocessing = 0;
236246 };