adium 2443:35f6b312d24c: Synthesize a bunch of message view cont...
commits at adium.im
commits at adium.im
Tue Jun 2 05:47:08 UTC 2009
details: http://hg.adium.im/adium/rev/35f6b312d24c
revision: 2443:35f6b312d24c
author: David Smith <catfish.man at gmail.com>
date: Mon Jun 01 22:46:44 2009 -0700
Synthesize a bunch of message view controller/message style methods
diffs (356 lines):
diff -r a12698ec7c05 -r 35f6b312d24c Plugins/WebKit Message View/AIWebKitMessageViewController.h
--- a/Plugins/WebKit Message View/AIWebKitMessageViewController.h Mon Jun 01 13:32:40 2009 -0700
+++ b/Plugins/WebKit Message View/AIWebKitMessageViewController.h Mon Jun 01 22:46:44 2009 -0700
@@ -66,17 +66,9 @@
/*!
* @return the ESWebView which should be inserted into the message window
*/
-- (NSView *)messageView;
-
-/*!
- * @return our scroll view
- */
-- (NSView *)messageScrollView;
-
-/*!
- * @return our message style controller
- */
-- (AIWebkitMessageViewStyle *)messageStyle;
+ at property (readonly, nonatomic) ESWebView *messageView;
+ at property (readonly, nonatomic) NSView *messageScrollView;
+ at property (readonly, nonatomic) AIWebkitMessageViewStyle *messageStyle;
/*!
* @brief Clears the view from displayed messages
@@ -93,14 +85,9 @@
- (void)setShouldReflectPreferenceChanges:(BOOL)inValue;
/*!
- * @brief Set the HTML content for the "Chat" area.
+ * @brief The HTML content for the "Chat" area.
*/
-- (void)setChatContentSource:(NSString *)source;
-
-/*!
- * @brief Get the HTML content for the "Chat" area.
- */
-- (NSString *)chatContentSource;
+ at property (readwrite, copy, nonatomic) NSString *chatContentSource;
/*!
* @brief An editing operation ended, or the user pressed enter.
diff -r a12698ec7c05 -r 35f6b312d24c Plugins/WebKit Message View/AIWebKitMessageViewController.m
--- a/Plugins/WebKit Message View/AIWebKitMessageViewController.m Mon Jun 01 13:32:40 2009 -0700
+++ b/Plugins/WebKit Message View/AIWebKitMessageViewController.m Mon Jun 01 22:46:44 2009 -0700
@@ -241,21 +241,14 @@
//WebView --------------------------------------------------------------------------------------------------
#pragma mark WebView
-- (NSView *)messageView
-{
- return webView;
-}
+
+ at synthesize messageStyle, messageView = webView;
- (NSView *)messageScrollView
{
return [[webView mainFrame] frameView];
}
-- (AIWebkitMessageViewStyle *)messageStyle
-{
- return messageStyle;
-}
-
/*!
* @brief Apply preference changes to our webview
*/
@@ -1441,15 +1434,13 @@
- (NSNumber *)currentOffsetHeight
{
- DOMElement *element = (DOMElement *)[(DOMHTMLDocument *)webView.mainFrameDocument body];
// We use the body's height to determine our mark location.
- return [element valueForKey:@"scrollHeight"];
+ return [(DOMElement *)[(DOMHTMLDocument *)webView.mainFrameDocument body] valueForKey:@"scrollHeight"];
}
- (void)markCurrentLocation
{
- JVMarkedScroller *scroller = self.markedScroller;
- [scroller addMarkAt:[self.currentOffsetHeight integerValue]];
+ [self.markedScroller addMarkAt:[self.currentOffsetHeight integerValue]];
}
#define PREF_KEY_FOCUS_LINE @"Draw Focus Lines"
@@ -1462,9 +1453,7 @@
[scroller removeMarkWithIdentifier:@"focus"];
[scroller addMarkAt:[self.currentOffsetHeight integerValue] withIdentifier:@"focus" withColor:[NSColor redColor]];
- DOMElement *element;
-
- element = (DOMElement *)[webView.mainFrameDocument getElementById:@"focus"];
+ DOMElement *element = (DOMElement *)[webView.mainFrameDocument getElementById:@"focus"];
if (element) {
[element.parentNode removeChild:element];
}
@@ -1480,44 +1469,37 @@
- (void)addMark
{
- JVMarkedScroller *scroller = self.markedScroller;
- [scroller addMarkAt:[self.currentOffsetHeight integerValue] withColor:[NSColor greenColor]];
+ [self.markedScroller addMarkAt:[self.currentOffsetHeight integerValue] withColor:[NSColor greenColor]];
}
- (void)jumpToPreviousMark
{
- JVMarkedScroller *scroller = self.markedScroller;
- [scroller jumpToPreviousMark:nil];
+ [self.markedScroller jumpToPreviousMark:nil];
}
- (BOOL)previousMarkExists
{
- JVMarkedScroller *scroller = self.markedScroller;
- return [scroller previousMarkExists];
+ return [self.markedScroller previousMarkExists];
}
- (void)jumpToNextMark
{
- JVMarkedScroller *scroller = self.markedScroller;
- [scroller jumpToNextMark:nil];
+ [self.markedScroller jumpToNextMark:nil];
}
- (BOOL)nextMarkExists
{
- JVMarkedScroller *scroller = self.markedScroller;
- return [scroller nextMarkExists];
+ return [self.markedScroller nextMarkExists];
}
- (void)jumpToFocusMark
{
- JVMarkedScroller *scroller = self.markedScroller;
- [scroller jumpToFocusMark:nil];
+ [self.markedScroller jumpToFocusMark:nil];
}
- (BOOL)focusMarkExists
{
- JVMarkedScroller *scroller = self.markedScroller;
- return [scroller focusMarkExists];
+ return [self.markedScroller focusMarkExists];
}
#pragma mark JS Bridging
diff -r a12698ec7c05 -r 35f6b312d24c Plugins/WebKit Message View/AIWebkitMessageViewStyle.h
--- a/Plugins/WebKit Message View/AIWebkitMessageViewStyle.h Mon Jun 01 13:32:40 2009 -0700
+++ b/Plugins/WebKit Message View/AIWebkitMessageViewStyle.h Mon Jun 01 22:46:44 2009 -0700
@@ -115,7 +115,7 @@
BOOL allowsColors;
BOOL showIncomingFonts;
BOOL showIncomingColors;
- NSInteger customBackgroundType;
+ AIWebkitBackgroundType customBackgroundType;
NSString *customBackgroundPath;
NSColor *customBackgroundColor;
NSImage *userIconMask;
@@ -137,7 +137,7 @@
/*!
* @brief The NSBundle for this style
*/
-- (NSBundle *)bundle;
+ at property (readonly, nonatomic) NSBundle *bundle;
/*!
* @brief Reloads the content of the style, useful for style authors and updates
@@ -214,84 +214,83 @@
/*!
* @brief Style has a header
*/
- at property (readonly) BOOL hasHeader;
+ at property (readonly, nonatomic) BOOL hasHeader;
/*!
* @brief Style has a topic
*/
- at property (readonly) BOOL hasTopic;
+ at property (readonly, nonatomic) BOOL hasTopic;
/*!
* @brief Style's user icon mask
*/
- at property (readonly) NSImage *userIconMask;
+ at property (readonly, nonatomic) NSImage *userIconMask;
/*!
* @brief Style supports user icons
*/
- at property (readonly) BOOL allowsUserIcons;
+ at property (readonly, nonatomic) BOOL allowsUserIcons;
/*!
* @brief Style supports display of text colors
*/
- at property (readonly) BOOL allowsColors;
+ at property (readonly, nonatomic) BOOL allowsColors;
//Behavior
/*!
- * @brief Set format of dates/time stamps
+ * @brief Set the format of dates/time stamps
*/
-- (void)setDateFormat:(NSString *)format;
+- (void ) setDateFormat:(NSString *)inDateFormat;
/*!
- * @brief Set visibility of user icons
+ * @brief The visibility of user icons
*/
-- (void)setShowUserIcons:(BOOL)inValue;
+ at property (readwrite, nonatomic) BOOL showUserIcons;
/*!
- * @brief Set visibility of header
+ * @brief The visibility of the chat header
*/
-- (void)setShowHeader:(BOOL)inValue;
+ at property (readwrite, nonatomic) BOOL showHeader;
/*!
* @brief Toggle use of a custom name format
*/
-- (void)setUseCustomNameFormat:(BOOL)inValue;
+ at property (readwrite, nonatomic) BOOL useCustomNameFormat;
/*!
- * @brief Set the custom name format being used
+ * @brief The custom name format being used
*/
-- (void)setNameFormat:(AINameFormat)inValue;
+ at property (readwrite, nonatomic) AINameFormat nameFormat;
/*!
- * @brief Set visibility of message background colors
+ * @brief The visibility of message background colors
*/
-- (void)setAllowTextBackgrounds:(BOOL)inValue;
+ at property (readwrite, nonatomic) BOOL allowTextBackgrounds;
/*!
- * @brief Set the custom background image
- * @param inPath the path to the backgroun image to use
+ * @brief The path to the custom background image
*/
-- (void)setCustomBackgroundPath:(NSString *)inPath;
+ at property (readwrite, copy, nonatomic) NSString *customBackgroundPath;
/*!
* @brief Set the custom background image type (How it is displayed - stretched, tiled, centered, etc)
*/
-- (void)setCustomBackgroundType:(AIWebkitBackgroundType)inType;
+ at property (readwrite, nonatomic) AIWebkitBackgroundType customBackgroundType;
/*!
* @brief Set the custom background color
*/
-- (void)setCustomBackgroundColor:(NSColor *)inColor;
+ at property (readwrite, retain, nonatomic) NSColor *customBackgroundColor;
/*!
* @brief Toggle visibility of received coloring
*/
-- (void)setShowIncomingMessageColors:(BOOL)inValue;
+ at property (readwrite, nonatomic) BOOL showIncomingMessageColors;
/*!
* @brief Toggle visibility of received fonts
*/
-- (void)setShowIncomingMessageFonts:(BOOL)inValue;
+ at property (readwrite, nonatomic) BOOL showIncomingMessageFonts;
#pragma mark Variants
/*!
diff -r a12698ec7c05 -r 35f6b312d24c Plugins/WebKit Message View/AIWebkitMessageViewStyle.m
--- a/Plugins/WebKit Message View/AIWebkitMessageViewStyle.m Mon Jun 01 13:32:40 2009 -0700
+++ b/Plugins/WebKit Message View/AIWebkitMessageViewStyle.m Mon Jun 01 22:46:44 2009 -0700
@@ -238,10 +238,7 @@
[super dealloc];
}
-- (NSBundle *)bundle
-{
- return styleBundle;
-}
+ at synthesize bundle = styleBundle;
- (BOOL)isLegacy
{
@@ -306,62 +303,7 @@
}
}
-- (void)setShowUserIcons:(BOOL)inValue
-{
- showUserIcons = inValue;
-}
-
-- (void)setShowHeader:(BOOL)inValue
-{
- showHeader = inValue;
-}
-
-- (void)setUseCustomNameFormat:(BOOL)inValue
-{
- useCustomNameFormat = inValue;
-}
-
-- (void)setNameFormat:(AINameFormat)inValue
-{
- nameFormat = inValue;
-}
-
-- (void)setAllowTextBackgrounds:(BOOL)inValue
-{
- allowTextBackgrounds = inValue;
-}
-
-- (void)setCustomBackgroundPath:(NSString *)inPath
-{
- if (customBackgroundPath != inPath) {
- [customBackgroundPath release];
- customBackgroundPath = [inPath retain];
- }
-}
-
-- (void)setCustomBackgroundType:(AIWebkitBackgroundType)inType
-{
- customBackgroundType = inType;
-}
-
-- (void)setCustomBackgroundColor:(NSColor *)inColor
-{
- if (customBackgroundColor != inColor) {
- [customBackgroundColor release];
- customBackgroundColor = [inColor retain];
- }
-}
-
-- (void)setShowIncomingMessageColors:(BOOL)inValue
-{
- showIncomingColors = inValue;
-}
-
-- (void)setShowIncomingMessageFonts:(BOOL)inValue
-{
- showIncomingFonts = inValue;
-}
-
+ at synthesize allowTextBackgrounds, customBackgroundType, customBackgroundColor, showIncomingMessageColors=showIncomingColors, showIncomingMessageFonts=showIncomingFonts, customBackgroundPath, nameFormat, useCustomNameFormat, showHeader, showUserIcons;
//Templates ------------------------------------------------------------------------------------------------------------
#pragma mark Templates
More information about the commits
mailing list